以下的文章主要是對Oracle復制方法慢慢變得精細的具體介紹,其中會涉及到在其運行過程中的公共數據庫的連接,它需要每個復制需要創建三個數據庫連接,以及公共數據庫連接指定數據庫的全局名稱的介紹。
設置實體化視圖站點:
1.創建復制管理員並授予相應的權限:
- disconnect;
- connect system/passwd@BJ;
- create user mvadmin identifIEd by
- mvadmin;
- begin
- dbms_repcat_admin.
- grant_admin_any_schema(username=> ’mvadmin’);
- end;
- /
- grant comment any table to mvadmin;
- grant lock any table to mvadmin;
- grant select any dictionary to mvadmin;
注冊傳播方:
- begin
- dbms_defer_sys.reGISter_propagator(
- username => ’mvadmin’);
- end;
- /
公共數據庫連接。需要每個復制需要創建三個數據庫連接。公共數據庫連接指定數據庫的全局名稱:
- create public database link ORACLSH using ’Oracle.shanghai.
- com’;
Using子句後跟的是全局數據庫名或者是連接字符串。
- create public database link ORACLSH using ’(description=
- (address=(protocol=tcp)(host=127.0.0.1)(port=1521))
- (connect_data=(service_name=oracl)))’
建立清除延遲事務隊列調度作業:
- disconnect;
- connect mvadmin/mvadmin@BJ;
- begin
- dbms_defer_sys.schedule_purge(
- next_date => sysdate,
- interval => ’/*1:hr*/ sysdate + 1’,
- delay_seconds => 0,
- rollback_segment => ’’);
- end;
建立Oracle復制管理員mvadmin的數據庫連接:
- create database link ORACLSH connect to proxy_bjOracle
- identifIEd by proxy_bjoralce
- Connect to ... IdentifIEd by ...
子句指明用什麼用戶連接遠程數據庫
建立Oracle復制調度數據庫連接作業:
- begin
- dbms_defer_sys.schedule_push(
- destination => ’ora92zjk’,interval => ’/*1:hr*/
sysdate + 1’,- next_date => sysdate,stop_on_error => false,
- delay_seconds => 0,parallelism => 0);
- end;
- /
授予SHORACL用戶(對應SHORACL方案)相應的權限建立實體化視圖:
- disconnect;
- connect system/passwd@BJ;
- grant alter session to crm;
- grant create cluster to crm;
- grant create database link to crm;
- grant create sequence to crm;
- grant create session to crm;
- grant create synonym to crm;
- grant create table to crm;
- grant create vIEw to crm;
- grant create procedure to crm;
- grant create trigger to crm;
- grant unlimited tablespace to crm;
- grant create type to crm;
- grant create any snapshot to crm;
- grant alter any snapshot to crm;