One .1  BLOG Document structure chart

 

wps9928.tmp 

 

One .2   Preface

 

One .2.1   Reading guide

Technology enthusiasts , After reading this article , You can master the following skills , You can also learn something else you don't know ,~O(∩_∩)O~:

① Data Guard Broker Configuration of

② Fast-Start Failover Configuration of

③ Oracle DataGuard Client of TAF To configure

④ Use DGMGRL To manage the database

⑤  Physics dg Management and maintenance of some sql

⑥ DataGuard Client special configuration

 

Be careful : This article BLOG I use yellow background and red font to show the places that need special attention in the code part of , For example, in the following example ,thread 1 The maximum archive log number for is 33,thread 2 The maximum archive log number for is 43 It's something that needs special attention .

  List of Archived Logs in backup set 11

  Thrd Seq     Low SCN    Low Time            Next SCN   Next Time

  ---- ------- ---------- ------------------- ---------- ---------

  1    32      1621589    2015-05-29 11:09:52 1625242    2015-05-29 11:15:48

  1    33      1625242    2015-05-29 11:15:48 1625293    2015-05-29 11:15:58

  2    42      1613951    2015-05-29 10:41:18 1625245    2015-05-29 11:15:49

  2    43      1625245    2015-05-29 11:15:49 1625253    2015-05-29 11:15:53

 

 

 

 

 

If there are any mistakes or imperfections in this article, please correct them ,ITPUB Message or QQ All can , Your criticism is the biggest motivation of my writing .

One .2.2   Introduction to the experimental environment

 

  project

Main library

dg library

db  type

Single instance

Single instance

db version

11.2.0.3

11.2.0.3

db  Storage

FS type

FS type

ORACLE_SID

oradg11g

oradgphy

db_name

oradg11g

oradg11g

host IP Address :

192.168.59.130

192.168.59.130

OS Version and kernel edition

RHEL6.5 64 position ,2.6.32-504.16.2.el6.x86_64

RHEL6.5 64 position ,2.6.32-504.16.2.el6.x86_64

OS hostname

rhel6_lhr

rhel6_lhr

 

 

 

One .2.3   Links to related reference articles

 

dg A series of articles :

【DATAGUARD】 Establish physical backup and logical backup based on the same host ( One ): http://blog.itpub.net/26736162/viewspace-1448197/ 
【DATAGUARD】 Establish physical backup and logical backup based on the same host ( Two ):  http://blog.itpub.net/26736162/viewspace-1448207/ 
【DATAGUARD】 Establish physical backup and logical backup based on the same host ( 3、 ... and ):  http://blog.itpub.net/26736162/viewspace-1481972/ 
【DATAGUARD】 Establish physical backup and logical backup based on the same host ( Four )-- Add a physical dg node :http://blog.itpub.net/26736162/viewspace-1484878/

【DATAGUARD】 Physics dg Of switchover Switch ( 5、 ... and ) :http://blog.itpub.net/26736162/viewspace-1753111/

【DATAGUARD】 Physics dg Of failover Switch ( 6、 ... and ):   http://blog.itpub.net/26736162/viewspace-1753130/

【DATAGUARD】 Physics dg Recovery in the case of lost archive files in the main library ( 7、 ... and ) : http://blog.itpub.net/26736162/viewspace-1780863/

【DATAGUARD】 Physics dg Configure client seamless switching ( 8、 ... and .1)--Data Guard Broker Configuration of :http://blog.itpub.net/26736162/viewspace-1811839/

【DATAGUARD】 Physics dg Configure client seamless switching ( 8、 ... and .2)--Fast-Start Failover Configuration of :http://blog.itpub.net/26736162/viewspace-1811936/

【DATAGUARD】 Physics dg Configure client seamless switching ( 8、 ... and .3)-- client TAF To configure :http://blog.itpub.net/26736162/viewspace-1811944/

【DATAGUARD】 Physics dg Configure client seamless switching ( 8、 ... and .4)--ora-16652 and ora-16603 error :http://blog.itpub.net/26736162/viewspace-1811947/

 

 

 

 

One .2.4   Brief introduction

 

This article blog Is based on cuug The content of the open class , I do the practical operation myself , Video can refer to :http://blog.itpub.net/26736162/viewspace-1624453/ , I won't write more about it , hold cuug The content is direct copy Come here , I think it's more useful .

 

