--The independence of distributed database: the independence of distributed data means that the user doesn't have to care about how the data is segmented and stored, just care about what data he needs. --Local operation sql> sqlplus scott/tiger--remote operation sql> sqlplus scott/[email protected]:1521/orcl--distributed Operation Sql>-- Create a database link L2 (requires permissions);sql>--REMOTEORCL service naming (configured in Net Manager): Configure the Connection protocol, hostname (IP address), port number, and so on for the database that is connected to the remote server, sql> the CREATE database Link L2 Connect to Scott identified by Tiger using ' REMOTEORCL '; Sql>--Execute query in distributed database Sql> select Ename,dname 2 from dept, [email protected]--query EMP table 3 via database link L2 where emp.dept No=dept.deptno; Sql>--creating synonyms for [email protected] sql> create synonym remoteemp for [email protected]; Sql>--Querying with synonyms sql> select Ename,dname 2 from dept, remoteemp--using synonyms 3 where remoteemp.deptno=dept.deptno;creat E View Empasselect * FROM [email protected]--links to Shanghai Unionselect * from [email protected]; --Links to Beijing select * from EMP; --The database query from Shanghai and Beijing--the cross-boundary point update of distributed database: snapshot; trigger;--Snapshot: Defines an asynchronous copy of the Snapshot Maintenance relationship table (created on the backup side)--a table that refreshes the replica for a specified time after the primary table has been modified, but frequently queries tables create Snapshot emp--Create snapshot refresh start with sysdate--first update next next_day (sysdate, ' Monday ')--Next Update time as SELECT * FROM [email protected];--update-trigger (created on primary database) Sql>-- Synchronous updating of data with triggers (the following code implements only the pay Update trigger) sql> Create or replace trigger Syncsal 2 after update 3 on EMP 4 for each row 5 Begin 6 Update remoteemp set sal=:new.sal where Empno=:new.empno; 7 8 End; 9/