DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
In other words, when resolving service names, the Oracle client will first attempt a lookup using
the tnsnames.ora file, then use Easy Connect.
Using Database Links
You should create database links to support frequently used connections to remote databases.
Database links specify the connect descriptor to be used for a connection, and they may also
specify the username to connect to in the remote database.
A database link is typically used to create local objects (such as views or synonyms) that
access remote databases via server/server communications. The local synonyms for remote
objects provide location transparency to the local users. When a database link is referenced by a
SQL statement, it opens a session in the remote database and executes the SQL statement there.
The data is then returned, and the remote session may stay open in case it is needed again.
Database links can be created as public links (by DBAs, making the links available to all users
in the local database) or as private links.
The following example creates a private database link called HR_LINK:
create database link HR_LINK
connect to HR identified by HR
using 'loc';
The create database link command, as shown in this example, has three parameters:
The name of the link (HR_LINK, in this example) ?–
Chapter 15: Oracle Net 539
The account to connect to
The net service name
A public database link can be created by adding the keyword public to the create database
link command, as shown in the following example:
create public database link HR_LINK
connect to HR identified by HR
using 'loc';
NOTE
Best practices for public database links would favor including the
using clause but not the connect to clause.
Pages:
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806