Professional Documents
Culture Documents
Oracle Reference
Oracle Functions
PSOUG Forum
Oracle Blogs
NAMES.ORA
E_HOME/network/admin
es.ora
e following:
hange repos
down immediate;
r database archivelog;
r database open;
CT dbid, name FROM v$database; e you save the dbid for future reference
CT file_name dba_data_files;
TE TABLESPACE cat_tbs FILE '/app/oracle/product/oradata/REPOS/cat_tbs.dbf' SIZE 50M EXTEND ON KSIZE 8192 E LOGGING ULT NOCOMPRESS NT MANAGEMENT LOCAL UNIFORM SIZE 64K ENT SPACE MANAGEMENT AUTO NE;
TE USER repoomega# TIFIED BY oracle1 ULT TABLESPACE cat_tbs ORARY TABLESPACE temp A UNLIMITED ON cat_tbs;
ister database;
Backup Parameters
w all;
the backup optimization feature introduced in 9i to make sure that RMAN won't archivelog or datafile if there already exists a backup of that file. The FORCE n be used to override optimization on a specific BACKUP command. */ FIGURE BACKUP OPTIMIZATION ON; -- do not back up unchanged data MAXSETSIZE ENCRYPTION ENCRYPTION ARCHIVELOG TO 2 G; FOR DATABASE ON; ALGORITHM 'AES256'; DELETION POLICY TO NONE; ---# make filesize <= 2GB encrypt backups use 256 bit encryption default
ure the number of server processes (channels) that write backups to DISK. */ FIGURE DEVICE TYPE DISK PARALLELISM 2;
e retention policy to a recovery window of 30 days. This ensures that RMAN ll backups needed to recover the database to any point in time in the last 30 can use the DELETE OBSOLETE command to delete backups that are no longer by the retention policy. To exclude a backup from consideration by the policy, se KEEP option with the BACKUP command. */ FIGURE RETENTION POLICY TO RECOVERY WINDOW OF 30 DAYS;
automatic controlfile backup after each database or archivelog backup */ FIGURE CONTROLFILE AUTOBACKUP ON;
w all;
ackup
LLOCATE CHANNEL d1 DEVICE TYPE DISK FORMAT '/home/oracle/backup1/%U'; LLOCATE CHANNEL d2 DEVICE TYPE DISK FORMAT '/home/oracle/backup2/%U'; AS COPY is default when backing up to disk ACKUP DATABASE PLUS ARCHIVELOG;
t backup summary;
ckup
/oracle/product/OracleHomes/oradata/orcl
rol02.ctl
/oracle/product/OracleHomes/admin/orcl/bdump
ert_orcl.log
n you try to start db after copying one logfile to another (a common mistake)
over abase clear unarchived logfile group 1; abase drop logfile group 1;
ecreate the log file abase add logfile group 1 ('/app/oracle/product/oradata/prod/redo01.log') SIZE
ckup across several disk drives. Allocate one DEVICE TYPE DISK channel for each disk drive and specify the format string so that are on different disks
E CHANNEL disk1 DEVICE TYPE DISK FORMAT '/disk1/backups/%U'; E CHANNEL disk2 DEVICE TYPE DISK FORMAT '/disk2/backups/%U'; PY is default when backing up to disk DATABASE PLUS ARCHIVELOG;
multiple copies of a backup, you can specify the SET BACKUP COPIES command. The following example generates a single database to disk, and then creates two identical backups of datafile 1 to two different file systems
E CHANNEL c1 DEVICE TYPE DISK MAXPIECESIZE 5M; PY is the default, so RMAN creates image copies DATABASE PLUS ARCHIVELOG; KUP COPIES = 2; DATAFILE 1 FORMAT '/disk1/backups/%U', '/disk2/backups/%U';
a duplicate database, allocate a channel by using the AUXILIARY option
E AUXILIARY CHANNEL c1 DEVICE E AUXILIARY CHANNEL c2 DEVICE TE TARGET DATABASE TO ndbnewh LE oradata/aux1/redo01.log' SIZE oradata/aux1/redo02.log' SIZE oradata/aux1/redo03.log' SIZE ADONLY
AMECHECK;
RTUP MOUNT
kup Demo
{ ocate channel c1 type disk; kup database format '/nfs/curly/rman/o1/%u'; ease channel c1;
o1
Not Running in Archive Log Mode
TION s parameters that can be used to configure RMAN operations to suit your needs. Some of the things that you can configure are: umber of backups of each datafile f server processes that will do backup/restore operations
assumes that you want: each datafile stored on disk in the /backup directory esses to do backup/restore operations in parallel or tablespace tbl_exclude, because it is easy to recreate
ed that configuration settings are stored persistently, and will be used by RMAN for all subsequent backup, restore, recovery, and maintenance
RMAN to keep at least 5 backups of each datafile. If you have certain backups t be retained longer than this retention policy, you can use the KEEP option with P command when creating those backups.
RMAN to use two disk channels for backup, restore, recovery, and maintenance s.
RMAN to write disk backups to the /backup directory. The format specifier %t is with a 4-byte timestamp, %s with the t number, and %p with the backup piece number.
tbs_exclude from full database backups. NOEXCLUDE can be specified with the mmand to override this configuration.
nt backups to go to tape, refer to the configuration section in case2.rcv on how ure tape backups. However in case of disaster recover if RMAN is not connected to catalog, you will have to manually allocate all channels where backups were
the database id displayed in the RMAN output if you are taking backups in nocatalog mode or database name is ambiguous in ery catalog. The database id is required during disaster ery (See Section 5). You will see the database id in RMAN output nnecting to target database like :
are operating the database in no-archivelog mode, only the following kinds of re allowed: database backups when the database is cleanly closed and the nce is mounted space backups of tablespaces that are offline clean or read only week, full the any
wing scenario assumes that you want to take one full database backup every ncremental database backup every day. The backup cycle starts on Friday. A taken on Friday, and an incremental backup is taken every other day. The policy of REDUNDANCY 5 applies only to full (not incremental) backups, so on of that policy and this backup schedule ensures that you can restore to al backup time for the last 5 weeks.
ipt for backup cycle wing commands are run each Friday to start the backup cycle. The steps are: art the database to perform crash recovery, in case the database is urrently open, and was not shut down consistently. The database is ed in DBA mode so that normal users cannot connect. down with the IMMEDIATE option to close the database consistently. up and mount the database. p database with incremental level 0. database for normal operation.
ove backup fails for any reaon, you can use the NOT BACKED UP SINCE the BACKUP command (9i restartable backup feature) to continue from the point of The small value of FILESPERSET is good for restartable backups. However you te that smaller FILESPERSET produces more backup sets.
r other days of the backup cycle wing commands can be run from Saturday through Thursday to take e incremental backups. They are same as in section 2.1, except L 1 is specified on BACKUP command.
are the same as in section 2.1, except that the options LEVEL 1 CUMULATIVE that only the blocks that have changed since the last level 0 backup will be . If the CUMULATIVE option was not specified, then only the blocks that have ince the last level 1 backup will be backed up. The advantage of a cumulative that only one incremental backup ever needs to be applied during recovery.
CE DBA; MEDIATE; NT; EMENTAL LEVEL 1 CUMULATIVE DATABASE FILESPERSET 4; ASE OPEN;
ckups of readonly tablespaces ase does not have to be closed to back up a readonly tablespace. The following an be used to backup a readonly tablespace.
ESPACE read_only_tablespace_name;
ALIDATION
wing commands can be run any time to check if RMAN is capable of restoring tablespace using existing backups.
ABASE VALIDATE;
f tablespace is restorable
CE COMMANDS
BACKUP OF DATABASE;
ay a list of files that need to be backed up based on the ion policy. For this case study, files that don't have at least ups will be reported.
BACKUP;
-necessary backups. This command deletes backups based on the policy. For this case study, all backups older than the 5 most ckups of each datafile will be deleted.
LETE;
ND RECOVERY
f any user error or media failure you would have to do complete recovery. However using the SET UNTIL command, it is possible to recover to points in time when incrementals were taken. Because redo logs are not archived, and incremental backups are available for restore and recovery.
umed that you have all the configuration files like the server file (spfile - equivalent of init.ora in 9i), tnsnames.ora, and listener.ora in priate places, and that you can startup the Oracle instance in nomount mode and rom RMAN to the target instance.
are: t using a recovery catalog, or if the database name is uous in, the recovery catalog you need to start RMAN without T option and set the dbid before restoring the controlfile from ackup. up database in nomount mode (you should have restored alization files for database, and listener files (only if ting over SQLNET)). re controlfile. re all database files. Use CHECK READONLY, to make sure all only files are correct. If not RMAN will restore them. all incrementals. database with resetlogs mode to re-create online logs.
nt the SET UNTIL command to restore database to the ntal backup taken three days ago. IL TIME 'SYSDATE-3'; OLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ora_cf%F'; ONTROLFILE FROM AUTOBACKUP; ABASE MOUNT; ATABASE CHECK READONLY; ATABASE NOREDO; ABASE OPEN RESETLOGS;
o2
study can be used as basis for developing your own backup, maintenance, restore, ery scripts for a single instance database running in archivelog mode.
les provided in this case study will use a disk area (/backup directory) to hold recent one week of backups, in order to expedite backup/restore operations. The his area may vary depending on database size, redo generated, etc. If you want ps to go to tape, remove DEVICE TYPE DISK option from the BACKUP commands given ase study.
incremental backups are stored on disk for one week. The level 0 backup goes ly to tape. This means that RMAN will always have to read tape for recovery.
d not run all of the commands in this file in a single RMAN Rather, the various sections in this file should be separated into individual pts which can be run to configure, backup, restore, and recover the database.
ion:
study is divided into the following sections: iguring RMAN parameters up script for backup cycle atabase backup and archivelog backups) t for other days of backup cycle tive incremental level 1 backups and archivelog backups) ore validation y that the database/tablespace is restorable tenance commands ore and Recovery ile recovery space recovery olfile recovery recovery ter recovery ase Point-in-time recovery
TION
various parameters that can be used to configure RMAN operations to suit your me of the things that you can configure are: ecovery window, to keep backups so that it is possible to recover atabase to any point in time during last X days. umber of server processes that can do backups/restore operations in lel lt device type for backups irectory where on-disk backups will be stored
study assumes that you 1 tape drive parallelization for disk to two and for tape to one to be able to recover your database to any point in time during the last ys all full database backups to go only to tape to keep incrementals on disk for seven days to leave archivelogs on disk for seven days one copy of each archivelog backup saved on tape to back up archivelogs once per day to exclude tablespace tbl_exclude from database backups and restores se it is easier to re-create it than to restore and recover it.
be noted that configuration setting is done just once, and these settings are MAN to perform all subsequent backup, restore, recovery, and maintenance s. backups to be written to tape, via a 3rd-party media management product.
dia manager requires an RMAN PARMS string, configure it here. The media manager tion will specify whether this configuration is needed.
the number of server processes (channels) that write backups to DISK. You can ese three lines if you want to only back up to tape.
EVICE TYPE DISK PARALLELISM 2; HANNEL DEVICE TYPE DISK FORMAT '/backup/ora_df%t_s%s_s%p'; ONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/backup/%F';
etention policy to a recovery window of 30 days. This ensures that RMAN retains ps needed to recover the database to any point in time in the last 30 days. You he DELETE OBSOLETE command to delete backups that are no longer required by the policy. To exclude a backup from consideration by the policy, you can use KEEP th the BACKUP command.
e backup optimization feature introduced in 9i to make sure that RMAN won't archivelog or datafile if there already exists a backup of that file. The FORCE n be used to override optimization on a specific BACKUP command.
tbs_exclude from full database backups. NOEXCLUDE can be specified ckup command to override this configuration. EXCLUDE FOR TABLESPACE tbl_exclude;
NT: Save the database id displayed in the RMAN output if you are ng RMAN backups in nocatalog mode, since it is required during r recovery. You will see the database id in output from RMAN on ing to target database like:
ed to target database: INVENTORY (DBID=1670954628) SHOW ALL command to see the current configuration settings.
atabase in archivelog mode provides following advantages high availability, i.e., is available during backups. in time recovery within recovery window for database/tablespace.
lso follow the procedure given in case1.rcv for taking consistent backups. Only
age of taking consistent backups is that you have to close database cleanly, and estricted mode. Hence database is not available for general use during consistent
scenario assumes that you want to take one full database once a week, doing incrementals. Backup cycle starts on friday, i.e., every friday full backup, and days incrementals.
2.1 - Start script for backup cycle -----------------------------------lowing commands are run each Friday to start the backup cycle. ps are: an incremental level 0 backup of the database. A level 0 backup is ete backup of the entire file which can be used as the basis ubsequent incremental backup. p all archivelogs that have not already been backed up. e on-disk archivelogs older than seven days.
EMENTAL LEVEL 0 DATABASE FILESPERSET 4; IVELOG ALL; IVELOG UNTIL TIME 'SYSDATE-7';
ove backup fails for any reaon, you can use the NOT BACKED UP SINCE option on the mmand (9i restartable backup feature) to continue from the point of failure. The ue of FILESPERSET is good for restartable backups. However you should note that ILESPERSET produces more backup sets.
EMENTAL LEVEL 0 DATABASE FILESPERSET 4 UP SINCE TIME 'SYSDATE-1'; IVELOG ALL; IVELOG UNTIL TIME 'SYSDATE-7';
2.2 - script for other days of backup cycle ---------------------------------------------lowing commands can be run from Saturday through Thursday to take ive incremental backups. ps are: e incrementals on disk that were taken before 7 days. differential incremental backup of complete database. incrementals to tape. p all archiveogs that are not backed up. es any copies of archivelog on disk older than 7 days.
UP COMPLETED BEFORE 'SYSDATE-7' DEVICE TYPE DISK; EMENTAL LEVEL 1 CUMULATIVE DEVICE TYPE DISK DATABASE FILESPERSET 4; UPSET ALL; # copies backups from disk to tape IVELOG ALL; IVELOG UNTIL TIME 'SYSDATE-7';
OTE ON CUMULATIVE INCREMENTAL BACKUPS: Cumulative incremental level 1 backups up the blocks that changed since the last level 0 backup. Incremental backups
ar in function to archived logs and RMAN uses them in favor of archived logs covery. If the CUMULATIVE option was not specified, then only the blocks that ged since the last level 1 backup will be backed up. The advantage of a e backup is that only one incremental backup ever needs to be applied during
tion 2.1, you can use the NOT BACKED UP SINCE option with the BACKUP command (9i ble backup feature) to continue from the point of failure.
UP COMPLETED BEFORE 'SYSDATE-7' DEVICE TYPE DISK; EMENTAL LEVEL 1 CUMULATIVE DEVICE TYPE DISK DATABASE FILESPERSET 4 UP SINCE TIME 'SYSDATE -1 '; UPSET ALL; # copies backups from disk to tape IVELOG ALL; IVELOG UNTIL TIME 'SYSDATE-7';
ALIDATION wing commands can be run any time to check if RMAN is capable of restoring the tablespace using existing backups.
ABASE VALIDATE;
TROLFILE VALIDATE;
CE COMMANDS wing commands can be run any time for maintenance of backups.
at all backups which RMAN thinks are stored by the third-party media manager st, and generate a report of backups that need to be taken to satisfy the policy.
BACKUP; BACKUP;
ckups that are no longer needed to satisfy the retention policy. Since we have etention policy to a recovery window of 30 days, any datafile backups (generated he KEEP option) not required to recover within 30 days are deleted. After which datafile backups are no longer needed, RMAN can then decide which g backups are no longer needed. Archivelog backups are not needed if they are n ANY existing datafile backup.
LETE;
eport and list commands aren't very user-friendly if you are looking for something specific. For example, if you want a list cent Level 0 backups in a database, you can devise a more specific query if you go into the database and use the tafile view:
STINCT TO_CHAR((b.CHECKPOINT_TIME), 'YYYY-MM-DD HH:MI.SS') t ckup_datafile b, v$tablespace ts, v$datafile f ncremental_level = 0 DED_IN_DATABASE_BACKUP='YES' e#=b.file# =ts.ts# b.checkpoint_time 1;
ND RECOVERY
.1 - Datafile recovery
ion assumes that datafile 5 has been damaged and needs to be and recovered, and that the current controlfile and all other datafiles are he database is open during the restore and recovery.
are: ne the datafile that needs recovery re the datafile from backups incrementals and archivelogs as necessary to recover. online recovered datafile
AFILE 5;
restored to a different location, uncomment the command below to the controlfile to point to the file in the new location. DATAFILE ALL;
.2 - Tablespace recovery ion assumes that tablespace tbs_5, containing datafiles 5, 6, and 7 has been nd needs to be restored and recovered, and that the current controlfile and all afiles are intact. The database is open during the restore and recovery.
are: e the tablespace that needs recovery. e the tablespace from backups. incrementals and archivelogs as necessary to recover. the recovered tablespace.
nt to restore to a different location, uncomment the following commands. NAME FOR DATAFILE 5 TO '/newdirectory/new_filename_for_5.f'; NAME FOR DATAFILE 6 TO '/newdirectory/new_filename_for_6.f'; NAME FOR DATAFILE 7 TO '/newdirectory/new_filename_for_7.f';
ABLESPACE TBS_5;
stored to different locations, uncomment the commands below to switch the le to point to the files in their new locations. DATAFILE ALL;
.3 - Controlfile recovery
rongly recommends that you specify multiple controlfiles, on separate physical controllers, in the CONTROL_FILES initialization parameter. e copy is lost due to media failure, copy one of the others over the controlfile and restart the instance. u lose all copies of the controlfile, you must re-create it using REATE CONTROLFILE sql command.
d use RMAN to recover a backup controlfile only if you have lost all copies of nt controlfile, because after restoring a backup controlfile, you will have to TLOGS and take a new whole database backup.
ion assumes that all copies of the current controlfile have been lost, and that alization parameter files, datafiles and online logs are intact.
N without the TARGET option, and use the following commands to restore and he database:
d to allocate channels if not using recovery catalog. Media parameter string must be same as in Section 1. CHANNEL FOO TYPE SBT PARMS '<media manager parameter string>'; CHANNEL FOO2 TYPE DISK;
t take a new whole database backup after resetlogs (as ion 2.1), since backups of previous incarnation are not easily
5.4 - Block recovery ecovery can be used to recover a corrupted block(s). It is not d to recover complete datafile. , the corruption is reported in alert logs, trace files or of SQL commands
8: 8: 8: 0: 0:
ORACLE data block corrupted (file # 7, block # 233) ORACLE data block corrupted (file # 7, block # 235) ORACLE data block corrupted (file # 4, block # 101) data file 7: '/oracle/dbs/tbs_07.f' data file 4: '/oracle/dbs/tbs_04.f'
following BLOCKRECOVER command to recover the corrupted blocks above: VER DATAFILE 7 BLOCK 233, 235 DATAFILE 4 BLOCK 101;
CKRECOVER command can also be used to repair all corrupted blocks in V$BACKUP_CORRUPTION and V$COPY_CORRUPTION. These views are ed whenever an RMAN process peforms a complete scan of a file for the of backing it up, such as with the BACKUP or COPY command. Use the ng command to repair all blocks listed in the V$xxx_CORRUPTION views: : VER CORRUPTION LIST;
.5 - Disaster recovery ter recovery scenario assumes that you have lost everything. To recovery in this case, you would have to restore initialization ers manually. Then use RMAN to restore and recover the database as ed in this section.
mands below assume that all initialization parameter files are in nd the complete directory structure for datafiles is recreated.
you set your NLS_LANG environment variable. unix (csh): v NLS_LANG american_america.we8dec
MAN without the TARGET option, and use the following commands to and recover the database:
<database_id>; # use database id from RMAN output as ed in Section 2.1, uired if using recovery catalog ARGET <target_connect_string>; OMOUNT;
d to allocate channels if not using recovery catalog. Media parameter string must be same as in Section 1. CHANNEL FOO TYPE SBT PARMS '<media manager parameter string>'; CHANNEL FOO2 TYPE DISK;
lly you can use SET NEWNAME and SWITCH commands as described in 5.2 to restore datafiles to a new location. ONTROLFILE from AUTOBACKUP; ABASE MOUNT; ATABASE; ATABASE; ABASE OPEN RESETLOGS;
t take a new whole database backup after resetlogs (as ion 2.1), since backups of previous incarnation are not easily
.6 - Database Point-in-time recovery enario assumes that all initialization files and the current file are in place and you want to recover to a point in time 4-09:14:30:00'.
v NLS_LANG american_america.we8dec
OUNT FORCE;
t take a new whole database backup after resetlogs (as ion 2.1), since backups of previous incarnation are not easily
o3
ON udy outlines the basic steps to perform tablespace recovery (TSPITR) using Recovery Manager.
s in this case study assume that all backups are stored on er if you have backups on tape and channels are configured as case2.rcv, Section 1, the same procedures will work.
udy assumes that o recover tablespaces TBS1 and TBS2 to the point in time 1:07:05:30'. performed on the same machine as the target database. HOME is /oracle. SID for the target database is PROD. base files and online logs are in $ORACLE_HOME/dbs/. SID for the auxiliary instance is AUX. ry files (except password file) for the auxiliary created in $ORACLE_HOME/auxiliary.
not run all of the commands in this file in a single RMAN her, the various sections in this file should be studied efore performing TSPITR.
MM/DD/YY) 7/01 - re-write case for tablespace point-in-time recovery 7/01 - Creation
udy is organized into the following sections: sage and restrictions referential dependencies for TSPITR - setup auxiliary instance g TSPITR the target database to use recovered files up the auxiliary instance and temporary files
When to do TSPITR e performed: m an erroneous drop or truncate table operation able that has become logically corrupted m a batch job or DML that has affected only a subset of the
Restrictions of TSPITR ted that TSPITR: er a dropped tablespace er a tablespace that was dropped and recreated with same name er optimizer statistics; statistics must be recalculated
er a tablespace containing any of the following object types: ster tables array columns ested tables xternal bfiles s es
you should take a new backup of the recovered tablespace(s), ossible to recover using the pre-TSPITR backups.
RMAN specific restrictions for TSPITR TSPITR restrictions are : er partitioned tables unless all partitions are contained in the recovery set er tablespaces containing rollback segments
olving referential dependencies The main issue to consider when deciding whether or not to proceed with possibility of application-level inconsistencies between tables in recovered and unrecovered tablespaces due to implicit rather than tial dependencies. You should understand these dependencies and have means to resolve any possible inconsistencies before
s the TS_PITR_CHECK view to assert that no referential integrity constraints will be broken after TSPITR. If this view returns rows hen the reason should be investigated and resolved. Only when TS_PITR_VIEW returns no rows TSPITR will be able to proceed w is checked by imp/exp utilities called by RMAN during ctions taken at this stage should be noted in order that these relationship can be rebuilt after TSPITR is complete.
eck view TS_PITR_OBJECTS_TO_BE_DROPPED to see which objects will be lost after TSPITR. If you want certain object listed by TSPITR should not be performed.
ng queries to prepare for performing TSPITR on TBS1 and TBS2 to time '2000-APR-01:07:05:30':
R, NAME, TABLESPACE_NAME _PITR_OBJECTS_TO_BE_DROPPED SPACE_NAME IN ('TBS1', 'TBS2') N_TIME > TO_DATE('2000-APR-01:07:05:30', 'YYYY-MON-DD:HH24:MI:SS') BLESPACE_NAME, CREATION_TIME;
TSPITR
hows how to set up the auxiliary instance which will be used by RMAN to perform TSPITR on the desired tablespaces. RMAN will database using the AUXILIARY connect option.
etting up the auxiliary instance Preparing to connect to the auxiliary instance The following steps should be followed to connect to the auxiliary instance:
word file for the auxiliary instance using the orapwd utility:
reparing the parameter file for the auxiliary instance You can use the production instance parameter file as the basis for the auxiliary instance. parameters like db_block_buffers, shared_pool_size, large_pool_size, enqueue_resources, etc which allocate shared memory can probably be e the auxiliary instance does not have the same memory requirements as the production instance.
arameters must be set for the auxiliary instance: db_name must be the same as in the production instance
ROD
iles=/oracle/auxiliary/ctl.f
_space=_PROD
convert and log_file_name_convert are used only in the parameter file of the auxiliary instance. They establish the rules that are t the datafile and log file names from the production to the auxiliary database.
ng in Oracle9i, more than one pair of substitutions can be specified in both of these parameters, which allows more flexibility in names. Use the RMAN SET NEWNAME command to convert any file names that cannot be converted with the _convert parameters.
ve_dest_1='LOCATION=/oracle/log' ve_format=r_%t_%s.arc
o note that ALL controlfiles, online logs, and datafiles must have different names at the auxiliary instance than they have at the ance, otherwise RMAN may restore files to those locations, and overwrite the production files. Use the control_files, convert, and log_file_name_convert parameters to make sure the auxiliary instance all have different names.
- Starting the auxiliary instance rt the auxiliary instance in nomount mode before performing TSPITR. You can connect using SQLPLUS and start the auxiliary using ommands:
atabase must be in nomount state and the target instance must be mounted or open state to perform TSPITR. The steps in RMAN
uxiliary instance arget database ecovery catalog (optional) espace TBS1 and TBS2
lly, use SET NEWNAME here for file name translation NAME FOR DATAFILE 1 TO '/oracle/auxiliary/file1.f' NAME FOR DATAFILE 2 TO '/oracle/auxiliary/file2.f'
ed tablespaces will be OFFLINE in target database on successful execution of RECOVER command. If the RECOVER command resolving the error you can re-execute the commands.
ue to lack of temporary space, you can create a temporary tablespace. Search for tspitr_7 in /oracle/rdbms/admin/recover.bsq and to create temporary tablespace.
ecause of import tables not existing, you can run CATEXP.SQL on target database to create import schema. target database to use the recovered tablespaces
OVER command in Section 4 runs successfully, you should backup the recovered tablespaces, because after they are brought online, nger be recovered using backups taken prior to the TSPITR.
iary instance
nstance is not usable after successful completion of TSPITR. This instance must be cleaned using following steps: he auxiliary instance as explained in Section 3.1.3 atabase using 'ALTER DATABASE MOUNT CLONE DATABASE' emporary files restored by RMAN when performing TSPITR.
name atafile d, gv$tablespace t s#=t.ts# AND status in ('SYSTEM', 'ONLINE') e not in ('TBS1', 'TBS2');
me FROM gv$controlfile;
e auxiliary instance and delete the above files. All these files in this case should be in the /oracle/auxiliary directory. delete initAUX.ora and orapwAUX
o4
lowing script creates a duplicate database that you can use ting purposes. This scenario assumes: ish to duplicate the target database to a new database ewdb. arget database is mounted or open. uxiliary instance is started in NOMOUNT state. NIT.ORA file of the duplicate database must contain: ME = newdb OL_FILES = ... (see script) NIT.ORA file of the duplicate database can also contain: LE_NAME_CONVERT = ... (see script) ILE_NAME_CONVERT = ... (see script) ther parameters required by the auxiliary database.
lowing script creates a duplicate database using the most recent After the DUPLICATE command has finished succesfully, register the duplicate database (if using a recovery catalog) form backups as with any other database.
re to set your NLS_LANG and NLS_DATE_FORMAT environment variables. set these values to whatever you wish. The UNIX example eeps the date format to the standard date format used overy:
to RMAN and run the script by executing the following at command line le-line command is shown here on multiple lines for the clarity):
_userid</<target_password>@<target_net_service_name>
e information about the commands in this script, see the "Recovery Command Syntax" in the Oracle8i Backup and Recovery Guide. escription of the procedures for creating a duplicate database, chapter "Creating a Duplicate Database."
get database can be mounted with the following command already opened or mounted: MOUNT;
ult the DUPLICATE command will try to create the duplicate database he most recent backup of the target database. If you wish to the duplicate database to a non-current time issue a SET UNTIL to speceify the time.
IL TIME '1998-10-31:14:30:00';
re several ways to convert the filenames for the duplicate e. For a complete account, see the chapter "Creating a te Database" in the Oracle8i Backup and Recovery Guide. Note lowing guidelines:
the duplicate database is in the same host as the target, target datafiles cannot be transformed with _NAME_CONVERT rule from the INIT.ORA file of the te database, then issue a SET NEWNAME command for each e that cannot be converted automatically.
you are connected to a recovery catalog database and have issued NAME commands for some datafiles, the DUPLICATE command e the AUXNAME value. Disable the use of the AUXNAME e command: SET AUXNAME FOR DATAFILE ... TO NULL;
n the duplicate database is in a different host from the database, the same disk structure is present at the new nd you want to keep the same datafile names, then use ILENAMECHECK clause
t allocate at least one auxiliary channel needs before issuing LICATE command. The channel type (DISK or SBT) must match
ia where the backups of the target database are stored. If you e TYPE DISK, then the more channels that are allocated, the the duplicate process will be. For other types the number of s should be limited to the actual number of devices available operation:
AUXILIARY CHANNEL ch1 TYPE DISK; E AUXILIARY CHANNEL ch2 TYPE SBT;
s the name of the auxiliary database as specified in the A parameter DB_NAME: TARGET DATABASE TO newdb;
FILE clause is needed if the online logs cannot be ically generated from the target datafile names after g the LOG_FILE_NAME_CONVERT parameter of the ry database. mple, for two groups each with two members of 512K bytes:
oring to a host with the same structure as the target host, use the AMECHECK clause:
AMECHECK
at read-only datafiles are duplicated by default. If this is not , use the SKIP READONLY clause:
ADONLY
e Failure
k Corruption Demo
2010 psoug.org