{"id":2299,"date":"2017-03-27T16:42:10","date_gmt":"2017-03-27T13:42:10","guid":{"rendered":"http:\/\/www.fatihacar.com\/blog\/?p=2299"},"modified":"2017-05-10T11:20:33","modified_gmt":"2017-05-10T08:20:33","slug":"oracle-11g-r2-multi-real-time-apply-data-guard-configuration-steps","status":"publish","type":"post","link":"http:\/\/www.fatihacar.com\/blog\/oracle-11g-r2-multi-real-time-apply-data-guard-configuration-steps\/","title":{"rendered":"Oracle 11g R2 Multi Real Time Apply Data Guard Configuration Steps"},"content":{"rendered":"<p>Oracle 11g R2 database supports multi standby database structure up to 30 standby databases. We can use remote destinations for real time apply standby structures with todays network technologies. If your remote destination network is not good, you can use archivelog apply for remote destination with some delay.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2300\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/multiple_standby_adimlari1.jpg\" alt=\"\" width=\"747\" height=\"613\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/multiple_standby_adimlari1.jpg 747w, http:\/\/www.fatihacar.com\/blog\/resimler\/multiple_standby_adimlari1-300x246.jpg 300w\" sizes=\"auto, (max-width: 747px) 100vw, 747px\" \/><\/p>\n<p>System informations are like below.<\/p>\n<h2><strong>System Informations<\/strong><\/h2>\n<p><strong>PRIMARY DATABASE<\/strong><br \/>\n<strong>VERSION :<\/strong> 11.2.0.3<br \/>\n<strong>IP :<\/strong> 192.168.9.129<br \/>\n<strong>SID :<\/strong> PRI<br \/>\n<strong>HOSTNAME :<\/strong> primary.localdomain<\/p>\n<p><strong>FIRST STANDBY DATABASE<\/strong><br \/>\n<strong>VERSION :<\/strong> 11.2.0.3<br \/>\n<strong>IP :<\/strong> 192.168.9.130<br \/>\n<strong>SID :<\/strong> DR1<br \/>\n<strong>HOSTNAME :<\/strong> dr1.localdomain<\/p>\n<p><strong>SECOND STANDBY DATABASE<\/strong><br \/>\n<strong>VERSION :<\/strong> 11.2.0.3<br \/>\n<strong>IP :<\/strong> 192.168.9.131<br \/>\n<strong>SID :<\/strong> DR2<br \/>\n<strong>HOSTNAME :<\/strong> dr2.localdomain<br \/>\n<!--more--><\/p>\n<h2><strong>Assumptions<\/strong><\/h2>\n<blockquote><p>Primary database installed.<br \/>\nPrimary database archivelog mode enabled.<br \/>\nStandby databases installed as only software.<br \/>\nShh-Keygen connection configuration completed.<\/p><\/blockquote>\n<p><strong>hosts file of all systems<\/strong><\/p>\n<blockquote><p>192.168.9.129 primary.localdomain primary<br \/>\n192.168.9.130 dr1.localdomain dr1<br \/>\n192.168.9.131 dr2.localdomain dr2<\/p><\/blockquote>\n<p><strong>Oracle User Bash Profiles<\/strong><\/p>\n<p><strong>Primary Database Oracle User .bash_profile<\/strong><\/p>\n<blockquote>\n<pre><code>\r\n#bash_profile\r\n\r\n# Get the aliases and functions\r\nif [ -f ~\/.bashrc ]; then\r\n        . ~\/.bashrc\r\nfi\r\n\r\n# User specific environment and startup programs\r\n\r\nif [ $USER = \"oracle\" ]; then\r\n  if [ $SHELL = \"\/bin\/ksh\" ]; then\r\n    ulimit -p 16384\r\n    ulimit -n 65536\r\n  else\r\n    ulimit -u 16384 -n 65536\r\n  fi\r\nfi\r\n\r\n# User specific environment and startup programs\r\n# Oracle Settings\r\nTMP=\/tmp; export TMP\r\nTMPDIR=$TMP; export TMPDIR\r\nORACLE_HOSTNAME=primary.localdomain; export ORACLE_HOSTNAME\r\nORACLE_UNQNAME=PRI; export ORACLE_UNQNAME\r\nORACLE_BASE=\/oracle\/db\/11.2.0; export ORACLE_BASE\r\nORACLE_SID=PRI; export ORACLE_SID\r\nORACLE_HOME=\/oracle\/db\/11.2.0\/db_home; export ORACLE_HOME\r\nORACLE_TERM=xterm; export ORACLE_TERM\r\nLD_LIBRARY_PATH=$ORACLE_HOME\/lib:\/lib:\/usr\/lib; export LD_LIBRARY_PATH\r\nCLASSPATH=$ORACLE_HOME\/JRE:$ORACLE_HOME\/jlib:$ORACLE_HOME\/rdbms\/jlib; export CLASSPATH\r\nBASE_PATH=\/usr\/sbin:$PATH:$HOME\/bin; export BASE_PATH\r\nPATH=$ORACLE_HOME\/bin:$BASE_PATH; export PATH\r\n\r\nalias home='cd \/oracle\/db\/11.2.0\/db_home'\r\nalias sql='sqlplus \/ as sysdba'\r\nalias alert_db='tail -100f \/oracle\/db\/11.2.0\/diag\/rdbms\/PRI\/PRI\/trace\/alert_PRI.log'\r\n<\/code><\/pre>\n<p>&nbsp;<\/p><\/blockquote>\n<p><strong>First Standby Database Oracle User .bash_profile<\/strong><\/p>\n<blockquote>\n<pre><code>\r\n#bash_profile\r\n\r\n# Get the aliases and functions\r\nif [ -f ~\/.bashrc ]; then\r\n        . ~\/.bashrc\r\nfi\r\n\r\n# User specific environment and startup programs\r\n\r\nif [ $USER = \"oracle\" ]; then\r\n  if [ $SHELL = \"\/bin\/ksh\" ]; then\r\n    ulimit -p 16384\r\n    ulimit -n 65536\r\n  else\r\n    ulimit -u 16384 -n 65536\r\n  fi\r\nfi\r\n\r\n# User specific environment and startup programs\r\n# Oracle Settings\r\nTMP=\/tmp; export TMP\r\nTMPDIR=$TMP; export TMPDIR\r\nORACLE_HOSTNAME=dr1.localdomain; export ORACLE_HOSTNAME\r\nORACLE_UNQNAME=DR1; export ORACLE_UNQNAME\r\nORACLE_BASE=\/oracle\/db\/11.2.0; export ORACLE_BASE\r\nORACLE_SID=DR1; export ORACLE_SID\r\nORACLE_HOME=\/oracle\/db\/11.2.0\/db_home; export ORACLE_HOME\r\nORACLE_TERM=xterm; export ORACLE_TERM\r\nLD_LIBRARY_PATH=$ORACLE_HOME\/lib:\/lib:\/usr\/lib; export LD_LIBRARY_PATH\r\nCLASSPATH=$ORACLE_HOME\/JRE:$ORACLE_HOME\/jlib:$ORACLE_HOME\/rdbms\/jlib; export CLASSPATH\r\nBASE_PATH=\/usr\/sbin:$PATH:$HOME\/bin; export BASE_PATH\r\nPATH=$ORACLE_HOME\/bin:$BASE_PATH; export PATH\r\n\r\nalias home='cd \/oracle\/db\/11.2.0\/db_home'\r\nalias sql='sqlplus \/ as sysdba'\r\nalias alert_db='tail -100f \/oracle\/db\/11.2.0\/diag\/rdbms\/dr1\/DR1\/trace\/alert_DR1.log'\r\n\r\n<\/code><\/pre>\n<\/blockquote>\n<p><strong>Second Standby Database Oracle User .bash_profile<\/strong><\/p>\n<blockquote>\n<pre><code>\r\n#bash_profile\r\n\r\n# Get the aliases and functions\r\nif [ -f ~\/.bashrc ]; then\r\n        . ~\/.bashrc\r\nfi\r\n\r\n# User specific environment and startup programs\r\n\r\nif [ $USER = \"oracle\" ]; then\r\n  if [ $SHELL = \"\/bin\/ksh\" ]; then\r\n    ulimit -p 16384\r\n    ulimit -n 65536\r\n  else\r\n    ulimit -u 16384 -n 65536\r\n  fi\r\nfi\r\n\r\n# User specific environment and startup programs\r\n# Oracle Settings\r\nTMP=\/tmp; export TMP\r\nTMPDIR=$TMP; export TMPDIR\r\nORACLE_HOSTNAME=dr2.localdomain; export ORACLE_HOSTNAME\r\nORACLE_UNQNAME=DR2; export ORACLE_UNQNAME\r\nORACLE_BASE=\/oracle\/db\/11.2.0; export ORACLE_BASE\r\nORACLE_SID=DR2; export ORACLE_SID\r\nORACLE_HOME=\/oracle\/db\/11.2.0\/db_home; export ORACLE_HOME\r\nORACLE_TERM=xterm; export ORACLE_TERM\r\nLD_LIBRARY_PATH=$ORACLE_HOME\/lib:\/lib:\/usr\/lib; export LD_LIBRARY_PATH\r\nCLASSPATH=$ORACLE_HOME\/JRE:$ORACLE_HOME\/jlib:$ORACLE_HOME\/rdbms\/jlib; export CLASSPATH\r\nBASE_PATH=\/usr\/sbin:$PATH:$HOME\/bin; export BASE_PATH\r\nPATH=$ORACLE_HOME\/bin:$BASE_PATH; export PATH\r\n\r\nalias home='cd \/oracle\/db\/11.2.0\/db_home'\r\nalias sql='sqlplus \/ as sysdba'\r\nalias alert_db='tail -100f \/oracle\/db\/11.2.0\/diag\/rdbms\/dr2\/DR2\/trace\/alert_DR2.log'\r\n\r\n<\/code><\/pre>\n<\/blockquote>\n<h2><strong>Configuration Steps<\/strong><\/h2>\n<h3><strong>1- Create Listener on Standby Sides<\/strong><\/h3>\n<p>You can use netca assistant to create new listener. You have to configure like below after creating.<\/p>\n<p><strong>First Standby Database listener.ora file<\/strong><\/p>\n<blockquote>\n<pre><code>\r\nSID_LIST_LISTENER=\r\n\t(SID_LIST=\r\n\t\t(SID_DESC=\r\n\t\t\t(GLOBAL_DBNAME=DR1)\r\n\t\t\t(ORACLE_HOME=\/oracle\/db\/11.2.0\/db_home)\r\n\t\t\t(SID_NAME=DR1)\r\n\t\t)\r\n\t)\t\r\n\r\nLISTENER =\r\n  (DESCRIPTION_LIST =\r\n    (DESCRIPTION =\r\n      (ADDRESS = (PROTOCOL = TCP)(HOST = dr1.localdomain)(PORT = 1521))\r\n      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))\r\n    )\r\n  )\r\n\r\nADR_BASE_LISTENER = \/oracle\/db\/11.2.0\r\n<\/code><\/pre>\n<p>&nbsp;<\/p><\/blockquote>\n<p><strong>Second Standby Database listener.ora file<\/strong><\/p>\n<blockquote>\n<pre><code>\r\nSID_LIST_LISTENER=\r\n\t(SID_LIST=\r\n\t\t(SID_DESC=\r\n\t\t\t(GLOBAL_DBNAME=DR2)\r\n\t\t\t(ORACLE_HOME=\/oracle\/db\/11.2.0\/db_home)\r\n\t\t\t(SID_NAME=DR2)\r\n\t\t)\r\n\t)\r\n\r\nLISTENER =\r\n  (DESCRIPTION_LIST =\r\n    (DESCRIPTION =\r\n      (ADDRESS = (PROTOCOL = TCP)(HOST = dr2.localdomain)(PORT = 1521))\r\n      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))\r\n    )\r\n  )\r\n\r\nADR_BASE_LISTENER = \/oracle\/db\/11.2.0\r\n\r\n<\/code><\/pre>\n<\/blockquote>\n<h3><strong>2- Create and Configure Tnsnames on All Sides<\/strong><\/h3>\n<p><strong>tnsnames.ora File on All Sides<\/strong><\/p>\n<blockquote>\n<pre><code>\r\nPRI =\r\n  (DESCRIPTION =\r\n    (ADDRESS = (PROTOCOL = TCP)(HOST = primary.localdomain)(PORT = 1521))\r\n    (CONNECT_DATA =\r\n      (SERVER = DEDICATED)\r\n      (SERVICE_NAME = PRI)\r\n    )\r\n  )\r\n\r\nDR1 =\r\n  (DESCRIPTION =\r\n    (ADDRESS = (PROTOCOL = TCP)(HOST = dr1.localdomain)(PORT = 1521))\r\n    (CONNECT_DATA =\r\n      (SERVER = DEDICATED)\r\n      (SERVICE_NAME = DR1)\r\n    )\r\n  )\r\n\r\nDR2 =\r\n  (DESCRIPTION =\r\n    (ADDRESS = (PROTOCOL = TCP)(HOST = dr2.localdomain)(PORT = 1521))\r\n    (CONNECT_DATA =\r\n      (SERVER = DEDICATED)\r\n      (SERVICE_NAME = DR2)\r\n    )\r\n  )\r\n\r\n<\/code><\/pre>\n<\/blockquote>\n<h3><strong>3- Configure Parameters of Primary Database<\/strong><\/h3>\n<blockquote>\n<pre><code>\r\n\r\nSQL&gt; alter system set remote_login_passwordfile=EXCLUSIVE scope=spfile;\r\n\r\nSystem altered.\r\n\r\nSQL&gt; alter system set standby_file_management=AUTO scope=both;\r\n\r\nSystem altered.\r\n\r\nSQL&gt; alter database force logging;\r\n\r\nDatabase altered.\r\n\r\nSQL&gt; alter system set fal_client='PRI';\r\n\r\nSystem altered.\r\n\r\nSQL&gt; alter system set fal_server='DR1','DR2';\r\n\r\nSystem altered.\r\n\r\nSQL&gt; alter system set log_archive_config='DG_CONFIG=(PRI,DR1,DR2)'; \r\n\r\nSystem altered.\r\nSQL&gt; alter system set log_archive_dest_1='LOCATION=\/oracle\/fra\/PRI\/archivelog\/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=PRI';   \r\n\r\nSystem altered.\r\n\r\nSQL&gt; alter system set log_archive_dest_2='SERVICE=DR1 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE) DB_UNIQUE_NAME=DR1';\r\n\r\nSystem altered.\r\n\r\nSQL&gt; alter system set log_archive_dest_3='SERVICE=DR2 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE) DB_UNIQUE_NAME=DR2';\r\n\r\nSystem altered.\r\n\r\n\r\n\r\nSQL&gt; shu immediate;\r\nDatabase closed.\r\nDatabase dismounted.\r\nORACLE instance shut down.\r\nSQL&gt; startup;\r\nORACLE instance started.\r\n\r\nTotal System Global Area  818401280 bytes\r\nFixed Size\t\t    2232800 bytes\r\nVariable Size\t\t  620760608 bytes\r\nDatabase Buffers\t  192937984 bytes\r\nRedo Buffers\t\t    2469888 bytes\r\nDatabase mounted.\r\nDatabase opened.\r\n\r\n<\/code><\/pre>\n<\/blockquote>\n<h3><strong>4- Copy Password File Of Primary Database to Standby Databases<\/strong><\/h3>\n<blockquote>\n<pre><code>\r\n\r\n[oracle@primary ~]$ scp \/oracle\/db\/11.2.0\/db_home\/dbs\/orapwPRI oracle@dr1:\/oracle\/db\/11.2.0\/db_home\/dbs\/orapwDR1\r\norapwPRI                                                                                                                                                                         100% 1536     1.5KB\/s   00:00    \r\n[oracle@primary ~]$ scp \/oracle\/db\/11.2.0\/db_home\/dbs\/orapwPRI oracle@dr2:\/oracle\/db\/11.2.0\/db_home\/dbs\/orapwDR2\r\norapwdDR1\r\norapwPRI                                                                                                                                                                         100% 1536     1.5KB\/s   00:00\r\n\r\n<\/code><\/pre>\n<\/blockquote>\n<h3><strong>5- Standby Databases Auto Open Disable<\/strong><\/h3>\n<blockquote>\n<pre><code>\r\n\r\nAdd below line to \/etc\/oratab file on all standby server.\r\n\r\n[oracle@dr1 ~] vi \/etc\/oratab\r\n\r\nDR1:\/oracle\/db\/11.2.0\/db_home:N\r\n\r\n[oracle@dr2 ~] vi \/etc\/oratab\r\n\r\nDR2:\/oracle\/db\/11.2.0\/db_home:N     \r\n\r\n<\/code><\/pre>\n<\/blockquote>\n<h3><strong>6- Configure Parameter Files<\/strong><\/h3>\n<p>You can export pfile like below command from primary database.<\/p>\n<blockquote>\n<pre><code>\r\nSQL&gt; create pfile='\/tmp\/pfile.ora' from spfile;<\/code><\/pre>\n<\/blockquote>\n<p>You have to configure pfile files for standby databases. In the last case, your datafiles can be like below. Parameters can vary depending on your system.<\/p>\n<p><strong>Primary Database Parameter File<\/strong><\/p>\n<blockquote>\n<pre><code>\r\n   \r\nPRI.__db_cache_size=226492416\r\nPRI.__java_pool_size=4194304\r\nPRI.__large_pool_size=4194304\r\nPRI.__oracle_base='\/oracle\/db\/11.2.0'#ORACLE_BASE set from environment\r\nPRI.__pga_aggregate_target=285212672\r\nPRI.__sga_target=536870912\r\nPRI.__shared_io_pool_size=0\r\nPRI.__shared_pool_size=289406976\r\nPRI.__streams_pool_size=4194304\r\n*.audit_file_dest='\/oracle\/db\/11.2.0\/admin\/PRI\/adump'\r\n*.audit_trail='db'\r\n*.compatible='11.2.0.0.0'\r\n*.control_files='\/oracle\/data\/PRI\/control01.ctl','\/oracle\/db\/11.2.0\/fast_recovery_area\/PRI\/control02.ctl'\r\n*.db_block_size=8192\r\n*.db_domain=''\r\n*.db_name='PRI'\r\n*.db_recovery_file_dest='\/oracle\/fra'\r\n*.db_recovery_file_dest_size=10737418240\r\n*.diagnostic_dest='\/oracle\/db\/11.2.0'\r\n*.dispatchers='(PROTOCOL=TCP) (SERVICE=PRIXDB)'\r\n*.fal_client='PRI'\r\n*.fal_server='DR1','DR2'\r\n*.job_queue_processes=1000\r\n*.log_archive_config='DG_CONFIG=(PRI,DR1,DR2)'\r\n*.log_archive_dest_1='LOCATION=\/oracle\/fra\/PRI\/archivelog\/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=PRI'\r\n*.log_archive_dest_2='SERVICE=DR1 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE) DB_UNIQUE_NAME=DR1'\r\n*.log_archive_dest_2='SERVICE=DR2 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE) DB_UNIQUE_NAME=DR2'\r\n*.memory_target=821035008\r\n*.archive_lag_target=900\r\n*.open_cursors=300\r\n*.processes=150\r\n*.remote_login_passwordfile='EXCLUSIVE'\r\n*.standby_file_management='AUTO'\r\n*.undo_tablespace='UNDOTBS1'\r\n\r\n<\/code><\/pre>\n<\/blockquote>\n<p><strong>First Standby Database Parameter File<\/strong><\/p>\n<blockquote>\n<pre><code>\r\n   \r\nDR1.__db_cache_size=226492416\r\nDR1.__java_pool_size=4194304\r\nDR1.__large_pool_size=4194304\r\nDR1.__oracle_base='\/oracle\/db\/11.2.0'#ORACLE_BASE set from environment\r\nDR1.__pga_aggregate_target=285212672\r\nDR1.__sga_target=536870912\r\nDR1.__shared_io_pool_size=0\r\nDR1.__shared_pool_size=289406976\r\nDR1.__streams_pool_size=4194304\r\n*.audit_file_dest='\/oracle\/db\/11.2.0\/admin\/DR1\/adump'\r\n*.audit_trail='db'\r\n*.compatible='11.2.0.0.0'\r\n*.control_files='\/oracle\/data\/DR1\/control01.ctl','\/oracle\/fra\/DR1\/control02.ctl'\r\n*.db_block_size=8192\r\n*.db_domain=''\r\n*.db_unique_name='DR1'\r\n*.db_name='PRI'\r\n*.db_recovery_file_dest='\/oracle\/fra'\r\n*.db_recovery_file_dest_size=10737418240\r\n*.diagnostic_dest='\/oracle\/db\/11.2.0'\r\n*.dispatchers='(PROTOCOL=TCP) (SERVICE=DR1XDB)'\r\n*.fal_client='DR1'\r\n*.fal_server='PRI','DR2'\r\n*.job_queue_processes=1000\r\n*.log_archive_config='DG_CONFIG=(PRI,DR1,DR2)'\r\n*.log_archive_dest_1='LOCATION=\/oracle\/fra\/DR1\/archivelog\/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=DR1'\r\n*.log_archive_dest_2='SERVICE=PRI LGWR ASYNC VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE) DB_UNIQUE_NAME=PRI'\r\n*.log_archive_dest_3='SERVICE=DR2 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE) DB_UNIQUE_NAME=DR2'\r\n*.db_file_name_convert='\/oracle\/data\/PRI','\/oracle\/data\/DR1','\/oracle\/fra\/PRI','\/oracle\/fra\/DR1'\r\n*.log_file_name_convert='\/oracle\/data\/PRI','\/oracle\/data\/DR1',<\/code><code>'\/oracle\/fra\/PRI','\/oracle\/fra\/DR1'<\/code>\r\n<code><\/code>*.service_names='DR1' *.memory_target=821035008 *.open_cursors=300 *.processes=150 *.remote_login_passwordfile='EXCLUSIVE' *.standby_file_management='AUTO' *.undo_tablespace='UNDOTBS1'<\/pre>\n<\/blockquote>\n<p><strong>Second Standby Database Parameter File<\/strong><\/p>\n<blockquote>\n<pre><code>\r\n   \r\nDR2.__db_cache_size=226492416\r\nDR2.__java_pool_size=4194304\r\nDR2.__large_pool_size=4194304\r\nDR2.__oracle_base='\/oracle\/db\/11.2.0'#ORACLE_BASE set from environment\r\nDR2.__pga_aggregate_target=285212672\r\nDR2.__sga_target=536870912\r\nDR2.__shared_io_pool_size=0\r\nDR2.__shared_pool_size=289406976\r\nDR2.__streams_pool_size=4194304\r\n*.audit_file_dest='\/oracle\/db\/11.2.0\/admin\/DR2\/adump'\r\n*.audit_trail='db'\r\n*.compatible='11.2.0.0.0'\r\n*.control_files='\/oracle\/data\/DR2\/control01.ctl','\/oracle\/fra\/DR2\/control02.ctl'\r\n*.db_block_size=8192\r\n*.db_domain=''\r\n*.db_unique_name='DR2'\r\n*.db_name='PRI'\r\n*.db_recovery_file_dest='\/oracle\/fra'\r\n*.db_recovery_file_dest_size=10737418240\r\n*.diagnostic_dest='\/oracle\/db\/11.2.0'\r\n*.dispatchers='(PROTOCOL=TCP) (SERVICE=DR2XDB)'\r\n*.fal_client='DR2'\r\n*.fal_server='PRI','DR1'\r\n*.job_queue_processes=1000\r\n*.log_archive_config='DG_CONFIG=(PRI,DR1,DR2)'\r\n*.log_archive_dest_1='LOCATION=\/oracle\/fra\/DR2\/archivelog\/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=DR2'\r\n*.log_archive_dest_2='SERVICE=PRI LGWR ASYNC VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE) DB_UNIQUE_NAME=PRI'\r\n*.log_archive_dest_3='SERVICE=DR1 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE) DB_UNIQUE_NAME=DR1'<\/code>\r\n<code>*.db_file_name_convert='\/oracle\/data\/PRI','\/oracle\/data\/DR2','\/oracle\/fra\/PRI','\/oracle\/fra\/DR2'\r\n*.log_file_name_convert='\/oracle\/data\/PRI','\/oracle\/data\/DR2',<\/code><code>'\/oracle\/fra\/PRI','\/oracle\/fra\/DR2'<\/code>\r\n<code>*.memory_target=821035008 *.open_cursors=300 *.processes=150 *.remote_login_passwordfile='EXCLUSIVE' *.standby_file_management='AUTO' *.undo_tablespace='UNDOTBS1' <\/code><\/pre>\n<\/blockquote>\n<p>After changed parameters for your systems, you can create spfile on the standby databases from pfile like below.<\/p>\n<blockquote>\n<pre><code>\r\nSQL&gt; create spfile from pfile='\/tmp\/pfile.ora';\r\n<\/code><\/pre>\n<\/blockquote>\n<h3><strong>7- Backup And Restore<\/strong><\/h3>\n<p><strong>Backup From Primary Database<\/strong><\/p>\n<p>Your backup directory have to be the same at primary and standby servers.<\/p>\n<blockquote>\n<pre><code>\r\n[oracle@primary ~] rman target \/\r\n\r\nRMAN&gt; run {\r\nALLOCATE CHANNEL d1 TYPE DISK FORMAT '\/oracle\/backup\/backup_pri_%d_s%s_p%p_%T' ;\r\nbackup as compressed backupset database plus archivelog;\r\nbackup current controlfile for standby format '\/oracle\/backup\/controlfile_standby.ctl' ;\r\nrelease channel d1;\r\n}\r\n\r\n<\/code><\/pre>\n<\/blockquote>\n<p><strong>Copy Backup Files to Standby Servers.<\/strong><\/p>\n<p>You can use scp command or ftp file transfer application to transport backups.<\/p>\n<p><strong>Restore First Standby Database<\/strong><\/p>\n<blockquote>\n<pre><code>\r\n[oracle@dr1 ~] sqlplus \/ as sysdba\r\nSQL&gt; create spfile from pfile='\/tmp\/pfile.ora';\r\nSQL&gt; startup nomount;\r\nSQL&gt; exit;\r\n\r\n[oracle@dr1 ~] rman target \/\r\n\r\nconnected to target database: PRI (not mounted)\r\n\r\nRMAN&gt; restore standby controlfile from '\/oracle\/backup\/controlfile_standby.ctl';\r\n\r\nStarting restore at 02-MAR-17\r\nusing target database control file instead of recovery catalog\r\nallocated channel: ORA_DISK_1\r\nchannel ORA_DISK_1: SID=19 device type=DISK\r\n\r\nchannel ORA_DISK_1: restoring control file\r\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:01\r\noutput file name=\/oracle\/data\/DR1\/control01.ctl\r\noutput file name=\/oracle\/fra\/DR1\/control02.ctl\r\nFinished restore at 02-MAR-17\r\n\r\nRMAN&gt; sql 'alter database mount standby database';\r\n\r\nsql statement: alter database mount standby database\r\nreleased channel: ORA_DISK_1\r\n\r\nRMAN&gt; restore database;\r\n\r\nStarting restore at 02-MAR-17\r\nStarting implicit crosscheck backup at 02-MAR-17\r\nallocated channel: ORA_DISK_1\r\nchannel ORA_DISK_1: SID=27 device type=DISK\r\nCrosschecked 4 objects\r\nFinished implicit crosscheck backup at 02-MAR-17\r\n\r\nStarting implicit crosscheck copy at 02-MAR-17\r\nusing channel ORA_DISK_1\r\nFinished implicit crosscheck copy at 02-MAR-17\r\n\r\nsearching for all files in the recovery area\r\ncataloging files...\r\nno files cataloged\r\n\r\nusing channel ORA_DISK_1\r\n\r\nchannel ORA_DISK_1: starting datafile backup set restore\r\nchannel ORA_DISK_1: specifying datafile(s) to restore from backup set\r\nchannel ORA_DISK_1: restoring datafile 00001 to \/oracle\/data\/DR1\/system01.dbf\r\nchannel ORA_DISK_1: restoring datafile 00002 to \/oracle\/data\/DR1\/sysaux01.dbf\r\nchannel ORA_DISK_1: restoring datafile 00003 to \/oracle\/data\/DR1\/undotbs01.dbf\r\nchannel ORA_DISK_1: restoring datafile 00004 to \/oracle\/data\/DR1\/users01.dbf\r\nchannel ORA_DISK_1: restoring datafile 00005 to \/oracle\/data\/DR1\/example01.dbf\r\nchannel ORA_DISK_1: reading from backup piece \/oracle\/backup\/backup_pri_PRI_s2_p1_20170302\r\nchannel ORA_DISK_1: piece handle=\/oracle\/backup\/backup_pri_PRI_s2_p1_20170302 tag=TAG20170302T170208\r\nchannel ORA_DISK_1: restored backup piece 1\r\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:35\r\nFinished restore at 02-MAR-17\r\n\r\nRMAN&gt; recover database;\r\n\r\nRMAN&gt; exit;\r\n\r\n[oracle@dr1 ~] sqlplus \/ as sysdba\r\nSQL&gt; shu immediate;\r\nSQL&gt; startup mount;\r\n\r\n<\/code><\/pre>\n<\/blockquote>\n<p><strong>Restore Second Standby Database<\/strong><\/p>\n<blockquote>\n<pre><code>\r\n\r\nThe same steps like first standby restore and recovery steps.\r\n\r\n<\/code><\/pre>\n<\/blockquote>\n<h3><strong>8- Create Standby Log File<\/strong><\/h3>\n<p>For real time apply you have to create standby log file at cascading standby database. This standby log files have to be the same size with redo log files and should be more 1 than redo log count.<\/p>\n<blockquote>\n<pre><code>\r\n\r\nCheck primary redo log sizes and count with below.\r\n\r\n[oracle@primary ~] sqlplus \/ as sysdba\r\n\r\nSQL&gt; select group#,bytes from v$log;\r\n    GROUP#\tBYTES\r\n---------- ----------\r\n\t 1   52428800\r\n\t 2   52428800\r\n\t 3   52428800\r\n\r\nYou can see this example, 3 redo log files and 50 MB size. We have to add 4 standby log files and size has to be 50 MB.\r\n\r\nCreate standby log files at first and second standby database.\r\n\r\n[oracle@dr1 ~] sqlplus \/ as sysdba\r\n\r\nSQL&gt; alter database add standby logfile size 50M;\r\n\r\nDatabase altered.\r\n\r\nSQL&gt; alter database add standby logfile size 50M;\r\n\r\nDatabase altered.\r\n\r\nSQL&gt; alter database add standby logfile size 50M;\r\n\r\nDatabase altered.\r\n\r\nSQL&gt; alter database add standby logfile size 50M;\r\n\r\nDatabase altered.\r\n\r\n<\/code><\/pre>\n<\/blockquote>\n<h3><strong>9- Start Listener<\/strong><\/h3>\n<p>Standby Listeners have to be started state.<\/p>\n<p><strong>Start Listener<\/strong><\/p>\n<blockquote>\n<pre><code>\r\n\r\n[oracle@dr1 dbs]$ lsnrctl start\r\n\r\nLSNRCTL for Linux: Version 11.2.0.3.0 - Production on 22-MAR-2017 17:48:22\r\n\r\nCopyright (c) 1991, 2011, Oracle.  All rights reserved.\r\n\r\nStarting \/oracle\/db\/11.2.0\/db_home\/bin\/tnslsnr: please wait...\r\n\r\nTNSLSNR for Linux: Version 11.2.0.3.0 - Production\r\nSystem parameter file is \/oracle\/db\/11.2.0\/db_home\/network\/admin\/listener.ora\r\nLog messages written to \/oracle\/db\/11.2.0\/diag\/tnslsnr\/dr1\/listener\/alert\/log.xml\r\nListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dr1.localdomain)(PORT=1521)))\r\nListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))\r\n\r\nConnecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dr1.localdomain)(PORT=1521)))\r\nSTATUS of the LISTENER\r\n------------------------\r\nAlias                     LISTENER\r\nVersion                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production\r\nStart Date                22-MAR-2017 17:48:22\r\nUptime                    0 days 0 hr. 0 min. 10 sec\r\nTrace Level               off\r\nSecurity                  ON: Local OS Authentication\r\nSNMP                      OFF\r\nListener Parameter File   \/oracle\/db\/11.2.0\/db_home\/network\/admin\/listener.ora\r\nListener Log File         \/oracle\/db\/11.2.0\/diag\/tnslsnr\/dr1\/listener\/alert\/log.xml\r\nListening Endpoints Summary...\r\n  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dr1.localdomain)(PORT=1521)))\r\n  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))\r\nServices Summary...\r\nService \"DR1\" has 1 instance(s).\r\n  Instance \"DR1\", status UNKNOWN, has 1 handler(s) for this service...\r\nThe command completed successfully\r\n\r\n\r\n[oracle@dr2 ~]$ lsnrctl start\r\n\r\nLSNRCTL for Linux: Version 11.2.0.3.0 - Production on 22-MAR-2017 17:51:22\r\n\r\nCopyright (c) 1991, 2011, Oracle.  All rights reserved.\r\n\r\nStarting \/oracle\/db\/11.2.0\/db_home\/bin\/tnslsnr: please wait...\r\n\r\nTNSLSNR for Linux: Version 11.2.0.3.0 - Production\r\nSystem parameter file is \/oracle\/db\/11.2.0\/db_home\/network\/admin\/listener.ora\r\nLog messages written to \/oracle\/db\/11.2.0\/diag\/tnslsnr\/dr2\/listener\/alert\/log.xml\r\nListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dr2.localdomain)(PORT=1521)))\r\nListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))\r\n\r\nConnecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dr2.localdomain)(PORT=1521)))\r\nSTATUS of the LISTENER\r\n------------------------\r\nAlias                     LISTENER\r\nVersion                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production\r\nStart Date                22-MAR-2017 17:51:22\r\nUptime                    0 days 0 hr. 0 min. 10 sec\r\nTrace Level               off\r\nSecurity                  ON: Local OS Authentication\r\nSNMP                      OFF\r\nListener Parameter File   \/oracle\/db\/11.2.0\/db_home\/network\/admin\/listener.ora\r\nListener Log File         \/oracle\/db\/11.2.0\/diag\/tnslsnr\/dr2\/listener\/alert\/log.xml\r\nListening Endpoints Summary...\r\n  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dr2.localdomain)(PORT=1521)))\r\n  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))\r\nServices Summary...\r\nService \"DR2\" has 1 instance(s).\r\n  Instance \"DR2\", status UNKNOWN, has 1 handler(s) for this service...\r\nThe command completed successfully\r\n\r\n<\/code><\/pre>\n<\/blockquote>\n<h3><strong>10- Connect And Start Apply On All Standby Databases<\/strong><\/h3>\n<p>In the last case the standby databases were in mount mode. We can use alter database open read only command.<\/p>\n<p><strong>First Standby Database<\/strong><\/p>\n<blockquote>\n<pre><code>\r\n\r\n[oracle@dr1 dbs]$ sqlplus \/ as sysdba\r\n\r\nSQL&gt; alter database open read only;\r\n\r\nDatabase altered.\r\n\r\nSQL&gt; alter database recover managed standby database using current logfile disconnect;\r\n\r\nDatabase altered.\r\n\r\n<\/code><\/pre>\n<\/blockquote>\n<p><strong>Second Standby Database<\/strong><\/p>\n<blockquote>\n<pre><code>\r\n\r\n[oracle@dr2 dbs]$ sqlplus \/ as sysdba\r\n\r\nSQL&gt; alter database open read only;\r\n\r\nDatabase altered.\r\n\r\nSQL&gt; alter database recover managed standby database using current logfile disconnect;\r\n\r\nDatabase altered.\r\n\r\n<\/code><\/pre>\n<\/blockquote>\n<p>If you want to do switchover, you can use standart steps of switchover. You can find switchover steps here : <a href=\"http:\/\/www.fatihacar.com\/blog\/oracle-11g-r2-data-guard-manual-switchover-steps\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.fatihacar.com\/blog\/oracle-11g-r2-data-guard-manual-switchover-steps\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Oracle 11g R2 database supports multi standby database structure up to 30 standby databases. We can use remote destinations for real time apply standby structures with todays network technologies. If your remote destination network is not good, you can use archivelog apply for remote destination with some delay. System informations are like below. System Informations&#8230;<\/p>\n","protected":false},"author":37,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9,20],"tags":[14,32],"class_list":["post-2299","post","type-post","status-publish","format-standard","hentry","category-administration","category-oracle-backup-and-recovery","tag-database-administration","tag-oracle-administration"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p39NFI-B5","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/2299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/users\/37"}],"replies":[{"embeddable":true,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/comments?post=2299"}],"version-history":[{"count":15,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/2299\/revisions"}],"predecessor-version":[{"id":2360,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/2299\/revisions\/2360"}],"wp:attachment":[{"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/media?parent=2299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/categories?post=2299"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/tags?post=2299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}