Wednesday, December 10, 2014

Oracle 11g Dataguard_Broker Setup Guide

Last login: Mon Oct 28 12:31:04 2013 from 192.168.0.47
 
[oracle@report ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mon Oct 28 15:49:10 2013

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> show parameter dg_broker_start

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
dg_broker_start                      boolean     FALSE
SQL> ALTER SYSTEM SET DG_BROKER_START=TRUE SCOPE=BOTH;

System altered.

SQL> show parameter dg_broker_start

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
dg_broker_start                      boolean     TRUE
SQL> !dgmgrl
DGMGRL for Linux: Version 11.2.0.3.0 - 64bit Production

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

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/sys123
Connected.
DGMGRL> show configuration
ORA-16532: Data Guard broker configuration does not exist

Configuration details cannot be determined by DGMGRL
DGMGRL> DGMGRL>
SQL> !dgmgrl
DGMGRL for Linux: Version 11.2.0.3.0 - 64bit Production

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

Welcome to DGMGRL, type "help" for information.
DGMGRL> !dgmgrl
Unrecognized command "!dgmgrl", try "help"
DGMGRL>
DGMGRL>
DGMGRL>
DGMGRL>
DGMGRL>
DGMGRL> create configuration 'primDR' as primary database is 'prim' connect identified is 'prim';
create configuration 'primDR' as primary database is 'prim' connect identified is 'prim';
                                                                    ^
Syntax error before or at "identified"
DGMGRL> DGMGRL>
SQL>  create configuration 'primDR' as primary database is 'prim' connect identifier is 'prim';
 create configuration 'primDR' as primary database is 'prim' connect identifier is 'prim'
        *
ERROR at line 1:
ORA-00901: invalid CREATE command


SQL> dgmgrl
SP2-0042: unknown command "dgmgrl" - rest of line ignored.
SQL> !dgmgrl
DGMGRL for Linux: Version 11.2.0.3.0 - 64bit Production

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

Welcome to DGMGRL, type "help" for information.
DGMGRL>  create configuration 'primDR' as primary database is 'prim' connect identifier is 'prim';
not logged on
DGMGRL> connect sys/sys123
Connected.
DGMGRL>  create configuration 'primDR' as primary database is 'prim' connect identifier is 'prim';
Configuration "primDR" created with primary database "prim"
DGMGRL>
DGMGRL> add database 'stan' as connect identifier is 'stan';
Database "stan" added
DGMGRL> show configuration

Configuration - primDR

  Protection Mode: MaxPerformance
  Databases:
    prim - Primary database
    stan - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
DISABLED

DGMGRL> enable configuration
Enabled.
DGMGRL> show configuration

Configuration - primDR

  Protection Mode: MaxPerformance
  Databases:
    prim - Primary database
    stan - Physical standby database
      Error: ORA-16525: the Data Guard broker is not yet available

Fast-Start Failover: DISABLED

Configuration Status:
ERROR

DGMGRL> show database prim

Database - prim

  Role:            PRIMARY
  Intended State:  TRANSPORT-ON
  Instance(s):
    prim

Database Status:
SUCCESS

DGMGRL> show database stan

Database - stan

  Role:            PHYSICAL STANDBY
  Intended State:  APPLY-ON
  Transport Lag:   (unknown)
  Apply Lag:       (unknown)
  Real Time Query: OFF
  Instance(s):
    stan

Database Status:
DGM-17016: failed to retrieve status for database "stan"
ORA-16525: the Data Guard broker is not yet available
ORA-16625: cannot reach database "stan"

DGMGRL> SHOW CONFIGURATION

Configuration - primDR

  Protection Mode: MaxPerformance
  Databases:
    prim - Primary database
    stan - Physical standby database
      Error: ORA-16532: Data Guard broker configuration does not exist

Fast-Start Failover: DISABLED

Configuration Status:
ERROR

DGMGRL> DGMGRL>
SQL> dgmgrl
SP2-0042: unknown command "dgmgrl" - rest of line ignored.
SQL> !dgmgrl
DGMGRL for Linux: Version 11.2.0.3.0 - 64bit Production

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

Welcome to DGMGRL, type "help" for information.
DGMGRL> SHOW CONFIGURATION
not logged on
DGMGRL> connect sys/sys123
Connected.
DGMGRL> SHOW CONFIGURATION

Configuration - primDR

  Protection Mode: MaxPerformance
  Databases:
    prim - Primary database
    stan - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

DGMGRL> show database prim

Database - prim

  Role:            PRIMARY
  Intended State:  TRANSPORT-ON
  Instance(s):
    prim

Database Status:
SUCCESS

DGMGRL> show database stan

Database - stan

  Role:            PHYSICAL STANDBY
  Intended State:  APPLY-ON
  Transport Lag:   0 seconds
  Apply Lag:       0 seconds
  Real Time Query: ON
  Instance(s):
    stan

Database Status:
SUCCESS

DGMGRL> show database verbose stan

Database - stan

  Role:            PHYSICAL STANDBY
  Intended State:  APPLY-ON
  Transport Lag:   0 seconds
  Apply Lag:       0 seconds
  Real Time Query: ON
  Instance(s):
    stan

  Properties:
    DGConnectIdentifier             = 'stan'
    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          = '5'
    LogArchiveMinSucceedDest        = '1'
    DbFileNameConvert               = '/u01/app/oracle/oradata/prim/, /u01/app/oracle/oradata/stan/, /u01/app/oracle/oradata/prim/, /u01/app/oracle/oradata/stan/'
    LogFileNameConvert              = '/u01/app/oracle/oradata/prim/, /u01/app/oracle/oradata/stan/'
    FastStartFailoverTarget         = ''
    InconsistentProperties          = '(monitor)'
    InconsistentLogXptProps         = '(monitor)'
    SendQEntries                    = '(monitor)'
    LogXptStatus                    = '(monitor)'
    RecvQEntries                    = '(monitor)'
    SidName                         = 'stan'
    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=mobile)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=stan_DGMGRL)(INSTANCE_NAME=stan)(SERVER=DEDICATED)))'
    StandbyArchiveLocation          = '/u01/app/oracle/oradata/stan/arch'
    AlternateLocation               = ''
    LogArchiveTrace                 = '0'
    LogArchiveFormat                = '%t_%s_%r.dbf'
    TopWaitEvents                   = '(monitor)'

