Professional Documents
Culture Documents
Faq Rman
Faq Rman
RMAN
In catalog database, if some of the blocks are corrupted due to system crash, How will you recover?
A:using RMAN BLOCK RECOVER command
List some of the RMAN catalog view names which contains the catalog information ?
A:RC_DATABASE_INCARNATION
RC_BACKUP_COPY_DETAILS
RC_BACKUP_CORRUPTION
RC_BACKUP-DATAFILE_SUMMARY
1 ORAFACT
DBA FAQ
What are the various tape backup solutions available in the market?
A:There are various Media Management Layer (MML) solutions available for Oracle.
1) EMC's Legato Networker Module for Oracle
2) Symantec's Netbackup Database Agent for Oracle
3) IBM's Tivoli Storage Management (TSM) Database Agent
4) and others in the market.
What is Channel? How do you enable the parallel backups with RMAN?
A:Channel is a link that RMAN requires to link to target database. This link
is required when backup and recovery operations are performed and recorded.
This channel can be allocated manually or can be preconfigured by using
automatic channel allocation.
The number of allocated channels determines the maximum degree of
parallelism that is used during backup restore or recovery. For example if
you allocate 4 channels for a backup operation 4 background processes for the
operation can run concurrently.
Parallelization of backup sets allocates multiple channels and assigns
files to specific channels. You can configure parallel backups by setting a
PARALLELISM option of the CONFIGURE command to a value greater than 1 or by
manually allocating multiple channels.
RMAN> CONFIGURE DEVICE TYPE PARALLELISM 2 BACKUP TYPE TO COMPRESSED
BACKUPSET;
What is the difference between obsolete RMAN backups and expired RMAN backups?
A:The term obsolete does not mean the same as expired. In short obsolete means "not needed " whereas
expired means "not found."
How do you clone the database using RMAN software? Give brief steps? When do you use crosscheck
command?
A:Check whether backup pieces proxy copies or disk copies still exist.
Two commands available in RMAN to clone database:
1) Duplicate
2) Restore.
Where RMAN keeps information of backups if you are using RMAN without Catalog?
A:RMAN keeps information of backups in the control file.
CATALOG vs NOCATALOG
the difference is only who maintains the backup records like
when is the last successful backup incremental differential etc.
In CATALOG mode another database (TARGET database) stores all the information.
In NOCATALOG mode controlfile of Target database is responsible.
2 ORAFACT
DBA FAQ
Can a schema be restored in oracle 9i RMAN when the schema having numerous table spaces?
A:RMAN gives the command to find all the tablespaces and hence the datafiles belonging to different
schemas as:
REPORT SCHEMA;
This command lists all the schemas tablespace names and the corresponding data files.
After listing we can restore the datafiles or the tablespaces corresponding to a particular schema.
What are the steps required to perform in $ORACLE_HOME for enabling the RMAN backups with
netbackup or TSM tape library software?
A:1.Install TDPO (default path /usr/tivoli/tsm/client/oracle/)
2.Once u installed the TDPO automatically one link is created from TDPO directory to /usr/lib.Now we
need to Create soft link between OS to ORACLE_HOME
ln -s /usr/lib/libiobk64.a $ORACLE_HOME/lib/libobk.a(very imporatant)
3.Uncomment and Modify tdpo.opt file which in /usr/tivoli/tsm/client/oracle/bin/tdpo.opt as follows
DSMI_ORC_CONFIG /usr/tivoli/tsm/client/oracle/bin64/dsm.opt
DSMI_LOG /home/tmp/oracle
TDPO_NODE backup
TDPO_PSWDPATH /usr/tivoli/tsm/client/oracle/bin64
4.create dsm.sys file in same path and add the entries
SErvername <Server name >
TCPPort 1500
passwordacess prompt
nodename backup
enablelanfree yes
TCPSERVERADDRESS <Server Address>
5.Create dsm.opt file add an entry
SErvername <Server name >
5.Then take backup
RMAN>run
3 ORAFACT
DBA FAQ
{
allocate channel t1 type 'sbt_tape' parms
'ENV (TDPO_OPTFILE /usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
backup database include current controlfile;
release channel t1;
}
How do you identify the block corruption in RMAN database? How do you fix it?
A:using v$block_corruption view u can find which blocks corrupted.
How do you verify the integrity of the image copy in RMAN environment?
A:rman> catalog datafilecopy 'f:testsystem.dbf';
rman> backup validate check logical datafile 'f:testsystem.dbf';
SQL> SELECT * FROM v$database_block_corruption;
4 ORAFACT
DBA FAQ
5 ORAFACT
DBA FAQ
How to enable Fast Incremental Backup to backup only those data blocks that have changed?
A:
SQL> ALTER DATABASE enable BLOCK CHANGE TRACKING;
How can you use the CURRENT_SCN column in the V$DATABASE view to obtain the current
SCN?
A:
SQL> SELECT current_scn FROM v$database;
Where RMAN keeps information of backups if you are using RMAN without Catalog?
CATALOG vs NOCATALOGthe difference is only, who maintains the backup records like,when is the
lastsuccessfulbackup, incremental,differential,etc.,In CATALOG mode, another database (TARGET
database) stores all the information.In NOCATALOG
You have taken a manual backup of a datafile using o/s. How RMAN will know about it?
You have to catalog that manual backup in RMAN's repository by commandRMAN> catalog
datafilecopy '/DB01/BACKUP/users01.dbf';restrictions:> Accessible on disk> A complete image copy
of a single file
In catalog database, if some of the blocks are corrupted due to system crash, How will you recover?
using RMAN BLOCK RECOVER command
6 ORAFACT
DBA FAQ
How do you identify the expired, active, obsolete backups? Which RMAN command you use?
Use command:Rman > crosscheck backup; Rman > crosscheck archivelog all; Rman > list
backup;Rman > list archive logall
How do you enable the autobackup for the controlfile using RMAN?
issue command at rman prompt..... RMAN> configure controlfile autobackup on;also we can configure
controlfile backup format......RMAN> configure controlfile autobackup format for device type disk
How do you identify what are the all the target databases that are being backed-up with RMAN
database?
You dont have any view to identifiy whether it is backed up or not . The only option is connect to the
target database and give list backup, this will give you the backup information with date and timining
What is the difference between cumulative incremental and differential incremental backups?
Differencial backup: This is the default type of incremental backup which backs up all blocks changed
after the most recent backup at level n or lower.Cumulative backup: Backup all blocks cahnged after
the most recent backup at level n-1 or lower
7 ORAFACT
DBA FAQ
How do you use the V$RECOVERY_FILE_DEST view to display information regarding the flash
recovery area?
A:
SQL> SELECT name, space_limit, space_used,
space_reclaimable, number_of_files
FROM v$recovery_file_dest;
How to use the best practice to use Oracle Managed File (OMF) to let Oracle database to create and
manage the underlying operating system files of a database?
A:
SQL> ALTER SYSTEM SET
db_create_file_dest = ‘/u03/oradata/school’;
SQL> ALTER SYSTEM SET
db_create_online_dest_1 = ‘/u04/oradata/school’;
How to enable Fast Incremental Backup to backup only those data blocks that have changed?
8 ORAFACT
DBA FAQ
A:
SQL> ALTER DATABASE enable BLOCK CHANGE TRACKING;
How do you use the V$BACKUP_DATAFILE view to display how effective the block change tracking
is in minimizing the incremental backup I/O?
A:
SQL> SELECT file#, AVG(datafile_blocks), AVG(blocks_read),
AVG (blocks_read/datafile_blocks), AVG(blocks)
FROM v$backup_datafile
WHERE used_change_tracking = ‘YES’ AND incremental_level > 0
GROUP BY file#;
If the AVG (blocks_read/datafile_blocks) column is high then you may have to decrease the time
between the incremental backups.
Use a fast recovery without restoring all backups from their backup location to the location specified in
the controlfile.
A:
RMAN> SWITCH DATABASE TO COPY;
RMAN will adjust the control file so that the data files point to the backup file location and then starts
recovery.
9 ORAFACT
DBA FAQ
Global Scripting
A.RMAN> print script full_backup to file 'my_script_file.txt'
Oracle Database 10g provides a new concept of global scripts, which you can execute
against any database registered in the recovery catalog, as long as your RMAN client is
connected to the recovery catalog and a target database simultaneously.
CPISOLUTION.COM
RMAN> create global script global_full_backup
10 ORAFACT
DBA FAQ
11 ORAFACT
DBA FAQ
When you first connect to RMAN, Oracle will start two sessions and two corresponding OS
processes. There will also be a session and process started for each subsequent channel that
is allocated. You can monitor and view these channel processes via the V$SESSION and
V$PROCESS views.
The SID and SERIAL# values are useful when querying from other V$ views where you
want to select and return rows just for your session identifier or serial number (and not hundreds
of unrelated rows). The SPID column in V$PROCESS identifies the OS process ID.
You can also use set command id to label a process. This will help you identify a channel
process if you have many RMAN jobs running at the same time. You must put set command id
after the allocate channel command, or your specified identifier will not be included in the
CLIENT_INFO output. This example sets the command ID to my_session:
RMAN> run{
2> allocate channel d1 type disk;
3> set command id to 'my_session';
4> backup database;
5> }
The output (of the previous SQL statement) now includes the ID of my_session:
SID SERIAL# SPID CLIENT_INFO
---------- ---------- ------------ ------------------------------
146 29 4376 id=my_session,rman channel=d1
12 ORAFACT
DBA FAQ
backup. Seriously, the job showing a duration of 42 minutes is most likely the result of a DBA
doing some experimentation and running several backups interactively, from the command
prompt, during one connected session, whereas the other sessions were small backup jobs
that connected, ran the backup, and then disconnected from RMAN.
How It Works
Measuring the duration of your backups provides a good starting point from which you can
begin tuning your RMAN backups. The V$RMAN_BACKUP_JOB_DETAILS view contains a
plethora of information about backup durations and I/O rates.
13 ORAFACT
DBA FAQ
14 ORAFACT
DBA FAQ
Note: Oracle does not recommend using backup duration ... minimize load when using tape
devices. When using minimize load, RMAN could reduce its I/O to a rate that is too low to keep
the tape device streaming.
What is RMAN ?
Recovery Manager (RMAN) is a utility that can manage your entire Oracle backup and recovery
activities.
Which Files must be backed up?
Database Files (with RMAN)
Control Files (with RMAN)
Offline Redolog Files (with RMAN)
INIT.ORA (manually)
Password Files (manually)
When you take a hot backup putting Tablespace in begin backup mode, Oracle records SCN # from
header of a database file. What happens when you issue hot backup database in RMAN at block level
backup? How does RMAN mark the record that the block has been backed up ? How does RMAN
know what blocks were backed up so that it doesn't have to scan them again?
In 11g, there is Oracle Block Change Tracking feature. Once enabled; this new 10g feature records the
modified since last backup and stores the log of it in a block change tracking file. During backups
RMAN uses the log file to identify the specific blocks that must be backed up. This improves RMAN's
15 ORAFACT
DBA FAQ
performance as it does not have to scan whole datafiles to detect changed blocks.
Logging of changed blocks is performed by the CTRW process which is also responsible for writing
data to the block change tracking file. RMAN uses SCNs on the block level and the archived redo logs
to resolve any inconsistencies in the datafiles from a hot backup. What RMAN does not require is to
put the tablespace in BACKUP mode, thus freezing the SCN in the header. Rather, RMAN keeps this
information in either your control files or in the RMAN repository (i.e., Recovery Catalog).
16 ORAFACT
DBA FAQ
medium, whether to disk or tape. They contain blocks from the target database's datafiles, archived
redo log files, and control files. When RMAN constructs a backup piece from datafiles, there are a
several rules that it follows:
A datafile cannot span backup sets
A datafile can span backup pieces as long as it stays within one backup set
Datafiles and control files can coexist in the same backup sets
Archived redo log files are never in the same backup set as datafiles or control files RMAN is the only
tool that can operate on backup pieces. If you need to restore a file from an RMAN backup, you must
use RMAN to do it. There's no way for you to manually reconstruct database files from the backup
pieces. You must use RMAN to restore files from a backup piece.
17 ORAFACT
DBA FAQ
Can you use Back upsets created by RMAN with any other utility?
No. The backup Sets created by RMAN utility cannot be used in other utility other than RMAN.
Where RMAN keeps information of backups if you are using RMAN without Catalog?
RMAN keeps information of backups in the control file
You have taken a manual backup of a datafile using o/s. How RMAN will know about it?
you should use CATALOG command to make RMAN know about it Catalog datafile'/path' if catalog
is used
18 ORAFACT
DBA FAQ
You have taken a manual backup of a datafile using o/s. How RMAN will know about it?
Answer: You have to catalog those backups with RMAN using catalog.
Can a schema be restored in oracle 9i RMAN when the schema having numerous table spaces?
Answer: RMAN gives the command to find all the tablespaces and hence the datafiles belonging to
different schemas as:
RMAN>REPORT SCHEMA;
This command lists all the schemas tablespace names and the corresponding data files.
After listing we can restore the datafiles or the tablespaces corresponding to a particular schema.
You loss one datafile and DB is running in ARCHIVELOG mode. You have full database backup of 1
week old and partial backup of this datafile which is just 1 day old. From which backup should you
restore this file?
Answer: Partail Backup
Some datafiles were there on a secondary disk and that disk has become damaged and it will take
some days to get a new disk. How will you recover from this situation?
Answer: check whether there is sufficient space available in Primary disk. If it so, Restore the files in it
and recover the datafiles. or you have to mount to another server file system.
Only some blocks are damaged in a datafile. Can you just recover these blocks if you are using
RMAN?
19 ORAFACT
DBA FAQ
Answer: query the SELECT * FROM V$DATABASE_BLOCK_CORRUPTION view and get the
status. From the RMAN prompt execute the Blockrecover command by mention the File#,Block#,
Blocks.
Some user has accidentally dropped one table and you realize this after two days. Can you recover
this table if the DB is running in ARCHIVELOG mode?
Answer: we can use Flashback with time based option.
Can you use Backupsets created by RMAN with any other utility?
Answer: No.
if we loss our catalog in our RMAN setup then what is the procedure to recover the catalog ?
Answer: Even the catalog is lost, target conrol files have the metadata of this catalog. we can restore
this particular catalog from the catalog DB (Tablespace/ Datafile) from the backup and recover it.
Can I perform Block Media Recovery (BMR) if I did not use RMAN for backups?
Answer: If you have image copies or OS backups of the datafiles you can perform BMR. You must first
register the datafile image copies or OS backups to RMAN as well as the current archive log and all
logs since the image backup time. This can be accomplished by using the RMAN CATALOG
command.
15. Answer:Yes. Infact a configuration many customers may choose, is to create the Recovery Catalog
in
the same database that stores the Oracle Enterprise Manager repository.
I have noticed the shadow (or server) processes spawned for "allocate channel" command wouldn't
go away after rman completed and released the channel (at least the message in RMAN showed they
were released), I noticed the shadow stayed for at least 8 minutes. I did wait for too long. As soon as I
20 ORAFACT
DBA FAQ
exit from rman, they disappeared. Were they waiting pmon to clean them up? How long does this
usually take?
Server processes for channels will not disappear until RMAN exists. The idea is that these processes
will be reused for further backup jobs.
Is there any method to encrypt a Recovery Manager(RMAN) backup while the backup is being
written out to tape?
Answer: RMAN does not use an explicit encryption method, although the binary format of backup files
offers some security.
What is the recommended method for backing up the RMAN repository?
Here is how we recommend deploying the Recovery Catalog:
* It should be a separate database, not contained in any of the target databases whose backup data it
contains.
* Create a new schema in the Enterprise Manager Database to house the Recovery Manager catalog
* High availability of the catalog can be achieved by any of the following techniques:
o standy database
o replication
o maintaining two separate Recovery Catalog databases: one is kept in sync as it is used for
everyday production operation, and the other is kept in sync manually, by periodically issuing the
RESYNC CATALOG command.
* Use RMAN to back up the Recovery Catalog database, but for these backups, start RMAN with
the NOCATALOG option, so that the backup repository for the Recovery Catalog is its own control
file. The CONTROL_FILE_RECORD_KEEP_TIME parameter should be set to a value which is high
enough to store an adequate amount of historical backup data for the Recovery Catalog.
* Back up the Recovery Catalog controlfile, so that you can restore it if you ever need to restore the
Recovery Catalog.
21 ORAFACT
DBA FAQ
Can you use Backupsets created by RMAN with any other utility?
NO, Backup sets which are only created and accessed through
RMAN, are the only form in which RMAN can write backups to
media managers such as tape drives and tape libraries.
RMAN-06089: ARCHIVED LOG XYZ NOT FOUND OR OUT OF SYNC WITH CATALOG?
Execute from RMAN: RMAN> change archivelog all validate;
RMAN ADVANTAGES?
* only the used blocks can be backed up.
* detected the corrupted blocks.
* space and time saves.
* full database,tablespace,controlfile can be taken separately
* less redo generated.
• incremental backup.
22 ORAFACT
DBA FAQ
redo.
ii) Parent Incarnation: The database incarnation from which the current incarnation branched
following an OPEN RESETLOGS operation.
LIST SOME OF THE RMAN CATALOG VIEW NAMES WHICH CONTAINS THE
CATALOG INFORMATION ?
RC_DATABASE_INCARNATION
RC_BACKUP_COPY_DETAILS
RC_BACKUP_CORRUPTION
RC_BACKUP_DATAFILE_SUMMARY to name a few
23 ORAFACT
DBA FAQ
files. When RMAN constructs a backup piece from datafiles, there are a several rules that it
follows:
● A datafile cannot span backup sets
● A datafile can span backup pieces as long as it stays within one backup set
● Datafiles and control files can coexist in the same backup sets
● Archived redo log files are never in the same backup set as datafiles or control files
RMAN is the only tool that can operate on backup pieces. If you need to restore a file from
an RMAN backup, you must use RMAN to do it. There's no way for you to manually
reconstruct database files from the backup pieces. You must use RMAN to restore files
from a backup piece.
24 ORAFACT
DBA FAQ
STORED IN CONTROLFILE?
control_file_record_keep_time
When you take a hot backup putting Tablespace in begin backup mode, Oracle records SCN #
from header of a database file. What happens when you issue hot backup database in RMAN at
block level backup? How does RMAN mark the record that the block has been backed up ? How
does RMAN know what blocks were backed up so that it doesn't have to scan them again?
In 11g, there is Oracle Block Change Tracking feature. Once enabled; this new 10g feature
records the modified since last backup and stores the log of it in a block change tracking
file. During backups RMAN uses the log file to identify the specific blocks that must be
backed up. This improves RMAN's performance as it does not have to scan whole
datafiles to detect changed blocks.
Logging of changed blocks is performed by the CTRW process which is also responsible
for writing data to the block change tracking file. RMAN uses SCNs on the block level
and the archived redo logs to resolve any inconsistencies in the datafiles from a hot
backup. What RMAN does not require is to put the tablespace in BACKUP mode, thus
freezing the SCN in the header. Rather, RMAN keeps this information in either your
control files or in the RMAN repository (i.e., Recovery Catalog).
25 ORAFACT
DBA FAQ
how can we remove the invalid backup pieces from the backup sets
crosscheck backup
delete expired backup
26 ORAFACT
DBA FAQ
what view helps to create equal sized backup sets determining the no.of blocks in each datafile
v$backup_datafile
What is Channel? How do you enable the parallel backups with RMAN?
Channel is a link that RMAN requires to link to target database. This link
27 ORAFACT
DBA FAQ
is required when backup and recovery operations are performed and recorded.
This channel can be allocated manually or can be preconfigured by using
automatic channel allocation.
The number of allocated channels determines the maximum degree of
parallelism that is used during backup restore or recovery. For example if
you allocate 4 channels for a backup operation 4 background processes for the
operation can run concurrently.
RMAN> CONFIGURE DEVICE TYPE PARALLELISM 2 BACKUP TYPE TO COMPRESSED
BACKUPSET;
Should you take the backup of Logfiles if the database is running in ARCHIVELOG mode?
Yes,
RMAN>backup archivelog all;
28 ORAFACT
DBA FAQ
RMAN>register database
How do you find out from the RMAN catalog if a particular archive log has been backed-up?
RMAN>list archivelog all;
Can I have my target database on a Sun box and the recovery catalog on a WinNT machine?
A: Yes.
Why do tablespaces not require hot backup mode or extra logging when using RMan for backups?
A: To understand why RMAN does not require extra logging or backup mode, you must first understand why
those features are required for non-RMAN online backups.
A non-RMAN online backup consists of a non-Oracle tool, such as cp or dd, backing up a datafile at the same
time that DBWR is updating the file. We can't prevent the tool from reading a particular block at the exact same
time that DBWR is updating that block. When that happens, the non-Oracle tool might read a block in a
halfupdated
state, so that the block which is copied to the backup media might only have been updated in its first
half, while the second half contains older data. This is called a "fractured block". If this backup needs to be
restored later, and that block needs to be recovered, recovery will fail because that block is not usable.
The 'alter tablespace begin backup' command is our solution for the fractured block problem. When a tablespace
is in backup mode, and a change is made to a data block, instead of logging just the changed bytes to the redo
log, we also log a copy of the entire block image before the change, so that we can reconstruct this block if
media recovery finds that this block was fractured. That block image logging is what causes extra redo to be
generated while files are in backup mode.
The reason that RMAN does not require extra logging is that it guarantees that it will never back up a fractured
block. We can make that guarantee because we know the format of Oracle data blocks, and we verify that each
block that we read is complete before we copy it to the backup. If we read a fractured block, we read the block
again to obtain a complete block before backing it up. non-Oracle tools are not able to do the same thing because
they do not know how to verify the contents of an Oracle data block. Backup mode has another effect, which is
to 'freeze' the checkpoint in the header of the file until the file is removed from backup mode. We do this because
we cannot guarantee that the third-party backup tool will copy the file header prior to copying the data blocks.
RMAN does not need to freeze the file header checkpoint because we know the order in which we will read the
blocks, which enables us to capture a known good checkpoint for the file.
29 ORAFACT
DBA FAQ
A differential backup, which backs up all blocks changed after the most recent incremental backup at
level 1 or. 0
A cumulative backup, which backs up all blocks changed after the most recent incremental backup at
level 0.
Incremental backups are differential by default.
Give me some of the RMAN catalog view names which contains the catalog information ?
Ans:RC_DATABASE_INCARNATION
RC_BACKUP_COPY_DETAILS
RC_BACKUP_CORRUPTION
RC_BACKUP_DATAFILE_SUMMARY to name a few
What is RMAN ?
Recovery Manager (RMAN) is a utility that can manage your entire Oracle backup and recovery
activities.
Diffarance b/t, When you take a hot backup putting Tablespace in begin backup mode and
RMAN backup
Oracle records SCN # from header of a database file. What happens when you issue hot backup
database in RMAN at block level backup? How does RMAN mark the record that the block has
been backed up ? How does RMAN know what blocks were backed up so that it doesn't have to
scan them again?
In 11g, there is Oracle Block Change Tracking feature. Once enabled; this new 10g feature
records the modified since last backup and stores the log of it in a block change tracking file.
During backups RMAN uses the log file to identify the specific blocks that must be backed up.
This improves RMAN's performance as it does not have to scan whole datafiles to detect changed
blocks.
Logging of changed blocks is performed by the CTRW process which is also responsible for writing
data to the block change tracking file. RMAN uses SCNs on the block level and the archived redo
logs to resolve any inconsistencies in the datafiles from a hot backup. What RMAN does not
require is to put the tablespace in BACKUP mode, thus freezing the SCN in the header. Rather,
RMAN keeps this information in either your control files or in the RMAN repository (i.e.,
Recovery Catalog).
30 ORAFACT
DBA FAQ
31 ORAFACT
DBA FAQ
You want to retain only last 3 backups of datafiles. How do you go for it in RMAN?
CONFIGURE RETENTION POLICY TO REDUNDANCY 3
32 ORAFACT
DBA FAQ
33 ORAFACT
DBA FAQ
34 ORAFACT
DBA FAQ
35 ORAFACT
DBA FAQ
36 ORAFACT
DBA FAQ
Netbackup on Solaris:
allocate channel t1 type 'SBT_TAPE'
PARMS='SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so.1';
Netbackup on Windows:
allocate channel t1 type 'SBT_TAPE' send "NB_ORA_CLIENT=client_machine_name";
Omniback/ DataProtector on HPUX:
allocate channel t1 type 'SBT_TAPE' PARMS='SBT_LIBRARY=
/opt/omni/lib/libob2oracle8_64bit.sl';
or:
allocate channel 'dev_1' type 'sbt_tape' parms
'ENV=OB2BARTYPE=Oracle8,OB2APPNAME=orcl,OB2BARLIST=machinename_orcl_a
rchlogs)';
37 ORAFACT
DBA FAQ
38 ORAFACT
DBA FAQ
39 ORAFACT
DBA FAQ
ntrol01.ctl');
dbms_output.put_line('Start restoring '||v_maxPieces||' pieces.');
FOR i IN 1..v_maxPieces LOOP
dbms_output.put_line('Restoring from piece '||v_pieceName(i));
DBMS_BACKUP_RESTORE.restoreBackupPiece(handle=>v_pieceName(i),
done=>v_done, params=>null);
exit when v_done;
END LOOP;
Deallocate
the channel...
DBMS_BACKUP_RESTORE.deviceDeAllocate('d1');
EXCEPTION
WHEN OTHERS THEN
DBMS_BACKUP_RESTORE.deviceDeAllocate;
RAISE;
END;
/
Let's see if the controlfile was restored:
SQL> ! ls l
/oradata/orcl/control01.ctl
rwr1
oracle dba 3096576 Aug 20 16:45 /oradata/orcl/control01.ctl[/code]
We should now be able to MOUNT the database and continue recovery...
SQL> ! cp /oradata/orcl/control01.ctl /oradata/orcl/control02.ctl
SQL> ! cp /oradata/orcl/control01.ctl /oradata/orcl/control03.ctl
SQL> alter database mount
SQL> recover database using backup controlfile;
ORA00279:
change 7917452 generated at 08/20/2004 16:40:59 needed for thread 1
ORA00289:
suggestion :
/flash_recovery_area/ORCL/archivelog/2004_08_20/o1_mf_1_671_%u_.arc
ORA00280:
change 7917452 for thread 1 is in sequence #671
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/oradata/orcl/redo02.log
Log applied.
Media recovery complete.
Database altered.
SQL> alter database open resetlogs;
Database altered.
40 ORAFACT
DBA FAQ
1). copies only the filled blocks i.e. even if 1000 blocks is allocated to datafile but 500 are
filled with data then RMAN will only create a backup for that 500 filled blocks.
2). incremental and accumulative backup.
3). catalog and no catalog option.
4). detection of corrupted blocks during backup;
5). can create and store the backup and recover scripts.
6). increase performance through automatic parallelization( allocating channels), less
redo generation.
41 ORAFACT
DBA FAQ
Change-Aware Incremental Backups - By using a new type of log file to track blocks that have
changed in the database, Recovery Manager (RMAN) can avoid scanning the entire datafile during an
incremental backup. Instead, the amount of data scanned is proportional to the amount of data changed.
Automated Disk-Based Backup and Recovery - This release supports automated disk-based
backup and recovery. The result is a simplified and unified storage location for backups, archivelogs,
and any other files needed for Oracle recovery. It also provides automatic deletion of the files after they
have been successfully backed up by RMAN, and the equivalent of a disk cache for tape, which
reduces the time needed to restore a file from tape. It reduces the risk of an out-of-space condition on
disk by deleting files that are no longer necessary for successful database recovery.
RMAN Database Dropping and Deregistration - The new DROP DATABASE and
UNREGISTER DATABASE RMAN commands remove the database and its entry from the RMAN
recovery catalog.
Automated TSPITR Instantiation - This feature automatically creates the auxiliary instance
needed to perform tablespace point-in-time recovery (TSPITR) and incorporates the RMAN TSPITR
operations.
Simplified Recovery Manager Cataloging of Backup Files - You can now catalog RMAN
proprietary backup metadata into a backup repository. If a backup is overwritten in the control file, or a
backup file is moved to a new location on disk, then you can easily uncatalog the backup metadata
from the repository.
FLASHBACK
How do you set the flash recovery area?
A:
SQL> ALTER SYSTEM SET db_recovery_file_dest_size = 100G;
SQL> ALTER SYSTEM SET db_recovery_file_dest = ‘/u10/oradata/school’;
42 ORAFACT
DBA FAQ
A: The flashback gives users the capability to query past version of schema objects, query historical
data, and perform change analysis.
How it works?
A: Every transaction logically generates a new version of the database. You can navigate through these
versions to find an error and its cause.
43 ORAFACT
DBA FAQ
How do you use the V$FLASHBACK_DATABASE_LOG view to determine how much disk space is
needed to meet the current flashback retention target?
A:
SQL> SELECT estimated_flashback_size, flashback_size
FROM v$flashback_database_log;
How do you use the V$FLASHBACK_DATABASE_STAT view to monitor the overhead of logging
flashback data?
A: You can use this to adjust the retention time or the flash recovery area size.
SQL> SELECT * FROM v$flashback_database_stat;
How can you query the content of the recycle bin by using the DBA_RECYCLEBIN view?
A:
SQL> SELECT * FROM dba_recyclebin WHERE can_undrop = ‘YES’;
SQL> SHOW RECYCLEBIN
44 ORAFACT
DBA FAQ
How can you perform queries on the database as of a certain clock time or SCN?
A:
SQL> SELECT versions_xid, sal, versions_operation
FROM emp
VERSIONS BETWEEN TIMESTAMP sysdate-10/24 AND sysdate
WHERE empno = 100;
How can you use the CURRENT_SCN column in the V$DATABASE view to obtain the current SCN?
A:
SQL> SELECT current_scn FROM v$database;
45 ORAFACT
DBA FAQ
How do I determine how far back in time I can flash back to?
The actual earliest time to which you could rewind your database using flashback technology is
determined by querying the V$FLASHBACK_DATABASE_LOG view. The
V$FLASHBACK_DATABASE_LOG view can also help you decide how much space needed in the
flash recovery area for flashback logs to rewind back a specified number of hours.
46 ORAFACT
DBA FAQ
Does any of our competitors have any similar feature/product like Flashback Query?
Thanks to our superior multiversioning read consistency technology, Oracle is the only database
product with such a capability.
Do you have to enable the Flash Recovery Area to activate Flashback Database?
Yes. Flashback Database utilizes the Flash Recovery Area to organize and manage the flashback logs.
47 ORAFACT