{"id":2461,"date":"2017-10-12T11:11:32","date_gmt":"2017-10-12T08:11:32","guid":{"rendered":"http:\/\/www.fatihacar.com\/blog\/?p=2461"},"modified":"2019-10-23T16:33:57","modified_gmt":"2019-10-23T13:33:57","slug":"oracle-12c-r2-12-2-0-1-real-time-apply-data-guard-installation-on-oracle-linux-7-3","status":"publish","type":"post","link":"http:\/\/www.fatihacar.com\/blog\/oracle-12c-r2-12-2-0-1-real-time-apply-data-guard-installation-on-oracle-linux-7-3\/","title":{"rendered":"Oracle 12c R2 (12.2.0.1) Real Time Apply Data Guard Installation on Oracle Linux 7.3"},"content":{"rendered":"<p>Oracle Data Guard ensures high availability, data protection, and disaster recovery for enterprise data. Oracle Data Guard provides a comprehensive set of services that create, maintain, manage, and monitor one or more standby databases to enable production Oracle databases to survive disasters and data corruptions. Oracle Data Guard maintains these standby databases as copies of the production database.Then, if the production database becomes unavailable because of a planned or an unplanned outage, Oracle Data Guard can switch any standby database to the production role, minimizing the downtime associated with the outage. Oracle Data Guard can be used with traditional backup, restoration, and cluster techniques to provide a high level of data protection and data availability.<\/p>\n<p>With Oracle Data Guard, administrators can optionally improve production database performance by offloading resource-intensive backup and reporting operations to standby systems.<\/p>\n<p>Types of standby databases are Physical standby database, Logical standby database and Snapshot standby database.<\/p>\n<p>I will demonstrate Physical standby database as working real time apply at this document. Most used type is Physical standby database type. You can investigate other types of standby database from Oracle docs.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2464\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/oracle12c_data_guard_infrastructure.jpg\" alt=\"\" width=\"1041\" height=\"708\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/oracle12c_data_guard_infrastructure.jpg 1041w, http:\/\/www.fatihacar.com\/blog\/resimler\/oracle12c_data_guard_infrastructure-300x204.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/oracle12c_data_guard_infrastructure-768x522.jpg 768w, http:\/\/www.fatihacar.com\/blog\/resimler\/oracle12c_data_guard_infrastructure-1024x696.jpg 1024w\" sizes=\"auto, (max-width: 1041px) 100vw, 1041px\" \/><\/p>\n<p>I used Oracle RAC database as primary side and I used single instance database with asm file system as secondary side (Data Guard).<\/p>\n<p>Firstly, you have to adjust system parameters of operating system on secondary side and create asm disks. After, you can start to install of grid infrastructure. You can create disk groups for DATA and FRA disk groups after install grid. After grid installation, you can install Oracle Data Guard database on grid infrastructure and ASM disks as software only. Finally you can restore and recover standby database from primary side and you can start synchronization apply after add standby redo log.\u00a0I divide the stages of installation five steps.<\/p>\n<p>You can find primary side (Oracle 12c RAC) installation steps <a href=\"http:\/\/www.fatihacar.com\/blog\/oracle-12c-r2-12-2-0-1-rac-installation-steps-on-oracle-linux-7-3\/\">here<\/a>. I will use this infrastructure as primary side.<\/p>\n<h3>First Step : Configure Operation System on Secondery Side<\/h3>\n<p><strong>1. Upgrade Packages<\/strong><\/p>\n<blockquote><p>yum upgrade<\/p>\n<p>yum install oracleasm-support<\/p><\/blockquote>\n<p><!--more--><\/p>\n<p><strong>2. Selinux Disable<\/strong><\/p>\n<blockquote><p>You can do disabled or permissive<\/p>\n<p>vi \/etc\/selinux\/config<\/p>\n<p>SELINUX=disabled<\/p><\/blockquote>\n<p><strong>3. Firewall Close and Disable<\/strong><\/p>\n<blockquote><p>You can open after installation,but you have to give permission to necessary ports and services.<\/p>\n<p>systemctl stop firewalld.service<\/p>\n<p>systemctl disable firewalld.service<\/p><\/blockquote>\n<p><strong>4. Create Users<\/strong><\/p>\n<blockquote><p>groupadd \u2013g 501 oinstall<\/p>\n<p align=\"justify\">groupadd \u2013g 502 dba<\/p>\n<p align=\"justify\">groupadd \u2013g 503 oper<\/p>\n<p align=\"justify\">groupadd \u2013g 504 asmadmin<\/p>\n<p align=\"justify\">groupadd \u2013g 505 asmdba<\/p>\n<p align=\"justify\">groupadd \u2013g 506 asmoper<\/p>\n<p align=\"justify\">useradd \u2013u 502 \u2013g oinstall \u2013G dba,asmdba,oper oracle<\/p>\n<p align=\"justify\">passwd oracle<\/p>\n<p align=\"justify\">useradd \u2013u 501 \u2013g oinstall \u2013G asmadmin,asmoper,asmdba grid<\/p>\n<p align=\"justify\">passwd grid<\/p>\n<\/blockquote>\n<p align=\"justify\"><strong>5. Configure Bash Profile of Users<\/strong><\/p>\n<blockquote><p><b>Oracle User<\/b><\/p>\n<p>vi .bash_profile<\/p>\n<p># Oracle Settings<\/p>\n<p>export TMP=\/tmp<\/p>\n<p>export TMPDIR=$TMP<\/p>\n<p>export ORACLE_HOSTNAME=test12cdg.yourdomain<\/p>\n<p>export ORACLE_UNQNAME=TDG<\/p>\n<p>export ORACLE_BASE=\/oracle\/db\/12.2.0.1<\/p>\n<p>export DB_HOME=$ORACLE_BASE\/db_home<\/p>\n<p>export ORACLE_HOME=$DB_HOME<\/p>\n<p>export ORACLE_SID=TDG<\/p>\n<p>export ORACLE_TERM=xterm<\/p>\n<p>export BASE_PATH=\/usr\/sbin:$PATH<\/p>\n<p>export PATH=$ORACLE_HOME\/bin:$BASE_PATH<\/p>\n<p>export LD_LIBRARY_PATH=$ORACLE_HOME\/lib:\/lib:\/usr\/lib<\/p>\n<p>export CLASSPATH=$ORACLE_HOME\/JRE:$ORACLE_HOME\/jlib:$ORACLE_HOME\/rdbms\/jlib<\/p>\n<p>alias sql=&#8217;sqlplus \/ as sysdba&#8217;<\/p>\n<p>PATH=$PATH:$HOME\/.local\/bin:$HOME\/bin<\/p>\n<p>export PATH<\/p>\n<p>&nbsp;<\/p>\n<p><b>Grid User<\/b><\/p>\n<p># Oracle Settings<\/p>\n<p>export TMP=\/tmp<\/p>\n<p>export TMPDIR=$TMP<\/p>\n<p>export ORACLE_HOSTNAME=test12cdg.yourdomain<\/p>\n<p>export ORACLE_UNQNAME=TDG<\/p>\n<p>export ORACLE_BASE=\/oracle\/gridbase\/12.2.0.1<\/p>\n<p>export GRID_BASE=\/oracle\/gridbase\/12.2.0.1<\/p>\n<p>export GRID_HOME=\/oracle\/grid\/12.2.0.1\/grid_home<\/p>\n<p>export ORACLE_HOME=\/oracle\/grid\/12.2.0.1\/grid_home<\/p>\n<p>export ORACLE_SID=+ASM<\/p>\n<p>export ORACLE_TERM=xterm<\/p>\n<p>export BASE_PATH=\/usr\/sbin:$PATH<\/p>\n<p>export PATH=$ORACLE_HOME\/bin:$BASE_PATH<\/p>\n<p>export LD_LIBRARY_PATH=$ORACLE_HOME\/lib:\/lib:\/usr\/lib<\/p>\n<p>export CLASSPATH=$ORACLE_HOME\/JRE:$ORACLE_HOME\/jlib:$ORACLE_HOME\/rdbms\/jlib<\/p>\n<p>alias sql=&#8217;sqlplus \/ as sysasm&#8217;<\/p>\n<p>PATH=$PATH:$HOME\/.local\/bin:$HOME\/bin<\/p>\n<p>export PATH<\/p><\/blockquote>\n<p><strong>6. Create Directories<\/strong><\/p>\n<blockquote><p>mkdir -p \/oracle\/grid\/12.2.0.1\/grid_home<\/p>\n<p>mkdir -p \/oracle\/grid\/12.2.0.1\/log<\/p>\n<p>mkdir -p \/oracle\/gridbase\/12.2.0.1\/<\/p>\n<p>mkdir -p \/oracle\/db\/12.2.0.1\/db_home<\/p>\n<p>chown -R oracle.oinstall \/oracle\/<\/p>\n<p>chown -R grid.oinstall \/oracle\/grid*<\/p>\n<p>chmod -R 775 \/oracle\/<\/p><\/blockquote>\n<p><strong>7. Configure ASM Disks<\/strong><\/p>\n<blockquote><p>*Your disk name can be different from I used. I configured sdc, sdd,sde disks for asm on my test suite. These sd* disks can be different on your system.<\/p>\n<p>with root user.<\/p>\n<p>oracleasm configure -i<\/p>\n<p>Answers of Questions;<\/p>\n<p>grid<\/p>\n<p>asmadmin<\/p>\n<p>y<\/p>\n<p>y<\/p>\n<p>After finish configuration you can make init with below command.<\/p>\n<p>oracleasm init<\/p>\n<p>Create partition.<\/p>\n<p>fdisk \/dev\/sdc<\/p>\n<p>fdisk \/dev\/sdd<\/p>\n<p>fdisk \/dev\/sde<\/p>\n<p>oracleasm createdisk DATA1 \/dev\/sdc1<\/p>\n<p>oracleasm createdisk FRA1 \/dev\/sdd1<\/p>\n<p>oracleasm createdisk GRID1 \/dev\/sde1<\/p>\n<p>You can use scandisks and listdisks to control.<\/p>\n<p>oracleasm scandisks<\/p>\n<p>oracleasm listdisks<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p><strong>8. Configure Passwordless SSH Connection<\/strong><\/p>\n<blockquote><p>You have to configure ssh passwordless connection. Oracle and Grid user of primary and secondary side have to connect each other passwordless.<\/p>\n<p>You can find how to do this step <a href=\"http:\/\/www.fatihacar.com\/blog\/?s=ssh-keygen\">here<\/a>.<\/p><\/blockquote>\n<p><strong>9. Chrony NTP Configuration<\/strong><\/p>\n<blockquote><p>Chrony plugin came with Oracle Linux 7 version for ntp sync. You can write your ntp server information in \/etc\/chrony.conf file.<\/p>\n<p>vi \/etc\/chrony.conf<\/p>\n<p>server ntp.yourdomain<\/p>\n<p>systemctl restart chronyd.service<\/p>\n<p>systemctl enable chronyd.service<\/p><\/blockquote>\n<p><strong>10. Configure Hosts File<\/strong><\/p>\n<blockquote><p>You can write your domain name info instead of yourdomain text. Also, you can give IP addresses as your IP structure. You have to write IP and domain information to \/etc\/hosts file if you do not use dns server.<\/p>\n<p>You have to add &#8220;40.50.60.100 tdg tdg.yourdomain&#8221; line on primary side.\u00a040.50.60.100 IP address is our data guard server IP address.<\/p>\n<p>vi \/etc\/hosts<\/p>\n<p>20.10.4.141 ractest12c01 ractest12c01.yourdomain<\/p>\n<p>20.10.4.142 ractest12c02 ractest12c02.yourdomain<\/p>\n<p>20.10.4.143 ractest12c01-vip ractest12c01-vip.yourdomain<\/p>\n<p>20.10.4.144 ractest12c02-vip ractest12c02-vip.yourdomain<\/p>\n<p>20.10.4.145 ractest12c-scan ractest12c-scan.yourdomain<\/p>\n<p>20.10.4.146 ractest12c-scan ractest12c-scan.yourdomain<\/p>\n<p>20.10.4.147 ractest12c-scan ractest12c-scan.yourdomain<\/p>\n<p>40.50.60.100 test12cdg test12cdg.yourdomain<\/p><\/blockquote>\n<p><strong>11. DNS Register (optional)<\/strong><\/p>\n<blockquote><p>You can configure dns information of nodes in \/etc\/resolf.conf file.<\/p><\/blockquote>\n<p><strong>12. Preinstallation Package Intallation<\/strong><\/p>\n<blockquote><p>yum install oracle-database-server-12cR2-preinstall<\/p>\n<p>reboot<\/p><\/blockquote>\n<h3>Second Step : Install Grid Infrastructure<\/h3>\n<p>You have to copy your grid installation files to grid_home. I recommend that you copy grid zip file to grid home and change owner of zip file, and unzip with grid user.<\/p>\n<p><strong>Copy and Unzip Grid Files<\/strong><\/p>\n<blockquote><p>cp linuxx64_12201_grid_home.zip \/oracle\/grid\/12.2.0.1\/grid_home<\/p>\n<p>chown grid.oinsall linuxx64_12201_grid_home.zip<\/p>\n<p>su &#8211; grid<\/p>\n<p>unzip linuxx64_12201_grid_home.zip<\/p><\/blockquote>\n<p><strong>Display Config and Start Grid Installation<\/strong><\/p>\n<blockquote><p>su &#8211;<\/p>\n<p>export DISPLAY=:0.0<\/p>\n<p>xhost +<\/p>\n<p>su &#8211; grid<\/p>\n<p>export DISPLAY=:0.0<\/p>\n<p>xhost +<\/p>\n<p>cd \/$GRID_HOME\/<\/p>\n<p>.\/grid_Setup.sh<\/p><\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2482\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/1-1.jpg\" alt=\"\" width=\"796\" height=\"334\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/1-1.jpg 796w, http:\/\/www.fatihacar.com\/blog\/resimler\/1-1-300x126.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/1-1-768x322.jpg 768w\" sizes=\"auto, (max-width: 796px) 100vw, 796px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2483\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/2-1.jpg\" alt=\"\" width=\"797\" height=\"607\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/2-1.jpg 797w, http:\/\/www.fatihacar.com\/blog\/resimler\/2-1-300x228.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/2-1-768x585.jpg 768w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2484\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/3-1.jpg\" alt=\"\" width=\"797\" height=\"608\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/3-1.jpg 797w, http:\/\/www.fatihacar.com\/blog\/resimler\/3-1-300x229.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/3-1-768x586.jpg 768w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2485\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/4-1.jpg\" alt=\"\" width=\"797\" height=\"325\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/4-1.jpg 797w, http:\/\/www.fatihacar.com\/blog\/resimler\/4-1-300x122.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/4-1-768x313.jpg 768w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2486\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/5-1.jpg\" alt=\"\" width=\"793\" height=\"304\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/5-1.jpg 793w, http:\/\/www.fatihacar.com\/blog\/resimler\/5-1-300x115.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/5-1-768x294.jpg 768w\" sizes=\"auto, (max-width: 793px) 100vw, 793px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2487\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/6-1.jpg\" alt=\"\" width=\"797\" height=\"333\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/6-1.jpg 797w, http:\/\/www.fatihacar.com\/blog\/resimler\/6-1-300x125.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/6-1-768x321.jpg 768w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2488\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/7-1.jpg\" alt=\"\" width=\"797\" height=\"355\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/7-1.jpg 797w, http:\/\/www.fatihacar.com\/blog\/resimler\/7-1-300x134.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/7-1-768x342.jpg 768w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2489\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/8-1.jpg\" alt=\"\" width=\"795\" height=\"398\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/8-1.jpg 795w, http:\/\/www.fatihacar.com\/blog\/resimler\/8-1-300x150.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/8-1-768x384.jpg 768w\" sizes=\"auto, (max-width: 795px) 100vw, 795px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2490\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/9-1.jpg\" alt=\"\" width=\"798\" height=\"605\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/9-1.jpg 798w, http:\/\/www.fatihacar.com\/blog\/resimler\/9-1-300x227.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/9-1-768x582.jpg 768w\" sizes=\"auto, (max-width: 798px) 100vw, 798px\" \/><\/p>\n<p>Fix &amp; Check Again button creates fix scripts to resolve warnings. You have to run this scripts to resolve warnings.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2491\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/10-1.jpg\" alt=\"\" width=\"923\" height=\"60\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/10-1.jpg 923w, http:\/\/www.fatihacar.com\/blog\/resimler\/10-1-300x20.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/10-1-768x50.jpg 768w\" sizes=\"auto, (max-width: 923px) 100vw, 923px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2492\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/11-1.jpg\" alt=\"\" width=\"796\" height=\"606\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/11-1.jpg 796w, http:\/\/www.fatihacar.com\/blog\/resimler\/11-1-300x228.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/11-1-768x585.jpg 768w\" sizes=\"auto, (max-width: 796px) 100vw, 796px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2493\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/12-1.jpg\" alt=\"\" width=\"797\" height=\"607\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/12-1.jpg 797w, http:\/\/www.fatihacar.com\/blog\/resimler\/12-1-300x228.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/12-1-768x585.jpg 768w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/><\/p>\n<p>You have to run this scripts respectively. The run can be a bit long. You can click OK, after run scripts. If you do not get an error, you can continue.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2494\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/13-1.jpg\" alt=\"\" width=\"793\" height=\"604\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/13-1.jpg 793w, http:\/\/www.fatihacar.com\/blog\/resimler\/13-1-300x228.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/13-1-768x585.jpg 768w\" sizes=\"auto, (max-width: 793px) 100vw, 793px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2495\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/15-1.jpg\" alt=\"\" width=\"795\" height=\"603\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/15-1.jpg 795w, http:\/\/www.fatihacar.com\/blog\/resimler\/15-1-300x228.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/15-1-768x583.jpg 768w\" sizes=\"auto, (max-width: 795px) 100vw, 795px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2496\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/16-1.jpg\" alt=\"\" width=\"796\" height=\"240\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/16-1.jpg 796w, http:\/\/www.fatihacar.com\/blog\/resimler\/16-1-300x90.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/16-1-768x232.jpg 768w\" sizes=\"auto, (max-width: 796px) 100vw, 796px\" \/><\/p>\n<p>You can check your grid status with <strong>crs_stat -t<\/strong> and <strong>crsctl stat res -t<\/strong> commands with grid user.<\/p>\n<h3>Third Step : Create ASM Disk Group For DATA and FRA<\/h3>\n<p><strong>Display Config and Start ASMCA<\/strong><\/p>\n<blockquote><p>su &#8211;<\/p>\n<p>export DISPLAY=:0.0<\/p>\n<p>xhost +<\/p>\n<p>su &#8211; grid<\/p>\n<p>export DISPLAY=:0.0<\/p>\n<p>xhost +<\/p>\n<p>asmca<\/p><\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2498\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/1-2.jpg\" alt=\"\" width=\"947\" height=\"597\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/1-2.jpg 947w, http:\/\/www.fatihacar.com\/blog\/resimler\/1-2-300x189.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/1-2-768x484.jpg 768w\" sizes=\"auto, (max-width: 947px) 100vw, 947px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2499\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/2-2.jpg\" alt=\"\" width=\"947\" height=\"593\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/2-2.jpg 947w, http:\/\/www.fatihacar.com\/blog\/resimler\/2-2-300x188.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/2-2-768x481.jpg 768w\" sizes=\"auto, (max-width: 947px) 100vw, 947px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2500\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/3-3.jpg\" alt=\"\" width=\"949\" height=\"597\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/3-3.jpg 949w, http:\/\/www.fatihacar.com\/blog\/resimler\/3-3-300x189.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/3-3-768x483.jpg 768w\" sizes=\"auto, (max-width: 949px) 100vw, 949px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2501\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/4-2.jpg\" alt=\"\" width=\"947\" height=\"596\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/4-2.jpg 947w, http:\/\/www.fatihacar.com\/blog\/resimler\/4-2-300x189.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/4-2-768x483.jpg 768w\" sizes=\"auto, (max-width: 947px) 100vw, 947px\" \/><\/p>\n<h3>Fourth Step : Install Database as Software Only<\/h3>\n<p>You can unzip database file under \/tmp\/ and you have to give permission oracle user.<\/p>\n<p>chown oracle.oinstall -R \/tmp\/database\/<\/p>\n<p><strong>Display Config and Start Database Installation<\/strong><\/p>\n<blockquote><p>su &#8211;<\/p>\n<p>export DISPLAY=:0.0<\/p>\n<p>xhost +<\/p>\n<p>su &#8211; oracle<\/p>\n<p>export DISPLAY=:0.0<\/p>\n<p>xhost +<\/p>\n<p>cd \/tmp\/database\/<\/p>\n<p>.\/runInstaller<\/p><\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2503\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/1-4.jpg\" alt=\"\" width=\"797\" height=\"303\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/1-4.jpg 797w, http:\/\/www.fatihacar.com\/blog\/resimler\/1-4-300x114.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/1-4-768x292.jpg 768w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2504\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/2-3.jpg\" alt=\"\" width=\"797\" height=\"266\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/2-3.jpg 797w, http:\/\/www.fatihacar.com\/blog\/resimler\/2-3-300x100.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/2-3-768x256.jpg 768w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2505\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/3-4.jpg\" alt=\"\" width=\"798\" height=\"288\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/3-4.jpg 798w, http:\/\/www.fatihacar.com\/blog\/resimler\/3-4-300x108.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/3-4-768x277.jpg 768w\" sizes=\"auto, (max-width: 798px) 100vw, 798px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2506\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/4-3.jpg\" alt=\"\" width=\"797\" height=\"330\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/4-3.jpg 797w, http:\/\/www.fatihacar.com\/blog\/resimler\/4-3-300x124.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/4-3-768x318.jpg 768w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2507\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/5-2.jpg\" alt=\"\" width=\"796\" height=\"354\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/5-2.jpg 796w, http:\/\/www.fatihacar.com\/blog\/resimler\/5-2-300x133.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/5-2-768x342.jpg 768w\" sizes=\"auto, (max-width: 796px) 100vw, 796px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2508\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/6-2.jpg\" alt=\"\" width=\"797\" height=\"370\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/6-2.jpg 797w, http:\/\/www.fatihacar.com\/blog\/resimler\/6-2-300x139.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/6-2-768x357.jpg 768w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2509\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/7-2.jpg\" alt=\"\" width=\"793\" height=\"604\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/7-2.jpg 793w, http:\/\/www.fatihacar.com\/blog\/resimler\/7-2-300x228.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/7-2-768x585.jpg 768w\" sizes=\"auto, (max-width: 793px) 100vw, 793px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2510\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/8-2.jpg\" alt=\"\" width=\"798\" height=\"606\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/8-2.jpg 798w, http:\/\/www.fatihacar.com\/blog\/resimler\/8-2-300x228.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/8-2-768x583.jpg 768w\" sizes=\"auto, (max-width: 798px) 100vw, 798px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2511\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/9-2.jpg\" alt=\"\" width=\"794\" height=\"602\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/9-2.jpg 794w, http:\/\/www.fatihacar.com\/blog\/resimler\/9-2-300x227.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/9-2-768x582.jpg 768w\" sizes=\"auto, (max-width: 794px) 100vw, 794px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2512\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/10-2.jpg\" alt=\"\" width=\"797\" height=\"211\" srcset=\"http:\/\/www.fatihacar.com\/blog\/resimler\/10-2.jpg 797w, http:\/\/www.fatihacar.com\/blog\/resimler\/10-2-300x79.jpg 300w, http:\/\/www.fatihacar.com\/blog\/resimler\/10-2-768x203.jpg 768w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/><\/p>\n<h3>Fifth Step : Restore Database And Synchronize<\/h3>\n<p>Now, we have to configure primary and secondary side to data transport for data guard.<\/p>\n<p><strong>1. Listener Configuration<\/strong><\/p>\n<blockquote><p>I use different port to connect of primary side and secondary side.<\/p>\n<p><strong>Primary Side Rac Node 1<\/strong><\/p>\n<p>su &#8211; oracle<\/p>\n<p>cd $ORACLE_HOME\/network\/admin<\/p>\n<p>vi listener.ora<\/p>\n<p>listener_dr_for_arch_test =<\/p>\n<p>(ADDRESS_LIST =<\/p>\n<p>(ADDRESS= (PROTOCOL= TCP)(Host= ractest12c01-vip.sm.gov.tr)(Port= 1545))<\/p>\n<p>)<\/p>\n<p>&nbsp;<\/p>\n<p>SID_LIST_listener_dr_for_arch_test =<\/p>\n<p>(SID_LIST =<\/p>\n<p>(SID_DESC =<\/p>\n<p>(ORACLE_HOME= \/oracle\/db\/12.2.0.1\/db_home)<\/p>\n<p>(SID_NAME = RACTEST1)<\/p>\n<p>)<\/p>\n<p>)<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Start Listener<\/strong><\/p>\n<p>lsnrctl start listener_dr_for_arch_test<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Primary Side Rac Node 2<\/strong><\/p>\n<p>su &#8211; oracle<\/p>\n<p>cd $ORACLE_HOME\/network\/admin<\/p>\n<p>vi listener.ora<\/p>\n<p>listener_dr_for_arch_test =<\/p>\n<p>(ADDRESS_LIST =<\/p>\n<p>(ADDRESS= (PROTOCOL= TCP)(Host= ractest12c02-vip.sm.gov.tr)(Port= 1545))<\/p>\n<p>)<\/p>\n<p>SID_LIST_listener_dr_for_arch_test =<\/p>\n<p>(SID_LIST =<\/p>\n<p>(SID_DESC =<\/p>\n<p>(ORACLE_HOME= \/oracle\/db\/12.2.0.1\/db_home)<\/p>\n<p>(SID_NAME = RACTEST2)<\/p>\n<p>)<\/p>\n<p>)<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Start Listener<\/strong><\/p>\n<p>lsnrctl start listener_dr_for_arch_test<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Secondary Side<\/strong><\/p>\n<p>su &#8211; oracle<\/p>\n<p>cd $ORACLE_HOME\/network\/admin<\/p>\n<p>vi listener.ora<\/p>\n<p>listener_dr_for_arch_test =<\/p>\n<p>(ADDRESS_LIST =<\/p>\n<p>(ADDRESS= (PROTOCOL= TCP)(Host = test12cdg.sm.gov.tr)(Port= 1545))<\/p>\n<p>)<\/p>\n<p>&nbsp;<\/p>\n<p>SID_LIST_listener_dr_for_arch_test =<\/p>\n<p>(SID_LIST =<\/p>\n<p>(SID_DESC =<\/p>\n<p>(ORACLE_HOME= \/oracle\/db\/12.2.0.1\/db_home)<\/p>\n<p>(SID_NAME = TDG)<\/p>\n<p>)<\/p>\n<p>)<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Start Listener<\/strong><\/p>\n<p>lsnrctl start listener_dr_for_arch_test<\/p>\n<p>&nbsp;<\/p><\/blockquote>\n<p><strong>2. Tnsnames Configuration<\/strong><\/p>\n<blockquote><p><strong>Primary Side Rac Node 1<\/strong><\/p>\n<p>su &#8211; oracle<\/p>\n<p>vi tnsnames.ora<\/p>\n<p>RACTEST =<\/p>\n<p>(DESCRIPTION =<\/p>\n<p>(ADDRESS = (PROTOCOL = TCP)(HOST = ractest12c-scan)(PORT = 1521))<\/p>\n<p>(CONNECT_DATA =<\/p>\n<p>(SERVER = DEDICATED)<\/p>\n<p>(SERVICE_NAME = RACTEST)<\/p>\n<p>)<\/p>\n<p>)<\/p>\n<p>&nbsp;<\/p>\n<p>RACTEST1 =<\/p>\n<p>(DESCRIPTION =<\/p>\n<p>(ADDRESS = (PROTOCOL = TCP)(HOST = ractest12c01-vip)(PORT = 1521))<\/p>\n<p>(CONNECT_DATA =<\/p>\n<p>(SERVER = DEDICATED)<\/p>\n<p>(SERVICE_NAME = RACTEST)<\/p>\n<p>)<\/p>\n<p>)<br \/>\nRACTEST2 =<\/p>\n<p>(DESCRIPTION =<\/p>\n<p>(ADDRESS = (PROTOCOL = TCP)(HOST = ractest12c02-vip)(PORT = 1521))<\/p>\n<p>(CONNECT_DATA =<\/p>\n<p>(SERVER = DEDICATED)<\/p>\n<p>(SERVICE_NAME = RACTEST)<\/p>\n<p>)<\/p>\n<p>)<\/p>\n<p>&nbsp;<\/p>\n<p>DG_TEST =<\/p>\n<p>(DESCRIPTION =<\/p>\n<p>(ADDRESS = (PROTOCOL = TCP)(HOST = test12cdg.sm.gov.tr)(PORT = 1545))<\/p>\n<p>(CONNECT_DATA =<\/p>\n<p>(SERVER = DEDICATED)<\/p>\n<p>(SERVICE_NAME = TDG)<\/p>\n<p>)<\/p>\n<p>)<\/p>\n<p>&nbsp;<\/p>\n<p>PRI_TEST =<\/p>\n<p>(DESCRIPTION =<\/p>\n<p>(ADDRESS = (PROTOCOL = TCP)(HOST = ractest12c01-vip.sm.gov.tr)(PORT = 1545))<\/p>\n<p>(CONNECT_DATA =<\/p>\n<p>(SERVER = DEDICATED)<\/p>\n<p>(SERVICE_NAME = RACTEST)<\/p>\n<p>)<\/p>\n<p>)<\/p><\/blockquote>\n<blockquote><p><strong>Primary Side Rac Node 2<\/strong><\/p>\n<p>su &#8211; oracle<\/p>\n<p>vi tnsnames.ora<\/p>\n<p>RACTEST =<\/p>\n<p>(DESCRIPTION =<\/p>\n<p>(ADDRESS = (PROTOCOL = TCP)(HOST = ractest12c-scan)(PORT = 1521))<\/p>\n<p>(CONNECT_DATA =<\/p>\n<p>(SERVER = DEDICATED)<\/p>\n<p>(SERVICE_NAME = RACTEST)<\/p>\n<p>)<\/p>\n<p>)<\/p>\n<p>&nbsp;<\/p>\n<p>RACTEST1 =<\/p>\n<p>(DESCRIPTION =<\/p>\n<p>(ADDRESS = (PROTOCOL = TCP)(HOST = ractest12c01-vip)(PORT = 1521))<\/p>\n<p>(CONNECT_DATA =<\/p>\n<p>(SERVER = DEDICATED)<\/p>\n<p>(SERVICE_NAME = RACTEST)<\/p>\n<p>)<\/p>\n<p>)<\/p>\n<p>RACTEST2 =<\/p>\n<p>(DESCRIPTION =<\/p>\n<p>(ADDRESS = (PROTOCOL = TCP)(HOST = ractest12c02-vip)(PORT = 1521))<\/p>\n<p>(CONNECT_DATA =<\/p>\n<p>(SERVER = DEDICATED)<\/p>\n<p>(SERVICE_NAME = RACTEST)<\/p>\n<p>)<\/p>\n<p>)<\/p>\n<p>DG_TEST =<\/p>\n<p>(DESCRIPTION =<\/p>\n<p>(ADDRESS = (PROTOCOL = TCP)(HOST = test12cdg.sm.gov.tr)(PORT = 1545))<\/p>\n<p>(CONNECT_DATA =<\/p>\n<p>(SERVER = DEDICATED)<\/p>\n<p>(SERVICE_NAME = TDG)<\/p>\n<p>)<\/p>\n<p>)<\/p>\n<p>PRI_TEST =<\/p>\n<p>(DESCRIPTION =<\/p>\n<p>(ADDRESS = (PROTOCOL = TCP)(HOST = ractest12c01-vip.sm.gov.tr)(PORT = 1545))<\/p>\n<p>(CONNECT_DATA =<\/p>\n<p>(SERVER = DEDICATED)<\/p>\n<p>(SERVICE_NAME = RACTEST)<\/p>\n<p>)<\/p>\n<p>)<\/p>\n<p><strong>Secondary Side<\/strong><\/p>\n<p>su &#8211; oracle<\/p>\n<p>cd $ORACLE_HOME\/network\/admin<\/p>\n<p>vi tnsnames.ora<\/p>\n<p>RACTEST =<\/p>\n<p>(DESCRIPTION =<\/p>\n<p>(ADDRESS = (PROTOCOL = TCP)(HOST = ractest12c-scan.sm.gov.tr)(PORT = 1521))<\/p>\n<p>(CONNECT_DATA =<\/p>\n<p>(SERVER = DEDICATED)<\/p>\n<p>(SERVICE_NAME = RACTEST)<\/p>\n<p>)<\/p>\n<p>)<\/p>\n<p>PRI_TEST =<\/p>\n<p>(DESCRIPTION =<\/p>\n<p>(ADDRESS = (PROTOCOL = TCP)(HOST = ractest12c01-vip.sm.gov.tr)(PORT = 1545))<\/p>\n<p>(CONNECT_DATA =<\/p>\n<p>(SERVER = DEDICATED)<\/p>\n<p>(SID=RACTEST1)<\/p>\n<p>)<\/p>\n<p>)<\/p>\n<p>DG_TEST =<\/p>\n<p>(DESCRIPTION =<\/p>\n<p>(ADDRESS = (PROTOCOL = TCP)(HOST = test12cdg.sm.gov.tr)(PORT = 1545))<\/p>\n<p>(CONNECT_DATA =<\/p>\n<p>(SERVER = DEDICATED)<\/p>\n<p>(SERVICE_NAME = TDG)<\/p>\n<p>)<\/p>\n<p>)<\/p><\/blockquote>\n<p><strong>3. Archivelog Mode<\/strong><\/p>\n<blockquote><p>Primary has to be archivelog mode.<\/p>\n<p>You can check current status of archivelog mode with below query.<\/p>\n<p>select log_mode from gv$database;<\/p>\n<p>If write\u00a0NOARCHIVELOG, you have to do below operation to do ARCHIVELOG mode.<\/p>\n<p>srvctl stop database -d RACTEST<\/p>\n<p>sqlplus \/ as sysdba<\/p>\n<p>startup mount;<br \/>\nalter database archivelog;<br \/>\nalter database force logging;<br \/>\nalter database open;<\/p><\/blockquote>\n<p><strong>4. Force Logging<\/strong><\/p>\n<blockquote><p>You have to do force logging to log every thing.<\/p>\n<p>alter database force logging;<\/p><\/blockquote>\n<p><strong>5. Configure Parameters<\/strong><\/p>\n<blockquote><p>You have to configure parameter to data guard.<\/p>\n<p><strong>Primary Side<\/strong><\/p>\n<p>sqlplus \/ as sysdba<\/p>\n<p>alter system set log_archive_format=&#8217;%t_%s_%r.arc&#8217; scope=spfile sid=&#8217;*&#8217;;<br \/>\nalter system set remote_login_passwordfile=EXCLUSIVE scope=spfile sid=&#8217;*&#8217;;<\/p>\n<p>alter system set log_archive_dest_1=&#8217;location=+FRA\/RACTEST\/ARCHIVELOG&#8217; scope=both sid=&#8217;*&#8217;;<\/p>\n<p>DB Name can be max 8 characters<\/p>\n<p>alter system set log_archive_config=&#8217;DG_CONFIG=(RACTEST,TDG)&#8217; scope=both sid=&#8217;*&#8217;;<\/p>\n<p>alter system set log_archive_dest_2=&#8217;SERVICE=DG_TEST LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=TDG&#8217; scope=both sid=&#8217;*&#8217;;<\/p>\n<p>alter system set standby_file_management=AUTO scope=both sid=&#8217;*&#8217;;<\/p>\n<p>alter system set log_archive_dest_state_2=enable scope=both sid=&#8217;*&#8217;;<\/p>\n<p>alter system set fal_client= PRI_TEST scope=both sid=&#8217;*&#8217;;<\/p>\n<p>alter system set fal_server= DG_TEST scope=both sid=&#8217;*&#8217;;<\/p>\n<p>exit;<\/p>\n<p>srvctl stop database -d RACTEST<br \/>\nsrvctl start database -d RACTEST<\/p><\/blockquote>\n<p><strong>5. Take Backup<\/strong><\/p>\n<blockquote><p>Take backup from primary side and move to secondary side. I used \/backup directory to take backup and use secondary side backup directory. Backup dir has to be the same on primary side and secondary side.<\/p>\n<p>rman target \/<\/p>\n<p>delete archivelog all;<\/p>\n<p>run {<br \/>\nALLOCATE CHANNEL d1 TYPE DISK FORMAT &#8216;\/backup\/backup_pri_%d_s%s_p%p_%T&#8217; ;<br \/>\nbackup as compressed backupset database plus archivelog;<br \/>\nbackup current controlfile for standby format &#8216;\/backup\/controlfile_standby.ctl&#8217; ;<br \/>\nrelease channel d1;<br \/>\n}<\/p>\n<p>exit;<\/p>\n<p>sqlplus \/ as sysdba<\/p>\n<p>create pfile=&#8217;\/backup\/pfile.ora&#8217; from spfile;<\/p>\n<p>exit;<\/p>\n<p><strong>Move backup files<\/strong><\/p>\n<p>cd \/backup\/<\/p>\n<p>scp backup* oracle@test12cdg:\/backup\/<\/p>\n<p>scp controlfile_standby.ctl\u00a0oracle@test12cdg:\/backup\/<\/p>\n<p>scp file.ora\u00a0oracle@test12cdg:\/backup\/<\/p><\/blockquote>\n<p><strong>6. Configure Pfile to Data Guard on Secondary Side<\/strong><\/p>\n<blockquote><p>You have to configure pfile.ora file to data guard for secondary side. You can see configured pfile.ora at below.<\/p>\n<p>vi pfile.ora<\/p>\n<p>*.__data_transfer_cache_size=0<br \/>\n*.__db_cache_size=3657433088<br \/>\n*.__inmemory_ext_roarea=0<br \/>\n*.__inmemory_ext_rwarea=0<br \/>\n*.__java_pool_size=16777216<br \/>\n*.__large_pool_size=83886080<br \/>\n*.__oracle_base=&#8217;\/oracle\/db\/12.2.0.1&#8217;#ORACLE_BASE set from environment<br \/>\n*.__pga_aggregate_target=1660944384<br \/>\n*.__sga_target=4982833152<br \/>\n*.__shared_io_pool_size=251658240<br \/>\n*.__shared_pool_size=956301312<br \/>\n*.__streams_pool_size=0<br \/>\n*.audit_file_dest=&#8217;\/oracle\/db\/12.2.0.1\/admin\/TDG\/adump&#8217;<br \/>\n*.audit_trail=&#8217;db&#8217;<br \/>\n*.cluster_database=false<br \/>\n*.compatible=&#8217;12.2.0&#8242;<br \/>\n*.control_files=&#8217;+DATA\/TDG\/CONTROLFILE\/current.262.950370543&#8242;,&#8217;+DATA\/TDG\/CONTROLFILE\/current.261.950370543&#8242;<br \/>\n*.db_block_size=8192<br \/>\n*.db_create_file_dest=&#8217;+DATA&#8217;<br \/>\n*.db_name=&#8217;RACTEST&#8217;<br \/>\n*.db_unique_name=&#8217;TDG&#8217;<br \/>\n*.db_recovery_file_dest=&#8217;+FRA&#8217;<br \/>\n*.db_recovery_file_dest_size=214748364800<br \/>\n*.diagnostic_dest=&#8217;\/oracle\/db\/12.2.0.1&#8242;<br \/>\n*.dispatchers='(PROTOCOL=TCP) (SERVICE=TDGXDB)&#8217;<br \/>\n*.fal_client=&#8217;DG_TEST&#8217;<br \/>\n*.fal_server=&#8217;PRI_TEST&#8217;<br \/>\n*.local_listener=&#8217;-oraagent-dummy-&#8216;<br \/>\n*.log_archive_config=&#8217;DG_CONFIG=(RACTEST,TDG)&#8217;<br \/>\n*.log_archive_dest_1=&#8217;location=+FRA\/TDG\/ARCHIVELOG&#8217;<br \/>\n*.log_archive_dest_2=&#8217;SERVICE=PRI_TEST LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=RACTEST&#8217;<br \/>\n*.log_archive_dest_state_2=&#8217;DEFER&#8217;<br \/>\n*.log_archive_format=&#8217;%t_%s_%r.arc&#8217;<br \/>\n*.db_file_name_convert=&#8217;+DATA\/RACTEST\/DATAFILE&#8217;,&#8217;+DATA\/TDG\/DATAFILE&#8217;,&#8217;+FRA\/RACTEST\/DATAFILE&#8217;,&#8217;+FRA\/TDG\/DATAFILE&#8217;<br \/>\n*.log_file_name_convert=&#8217;+DATA\/RACTEST\/ONLINELOG&#8217;,&#8217;+DATA\/TDG\/ONLINELOG&#8217;,&#8217;+FRA\/RACTEST\/ONLINELOG&#8217;,&#8217;+FRA\/TDG\/ONLINELOG&#8217;<br \/>\n*.nls_language=&#8217;AMERICAN&#8217;<br \/>\n*.nls_territory=&#8217;AMERICA&#8217;<br \/>\n*.open_cursors=300<br \/>\n*.pga_aggregate_target=1579m<br \/>\n*.processes=640<br \/>\n*.remote_login_passwordfile=&#8217;EXCLUSIVE&#8217;<br \/>\n*.sga_target=4737m<br \/>\n*.standby_file_management=&#8217;AUTO&#8217;<br \/>\n*.undo_tablespace=&#8217;UNDOTBS1&#8242;<\/p><\/blockquote>\n<p><strong>7. Create Spfile from Pfile<\/strong><\/p>\n<blockquote><p>You can create spfile from pfile.ora at secondary side.<\/p>\n<p>sqlplus \/ as sysdba<\/p>\n<p>create spfile from pfile=\u2019\/backup\/pfile.ora\u2019;<\/p>\n<p>startup nomount;<\/p><\/blockquote>\n<p><strong>8. Restore Database<\/strong><\/p>\n<blockquote><p><strong>Method 1<\/strong><\/p>\n<p><strong>Secondary side<\/strong><\/p>\n<p>rman target \/<\/p>\n<p>restore standby controlfile from &#8216;\/backup\/controlfile_standby.ctl&#8217;;<\/p>\n<p>alter database mount standby database;<\/p>\n<p>restore database;<\/p>\n<p><strong>Method 2<\/strong><\/p>\n<p><strong>Secondary side<\/strong><\/p>\n<p>rman target sys@PRI_TEST auxiliary sys@DG_TEST<\/p>\n<p>target database Password:<\/p>\n<p>connected to target database: RACTEST (DBID=1915123103)<\/p>\n<p>auxiliary database Password:<\/p>\n<p>connected to auxiliary database: RACTEST (not mounted)<\/p>\n<p>duplicate target database for standby from active database dorecover nofilenamecheck;<\/p><\/blockquote>\n<p><strong>9. Check Error Logs<\/strong><\/p>\n<blockquote><p>After restore operation, if you see error logs like below, you have to do switch operation like below.<\/p>\n<p>tail -100f \/oracle\/db\/12.2.0.1\/diag\/rdbms\/tdg\/TDG\/trace\/alert_TDG.log<\/p>\n<p><strong>Error example:<\/strong><\/p>\n<p>WARNING: The converted filename &#8216;+DATA\/TDG\/datafile\/users.260.950370491&#8217;<br \/>\nis an ASM fully qualified filename.<br \/>\nChanging the filename to &#8216;+DATA\/MUST_RENAME_THIS_DATAFILE_7.4294967295.4294967295&#8217;.<br \/>\nPlease rename it accordingly.<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<p>sqlplus \/ as sysdba<\/p>\n<p>alter system set standby_file_management=MANUAL;<\/p>\n<p>exit;<\/p>\n<p>You have to check datafile number from alert log, and you have to check datafiles.<\/p>\n<p>rman target \/<\/p>\n<p>run{<br \/>\nset newname for datafile 1 to &#8216;+DATA\/TDG\/DATAFILE\/SYSTEM.293.953893449&#8217;;<br \/>\nset newname for datafile 3 to &#8216;+DATA\/TDG\/DATAFILE\/SYSAUX.292.953893449&#8217;;<br \/>\nset newname for datafile 4 to &#8216;+DATA\/TDG\/DATAFILE\/UNDOTBS1.267.953893449&#8217;;<br \/>\nset newname for datafile 5 to &#8216;+DATA\/TDG\/DATAFILE\/UNDOTBS2.291.953893449&#8217;;<br \/>\nset newname for datafile 7 to &#8216;+DATA\/TDG\/DATAFILE\/USERS.294.953893451&#8217;;<br \/>\nswitch datafile all;<br \/>\n}<\/p>\n<p>exit;<\/p>\n<p>sqlplus \/ as sysdba<\/p>\n<p>alter system set standby_file_management=AUTO;<\/p>\n<p>shutdown immediate;<\/p>\n<p>startup mount;<\/p><\/blockquote>\n<p><strong>10. Add Standby Log File<\/strong><\/p>\n<blockquote><p>You have to add standby log file both on primary side and secondary side to real time apply\u00a0synchronization.<\/p>\n<p>You have to add one more number standby log than normal logfile.<\/p>\n<p>You can see log file with below query.<\/p>\n<p><strong>Primary side<\/strong><\/p>\n<p>select * from gv$logfile;<\/p>\n<p>If you see 4 logfile (default number), you can add 5 standby logfile and size has to be the same. You can see size with bwlow query.<\/p>\n<p>select * from gv$log;<\/p>\n<p>Also, you read <a href=\"http:\/\/www.fatihacar.com\/blog\/how-to-add-standby-logfile-in-oracle\/\">this article <\/a>to see how to add and drop standby log files.<\/p>\n<p><strong>Primary side<\/strong><\/p>\n<p>alter database add standby logfile size 200M;<\/p>\n<p>alter database add standby logfile size 200M;<\/p>\n<p>alter database add standby logfile size 200M;<\/p>\n<p>alter database add standby logfile size 200M;<\/p>\n<p>alter database add standby logfile size 200M;<\/p>\n<p><strong>Secondary side<\/strong><\/p>\n<p>alter database add standby logfile size 200M;<\/p>\n<p>alter database add standby logfile size 200M;<\/p>\n<p>alter database add standby logfile size 200M;<\/p>\n<p>alter database add standby logfile size 200M;<\/p>\n<p>alter database add standby logfile size 200M;<\/p><\/blockquote>\n<p><strong>11. Start\u00a0Synchronization<\/strong><\/p>\n<blockquote><p><strong>Secondary side<\/strong><\/p>\n<p>sqlplus \/ as sysdba<\/p>\n<p>alter database open read only;<\/p>\n<p>alter database recover managed standby database using current logfile disconnect from session;<\/p><\/blockquote>\n<p><strong>12. Check Synchronization<\/strong><\/p>\n<blockquote><p><strong>Secondary side<\/strong><\/p>\n<p>Check alert log<\/p>\n<p>tail -100f \/oracle\/db\/12.2.0.1\/diag\/rdbms\/tdg\/TDG\/trace\/alert_TDG.log<\/p>\n<p>Check query<\/p>\n<p>sqlplus \/ as sysdba<\/p>\n<p>select open_mode, database_role, protection_mode from gv$database;<\/p>\n<p>READ ONLY WITH APPLY | PHYSICAL STANDBY | MAXIMUM PERFORMANCE<\/p>\n<p><strong>Primary side<\/strong><\/p>\n<p>select * from v$dataguard_status order by timestamp desc<\/p>\n<p>alter system set log_archive_dest_state_2 = ENABLE<\/p>\n<p>select * from gv$archive_dest_status where dest_id in (1,2)<\/p>\n<p>SELECT a.name,a.resetlogs_id, DECODE (a.thread#, 1, &#8216;RAC NODE1&#8217;, &#8216;RAC NODE2&#8217;) HOST, b.last_seq son_olusan,<br \/>\na.applied_seq son_uygulanan, TO_CHAR (a.uygulanan_son_zaman, &#8216;dd\/mm\/yyyy hh24:mi:ss&#8217;) son_uygulama_zamani<br \/>\nFROM (SELECT name,resetlogs_id, thread#, MAX (sequence#) applied_seq, MAX (next_time) uygulanan_son_zaman<br \/>\nFROM gv$archived_log<br \/>\nWHERE applied = &#8216;YES&#8217; and name in (&#8216;DG_TEST&#8217;) and resetlogs_id=(select max(resetlogs_id) from gv$archived_log)<br \/>\nGROUP BY name,resetlogs_id, thread# ) a,<br \/>\n(SELECT name,resetlogs_id, thread#, MAX (sequence#) last_seq<br \/>\nFROM gv$archived_log where name in (&#8216;DG_TEST&#8217;) and resetlogs_id=(select max(resetlogs_id) from gv$archived_log)<br \/>\nGROUP BY name,resetlogs_id, thread# ) b<br \/>\nWHERE a.thread# = b.thread#<br \/>\nand a.name = b.name;<\/p><\/blockquote>\n<p><strong>13. Post Installation<\/strong><\/p>\n<blockquote><p><strong>Secondary side<\/strong><\/p>\n<p>If you have grid user to manage listener, you have to give permission on $ORACLE_HOME\/bin\/oracle executable file. You have to give chmod 6751 permission. This provides that grid user can execute oracle file like oracle user. Oracle open process on OS when you connect to database. If you connect from remote with using listener, listener owner (grid) will want to open new process on OS but grid user cannot open process with using $ORACLE_HOME\/bin\/oracle file due to do not have permission. So you have to give 6751 permission to use $ORACLE_HOME\/bin\/oracle file.<\/p>\n<p>[root@tdg bin] cd $ORACLE_HOME\/bin\/<\/p>\n<p>[root@tdg bin] chmod 6751 oracle<\/p>\n<p>&nbsp;<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Oracle Data Guard ensures high availability, data protection, and disaster recovery for enterprise data. Oracle Data Guard provides a comprehensive set of services that create, maintain, manage, and monitor one or more standby databases to enable production Oracle databases to survive disasters and data corruptions. Oracle Data Guard maintains these standby databases as copies of&#8230;<\/p>\n","protected":false},"author":37,"featured_media":2464,"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":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9,20],"tags":[107,32,49,36],"class_list":["post-2461","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administration","category-oracle-backup-and-recovery","tag-oracle-12c","tag-oracle-administration","tag-oracle-backup-and-restore","tag-oracle-data-guard"],"jetpack_featured_media_url":"http:\/\/www.fatihacar.com\/blog\/resimler\/oracle12c_data_guard_infrastructure.jpg","jetpack_shortlink":"https:\/\/wp.me\/p39NFI-DH","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/2461","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=2461"}],"version-history":[{"count":13,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/2461\/revisions"}],"predecessor-version":[{"id":2520,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/2461\/revisions\/2520"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/media\/2464"}],"wp:attachment":[{"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/media?parent=2461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/categories?post=2461"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/tags?post=2461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}