Database Status:
SUCCESS

DGMGRL> show database prim statusreport
STATUS REPORT
       INSTANCE_NAME   SEVERITY ERROR_TEXT

DGMGRL> show database prim logxptstatus
LOG TRANSPORT STATUS
PRIMARY_INSTANCE_NAME STANDBY_DATABASE_NAME               STATUS
                prim                 stan                     

DGMGRL> show database prim InconsistentProperties
INCONSISTENT PROPERTIES
   INSTANCE_NAME        PROPERTY_NAME         MEMORY_VALUE         SPFILE_VALUE         BROKER_VALUE

DGMGRL> help

The following commands are available:

add            Adds a standby database to the broker configuration
connect        Connects to an Oracle database instance
convert        Converts a database from one type to another
create         Creates a broker configuration
disable        Disables a configuration, a database, or fast-start failover
edit           Edits a configuration, database, or instance
enable         Enables a configuration, a database, or fast-start failover
exit           Exits the program
failover       Changes a standby database to be the primary database
help           Displays description and syntax for a command
quit           Exits the program
reinstate      Changes a database marked for reinstatement into a viable standby
rem            Comment to be ignored by DGMGRL
remove         Removes a configuration, database, or instance
show           Displays information about a configuration, database, or instance
shutdown       Shuts down a currently running Oracle database instance
sql            Executes a SQL statement
start          Starts the fast-start failover observer
startup        Starts an Oracle database instance
stop           Stops the fast-start failover observer
switchover     Switches roles between a primary and standby database

Use "help <command>" to see syntax for individual commands

DGMGRL> help switchover

Switches roles between a primary and standby database

Syntax:

  SWITCHOVER TO <standby database name>;

DGMGRL> add database 'stan2' connect identifier is 'stan2' MAINTAINED AS PHYSICAL;
add database 'stan2' connect identifier is 'stan2' MAINTAINED AS PHYSICAL;
                     ^
Syntax error before or at "connect"
DGMGRL> add database as 'stan2' connect identifier is 'stan2' MAINTAINED AS PHYSICAL;
add database as 'stan2' connect identifier is 'stan2' MAINTAINED AS PHYSICAL;
                ^
Syntax error before or at "stan2"
DGMGRL> add database as 'stan2' connect identifier is 'stan2';^H^H^H
> ;
add database as 'stan2' connect identifier is 'stan2';
                ^
Syntax error before or at "stan2"
DGMGRL>
DGMGRL> add database 'stan2' as connect identifier is 'stan2' maintained as physical;
Database "stan2" added
DGMGRL> show configuration

Configuration - primDR

  Protection Mode: MaxPerformance
  Databases:
    prim  - Primary database
    stan  - Physical standby database
    stan2 - Physical standby database (disabled)

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

DGMGRL> show database stan2

Database - stan2

  Role:            PHYSICAL STANDBY
  Intended State:  OFFLINE
  Transport Lag:   (unknown)
  Apply Lag:       (unknown)
  Real Time Query: OFF
  Instance(s):
    stan2

Database Status:
DISABLED

DGMGRL> show database stan

Database - stan

  Role:            PHYSICAL STANDBY
  Intended State:  APPLY-ON
  Transport Lag:   0 seconds
  Apply Lag:       0 seconds
  Real Time Query: ON
  Instance(s):
    stan

Database Status:
SUCCESS

DGMGRL> enable configuration
Enabled.
DGMGRL> show configuration

Configuration - primDR

  Protection Mode: MaxPerformance
  Databases:
    prim  - Primary database
    stan  - Physical standby database
    stan2 - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

DGMGRL> show database stan2

Database - stan2

  Role:            PHYSICAL STANDBY
  Intended State:  APPLY-ON
  Transport Lag:   0 seconds
  Apply Lag:       0 seconds
  Real Time Query: OFF
  Instance(s):
    stan2

Database Status:
SUCCESS

DGMGRL> show configuration

Configuration - primDR

  Protection Mode: MaxPerformance
  Databases:
    prim  - Primary database
    stan  - Physical standby database
    stan2 - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

DGMGRL> show database stan2

Database - stan2

  Role:            PHYSICAL STANDBY
  Intended State:  APPLY-ON
  Transport Lag:   0 seconds
  Apply Lag:       0 seconds
  Real Time Query: OFF
  Instance(s):
    stan2

Database Status:
SUCCESS

DGMGRL> show database stan

Database - stan

  Role:            PHYSICAL STANDBY
  Intended State:  APPLY-ON
  Transport Lag:   0 seconds
  Apply Lag:       0 seconds
  Real Time Query: ON
  Instance(s):
    stan

Database Status:
SUCCESS

DGMGRL> show database prim

Database - prim

  Role:            PRIMARY
  Intended State:  TRANSPORT-ON
  Instance(s):
    prim

Database Status:
SUCCESS

DGMGRL> help switchover

Switches roles between a primary and standby database

Syntax:

  SWITCHOVER TO <standby database name>;

2 comments: