Multiple ORACLE databases physically stored in the network can be logically considered as a single large number.
Database. Users can access data in remote databases through the network at the same time, while
Collaborative processing is completely transparent for workstation users and applications: developers do not need to worry about
Network connection details, no need to care about the specific distribution of data in the network contacts, and no need to care about the server
The coordination process between servers.
The links between databases are established on the database link. To create a db link, you must first
Set the link string on each database server.
For example, the ORACLE database of Shenzhen SUN platform contains the following in/var/opt/oracle/tnsnames. ora:
A database link to Beijing, in the following format:
| Link string settings |
Description |
| Tobeijing = (description = |
Database link name: tobeijing |
| (Address = (protocol = tcp) |
TCP/IP protocol |
| (Host = www.bj.col.com.cn) |
Host Name or IP address to be linked |
| (Port = 1521 )) |
Network port 1521 |
| (Connect_data = (sid = oracle7 ))) |
Sid used to install ORACLE |
Go to the system administrator SQL> operator and run the following command:
SQL> create public database link beijing connect to scott identified by tiger
Using 'tobeijing ';
Then a link beijing with scott user and beijing database is created. We query scott data in beijing:
SQL> select * from emp @ beijing;
In this way, the data of scott users in Shenzhen and Beijing can be processed as a whole.
To make distributed operations more transparent, the ORACLE database has a synonym object synonym.
SQL> create synonym bjscottemp for emp @ beijing;
Therefore, you can use bjscottemp to replace the Distributed Link operation with the @ symbol emp @ beijing.
View All database links, go to the system administrator SQL> operator, and run the following command:
SQL> select owner, object_name from dba_objects where object_type = 'database link ';
Create an ORACLE snapshot log:
SQL> create snapshot log on table3 with primary key;
Create a snapshot:
SQL> create snapshot table3beijing refresh force start with sysdate
Next sysdate + 1/24 with primary key as select * from table3 @ beijing;
There are three refresh methods for ORACLE snapshot refresh:
| Fast |
Fast refresh. Use the snapshot log to update only the time period changes. |
| Complete |
Completely refresh and run SQL statements |
| Force |
Automatic refresh judgment, between fast and complete |