some tips on creating Oracle Dblink process <?xml:namespace prefix = o ns = "Urn:schemas-microsoft-com:office:office"/>
Two different database servers, one user from one database server reading the data of a user under another database server, this time can use Dblink.
Actually Dblink and the database view is similar, constructs dblink the time needs to know to read the database The IP address, the SSID as well as the database user name and the password.
There are two ways of creating:
1. Local Service has been configured
<?xml:namespace prefix = v ns = "URN:SCHEMAS-MICROSOFT-COM:VML"/>create Public Database
Link fwq12 Connect to fzept
Identified by Neu using ' fjept '
CREATE Database link Database links name connect to username identified by password USING ' locally configured data ' instance name ';
2. Local Service Not Configured
Create DATABASE link Linkfwq
Connect to fzept identified by Neu
Using ' (DESCRIPTION =
(Address_list =
(address = (PROTOCOL = TCP) (HOST = 10.142.202.12) (PORT = 1521))
)
(Connect_data =
(service_name = fjept)
)
)';
host= the IP address of the database, service_name= the SSID of the database.
In fact, the two methods of configuration dblink is similar, I personally feel that the second method is better, so not affected by local services.
Database connection strings can be defined in NET8 easy config or directly by modifying Tnsnames.ora.
Database parameter global_name=true requires the database link name to be the same as the remote database name
The database global name can be identified with the following command
SELECT * from Global_name;
Querying tables in the remote database
SELECT ... From table name @ database link name;
Querying, deleting, and inserting data is the same as manipulating a local database, except that the table name needs to be written as a "table name @dblink server."
The following synonyms are created:
CREATE synonym synonym name for table name;
CREATE synonym synonym name for table name @ database link name;
Delete Dblink:drop public DATABASE LINK Linkfwq.
If you create a global dblink, you must use the SYSTM or SYS user to add public before the database.