This technology, if you don't know , It's not ORACLE master

This technology, if you don't know , You can't say that you will DataGuard

This technology, if you don't know ,......

 

This online course , When the primary and standby databases are switched , How to start a service, Ensure that the client connection can continue , And it can continue select Query operation , No matter which server the primary and secondary libraries are on ; At the same time to ensure that the new customer connection without any problems . There are not many examples on the Internet of this course , Mr. Chen spent nearly a year searching for human flesh , Just recently , I can't wait to share it with you .

 

1、DataGuard Configuration of ( Fast )

2、 establish service

3、 Create trigger

4、 Active / standby database switching test

 

Because there is so much , I'm going to divide it into 4 This is a chapter to share with you , Paste a picture , Don't strange , There is also a chapter on how to solve the problems in the experiment .

wps9938.tmp 

 

This is the fourth section , List 2 A mistake .

 

 

 

One .3   Experimental part

 

One .3.1   The goal of the experiment

 

Can solve ORA-16603  and  ORA-16652 error .

One .3.2   error : ORA-16603: Data Guard  The mediation is configuring  ID  Mismatch detected in

DGMGRL> reinstate database   oradg11g;

Recovering database "oradg11g", Please wait a moment ...

error : ORA-16603: Data Guard The mediation is configuring ID Mismatch detected in

 

Failure .

Recover database "oradg11g" Failure

 

DGMGRL> remove configuration;

error : ORA-16603: Data Guard The mediation is configuring ID Mismatch detected in

error : ORA-16625: Unable to access database "oradgphy"

 

Failure .

 

 

DGMGRL> show database verbose oradgphy

 

database - oradgphy

 

  role :            PRIMARY

  Expected state :        OFFLINE

  example :

    oradgphy

 

  attribute :

    DGConnectIdentifier             = 'tns_oradgphy_dgmgrl'

    ObserverConnectIdentifier       = ''

    LogXptMode                      = 'ASYNC'

    DelayMins                       = '0'

    Binding                         = 'optional'

    MaxFailure                      = '0'

    MaxConnections                  = '1'

    ReopenSecs                      = '300'

    NetTimeout                      = '30'

    RedoCompression                 = 'DISABLE'

    LogShipping                     = 'ON'

    PreferredApplyInstance          = ''

    ApplyInstanceTimeout            = '0'

    ApplyParallel                   = 'AUTO'

    StandbyFileManagement           = 'AUTO'

    ArchiveLagTarget                = '0'

    LogArchiveMaxProcesses          = '4'

    LogArchiveMinSucceedDest        = '1'

    DbFileNameConvert               = 'oradg11g, oradgphy'

    LogFileNameConvert              = 'oradg11g, oradgphy'

    FastStartFailoverTarget         = ''

    InconsistentProperties          = '(monitor)'

    InconsistentLogXptProps         = '(monitor)'

    SendQEntries                    = '(monitor)'

    LogXptStatus                    = '(monitor)'

    RecvQEntries                    = '(monitor)'

    SidName                         = 'oradgphy'

    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rhel6_lhr)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=oradgphy_DGMGRL.lhr.com)(INSTANCE_NAME=oradgphy)(SERVER=DEDICATED)))'

    StandbyArchiveLocation          = 'USE_DB_RECOVERY_FILE_DEST'

    AlternateLocation               = ''

    LogArchiveTrace                 = '0'

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

    TopWaitEvents                   = '(monitor)'

 

Database state :

DISABLED

 

DGMGRL> show database verbose oradg11g

 

