In a single-host configuration, the dbed_vmclonedb
command creates a clone database on the same host. The command can also be used to shut down the clone database and unmount its file systems. When creating or unmounting the clone database in a single-host configuration, -r relocate_path
is required so that the clone database's file systems use different mount points than those used by the primary database.
When used in a two-host configuration, the dbed_vmclonedb
command imports the snapshot disk group SNAP_dg
, mounts the file systems on the snapshot volumes, and starts a clone database. It can also reverse the process by shutting down the clone database, unmounting the file systems, and deporting the snapshot disk group. When creating the clone off host, -o SFDBvol=vol_name
is required.
Caution When creating a clone database, all Storage Checkpoints in the original database are discarded.
dbed_vmclonedb
command, you must complete the steps in Summary of database snapshot steps, Validating a snapplan (dbed_vmchecksnap), and Creating a snapshot (dbed_vmsnap.
dbed_vmclonedb
command with the -r relocate_path
option (which specifies the initial mount point for the snapshot image), the system administrator must create the mount point and then change the owner to the Oracle database administrator.
SNAPSHOT_MODE
is set to offline
or instant
, a two-host configuration is required and -r
relocate_path
is not allowed.
dbed_vmclonedb
command can be used on the secondary host.
-r
relocate_path
is required. This command is also needed if the name of the clone database is different than the primary database.
SFDBvol=
vol_name
option is required.
init.ora
file that has reduced memory requirements. If the host where dbed_vmclonedb
is run has little available memory, you may not be able to start up the clone database and the cloning operation may fail.
dbed_vmclonedb
(1M) manual page for more information.
To mount a database and recover it manually
$ /opt/VRTS/bin/dbed_vmclonedb -S
ORACLE_SID
-g
snap_dg
\
$ /opt/VRTS/bin/dbed_vmclonedb -o update_status,new_sid=
new_sid
\
In this example, file systems are mounted without bringing up the clone database. The clone database must be manually created and recovered before it can be used. This example is for a clone created on the same host as the primary database.
$ /opt/VRTS/bin/dbed_vmclonedb -S PROD -g SNAP_PRODdg
\
-o mountdb,new_sid=NEWPROD -f snap1 -r /clone
dbed_vmclonedb started at 2004-04-02 15:34:41
Mounting /clone/prod_db on /dev/vx/dsk/SNAP_PRODdg/SNAP_prod_db.
Mounting /clone/prod_ar on /dev/vx/dsk/SNAP_PRODdg/SNAP_prod_ar.
Database NEWPROD (SID=NEWPROD) is in recovery mode.
If the database NEWPROD is recovered manually, you must run
dbed_vmclonedb -o update_status to change the snapshot status.
dbed_vmclonedb ended at 2004-04-02 15:34:59
The database is recovered manually using dbinitdb
.
The database status (database_recovered
) needs to be updated for a clone database on the primary host after manual recovery has been completed.
$ /opt/VRTS/bin/dbed_vmclonedb -o update_status,new_sid=NEWPROD
\
dbed_vmclonedb started at 2004-04-02 15:19:16
The snapshot status has been updated.
dbed_vmclonedb ended at 2004-04-02 15:19:42
In this example, file systems are mounted without recovering the clone database. The clone database must be manually recovered before it can be used. This example is for a clone created on a secondary host.
$ /opt/VRTS/bin/dbed_vmclonedb -S -g SNAP_PRODdg
\
-o mountdb,new_sid=NEWPROD,SFDBvol=SNAP_arch -f snap2
dbed_vmclonedb started at 2004-04-09 23:26:50
Mounting /clone/arch on /dev/vx/dsk/SNAP_PRODdg/SNAP_arch.
Mounting /clone/prod_db on /dev/vx/dsk/SNAP_PRODdg/SNAP_prod_db.
Database NEWPROD (SID=NEWPROD) is in recovery mode.
If the database NEWPROD is recovered manually, you must run
dbed_vmclonedb -o update_status to change the snapshot status.
dbed_vmclonedb ended at 2004-04-09 23:27:17
The database is recovered manually.
The snapshot status (database_recovered
) is updated for a clone database on a secondary host after manual recovery has been completed.
$ /opt/VRTS/bin/dbed_vmclonedb -o update_status,new_sid=NEWPROD
\
dbed_vmclonedb started at 2004-04-09 23:34:01
The snapshot status has been updated.
dbed_vmclonedb ended at 2004-04-09 23:34:35
To clone the database automatically
Use the dbed_vmclonedb
command as follows:
$ /opt/VRTS/bin/dbed_vmclonedb -S
ORACLE_SID
-g
snap_dg
\
-o recoverdb,new_sid=
new_sid
[,SFDBvol=
vol_name
] -f
SNAPPLAN
\
[-H
ORACLE_HOME
] [-r
relocate_path
]
ORACLE_SID
is the name of the Oracle database used to create the snapshot.
snap_dg
is the name of the diskgroup that contains all the snapshot volumes.
new_sid
specifies the ORACLE_SID
for the clone database.
SFDBvol
is the volume that contains the snapplan data. This name is provided after you run dbed_vmsnap -o snapshot
.
SNAPPLAN
is the name of the snapplan file.
ORACLE_HOME
is the ORACLE_HOME
setting for the ORACLE_SID
database.
relocate_path
is the name of the initial mount point for the snapshot image.
Note
When cloning a database on a secondary host, ensure that PRIMARY_HOST
and SECONDARY_HOST
parameters in the snapplan file are different.
When the -o recoverdb
option is used with dbed_vmclonedb
, the clone database is recovered automatically using all available archive logs. If the -o recoverdb
option is not used, you can perform point-in-time recovery manually.
In the following example, a clone of the primary database is automatically created on the same host as the primary database.
$ /opt/VRTS/bin/dbed_vmclonedb -S PROD -g SNAP_PRODdg
\
-o recoverdb,new_sid=NEWPROD -f snap1 -r /clone
dbed_vmclonedb started at 2004-04-02 14:42:10
Mounting /clone/prod_db on /dev/vx/dsk/SNAP_PRODdg/SNAP_prod_db.
Mounting /clone/prod_ar on /dev/vx/dsk/SNAP_PRODdg/SNAP_prod_ar.
Database NEWPROD (SID=NEWPROD) is running.
dbed_vmclonedb ended at 2004-04-02 14:43:05
In the following example, a clone of the primary database is automatically created on a secondary host.
$ /opt/VRTS/bin/dbed_vmclonedb -S PROD -g SNAP_PRODdg
\
-o recoverdb,new_sid=NEWPROD,SFDBvol=SNAP_arch -f snap2
dbed_vmclonedb started at 2004-04-09 23:03:40
Mounting /clone/arch on /dev/vx/dsk/SNAP_PRODdg/SNAP_arch.
Mounting /clone/prod_db on /dev/vx/dsk/SNAP_PRODdg/SNAP_prod_db.
Database NEWPROD (SID=NEWPROD) is running.
dbed_vmclonedb ended at 2004-04-09 23:04:50