Dblink How to use

Source: Internet
Author: User

ceate [Shared][public] Database LinkDblink_name
[Connect to {current_user| User identified by Password [authenticated by the User identified by password}| Authenticated by the User identified by Password][using ' connect_string '];
Specific parameters, need db_domain. And you need to have a user account on the remote database.
Step one, in the SAM database Tnsnames.ora exist tnsname, such as
sam=
(DESCRIPTION =
(Address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = ZX) (PORT = 1521))
)
(Connect_data =
(SERVER = dedicated)
(service_name = Sam)
)  )
Step two, the system to log the book database, create a TO_SAM_MX link
Conn System@book
Create Public Database Link TO_SAM_M1
Connect to Currnet_user using ' Sam ';
Create publink Database Link to_sam_m2
Connect to tuner identified by tuner using ' Sam ';
Create Public Database link to_sam_m3 using ' Sam ';
Step three, verify the connection in step two
Show Parmeter Db_domain
Select ' Global_name from GLOBAL_NAME@TO_SAM_M1
Select ' Global_name from global_name@to_sam_m2
Select ' Global_name from GLOBAL_NAME@TO_SAM_M3
Step four, select * from dba_db_links observation connection

Application Testing
1.) Connect Demo@book
2,) select * from cc@to_sam_m2;
SELECT * from location;
Insert into location values (999, ' Ottawa ')
INSERT into cc@to_sam_m2 values (");
SELECT * from cc@to_sam_m2;
Commit
3.) Connect Tuner@sam
Verifying data changes
You can use v$DblinkDynamic performance graphs for performance viewing

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.