CREATE a data link in Oracle 1. To establish a Database link, you must have the PCREATE Database link system permission. to connect to a remote account, you must have the common permission to CREATE session;
2. Ensure that the connected user has the permission to access the tables or views of the connected database. 3. Add the connection characters to the Linked database in the [TNSNAMES. ORA] file. Www.2cto.com LIMS = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 10.126.6.14) (PORT = 1521) (CONNECT_DATA = (SERVICE_NAME = LIMS ))) or use the second method to create a link. 3. CREATE [public] database link syntax create database link name connect to username identified by password USING 'database connection string '; create database link "ORACLE_13" connect to "TOTALPLANT" identified by "********" USING 'oracle _ Server' or: www.2cto.com -- Create database linkcreate database link TOCCIC connect to ZTRY identified by ZTRY using '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = fengwenwei) (PORT = 1521) (CONNECT_DATA = (SID = ZTRY) '; 4. Generally, PUBLIC is created by the database administrator. Individual users can skip public, is a private database link; 5. In the configuration file init. in ora, when the database parameter global_name = true, the Database Link name must be the same as the remote database name; when the database parameter global_name = false, the Database Link name can be different from the remote database name; restart the database to take effect, or modify the above and execute alter system set global_names = false without restarting the database; 6. In the configuration file init. in ora, the number of database connections is limited. The default number of concurrent connections is 4, which is limited by OP_LINKS; ====================================
You can use the following command to query the global name of a Database: SELECT * FROM GLOBAL_NAME; www.2cto.com ...... FROM table name @ database link name; query DATABASE connection select * from user_db_links; delete database connection DELETE USER_DB_LINKS; DROP (PUBLIC) database link DBaseLinkToCompany