ITPub博客

首页 > Linux操作系统 > Linux操作系统 > logical_standby_managed

logical_standby_managed

原创 Linux操作系统 作者:golden_zhou 时间:2011-08-30 15:14:41 0 删除 编辑

1)DML
SQL> alter database stop logical standby apply;
Database altered.

SQL> exec dbms_logstdby.skip('DML','DFMS','WIP_D_SHIP_BIN_DETAIL');
PL/SQL procedure successfully completed.

SQL> alter database start logical standby apply;
Database altered.

SQL> alter database stop logical standby apply;
Database altered.

SQL> exec dbms_logstdby.unskip('DML','DFMS','WIP_D_SHIP_BIN_DETAIL');
PL/SQL procedure successfully completed.

SQL> EXECUTE DBMS_LOGSTDBY.INSTANTIATE_TABLE ('DFMS','WIP_D_SHIP_BIN_DETAIL','DELLL10');
PL/SQL procedure successfully completed.

SQL> alter database start logical standby apply;
Database altered.

 


SQL> alter database stop logical standby apply;
Database altered.

SQL> exec dbms_logstdby.skip('DML','DFMS','WMS_D_TRANSFER_LIST_DETAIL');
PL/SQL procedure successfully completed.

SQL> alter database start logical standby apply;
Database altered.

SQL> alter database stop logical standby apply;
Database altered.

SQL> exec dbms_logstdby.unskip('DML','DFMS','WMS_D_TRANSFER_LIST_DETAIL');
PL/SQL procedure successfully completed.

SQL> EXECUTE DBMS_LOGSTDBY.INSTANTIATE_TABLE ('DFMS','WMS_D_TRANSFER_LIST_DETAIL','DELLL10');
PL/SQL procedure successfully completed.

SQL> alter database start logical standby apply;
Database altered.

WMS_D_TRANSFER_LIST_DETAIL

SQL> alter database stop logical standby apply;
Database altered.

SQL> exec dbms_logstdby.skip('DML','DFMS','WIP_D_WO_MASTER');
PL/SQL procedure successfully completed.

SQL> alter database start logical standby apply;
Database altered.

SQL> alter database stop logical standby apply;
Database altered.

SQL> exec dbms_logstdby.unskip('DML','DFMS','WIP_D_WO_MASTER');
PL/SQL procedure successfully completed.

SQL> EXECUTE DBMS_LOGSTDBY.INSTANTIATE_TABLE ('DFMS','WIP_D_WO_MASTER','DELLL10');
PL/SQL procedure successfully completed.

SQL> alter database start logical standby apply;
Database altered.

WIP_D_WO_MASTER


 SQL> alter database stop logical standby apply;

Database altered.

SQL> exec dbms_logstdby.apply_set('APPLY_SERVERS',20);    
  SQL> alter database start logical standby apply;

PRIMARY:
ALTER TABLE WIP_D_SHIP_BIN_DETAIL ADD SUPPLEMENTAL LOG GROUP TDUP  2  (empno,ename,job,mgr,hiredate,sal,comm,deptno) ALWAYS;


ALTER TABLE DFMS.WIP_D_SHIP_BIN_DETAIL ADD SUPPLEMENTAL LOG GROUP TDUP(SERIAL_NUMBER,BIN_ID,  INTERNAL_ID,
    GROUP_ID,  BUILDING_ID,  SO_NO, ALLOCATE_DATE,  ALLOCATE_EMP, RELEASE_DATE, RELEASE_EMP) ALWAYS;
   
   
    SELECT * FROM DBA_LOG_GROUPS;


exec dbms_logstdby.skip('DML','DFMS','WIP_S_MCID_SCACID_RELATION');

exec dbms_logstdby.skip('DDL','DFMS','WIP_S_MCID_SCACID_RELATION');


exec dbms_logstdby.unskip('DDL','DFMS','WIP_S_MCID_SCACID_RELATION');


exec dbms_logstdby.unskip('NON_SCHEMA_DDL');

2) DDL
Fri Aug 27 10:11:30 2010
LOGSTDBY status: ORA-02443: Cannot drop constraint  - nonexistent constraint
LOGSTDBY Apply process P004 pid=35 OS id=28329 stopped

SQL> alter database stop logical standby apply;

exec dbms_logstdby.skip(stmt=>'SCHEMA_DDL',schema_name=>'DFMS',object_name=>'WIP_S_MCID_SCACID_RELATION',proc_name=>null);

SQL> alter database start logical standby apply;

SQL> alter database stop logical standby apply;

exec dbms_logstdby.unskip(stmt=>'SCHEMA_DDL',schema_name=>'DFMS',object_name=>'WIP_S_MCID_SCACID_RELATION');

SQL> alter database start logical standby apply;


alter session disable guard;
alter session enable guard;

alter database guard none;
compile invalid objects
alter database guard all ;

LOGSTDBY status: ORA-01031: insufficient privileges
ORA-16111: log mining and apply setting up

SQL> alter database stop logical standby apply;
SQL> exec dbms_logstdby.skip('NON_SCHEMA_DDL');
SQL> alter database start logical standby apply;


SQL> alter database stop logical standby apply;
SQL> exec dbms_logstdby.unskip('NON_SCHEMA_DDL');
SQL> alter database start logical standby apply;


SQL> alter database stop logical standby apply; 
Database altered.

SQL> execute dbms_logstdby.apply_set('PREPARE_SERVERS', 4); 
PL/SQL procedure successfully completed.

SQL> execute dbms_logstdby.apply_set('APPLY_SERVERS', 20); 
PL/SQL procedure successfully completed.

SQL> EXECUTE DBMS_LOGSTDBY.APPLY_SET('MAX_SGA', 1500);
PL/SQL procedure successfully completed.

SQL> EXECUTE DBMS_LOGSTDBY.APPLY_SET('PRESERVE_COMMIT_ORDER', 'FALSE');     這種設置可能導致讀出不一致數據。但是可以提高效能50% 。可以作為臨時追趕production使用。
PL/SQL procedure successfully completed.

SQL> execute dbms_logstdby.skip('DML','DFMS','SYS_D_ERROR_TRACE') ;
PL/SQL procedure successfully completed.

SQL> shutdown immediate 
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 1.6106E+10 bytes
Fixed Size                  2112048 bytes
Variable Size            2130707920 bytes
Database Buffers         1.3959E+10 bytes
Redo Buffers               14663680 bytes
Database mounted.

SQL> alter database noarchivelog ;
Database altered.

SQL> alter database open ;
Database altered.

SQL> archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /ocfs_data/mxdell/arch
Oldest online log sequence     13
Current log sequence           18

SQL> alter database start logical standby apply;
Database altered.

alter system set log_archive_dest_2='';
alter system set log_archive_dest_2='service=standby valid_for=(online_logfiles,primary_role) db_unique_name=dellsty';

service=standby valid_for=(online_logfiles,primary_role) db_unique_name=dellsty

maximum SGA for LCR cache
  alter database stop logical standby apply;

EXECUTE DBMS_LOGSTDBY.APPLY_SET('MAX_SGA', 1000);

alter database start logical standby apply;

 逻辑备库在恢复的过程中,可以设置不同的事务一致性级别,一共有三种(9i):

Full:这是默认的级别,事务应用的顺序和主库完全一致
Read Only:这个级别的性能要比full好一些,并且对于select等到的数据还是一致的。但是事务在应用过程中可能和主库中commit的顺序是不一致的。
NONE:完全不管主库的事务顺序,这个级别性能最好,但是可能读取到不一致的数据。
 
alter database stop logical standby apply;

exec dbms_logstdby.apply_set('TRANSACTION_CONSISTENCY','READ_ONLY');

alter database start logical standby apply;


WMS_D_TRANSFER_LIST_DETAIL

 

SQL> alter database stop logical standby apply;
Database altered.

SQL> exec dbms_logstdby.skip('DML','DFMS','WIP_D_STATION_UPH');
PL/SQL procedure successfully completed.

SQL> alter database start logical standby apply;
Database altered.

SQL> alter database stop logical standby apply;
Database altered.

SQL> exec dbms_logstdby.unskip('DML','DFMS','WIP_D_STATION_UPH');
PL/SQL procedure successfully completed.

SQL> EXECUTE DBMS_LOGSTDBY.INSTANTIATE_TABLE ('DFMS','WIP_D_STATION_UPH','DELLL10');
PL/SQL procedure successfully completed.

SQL> alter database start logical standby apply;


WIP_D_SN_MASTER


SQL> alter database stop logical standby apply;
Database altered.

SQL> exec dbms_logstdby.skip('DML','DFMS','WIP_D_SN_MASTER');
PL/SQL procedure successfully completed.

SQL> alter database start logical standby apply;
Database altered.

SQL> alter database stop logical standby apply;
Database altered.

SQL> exec dbms_logstdby.unskip('DML','DFMS','WIP_D_SN_MASTER');
PL/SQL procedure successfully completed.

SQL> EXECUTE DBMS_LOGSTDBY.INSTANTIATE_TABLE ('DFMS','WIP_D_SN_MASTER','DELLL10');
PL/SQL procedure successfully completed.

SQL> alter database start logical standby apply;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25198367/viewspace-706231/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-03-09

  • 博文量
    238
  • 访问量
    308331