Oracle Builds Db-link

Source: Internet
Author: User

Oracle Builds Db-link

Test conditions

Two servers

Remote: ip:192.168.0.18,sid:usertest, User name: usertest, Password: 123456

Local: IP:192.168.8.90,SID:WJN, user name: Userwjn, Password: mosquito0

Parameter settings

1. View the database Global_name

Execute select * from Global_name;

Remote Database 18 returns: Usertest. US. Oracle.com

Local Database 90 returns: Db_wjn. Regress. Rdbms. DEV. US. Oracle.com

2. View Global_name Parameters

Sql>show Parameterglobal_name;

NAME TYPE VALUE

----------------------------------------------- ------------------------------

Global_names Boolean FALSE

When this parameter is true, the Dblink name of the local connection must be the same as the remote Global_name.

3. See if advanced replication is supported

View V$option view, advanced replication true support, otherwise not supported

SELECT * from V$option t Wheret. PARAMETER like ' Advanced replication% ';

Building methods

1. The first way to create a dblink is to configure the database to be accessed remotely in the local database Tnsnames.ora file.

Create DATABASE link Usertest_18connect to usertest identified by XXXX using ' usertest_192.168.0.18 ';

Where usertest_18 is the Dblink name you created, Usertest is the instance name of the remote database, and usertest/xxxx is the user/password to log in to the remote database. The dual table in remote database 18 is then accessed through Dblink in the local database, as shown in the SQL statement

SELECT * from [email protected] usertest_18;

2. The second way to create Dblink is to not configure the remote database to be accessed in the local database Tnsnames.ora file

Create Public database link usertest_18

Connect to Usertest

Identified by 123456 using

' (DESCRIPTION =

(Address_list =

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.18) (PORT = 1521))

)

(Connect_data =

(SID = usertest)

(SERVER = dedicated)

)

)‘;

The second is to put the first information that is configured in the Tnsnames.ora file directly behind the Create DBLINK statement. In the first case, the information in the Tnsnames.ora file is as follows:

usertest_192.168.0.18 =

(DESCRIPTION =

(Address_list =

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.18) (PORT = 1521))

)

(Connect_data =

(SID = usertest)

(SERVER = dedicated)

)

)

Oracle Builds Db-link

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.