restore backup
The restore backup command is used to restore a sharded database to a specific global restore point.
Syntax
restore backup [-restorepoint restore_point_name | -scn scn] [-cdb conn_str]
[-catalog_name pdbname] [-catalog_dbid dbid] [-restore_only | -recover_only]
[-catpwd password] [-shard shard_list] [-async]
Options
Table 2-85 GDSCTL restore backup Options
| Option | Description |
|---|---|
-restorepoint restore_point_name |
An sharded database global restore point that the specified list of shards will be restored to. |
-scn |
The SCN associated with a global restore point. This option cannot be used with option "-restorepoint". However, to restore the SDB catalog to a specific restore point, the associated SCN must be used. Command "LIST RESTOREPOINT" can be used to list the available global restore points and their associated SCNs. |
-cdb |
A connect string to the CDB root of the catalog database. The provided user must have SYSDG privilege in the CDB root and SYSBACKUP privilege for all containers. This option should only be used to restore the SDB catalog. |
-catalog_name |
The PDB name of the SDB catalog. This option should only be used to restore the SDB catalog. |
-catalog_dbid |
The DBID of the SDB catalog container database. Both the catalog name and the DBID can be obtained from fixed view v$containers. This option should only be used to restore the SDB catalog. |
-catpwd
password |
Password for user GSMCATUSER. Prompted if not specified. This password only needs to be specified once for this command in an entire GDSCTL session. |
-recover_only |
A flag. If specified, the command only recovers databases. This flag cannot be used with flag "-restore_only". |
-restore_only |
A flag. If specified, the command restores the databases only without doing database recovery. This flag cannot be used with flag "-recover_only". |
-shard shard_list |
shard_list specifies
a comma separated list of shard identifiers. They can be shard
space, shard group or shard names. The default is no
shards.
|
-async |
When specified, all tasks to configure the backup for the shards will run in background. By default, the task will run in foreground. The task for the SDB catalog database will always run in foreground regardless of this flag setting. |
Examples
The following example restores the control files of shard
v1908c_cdb2_pdb1 to restore point
backup_before_db_maintenance. The database must be in
NOMOUNT state. This command alters the database to
MOUNT state after it has restored the control file..
GDSCTL> restore backup -shard v1908c_cdb2_pdb1 -restorepoint BACKUP_BEFORE_DB_MAINTENANCE –controlfile –catpwd gsm
executing command: SET until clause
Starting restore at 14-APR-20
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=441 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=202 device type=DISK
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: reading from backup piece /ade/b/3998875997/oracle/dbs3/V1908C/autobackup/2020_04_14/o1_mf_s_1037736781_h9dndfrd_.bkp
channel ORA_DISK_1: piece handle=/ade/b/3998875997/oracle/dbs3/V1908C/autobackup/2020_04_14/o1_mf_s_1037736781_h9dndfrd_.bkp tag=TAG20200414T201301
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/ade/b/3998875997/oracle/dbs/ct_cf1.f
Finished restore at 14-APR-20
released channel: ORA_DISK_1
released channel: ORA_DISK_2
The next example restores the shard v1908c_cdb2_pdb1 to
a restore point backup_before_db_maintenance.
GDSCTL> restore backup -shard v1908c_cdb2_pdb1 -restorepoint BACKUP_BEFORE_DB_MAINTENANCE -catpwd gsm
executing command: SET until clause
Starting restore at 14-APR-20
starting full resync of recovery catalog
full resync complete
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=460 device type=DISK
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
...
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 14-APR-20
Starting recover at 14-APR-20
current log archived
using channel ORA_DISK_1
Creating automatic instance, with SID='yhox'
...
executing Memory Script
...
Oracle instance shut down
Removing automatic instance
Automatic instance removed
auxiliary instance file /ade/b/3998875997/oracle/dbs/V1908/datafile/o1_mf_sysext_h9dx66s0_.dbf deleted
auxiliary instance file /ade/b/3998875997/oracle/dbs/V1908/datafile/o1_mf_sysaux_h9dx66rp_.dbf deleted
auxiliary instance file /ade/b/3998875997/oracle/dbs/V1908/controlfile/o1_mf_h9dx5klq_.ctl deleted
Finished recover at 14-APR-20