ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Oracle Streams - UpStream with RMAN duplicate DB (Continued)

Oracle Streams - UpStream with RMAN duplicate DB (Continued)

原创 Linux操作系统 作者:mkcvictor 时间:2019-03-16 22:18:06 0 删除 编辑
由于有字节限制,上一个日志不完整,接上一个日志:

    we can see APPLY and CAPTURE process are started on both database because we configured the bi_directional=true.

15. Test DML and DDL in both databases.
   15.1 Make changes in source database under schema nai2276.

    14:20:38 SQL> show user
    USER is "NAI2276"
   
    DML Test:
    On the source:
    14:20:47 SQL> select count(*) from t3;
   
      COUNT(*)
    ----------
             0
   
    14:21:19 SQL> desc t3
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     DT                                                 DATE
     OWNER                                     NOT NULL VARCHAR2(30)
     OBJECT_NAME                               NOT NULL VARCHAR2(30)
     SUBOBJECT_NAME                                     VARCHAR2(30)
     OBJECT_ID                                 NOT NULL NUMBER
     DATA_OBJECT_ID                                     NUMBER
     OBJECT_TYPE                                        VARCHAR2(19)
     CREATED                                   NOT NULL DATE
     LAST_DDL_TIME                             NOT NULL DATE
     TIMESTAMP                                          VARCHAR2(19)
     STATUS                                             VARCHAR2(7)
     TEMPORARY                                          VARCHAR2(1)
     GENERATED                                          VARCHAR2(1)
     SECONDARY                                          VARCHAR2(1)
    
    14:22:13 SQL>  insert into t3 values(sysdate,'TEST_MIS01D','TEST_MIS01D',NULL,88888,NULL,NULL,SYSDATE,SYSDATE,NULL,NULL,NULL,NULL,NULL);
   
    1 row created.
   
    14:24:13 SQL>  COMMIT;
   
    Commit complete.
   
    14:24:13 SQL>
   
    on the target:
    14:25:21 SQL> select count(*) from t3 where object_id=88888;
   
      COUNT(*)
    ----------
             1
   
    14:25:37 SQL> show user
    USER is "NAI2276"
   
    we can see the change has been replicated to the target now.
   
    DDL test:
    on the source:
    Create a table t5 on the source, please remember the DDL replication limitation,
    Aviod System-Generated Names, thus, we need name all constraints mannually.
    Because of tablespace are same in both databases, thus, we can specify tablespace name while creating objects.
   
    14:32:24 SQL> CREATE TABLE T5(
    14:32:37   2  DT                                                 DATE,
    14:32:37   3  OWNER                                     VARCHAR2(30) CONSTRAINT t3_cons_001 not null,
    14:32:37   4  OBJECT_NAME                                VARCHAR2(30) CONSTRAINT t3_cons_002 NOT NULL,
    14:32:37   5  SUBOBJECT_NAME                                     VARCHAR2(30),
    14:32:37   6  OBJECT_ID                                 NUMBER CONSTRAINT t3_cons_003 NOT NULL,
    14:32:37   7  DATA_OBJECT_ID                                     NUMBER,
    14:32:37   8  OBJECT_TYPE                                        VARCHAR2(19),
    14:32:37   9  CREATED                                   DATE CONSTRAINT t3_cons_004 NOT NULL,
    14:32:37  10  LAST_DDL_TIME                              DATE CONSTRAINT t3_cons_005 NOT NULL,
    14:32:37  11  TIMESTAMP                                          VARCHAR2(19),
    14:32:37  12  STATUS                                             VARCHAR2(7),
    14:32:37  13  TEMPORARY                                          VARCHAR2(1),
    14:32:37  14  GENERATED                                          VARCHAR2(1),
    14:32:37  15  SECONDARY                                          VARCHAR2(1)) tablespace tbs_data;
   
    Table created.
   
    Check on the target:
    14:25:43 SQL> desc t5
     Name                                                  Null?    Type
     ----------------------------------------------------- -------- ------------------------------------
     DT                                                             DATE
     OWNER                                                 NOT NULL VARCHAR2(30)
     OBJECT_NAME                                           NOT NULL VARCHAR2(30)
     SUBOBJECT_NAME                                                 VARCHAR2(30)
     OBJECT_ID                                             NOT NULL NUMBER
     DATA_OBJECT_ID                                                 NUMBER
     OBJECT_TYPE                                                    VARCHAR2(19)
     CREATED                                               NOT NULL DATE
     LAST_DDL_TIME                                         NOT NULL DATE
     TIMESTAMP                                                      VARCHAR2(19)
     STATUS                                                         VARCHAR2(7)
     TEMPORARY                                                      VARCHAR2(1)
     GENERATED                                                      VARCHAR2(1)
     SECONDARY                                                      VARCHAR2(1)
  
   15.1 Make changes in target database under schema nai2276.
     on the mis02d:
     14:33:03 SQL> show user
     USER is "NAI2276"
     14:34:39 SQL> insert into t3 values(sysdate,'TEST_MIS02D','TEST_MIS02D',NULL,99999,NULL,NULL,SYSDATE,SYSDATE,NULL,NULL,NULL,N
     ULL,NULL);
    
     1 row created.
    
     14:34:43 SQL> commit;
    
     Commit complete.
    
     Check on the mis01d:
     14:32:38 SQL> select count(*) from t3 where object_id=99999;
    
       COUNT(*)
     ----------
              1
    
     we can see the change has been replicated to the source(mis01d) now.
    
     DDL test:
     on the target(mis02d):
     14:34:44 SQL> CREATE TABLE T6(
     14:37:29   2  DT                                                 DATE,
     14:37:29   3  OWNER                                     VARCHAR2(30) CONSTRAINT t6_cons_001 not null,
     14:37:29   4  OBJECT_NAME                                VARCHAR2(30) CONSTRAINT t6_cons_002 NOT NULL,
     14:37:29   5  SUBOBJECT_NAME                                     VARCHAR2(30),
     14:37:29   6  OBJECT_ID                                 NUMBER CONSTRAINT t6_cons_003 NOT NULL,
     14:37:29   7  DATA_OBJECT_ID                                     NUMBER,
     14:37:29   8  OBJECT_TYPE                                        VARCHAR2(19),
     14:37:29   9  CREATED                                   DATE CONSTRAINT t6_cons_004 NOT NULL,
     14:37:29  10  LAST_DDL_TIME                              DATE CONSTRAINT t6_cons_005 NOT NULL,
     14:37:29  11  TIMESTAMP                                          VARCHAR2(19),
     14:37:29  12  STATUS                                             VARCHAR2(7),
     14:37:29  13  TEMPORARY                                          VARCHAR2(1),
     14:37:29  14  GENERATED                                          VARCHAR2(1),
     14:37:29  15  SECONDARY                                          VARCHAR2(1)) tablespace tbs_data;
    
     Table created.
     check on the source(mis01d):
     14:35:48 SQL> desc t6
      Name                                      Null?    Type
      ----------------------------------------- -------- ----------------------------
      DT                                                 DATE
      OWNER                                     NOT NULL VARCHAR2(30)
      OBJECT_NAME                               NOT NULL VARCHAR2(30)
      SUBOBJECT_NAME                                     VARCHAR2(30)
      OBJECT_ID                                 NOT NULL NUMBER
      DATA_OBJECT_ID                                     NUMBER
      OBJECT_TYPE                                        VARCHAR2(19)
      CREATED                                   NOT NULL DATE
      LAST_DDL_TIME                             NOT NULL DATE
      TIMESTAMP                                          VARCHAR2(19)
      STATUS                                             VARCHAR2(7)
      TEMPORARY                                          VARCHAR2(1)
      GENERATED                                          VARCHAR2(1)
      SECONDARY                                          VARCHAR2(1)
    
     we can the table T6 has been replicated to the source(MIS01D).

