Wednesday, January 18, 2017

Steps to convert 12c Physical Standby Database to Active Data Guard.


Physical Standby Database had already been created and Data Guard Broker configuration exists before.


Step 1: Stop the MRP Process on the Standby Database. You can connect to DGMGRL Utility from either Primary Database Server or Standby Database Server.

DGMGRL> connect sys/xxxxxxxx
Connected as SYSDG.
DGMGRL> EDIT DATABASE "MY12CDBSTBY" SET STATE='APPLY-OFF';
Succeeded.
DGMGRL> exit

Step 2: Verify that the Physical Standby Database is in MOUNTED Stage as it is expected to be.

SQL> SELECT name,open_mode,database_role,cdb FROM v$database;

NAME      OPEN_MODE            DATABASE_ROLE    CDB
--------- -------------------- ---------------- ---
MY12CDB   MOUNTED              PHYSICAL STANDBY YES

SQL> SELECT name,open_mode FROM v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       MOUNTED
MYPDB1                         MOUNTED
MYPDB2                         MOUNTED
Step 3: Open the Physical Standby Database in Read Only Mode.

SQL> ALTER DATABASE OPEN READ ONLY;

Database altered.

Step 4: Now check the status of the Pluggable Databases.

SQL> SELECT name,open_mode,database_role,cdb FROM v$database;

NAME      OPEN_MODE            DATABASE_ROLE    CDB
--------- -------------------- ---------------- ---
MY12CDB   READ ONLY            PHYSICAL STANDBY YES

SQL> SELECT name,open_mode FROM v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
MYPDB1                         MOUNTED
MYPDB2                         MOUNTED

Step 5: Open the Pluggable Databases in READ ONLY Mode.

SQL> ALTER PLUGGABLE DATABASE ALL OPEN READ ONLY;

Pluggable database altered.
SQL> SELECT name,open_mode,database_role,cdb FROM v$database;

NAME      OPEN_MODE            DATABASE_ROLE    CDB
--------- -------------------- ---------------- ---
MY12CDB   READ ONLY            PHYSICAL STANDBY YES

SQL> SELECT name,open_mode FROM v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
MYPDB1                         READ ONLY
MYPDB2                         READ ONLY

SQL>

Step 6: Now Start the MRP Process on the Physical Standby Database.

DGMGRL> connect sys/xxxxxxx
Connected as SYSDG.
DGMGRL> EDIT DATABASE "MY12CDBSTBY" SET STATE='APPLY-ON';
Succeeded.

Step 7: Verify that the Primary Database and Standby Database are in SYNC.

DGMGRL> show database "MY12CDBSTBY";

Database - MY12CDBSTBY

  Role:               PHYSICAL STANDBY
  Intended State:     APPLY-ON
  Transport Lag:      0 seconds (computed 0 seconds ago)
  Apply Lag:          0 seconds (computed 0 seconds ago)
  Average Apply Rate: 5.00 KByte/s
  Real Time Query:    ON
  Instance(s):
    my12cdb

Database Status:
SUCCESS

DGMGRL>

Wednesday, January 29, 2014

RMAN-06035: wrong version of recover.bsq

While trying to connect to RMAN today,  I saw the below error.

Recovery Manager: Release 11.1.0.7.0 - Production on Wed Jan 29 12:10:26 2014

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

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-03000: recovery manager compiler component initialization failed
RMAN-06035: wrong version of recover.bsq, expecting 11.1.0.7, found 11.2.0.3


Cause: There were multiple oracle homes on this particular database server.

Solution:

Export the ORACLE_SID and ORACLE_HOME.
                Go to $ORACLE_HOME/bin and then try connecting to RMAN

sousurdba1:/home/oracle>cd $ORACLE_HOME/bin
sousurdba1:/u01/app/oracle/product/11.2.0.3/dev/bin>rman catalog rcat/rcat123@sou01pd

Recovery Manager: Release 11.2.0.3.0 - Production on Wed Jan 29 12:11:22 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to recovery catalog database

RMAN>

Cheers..!!!

Thursday, December 26, 2013

Example to show Insert command needs to be Commited




Step 1: Login to the database as User “Sur” and create a table as shown below.
Step 2: Insert a row into the table as shown below.
Step 3: As user Sur, you will be able to see the row inserted in the above step before committing.
Step 4: From another terminal, if you login as another user, say SYS, and try to see the contents of Friends table, you will not see any rows.
Step 5: Once the user Sur commits the transaction, SYS will be able to see the contents.