DG搭建邏輯備庫,dg搭建邏輯

來源:互聯網
上載者:User

DG搭建邏輯備庫,dg搭建邏輯

邏輯備庫是在物理備庫的基礎上搭建的,所以需要先搭建好物理備庫。

備庫執行如下操作:

[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production onFri Nov 7 15:03:30 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise EditionRelease 11.2.0.3.0 - 64bit Production

With the Partitioning, Oracle LabelSecurity, OLAP, Data Mining,

Oracle Database Vault and Real ApplicationTesting options


SQL> alter database recover managed standby database cancel;

 

Database altered.


SQL> exit

Disconnected from Oracle Database 11gEnterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Oracle LabelSecurity, OLAP, Data Mining,

Oracle Database Vault and Real ApplicationTesting options

 

主庫:

[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production onFri Nov 7 15:04:46 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise EditionRelease 11.2.0.3.0 - 64bit Production

With the Partitioning, Oracle LabelSecurity, OLAP, Data Mining,

Oracle Database Vault and Real ApplicationTesting options

 

SQL> alter database force logging; ---強制日誌記錄

 

Database altered.

 

SQL> alter database add supplemental log data; ----增加附加日誌

 

Database altered.

 

SQL> exec dbms_logstdby.build; ---指令碼

 

PL/SQL procedure successfully completed.

 

SQL>

 

備庫

[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production onFri Nov 7 15:11:37 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise EditionRelease 11.2.0.3.0 - 64bit Production

With the Partitioning, Oracle LabelSecurity, OLAP, Data Mining,

Oracle Database Vault and Real ApplicationTesting options

 

SQL> alter database recover to logical standby jadl11g;

 

Database altered.

 

SQL> shutdown immediate----注意必須一致性性關閉資料庫

ORA-01507: database not mounted

 

 

ORACLE instance shut down.

SQL> startup mount

ORACLE instance started.

 

Total System Global Area  626327552 bytes

Fixed Size                  2230952 bytes

Variable Size             268436824 bytes

Database Buffers          352321536 bytes

Redo Buffers                3338240 bytes

Database mounted.

SQL> alter database open resetlogs; *********

 

Database altered.

 

SQL> alter database start logical standby apply;

 

Database altered.

 

登入DGMGRL:

DGMGRL> createconfiguration dgc as primary database is pjadl11g connect identifier ispjadl11g;

Configuration "dgc" created withprimary database "pjadl11g"

DGMGRL> add database sjadl11g as connect identifier issjadl11g maintained as logical;

Database "sjadl11g" added

DGMGRL> enable configuration

Enabled.

DGMGRL> show configuration

Configuration - dgc

  Protection Mode: MaxPerformance

  Databases:

    pjadl11g - Primary database

    sjadl11g - Logical standby database

Fast-Start Failover: DISABLED

Configuration Status:

SUCCESS

至此邏輯備庫搭建完畢!!!!!!!

DGMGRL> show configuration verbose;

 

Configuration - dgc

 Protection Mode: MaxPerformance

 Databases:

   pjadl11g - Primary database

   sjadl11g - Logical standby database

 Properties:

   FastStartFailoverThreshold      ='30'

   OperationTimeout                ='30'

   FastStartFailoverLagLimit       ='30'

   CommunicationTimeout            ='180'

   FastStartFailoverAutoReinstate  ='TRUE'

   FastStartFailoverPmyShutdown    ='TRUE'

   BystandersFollowRoleChange      ='ALL'

Fast-Start Failover: DISABLED

Configuration Status:

SUCCESS

DGMGRL> show database verbose sjadl11g;

Database - sjadl11g

 Role:            LOGICAL STANDBY

 Intended State:  APPLY-ON

 Transport Lag:   0 seconds

 Apply Lag:       0 seconds

 Instance(s):

   jadl11g

 Properties:

   DGConnectIdentifier             ='sjadl11g'

   ObserverConnectIdentifier       =''

    LogXptMode                      = 'ASYNC'

   DelayMins                       ='0'

   Binding                         ='optional'

   MaxFailure                      ='0'

   MaxConnections                  ='1'

   ReopenSecs                      ='300'

   NetTimeout                      ='30'

   RedoCompression                 ='DISABLE'

   LogShipping                     ='ON'

    PreferredApplyInstance          = ''

   ApplyInstanceTimeout            ='0'

   LsbyASkipTxnCfgPr               ='0,0,0'

   LsbyDSkipTxnCfgPr               ='0,0,0'

   LsbyASkipCfgPr                  =''

   LsbyDSkipCfgPr                  =''

    LsbyASkipErrorCfgPr             = ''

   LsbyDSkipErrorCfgPr             =''

   LsbyMaxEventsRecorded           ='0'

   LsbyPreserveCommitOrder         =''

   LsbyRecordSkipErrors            =''

   LsbyRecordSkipDdl               =''

   LsbyRecordAppliedDdl            =''

   ArchiveLagTarget                ='0'

   LogArchiveMaxProcesses          ='4'

   LogArchiveMinSucceedDest        ='1'

   FastStartFailoverTarget         =''

   InconsistentProperties          ='(monitor)'

   InconsistentLogXptProps         ='(monitor)'

   SendQEntries                    ='(monitor)'

   LogXptStatus                    ='(monitor)'

   RecvQEntries                    ='(monitor)'

   LsbyParameters                  ='(monitor)'

   LsbySkipTxnTable                ='(monitor)'

   LsbySkipTable                   ='(monitor)'

   LsbyFailedTxnInfo               ='(monitor)'

   SidName                         ='jadl11g'

   StaticConnectIdentifier         ='(DESCRIPTION=(ADDRESS=(PROTOCOL=tc                        =localhost.localdomain)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=sjadl11g_D                        INSTANCE_NAME=jadl11g)(SERVER=DEDICATED)))'

   StandbyArchiveLocation          ='USE_DB_RECOVERY_FILE_DEST'

   AlternateLocation               = ''

   LogArchiveTrace                 ='0'

   LogArchiveFormat                ='%t_%s_%r.dbf'

   LsbyMaxSga                      ='0'

   LsbyMaxServers                  ='0'

   TopWaitEvents                   ='(monitor)'

 

Database Status:

SUCCESS

 

DGMGRL> edit database sjadl11g set propertylogxptmode='sync';---修改參數

Property"logxptmode" updated

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.