16. Test shutdown the source(MIS01D) database and make lots of changes on MIS02D, after a while bring MIS01D online
    check whether changes will be replicate to MIS01D after MIS01D back to online.
    on the source:
    14:38:08 SQL> conn / as sysdba
    Connected.
    14:39:45 SQL> shutdown immediate
    Database closed.
    Database dismounted.
    ORACLE instance shut down.

    On the target(MIS02D), make changes as following:
    14:37:30 SQL> show user
    USER is "NAI2276"
    14:43:57 SQL> select count(*) from t1
    14:44:06   2  ;
   
      COUNT(*)
    ----------
        213532
   
    14:44:12 SQL> select count(*) from t6;
   
      COUNT(*)
    ----------
             0
   
    14:44:22 SQL> insert into t6 select * from t1;
   
    213532 rows created.
   
    14:44:39 SQL> commit;
   
    Commit complete.
   
    Now bring up the MIS01D, check data in table t6:

    14:43:37 SQL> startup
    ORACLE instance started.
   
    Total System Global Area  419430400 bytes
    Fixed Size                  1249368 bytes
    Variable Size             192941992 bytes
    Database Buffers          218103808 bytes
    Redo Buffers                7135232 bytes
    Database mounted.
    Database opened.
    14:46:02 SQL> conn nai2276/nai2276
    Connected.
    14:46:41 SQL> select count(*) from t6;
   
      COUNT(*)
    ----------
             0
            
    There has no data in the t6 at this moment, let's wait for a while...
    check the alert_mis01d.log, we found:
    Thu Dec 04 15:06:08 2008
    C001: large txn detected (59861 LCRs), xid: 0x0009.024.0000038a
    Thu Dec 04 15:16:40 2008
    C001: large txn detected (131770 LCRs), xid: 0x0009.024.0000038a
    Thu Dec 04 15:22:19 2008
    Thread 1 advanced to log sequence 54
      Current log# 3 seq# 54 mem# 0: D:\ORACLE\ORADATA\MIS01D\REDO03_A.LOG
    Thu Dec 04 15:22:23 2008
    LOGMINER: End mining logfile: D:\ORACLE\ORADATA\MIS01D\REDO02_A.LOG
    Thu Dec 04 15:22:25 2008
    LOGMINER: Begin mining logfile: D:\ORACLE\ORADATA\MIS01D\REDO03_A.LOG
    Thu Dec 04 15:25:04 2008
    C001: large txn committed, xid: 0x0009.024.0000038a
   
    15:21:46 SQL> /
   
      COUNT(*)
    ----------
        213532
   
    15:46:50 SQL>
    finally, we found the changes has been replicated to the source.


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

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

注册时间:2002-05-07

  • 博文量
    29
  • 访问量
    21961