Saturday, April 3, 2021

Create Standby Database one command only

Sometimes we just have to create a standby as far as possible, it doesn't means that we can't use the easier way to do that. 

Here is just some examples about that:


# ---------------------------------------------------------------------

# SINGLE Instance on ASM


dbca -silent \
 -createDuplicateDB \
 -gdbName dbprod \ # Source Database
 -primaryDBConnectionString srv01:1521/dbprod \ # Source Database

 -createAsStandby \
 -sid dbstby -\ # Target Database

 -dbUniqueName dbstby \ # Target Database

 -databaseConfigType single \ # Instance Creation Type
 -initParams db_create_file_dest=+DATA,db_recovery_file_dest=+FRA,dg_broker_start=true


# During this process, I found this error, when we create the standby with Grid Infrastructure the new instance is created as NON STANDBY, we need to change it using the following command.


srvctl modify database -db dbstby -role PHYSICAL_STANDBY -startoption MOUNT -stopoption immediate


# Also, pay attention on the status of your new instance, it is OPEN, but you must to shutdown and start it as mount before to start the standby configuration with or without Dataguard Broker.


# ---------------------------------------------------------------------

# SINGLE Instance on File System


dbca -silent \
 -createDuplicateDB \
 -gdbName dbprod \ # Source Database
 -primaryDBConnectionString srv01:1521/dbprod \ # Source Database

 -createAsStandby \
 -sid dbstby \ # Target Database
 -dbUniqueName dbstby \ # Target Database
 -databaseConfigType single \ # Instance Creation Type
 -initParams db_create_file_dest=/u01/oradata/dbprod,db_recovery_file_dest=/u01/oradata/dbprod/arch,dg_broker_start=true


# During this process, I found this error, when we create the standby with Grid Infrastructure the new instance is created as NON STANDBY, we need to change it using the following command


srvctl modify database -db dbstby -role PHYSICAL_STANDBY -startoption MOUNT -stopoption immediate


# Also, pay attention on the status of your new instance, it is OPEN, but you must to shutdown and start it as mount before to start the standby configuration with or without Dataguard Broker.


# ---------------------------------------------------------------------

# RAC Instance


dbca -silent \
 -createDuplicateDB \
 -gdbName dbprod \ # Source Database
 -primaryDBConnectionString srv01:1521/dbprod \ # Source Database

 -adminManaged \
 -createAsStandby \
 -sid dbstby \ # Target Database
 -dbUniqueName dbstby \ # Target Database
 -databaseConfigType rac \ # Instance Creation Type
 -nodelist srv04,srv05,srv06 \
 -initParams db_create_file_dest=+DATA,db_recovery_file_dest=+FRA,dg_broker_start=true


# During this process, I found this error, when we create the standby with Grid Infrastructure the new instance is created as NON STANDBY, we need to change it using the following command


srvctl modify database -db dbstby -role PHYSICAL_STANDBY -startoption MOUNT -stopoption immediate


# Also, pay attention on the status of your new instance, it is OPEN, but you must to shutdown and start it as mount before to start the standby configuration with or without Dataguard Broker.

No comments:

Post a Comment