Showing posts with label How to create standby database using OEM. Show all posts
Showing posts with label How to create standby database using OEM. Show all posts

Thursday, April 17, 2025

How to create standby database using OEM

 Thank you very much for your interest about this topic.

1. Are you a lazy DBA?

2. Do you understand architectural concept of physical standby ?

3. Passionate about OEM?

If all the answers are YES then you have landed in right place. I will share my experience and I believe after going through this post you will definitely try this feature in non-prod first.

Pre-requisite:

Create a named credential from OEM console for oracle user .If that is not already present create and validate login like below.

Under setup>security>named credential

Fill up necessary details and save it.


For existing named credential for oracle

Search for Host credential for oracle and validate login for standby host


Create a named credential from OEM console for asmsnmp user if that is not already present and validate login like below. This login will be used to find diskgroup and whether it has enough space to clone.


Similarly, check named credential for sys login in the database as rman clone will happen using that.

Make sure you have password file and your remote sys login as sysdba is working.If you dont have password .

Now you are ready for actual fun.

Standby creation steps:-

From the database home page click on

Availibility>Add Standby Database


  • Select 1st option as shown below Click next button 


  • In this page just select named credential for oracle user and click next button.You can see it will create standby redo log file in your primary database


  • This page is very important.So pay your attention and provide correct hostname and oracle home location in standby database server.Select your named credential for oracle user.Click next button                                                                                                                                                                 

  • In this page select named credential created for ASM in pre-requisite step and click next button


  • I have not changed anything and always select default GI listner.Click Nect button


  • This page is also important as we provide 2 input database unique name and target name.I recommend using same as  instance_name.During clone all datafiles will be copied as +DATA/dbuniquename. I recommend using exiting net service name ,though that is not selected here.Click on next button


  • Finally review page appears and check every detail before you click on finish button




You will see a job has been created like below


Now,next question comes here how will you monitor progress from the server.We dont like this GUI we are black screen guy.
Okay,In primary database server,yes you here this right you do ps -ef | grep rman

you will find similar processes

oracle   45667 45665  0 12:14 ?        00:00:00 /u01/app/odaorahome/oracle/em/agentb/agent_13.4.0.0.0/perl/bin/perl - STANDBY_NO_RECOVERY N

oracle   45694 45667  0 12:14 ?        00:00:00 sh -c /u01/app/odaorahome/oracle/product/19.0.0.0/dbhome_18/bin/rman >/tmp/20eFwqFYQE/3OSural1km


tail output of that file and you can see rman script running to create standby database like below

RMAN> 
 PL/SQL package SYS.DBMS_BACKUP_RESTORE version 19.06.00.00 in TARGET database is not current
 PL/SQL package SYS.DBMS_RCVMAN version 19.06.00.00 in TARGET database is not current
 connected to target database: CISPREP9 (DBID=3279006222)
 
 RMAN> 
 connected to auxiliary database: CISPREP9 (not mounted)
 
 RMAN> 
 echo set on
 
 RMAN> run {
 2>   SQL CLONE "ALTER SYSTEM SET standby_file_management = ''MANUAL''";
 3> allocate channel tgt1 type disk;
 4> allocate channel tgt2 type disk;
 5> allocate channel tgt3 type disk;
 6> allocate channel tgt4 type disk;
 7> allocate channel tgt5 type disk;
 8> allocate channel tgt6 type disk;
 9> allocate channel tgt7 type disk;
 10> allocate channel tgt8 type disk;
 11> allocate auxiliary channel dup1 type disk;
 12>  DUPLICATE TARGET DATABASE FOR STANDBY 
 13>  FROM ACTIVE DATABASE
 14>   ;
 15>   SQL CLONE "ALTER SYSTEM SET standby_file_management = ''AUTO''";
 16> }

AT the end you can see similar job successful from job console also


Feel free to ask questions. I will be happy to answer.

I hope you have learned something new

When SQL plan baseline is not used

 Thank you very much for your interest. Problem Statement: Lets assume you are reported about an application query running slow in one envir...