database - oradg11g

 

  role :            PHYSICAL STANDBY

  Expected state :        OFFLINE

  Transmission lag :        ( Unknown )

  Application lag :        ( Unknown )

  Real-time query :        OFF

  example :

    oradg11g

 

  attribute :

    DGConnectIdentifier             = 'tns_oradg11g_dgmgrl'

    ObserverConnectIdentifier       = ''

    LogXptMode                      = 'ASYNC'

    DelayMins                       = '0'

    Binding                         = 'optional'

    MaxFailure                      = '0'

    MaxConnections                  = '1'

    ReopenSecs                      = '300'

    NetTimeout                      = '30'

    RedoCompression                 = 'DISABLE'

    LogShipping                     = 'ON'

    PreferredApplyInstance          = ''

    ApplyInstanceTimeout            = '0'

    ApplyParallel                   = 'AUTO'

    StandbyFileManagement           = 'AUTO'

    ArchiveLagTarget                = '0'

    LogArchiveMaxProcesses          = '4'

    LogArchiveMinSucceedDest        = '1'

    DbFileNameConvert               = 'oradgphy, oradg11g'

    LogFileNameConvert              = 'oradgphy, oradg11g'

    FastStartFailoverTarget         = ''

    InconsistentProperties          = '(monitor)'

    InconsistentLogXptProps         = '(monitor)'

    SendQEntries                    = '(monitor)'

    LogXptStatus                    = '(monitor)'

    RecvQEntries                    = '(monitor)'

    SidName                         = 'oradg11g'

    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rhel6_lhr)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=oradg11g_DGMGRL.lhr.com)(INSTANCE_NAME=oradg11g)(SERVER=DEDICATED)))'

    StandbyArchiveLocation          = 'USE_DB_RECOVERY_FILE_DEST'

    AlternateLocation               = ''

    LogArchiveTrace                 = '0'

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

    TopWaitEvents                   = '(monitor)'

 

Database state :

DISABLED

 

DGMGRL> show configuration

 

To configure - fsf_oradg11g_lhr

 

  Protected mode :        MaxPerformance

  database :

    oradgphy - Master database

    oradg11g - Physical backup database

 

Quick start of failover : DISABLED

 

Configuration status :

DISABLED

 

DGMGRL> enable configuration

Enabled .

DGMGRL> show configuration

 

To configure - fsf_oradg11g_lhr

 

  Protected mode :        MaxPerformance

  database :

    oradgphy - Master database

    oradg11g - Physical backup database ( Ban )

 

Quick start of failover : DISABLED

 

Configuration status :

SUCCESS

 

 

 

terms of settlement :

It is executed in both active and standby databases :

①  alter system set DG_BROKER_START=false;

② Delete the following file

14:45:50 SQL> show parameter DG_BROKER_CONFIG

 

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

dg_broker_config_file1               string      /u01/app/oracle/product/11.2.0

                                                 /dbhome_1/dbs/dr1oradgphy.dat

dg_broker_config_file2               string      /u01/app/oracle/product/11.2.0

                                                 /dbhome_1/dbs/dr2oradgphy.dat

 

①  alter system set DG_BROKER_START=true;

 

[oracle@rhel6_lhr admin]$ oerr ora 16603

16603, 00000, "Data Guard broker detected a mismatch in configuration ID"

// *Cause:  There was a mismatch in configuration unique ID. This could occur

//          if the original configuration was re-created while this database

//          was disconnected from the network or the same database was added

//          to two different Data Guard broker configurations.

// *Action: Make sure the database belongs to only one broker configuration.

//          Shut down the broker by setting the DG_BROKER_START initialization

//          parameter to false. Then remove the Data Guard broker configuration

//          files. Finally restart the broker by setting the DG_BROKER_START

//          initialization parameter to true.

 

[oracle@rhel6_lhr admin]$ ll  /u01/app/oracle/product/11.2.0/dbhome_1/dbs/dr*

-rw-r----- 1 oracle asmadmin 16384 Sep 28 12:11 /u01/app/oracle/product/11.2.0/dbhome_1/dbs/dr1oradg11g.dat

-rw-r----- 1 oracle asmadmin 16384 Sep 28 14:47 /u01/app/oracle/product/11.2.0/dbhome_1/dbs/dr1oradgphy.dat

-rw-r----- 1 oracle asmadmin 16384 Sep 28 12:10 /u01/app/oracle/product/11.2.0/dbhome_1/dbs/dr2oradg11g.dat

-rw-r----- 1 oracle asmadmin 16384 Sep 28 14:47 /u01/app/oracle/product/11.2.0/dbhome_1/dbs/dr2oradgphy.dat

[oracle@rhel6_lhr admin]$ rm -rf   /u01/app/oracle/product/11.2.0/dbhome_1/dbs/dr*

 

[oracle@rhel6_lhr ~]$ dgmgrl sys/lhr@tns_oradgphy_dgmgrl

DGMGRL for Linux: Version 11.2.0.3.0 - 64bit Production

 

Copyright (c) 2000, 2009, Oracle. All rights reserved.

 

