Thursday, December 19, 2013

Configuring Active Data Guard (ADG) using Oracle Database 12c (With Container Database and Pluggable Databases) - Part-4


Definition Of FAR SYNC database:

1. A lightweight Oracle database instance
2. Only a standby controlfile (created from primary database like phyical standby database controlfile process)
3. Password file, Standby Redo Log files & archive log files will have in Far Sync Instance
4. NO Data files & NO database to open for access
5. Far Sync database will deployed near distance to Primary Database to tolerate the impact of network latency

Configuration:

[oracle@dbnode]$ export ORACLE_SID=farsync
[oracle@dbnode]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome
[oracle@dbnode]$ cd /u01/app/oracle/product/12.1.0/dbhome/bin
[oracle@dbnode]$ sqlplus /nolog
SQL*Plus: Release 12.1.0.1.0 Production on Tue Nov 19 13:19:05 2013
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> connect sys/oracle as sysdba
Connected to an idle instance.

SQL> startup nomount pfile='/u01/pfile1.ora';
ORACLE instance started.

Total System Global Area  217157632 bytes
Fixed Size                         2286656 bytes
Variable Size                     159386560 bytes
Database Buffers              50331648 bytes
Redo Buffers                    5152768 bytes

SQL> alter database mount;
Database altered.

SQL> create spfile from  pfile='/u01/pfile1.ora';
File created.

SQL> shu immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.

SQL> connect sys/oracle as sysdba
Connected to an idle instance.

SQL> startup mount;
ORACLE instance started.

Total System Global Area  217157632 bytes
Fixed Size                         2286656 bytes
Variable Size                     159386560 bytes
Database Buffers              50331648 bytes
Redo Buffers                    5152768 bytes
Database mounted.

SQL> select open_mode,database_role from v$database;

OPEN_MODE            DATABASE_ROLE
--------------------      ---------------------
MOUNTED                 FAR SYNC 

Entries from listener.ora & tnsnames.ora:

[oracle@dbnode bin]$ cat /u01/app/oracle/product/12.1.0/dbhome/network/admin/listener.ora
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = cdb)
      (ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome)
      (SID_NAME = cdb)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = cdbstby)
      (ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome)
      (SID_NAME = cdbstby)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = cdbstby_DGMGRL)
      (ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome)
      (SID_NAME = cdbstby)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = cdb_DGMGRL)
      (ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome)
      (SID_NAME = cdb)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = farsync)
      (ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome)
      (SID_NAME = farsync)
    )
   )
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = dbnode.oracle.com)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = /u01/app/oracle

[oracle@dbnode bin]$ cat /u01/app/oracle/product/12.1.0/dbhome/network/admin/tnsnames.ora
CDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dbnode.oracle.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cdb)
    )
  )

cdbstby =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dbnode.oracle.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cdbstby)
    )
  )

CDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dbnode.oracle.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cdb_DGMGRL)
    )
  )

cdbstby =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dbnode.oracle.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cdbstby_DGMGRL)
    )
  )
farsync =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dbnode.oracle.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = farsync)
    )
  )

Adding "FAR SYNC" database to DGMGRL Configuration:

[oracle@dbnode]$ export ORACLE_SID=cdb
[oracle@dbnode]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome
[oracle@dbnode]$ cd /u01/app/oracle/product/12.1.0/dbhome/bin
[oracle@dbnode]$ dgmgrl
DGMGRL for Linux: Version 12.1.0.1.0 - 64bit Production
Copyright (c) 2000, 2012, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle
Connected as SYSDG.

DGMGRL> show configuration;
Configuration - DGCONFIG
  Protection Mode: MaxPerformance
  Databases:
  cdb     - Primary database
  cdbstby - (*) Physical standby database

Fast-Start Failover: ENABLED

Configuration Status:
SUCCESS

DGMGRL> add far_sync 'farsync' as connect identifier is farsync;
far sync instance "farsync" added

DGMGRL> enable far_sync farsync;
Enabled.

No comments:

Post a Comment