Wednesday, September 11, 2013

Creating Standby Container Database through OEM Cloud Control in 12c

In this post I'll show you the steps to create a Standby Database through OEM Cloud Control window.

Its pretty simple to create a standby database on the remote host through Cloud Control. You just simply need to install the 12c binaries over the host where you want to create a standby database. 

--> Make an entry of the Standby database name and Primary database name in the tnsnames.ora file on both side i.e. on standby and primary database host server.

--> Make an entry of the standby database into the listener file on the standby database server and start the listener file.

--> Make sure all the Pluggable Database is in OPEN state into the Primary Container Database other wise Standby Database job will be failed.
 
Here.
Primary Container Database  : CDB2
Standby Container Database :  SCDB2            

Follow the below snapshot to configure the Standby Database.















































































































































































































































































































































































































































Though the job status is showing failed but you can also see that the Oracle Standby Database creation step is succeeded. Lets check the Standby Container Database status.

[oracle@test cdb2]$ export ORACLE_SID=cdb2
 

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT
SQL> select name,open_mode from v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       MOUNTED
PDB5                           MOUNTED

SQL> select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
CDB2      MOUNTED              PHYSICAL STANDBY
SQL> show parameter db_unique

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_unique_name                       string      scdb2
 

Lets open the database in OPEN state.

SQL> alter database open;

Database altered.

SQL> select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
CDB2      READ ONLY            PHYSICAL STANDBY

SQL> select name,open_mode from v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDB5                           MOUNTED

SQL> alter pluggable database pdb5 open;

Pluggable database altered.

SQL> select name,open_mode from v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDB5                           READ ONLY

SQL> select protection_mode from v$database;

PROTECTION_MODE
--------------------
MAXIMUM PERFORMANCE
 


Check whether the standby media recovery process is running or not.
SQL> select process from v$managed_standby;

PROCESS
---------
ARCH
ARCH
ARCH
ARCH
RFS
RFS
RFS
MRP0
RFS


So it is running.

Lets create a test table under scott user on Primary Pluggable Container Database side and check  the same over Standby Container database.

On Primary Side.

 SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT
SQL> select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
CDB2      READ WRITE           PRIMARY

SQL> conn sys@pdb5 as sysdba
Enter password:
Connected.
SQL> alter user scott identified by tiger account unlock;

User altered.
SQL> conn scott/tiger@pdb5;
Connected.
SQL> create table test as
  2  select * from emp;

Table created.

SQL> insert into test
  2  select * from emp;

14 rows created.

SQL> conn /as sysdba;
Connected.
SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT
SQL> alter system switch logfile;

System altered.

SQL> /
System altered.

SQL> select max(sequence#) from v$archived_log;

System altered.

MAX(SEQUENCE#)
--------------
            62
 

SQL> conn scott/tiger@pdb5;
Connected.
SQL> select count(*) from test;

  COUNT(*)
----------
        28


On Standby Side.

SQL> select * from v$archive_gap;

no rows selected

SQL> select max(sequence#) from v$archived_log;

MAX(SEQUENCE#)
--------------
            62

SQL> conn sys@pdb5 as sysdba
Enter password:
Connected.
SQL> conn scott/tiger@pdb5;
Connected.
SQL> select count(*) from test;

  COUNT(*)
----------
        28

SQL> conn /as sysdba;
Connected.


So we can see that Standby Database is working fine.













































































HTH.

Thanks to visit here. :)

No comments:

Post a Comment