One powerful type of database object that involves Oracle networking is the database link. A database link allows a user to directly connect from one database to another, giving them access to read and modify data and objects. There are several ways to create a database link, but the most straightforward way involves using local naming and the tnsnames.ora
file to define the remote database. We can create a database link using the connection name specified for our database in the tnsnames.ora
file. In the following example, we create a database link that actually loops back to our database, rather than reaching out to a remote database. The example is sound, because it uses the same method to specify the link information even though the database is actually local.
In this example, we specify a database link named orcl_db_link that uses the username companylink with a password companylink. This means that when we invoke the database link, we will be logging into the...