Welcome to use DGMGRL, For more information, type "help".

Connected .

DGMGRL> show configuration;

ORA-16532: Data Guard Mediation configuration does not exist

 

Configuration details cannot be created by DGMGRL determine

DGMGRL>

DGMGRL>

DGMGRL> create configuration 'fsf_oradg11g_lhr' as

> primary database is 'oradgphy'

> connect identifier is tns_oradgphy_dgmgrl;

 

add database 'oradg11g' as

connect identifier is tns_oradg11g_dgmgrl

maintained as physical;

 

Configuration created "fsf_oradg11g_lhr", The main database is "oradgphy"

DGMGRL> DGMGRL> > > Database added "oradg11g"

DGMGRL> DGMGRL>

DGMGRL>

DGMGRL>

DGMGRL>

DGMGRL>

DGMGRL>

DGMGRL>

DGMGRL>  show configuration

 

To configure - fsf_oradg11g_lhr

 

  Protected mode :        MaxPerformance

  database :

    oradgphy - Master database

    oradg11g - Physical backup database

 

Quick start of failover : DISABLED

 

Configuration status :

DISABLED

 

DGMGRL> enable configuration

Enabled .

DGMGRL>  show configuration

 

To configure - fsf_oradg11g_lhr

 

  Protected mode :        MaxPerformance

  database :

    oradgphy - Master database

    oradg11g - Physical backup database

 

Quick start of failover : DISABLED

 

Configuration status :

SUCCESS

 

DGMGRL> switchover to oradg11g

Switch now , Please wait a moment ...

New master database "oradg11g" Opening ...

The operation requires closing the instance "oradgphy" ( In the database "oradgphy" On )

Closing instance "oradgphy"...

ORACLE Routine closed .

The operation requires starting the instance "oradgphy" ( In the database "oradgphy" On )

Starting instance "oradgphy"...

ORACLE Routine started .

Database loading complete .

The database has been opened .

Switch successful , The new main database is "oradg11g"

DGMGRL> show configuration

 

To configure - fsf_oradg11g_lhr

 

  Protected mode :        MaxPerformance

  database :

    oradg11g - Master database

    oradgphy - Physical backup database

 

Quick start of failover : DISABLED

 

Configuration status :

SUCCESS

 

DGMGRL>

 

 

One .3.3  ORA-16652:  QuickStart failover target standby database Disabled

[oracle@rhel6_lhr lhr]$ dgmgrl sys/lhr@tns_oradg11g_dgmgrl

DGMGRL for Linux: Version 11.2.0.3.0 - 64bit Production

 

Copyright (c) 2000, 2009, Oracle. All rights reserved.

 

Welcome to use DGMGRL, For more information, type "help".

Connected .

DGMGRL> disable  fast_start failover

error : ORA-16652: QuickStart failover target standby database Disabled

 

Failure .

DGMGRL>  reinstate database oradgphy;

Recovering database "oradgphy", Please wait a moment ...

Database recovered successfully "oradgphy"

 

DGMGRL> show configuration

 

To configure - fsf_oradg11g_lhr

 

  Protected mode :        MaxAvailability

  database :

    oradg11g - Master database

    oradgphy - (*) Physical backup database

 

Quick start of failover : ENABLED

 

Configuration status :

SUCCESS

 

DGMGRL>

 

If you make a mistake , Then restart the database that needs to be recovered , Then execute again reinstate database oradgphy;

DGMGRL> show configuration

 

To configure  - fsf_oradg11g_lhr

 

  Protected mode :        MaxAvailability

  database :

    oradgphy -  Master database

      Warning : ORA-16817:  QuickStart failover configuration out of sync

 

    oradg11g - (*)  Physical backup database  ( Ban )

      ORA-16661:  Need to restore standby database

 

Quick start of failover : ENABLED

 

Configuration status :

WARNING

 

DGMGRL>  reinstate database oradg11g;

Recovering database  "oradg11g",  Please wait a moment ...

Database recovered successfully  "oradg11g"

DGMGRL> show configuration

 

To configure  - fsf_oradg11g_lhr

 

  Protected mode :        MaxAvailability

  database :

    oradgphy -  Master database

    oradg11g - (*)  Physical backup database

 

Quick start of failover : ENABLED

 

Configuration status :

SUCCESS

 

DGMGRL>