Database duplicates/clones
This chapter presents the database creation script dbdupli.ksh.
Prerequisites
In the current release of DMK_DBDUPLICATE the following prerequisites apply:
It is recommended to start dbdupli.ksh on the host where the cloned/duplicated database will run
When the duplicated database shall resize on the same host then the "db_unique_name" parameter must be set in the spfile for the auxiliary instance
On the auxiliary host the following must be present:
Oracle Binaries must be already installed
An Oracle Listener must be up and running with a static entry for the database to be cloned to
The password file for the database to be cloned to must be prepared with same sys password as on the database to clone from
The spfile for the database to be cloned to must be already in place
Take care of the convert parameters
The directory structure for the following must be already there
adump
All the directories for the data files if not on ASM
The directory for the fast recovery area when not on ASM
The ADMIN directory structure
Windows only: The Oracle service must be created (oradim)
⚠️Connections to the databases to be cloned to as sysdba must be working from each host
Command-line parameters
The execution of dbdupli.ksh requires a configuration file, which contains the following parameters.
The script requires command lines argument in addition to the configuration file. Some of the configuration file parameters are also available in command-line.
The parameters given in command line are from higher priority compared to their configuration values.
–f <configuration file>
This parameter is mandatory as it points to the configuration file for the duplicate, e.g.:
An example configuration file can be found in the templates directory of DMK_DBDUPLICATE :
Point-In-Time recovery
–d <The date to clone from >
Optional parameter which specifies the date the clone shall be created from. This option is only available using duplication from backup and can only be executed through command lines.
Format of the date to be used is DDMMYYYY.
–t <The time of the day to clone from>
Optional parameter which specifies the time of the day the clone shall be created from. In case only rdate is specified and rtime is not specified, 00:00:00 will be used as default time. This option is only available using duplication from backup and can only be executed through command lines.
Format of the time to be used is HHMISS.
Example for a Point-In-Time recovery dated from June the 3rd 2020 at 15:38:00 :
⚠️Point-In-Time recovery will be ignored in case a duplication for standby is selected.
–s or –standby
Optional parameter which specifies a standby database duplication. This option is only available through command lines. It can be used either from active or from backup. Parameter must be followed with YES.
Example :
–r <NO_DROP, DROP or SILENT_DROP>
Optional parameter to clean up the TSID Database.
DROP : Interactive deletion, a confirmation will be required
SILENT_DROP : Silent deletion, no confirmation will be required
NO_DROP : No database deletion will happened. Default parameter
Configuration file parameters
SSID
TSID
SSID_CONNECT
TSID_CONNECT
RMAN_CATALOG_CONNECT
CLONE_MODE
BACKUP_LOCATION
BACKUP_TYPE
SBT_TAPE_PARMS
The parameters used when cloning from tape for accessing the media manager integration.
NOFILENAMECHECK
Prevents RMAN from checking whether the data files and online redo logs files of the source database are in use when the source database files share the same names as the duplicate database files. You are responsible for determining that the duplicate operation does not overwrite useful data.
This option is necessary when you are creating a duplicate database in a different host that has the same disk configuration, directory structure, and file names as the host of the source database.
The value of this parameter can be either "YES" or "NO". Everything else is ignored and NOFILENAMECHECK will not be included in the duplicate command.
POSTSCRIPT
A script to be executed one the duplicate finished can be specified here. This is e.g. useful if the cloned database shall be taken out of archive mode once duplication completed.
The script provided does not need to provide connect information as this is done automatically. Connection to the auxiliary database is performed as sysdba.
TSID_DATABASE_CLEANUP
The parameter to use to be able to cleanup the TSID database.
DROP : Interactive deletion, a confirmation will be required
SILENT_DROP : Silent deletion, no confirmation will be required
NO_DROP : No database deletion will happened. Default parameter
RESTORE_POINT
Restore point duplication can only be used from the configuration file. Both upper case or lower case are allowed. Restore point duplication can only be used when clone_backup mode is from backup and using a catalog is mandatory. Finally restore point duplication will be ignored if standby option or Point-In-Time recovery (rdate/rtime) is used.
CHANNEL_NBR
This parameter will be used to create a defined number of channels.
In case of duplication from active knowing a target connection is initialized, both auxiliary and target channels are allocated.
In case of duplication with tape needed auxiliary and target connections are as well allocated.
In case of duplication from backup, as no target connection is made, only auxiliary channels are allocated.
If parameter is kept empty or is less than 1 (so 0 value), as per default, one channel is allocated.
Duplicate a Database with dbdupli.ksh
Now it's time to start the duplicate of a database:
The logfiles will be created at:
Last updated