When you create a private or public database link, you can determine which schema on the remote database the link will establish connections to by creating fixed user, current user, and connected user database links. When an application uses a database link to access a remote database, Oracle Database establishes a database session in the remote database on behalf of the local application request. In this document these are what are referred to as global database links.Ī database link defines a communication path from one database to another. Now, you can use a directory server in which databases are identified by net service names. The Oracle Names server has been deprecated. In earlier releases, you defined global database links in the Oracle Names server. įollowing are examples of public database links:
To create a public database link, use the keyword PUBLIC (where link_name is the global database name or an arbitrary link name):ĬREATE PUBLIC DATABASE LINK link_name. To create a private database link, specify the following (where link_name is the global database name or an arbitrary link name):įollowing are examples of private database links:
#CREATE DATABASE IN ORACLE 10G HOW TO#
The following sections describe how to create the three basic types of links: When you create a database link, you must decide who will have access to it. WHERE PRIVILEGE IN ( 'CREATE SESSION','CREATE DATABASE LINK', SELECT DISTINCT PRIVILEGE AS "Database Link Privileges" For example, you could create and execute the following privs.sql script (sample output included): To see which privileges you currently have available, query ROLE _SYS _PRIVS. The following table illustrates which privileges are required on which database for which type of link: To create a private database link, you must have been granted the proper privileges. Obtaining Privileges Necessary for Creating Database LinksĪ database link is a pointer in the local database that lets you access objects on a remote database.
To support application access to the data and schema objects throughout a distributed database system, you must create all necessary database links.