DBA FAQ  

RMAN
How do you enable the encryption for RMAN backups? A:If you wish to modify your existing backup environment so that all RMAN backups are encrypted perform the following steps: Set up the Oracle Encryption Wallet Issue the following RMAN command: RMAN> CONFIGURE ENCRYPTION ALGORITHM 'AES256'; -- use 256 bit encryption RMAN> CONFIGURE ENCRYPTION FOR DATABASE ON; -- encrypt backups 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 How do you install the RMAN recovery catalog? A:1) Create connection string at catalog database. 2) At catalog database, create one new user or use existing user and give that user a recovery_catalog_owner privilege. 3) Login into RMAN with connection string a) export ORACLE_SID= b) rman target catalog@connection string 4)rman> create catalog; 5)register database; How do you setup the RMAN tape backups? A:RMAN Target / run { Allocate channel ch1 device type sbt_tape maxpiecesize 4g Format' D_ U_ T_ t'; sql 'alter system switch logfile'; Backup database; backup archivelog from time 'sysdate-7'; Backup Format ' D_CTLFILE_P_ U_ T_ t' Current controlfile; release channel ch1; } This is backup script for Tivoli Backup Server

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. How RMAN improves backup time? A:RMAN backup time consumption is very less than compared to regular online backup as RMAN 2 ORAFACT

                                                                                                                           DBA FAQ   copies only modified blocks Add channel to improve the performance of rman but it create session on DB and I/O on disk will increase so configure channel at proper number. What is the advantage of RMAN utility? A:Advantage over tradition backup system: 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. 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. Rman>> block recover datafile <fileid> block <blockid>; Using the above statement u recover the corrupted blocks. How do you see information about backups in RMAN? A:Use this SQL to check SQL> SELECT sid,totalwork,sofar FROM v$session_longops WHERE sid=153; Here give SID when back start it will show SID RMAN> List Backup; What is the significance of incarnation and DBID in the RMAN backups? A:DBIDmeans database id. Incunation means: Database incarnation is effectively a new “version” of the database that happens when you reset the online redo logs using “alter database open resetlogs;”. Database incarnation falls into following category Current, Parent, Ancestor and Sibling i) Current Incarnation: The database incarnation in which the database is currently generating redo. ii) Parent Incarnation: The database incarnation from which the current incarnation branched following an OPEN RESETLOGS operation. iii) Ancestor Incarnation: The parent of the parent incarnation is an ancestor incarnation. Any parent of an ancestor incarnation is also an ancestor incarnation. Sibling Incarnation: Two incarnations that share a common ancestor are sibling incarnations if neither one is an ancestor of the other. Outline the steps for changing the DBID in a cloned environment? A:Mount the databse $export ORACLE_SID test $ nid target system/manager It will change and automaticaly generate new id and asign it to the database. 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

Ability to automatically backup CONTROLFILE and SPFILE 4. 6. with the new one's automatically. 5. A data file has been shrunk. Ability to RESTART the failed backup. A tablespace has been dropped. Ability to perform INCREMENTAL backups 2. 8. How do you backup an individual tablespaces? A:RMAN> CONFIGURE DEFAULT DEVICE TYPE TO DISK.Flashback Logs are considered to be transient files and cannot be backed up by RMAN. RMAN> BACKUP CURRENT CONTROLFILE Why do need to use the flashback? A: It eliminates restore process and it is faster than traditional point-in-time recovery. Ability to delete the older ARCHIVE REDOLOG files. Flashback Logs are not backed up. How to list restore points in RMAN? A: You can use either the RC_RESTORE_POINT view in the recovery catalog or the command LIST RESTORE POINT [ALL|restore_point_name] in RMAN. RMAN> BACKUP TABLESPACE system. When are you not able to Flashback Database? ● ● ● The control file has been restored or recreated. They are not needed for media recovery. a. Ability to perform backup and restore with parallelism.k. without starting from beginning. RVWR (Recovery Writer. Ability to report the files needed for the backup.                                                                                                                           DBA FAQ   List atleast 6 advantages of RMAN backups compare to traditional hot backups? A:RMAN has the following advantages over Traditional backups: 1.a Flashback Writer) was introduced in Oracle 10g to write flashback data from the Flashback Buffer in the SGA to the flashback database logs on disk. Can RMAN be used to backup flashback logs? A: No. How do you backup the entire database? A:RMAN> BACKUP DATABASE. Much faster when compared to other TRADITIONAL backup strategies. Is there a separate background process for writing flashback logs? A: Yes. 5 ORAFACT . 7. Ability to Recover one block of datafile 3. How do you backup datafiles and control files? A: RMAN> BACKUP DATAFILE 3.

. but it create session on DB and I/O on disk will increase. How to enable Fast Incremental Backup to backup only those data blocks that have changed? A: SQL> ALTER DATABASE enable BLOCK CHANGE TRACKING. Here give SID when back start it will show SID Where RMAN keeps information of backups if you are using RMAN without Catalog? CATALOG vs NOCATALOGthe difference is only.In CATALOG mode. incremental. How RMAN improves backup time? Add channelto improve the performance of rman. The files on disk that have not previously been backed up will be backed up.etc.sofar FROM v$session_longops WHERE sid=153. control file auto-backups.dbf'. How will you recover? using RMAN BLOCK RECOVER command 6 ORAFACT . so configure channel at proper number How do you see information about backups in RMAN? Use this SQL to checkSQL> SELECT sid. and datafile copies.differential. 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. How RMAN will know about it? You have to catalog that manual backup in RMAN's repository by commandRMAN> catalog datafilecopy '/DB01/BACKUP/users01.In NOCATALOG You have taken a manual backup of a datafile using o/s.                                                                                                                           DBA FAQ   How do you test that your recovery was successful? SQL> SELECT count(*) FROM flashback_table.when is the lastsuccessfulbackup.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. SQL> ALTER SYSTEM SET db_recovery_file_dest = ‘/u10/oradata/school’. How do you set the flash recovery area? A: SQL> ALTER SYSTEM SET db_recovery_file_dest_size = 100G. another database (TARGET database) stores all the information.totalwork. They are full and incremental backup sets. How do you backup the Flash Recovery Area? A: RMAN> BACKUP RECOVERY FILES. archive logs. who maintains the backup records like.

A backup set is a collection of backup pieces. Ability to delete the older ARCHIVE REDOLOG files How do you identify the expired. CONFIGURE BACKUP OPTIMIZATION What is auxiliary channel in RMAN? When do you need this? An auxiliary channel is a link to auxiliary instance. The only option is connect to the target database and give list backup. If you do not have automatic channels configured. 7 ORAFACT . Using target database controlfile instead of recovery catalog RMAN configuration parameters are: CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS... 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.. obsolete backups? Which RMAN command you use? Use command:Rman > crosscheck backup.Cumulative backup: Backup all blocks cahnged after the most recent backup at level n-1 or lower Explain how to setup the physical stand by database with RMAN? $ Export ORACLE_SID=TEST $ rman target / RMAN> show all. manually allocate at least one auxiliary channel within the same RUN command.. The RMAN executable is located in your ORACLE_HOME/bin directory. Ability to perform INCREMENTAL backups2...also we can configure controlfile backup format.. Ability to Recover one block of datafile3.. Rman > list backup. restoring and recovering Oracle Databases. RMAN ships with the database server and doesn't require a separate installation. active. each of which may contain one or more datafile backups What is RMAN and how does one use it? Recovery Manager (or RMAN) is an Oracle provided utility for backing-up. then before issuing the DUPLICATE command..                                                                                                                           DBA FAQ   List advantages of RMAN backups compare to traditional hot backups? RMAN has the following advantages over Traditional backups:1. Ability to automatically backup CONTROLFILE and SPFILE4.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.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 . Rman > crosscheck archivelog all. What is backup set? RMAN can also store its backups in an RMAN-exclusive format which is called backup set.

How can you display warning messages? A: SQL> SELECT object_type. The files on disk that have not previously been backed up will be backed up. space_used. reason. How to enable Fast Incremental Backup to backup only those data blocks that have changed? 8 ORAFACT . space_reclaimable. Flashback Logs. How do you backup the Flash Recovery Area? A: RMAN> BACKUP RECOVERY FILES. number_of_files FROM v$recovery_file_dest. and RMAN files. control file auto-backups. How do you use the V$RECOVERY_FILE_DEST view to display information regarding the flash recovery area? A: SQL> SELECT name. How do you define a Flash Recovery Area? A: To define a Flash Recovery Area set the following Oracle Initialization Parameters. message_type. suggested_action FROM dba_outstanding_alerts. SQL> ALTER SYSTEM SET db_create_online_dest_1 = ‘/u04/oradata/school’.                                                                                                                           DBA FAQ   What kind of backup are supported by RMAN? Backup Sets Datafiles Copies OS Backup What is the Flash Recovery Area? A: It is a unified storage location for all recovery-related files and activities in an Oracle Database. It includes Control File. message_level. They are full and incremental backup sets. and datafile copies. SQL> ALTER SYSTEM SET db_recovery_file_dest = ‘/u10/oradata/school’. Data Files. space_limit. Archived Log Files. SQL> ALTER SYSTEM SET db_recovery_file_dest_size = 100G. 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’. Control File Autobackups. archive logs.

the status of it and the size. A: RMAN> SWITCH DATABASE TO COPY. 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#. RMAN will adjust the control file so that the data files point to the backup file location and then starts recovery. AVG (blocks_read/datafile_blocks). bytes FROM v$block_change_tracking. status. No Extra Costs. It shows where the block change-tracking file is located. How do you monitor block change tracking? A: SQL> SELECT filename. How do you backup datafiles and control files? A: RMAN> BACKUP DATAFILE 3. How do you backup the entire database? A: RMAN> BACKUP DATABASE. AVG(datafile_blocks). RMAN> BACKUP TABLESPACE system. It is available free. Use a fast recovery without restoring all backups from their backup location to the location specified in the controlfile. If the AVG (blocks_read/datafile_blocks) column is high then you may have to decrease the time between the incremental backups..RMAN introduced in Oracle 8 it has become simpler with new version and easier 9 ORAFACT . 1. AVG(blocks) FROM v$backup_datafile WHERE used_change_tracking = ‘YES’ AND incremental_level > 0 GROUP BY file#. 2.                                                                                                                           DBA FAQ   A: SQL> ALTER DATABASE enable BLOCK CHANGE TRACKING. AVG(blocks_read). How do you backup an individual tablespaces? A: RMAN> CONFIGURE DEFAULT DEVICE TYPE TO DISK. Why use Rman ? A. RMAN> BACKUP CURRENT CONTROLFILE.

compared to online backup 12.Duration Clause 8.Incrementally Updated Backups 3.Compress Backup Sets 12.Parrallel operation are supported 10.Know what backups are redundant 20.Oracle 10g has got further optimized incremental backups with has resulted in improvement of performance during backup 8.Global Scripting 7.Better Querying facility for knowing different details of backup.Recovery Through Reset Logs 13.Binary Compression 6. as long as your RMAN client is connected to the recovery catalog and a target database simultaneously.                                                                                                                           DBA FAQ   that user managed backups.Flash Recovery Area 2.No Extra redo generated when backup is taken.Knows what needs backup set locations 17.Remembers backup locations 16.SWITCH DATABASE COMMAND.Without rman.Facility of Testing validity of backups also command like cross check to check the status of backup.Faster Incremental Backups 4. 5.Maintains repository of backup metadata.COM RMAN> create global script global_full_backup 10 ORAFACT . CPISOLUTION.Automatic Channel Failover 11.Cross Backup Sets Global Scripting A.RMAN> print script full_backup to file 'my_script_file.Configure This 9.txt' Oracle Database 10g provides a new concept of global scripts.Knows what is required for recovery 19. 7. 13.Oracle Enhancement for Rman in 10g 10. 5. 15. 11. 3.RMAN is an intelligent tool 14. which you can execute against any database registered in the recovery catalog.Proper Security 4.which results in saving of space in hard disk.It handles database corruptions Oracle Enhancement for Rman in 10g A. 1.Knows what needs to be backed up 18.You are 100% sure your database has been backed up .It contains details of backup taken in the central repository 6.and recovery time 9.

delete obsolete. delete global script ‘full_backup’.} Global RMAN Scripts Auto Backp of Control file A.                                                                                                                           DBA FAQ   { backup database plus archivelog.Scripting 5.Extensive Reporting Available 4.client_info 2 FROM v$process a. use the V$SESSION and V$PROCESS views to identify which database server sessions correspond to RMAN channels: SQL> SELECT b. b. List Script Names.addr = b. Solution Inspect RMAN’s output messages to your terminal to identify your session identifier (SID).Backup of Server Parameter File 2.The maximum speed at which a backup can run will be dictated by: Max Mb/Sec = min(disk read Mb/s. period.Corrupt Block Detection 7. In this example.Backup archive Logs Speed Of Backup Devices A.------------------------146 29 4376 rman channel=ORA_DISK_1 How It Works 11 ORAFACT . b. When you start an RMAN job.sid.Parrallel Operation Supported 3.spid.Aditonally It Supports 1. Identifying RMAN Processes Problem An RMAN backup job is running too long.Duplex Backup sets 6.serial#. then look for the session ID in that file. the SID is 146: allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=146 devtype=DISK Next.paddr 4 AND b.-----------. v$session b 3 WHERE a. a.client_info LIKE '%rman%'.---------. This output shows that there is currently one RMAN channel allocated: SID SERIAL# SPID CLIENT_INFO ---------. If you’re sending output to a log file. you should see output similar to this on your screen.Whenever there is a structure change . Run { Execute Global Script global_backup_db. tape write Mb/s) It is not possible to make a backup to go faster than this. You would like to identify and monitor the RMAN processes associated with the backup job.

71M 00:14:52 23-DEC-06 1116 10.58M 00:14:31 24-DEC-06 This output indicates that there might have been some sort of a snafu on December 21. or your specified identifier will not be included in the CLIENT_INFO output.88M 1.73M 9.56M 00:14:56 22-DEC-06 1114 9.--------1096 8.-----------------------------146 29 4376 id=my_session.-------------------. You can monitor and view these channel processes via the V$SESSION and V$PROCESS views. 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 should see output similar to the following: SESSION_RECID INPUT_BYTES_PER OUTPUT_BYTES_PE TIME_TAKEN_DISPLAY END_TIME ------------.59M 8.60M 7. This will help you identify a channel process if you have many RMAN jobs running at the same time.78M 00:42:03 21-DEC-06 1110 9. You can also use set command id to label a process. 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). possibly related to the sun being directly over the tropic of Capricorn at the time of the 12 ORAFACT . You must put set command id after the allocate channel command. 3 time_taken_display. 3> set command id to 'my_session'. input_bytes_per_sec_display. 4> backup database. 2 output_bytes_per_sec_display. Solution Use information in V$RMAN_BACKUP_JOB_DETAILS for statistics on backups. The following query displays the time taken for recent backup jobs: SQL> SELECT session_recid. This example sets the command ID to my_session: RMAN> run{ 2> allocate channel d1 type disk.69M 00:14:25 20-DEC-06 1101 1.--------------.-----------.75M 8. end_time 4 FROM v$rman_backup_job_details 5 ORDER BY end_time.                                                                                                                           DBA FAQ   When you first connect to RMAN.--------------.rman channel=d1 Measuring Backup Performance Problem You want to determine whether backups are taking longer and longer. 5> } The output (of the previous SQL statement) now includes the ID of my_session: SID SERIAL# SPID CLIENT_INFO ---------. The SPID column in V$PROCESS identifies the OS process ID.

However. then by default cpu_count will be set to 2 when you create your database. the job showing a duration of 42 minutes is most likely the result of a DBA doing some experimentation and running several backups interactively. ran the backup. This parameter is set by default to the number of CPUs on your database server. Note :The initialization parameter recovery_parallelism has no effect on media recovery. then specify the noparallel clause as shown here: RMAN> recover database noparallel.                                                                                                                           DBA FAQ   backup. How It Works Measuring the duration of your backups provides a good starting point from which you can begin tuning your RMAN backups. The recovery_parallelism parameter affects only crash recovery. You should test whether adjusting the degree of parallelism improves performance before you attempt this in a production environment. if you want to override this default behavior. How It Works Ordinarily you don’t need to adjust the degree of parallelism for media recovery. Slowing RMAN Down Problem You’ve noticed that your application performance degrades when the RMAN backups are running. Solution Starting with Oracle Database 10g. For example. Oracle’s documentation states that systems with efficient asynchronous I/O see little benefit from parallel media recovery. This is because Oracle automatically parallelizes media recovery for you. Oracle will spawn two processes to apply redo anytime you issue a recover command (from either RMAN or SQL*Plus). You want to reduce RMAN’s I/O rate so that it spreads out its impact on the system over a period of time. you can use the recover parallel or recover noparallel command. when you issue an RMAN recover command from either within RMAN or within SQL*Plus. If you don’t want Oracle to recover in parallel. Oracle’s default behavior is to automatically perform media recovery operations in parallel. whereas the other sessions were small backup jobs that connected. Solution Use one of the following to control RMAN’s I/O rate: 13 ORAFACT . from the command prompt. Tuning Media Recovery Problem You want to manually adjust the degree of parallelism that Oracle uses for media recovery to match the number of CPUs on your database server. Seriously. The V$RMAN_BACKUP_JOB_DETAILS view contains a plethora of information about backup durations and I/O rates. and then disconnected from RMAN. This next line of code instructs Oracle to spawn four parallel processes to apply redo: RMAN> recover database parallel 4. if your server has two CPUS. For this server. during one connected session. Oracle determines the number of parallel processes to spawn for media recovery from the initialization parameter cpu_count.

the partial clause instructs RMAN to execute all subsequent commands in the run{} block even if the first command doesn’t finish within the specified time: RMAN { 2> backup duration 1:00 partial minimize load database. In this example. 3> backup current controlfile. RMAN will still consider any backup sets that were created successfully (before the time limit was exceeded) to be usable for restore operations. kilobytes. Any backup sets that complete before the duration time is exceeded will be marked as successful.. When you set the filesperset parameter to 1. The rate can be set using M. K. 3> backup archivelog all. If you are running backup commands from within a run{} block. 4> } Whether you use the partial clause or not.. How It Works The duration clause specifies the amount of time you want an RMAN backup to take. If a backup does not complete within the specified duration period. this instructs RMAN to spread out the I/O load over the duration of the specified time. and gigabytes). then you can use the filesperset parameter as shown here: RMAN> backup duration 01:00 minimize load database filesperset 1.. it forces RMAN to create each backup set with only one datafile within it. RMAN will report the time taken for the backup operation in the output... then RMAN will abort the backup. or G (for megabytes. You must specify the hour and colon components of the time even if the hour component is zero. then RMAN will not execute subsequent commands. You can use the partial clause to instruct RMAN to continue running subsequent commands within a run{} block (even if the backup doesn’t finish in the specified time). RMAN will monitor and adjust the I/O rate so that the resources are consumed evenly across the duration of the backup. This example configures channel 1 to have a maximum read rate of 5MB per second: RMAN> configure channel 1 device type disk rate=5M. as shown in this snippet: channel ORA_DISK_1: throttle time: 0:44:43 Finished backup at 10-MAR-07 Using rate You can also use the rate clause of the allocate channel command or the configure channel command to control RMAN’s I/O rate. minimize load command • The rate clause of the allocate channel or configure channel command Using backup duration . If you want to force RMAN to include only one datafile per backup set. This example shows how to spread the I/O of an RMAN backup over a 45-minute period: RMAN> backup duration 00:45 minimize load database. When minimizing the load. minimize load Use the backup duration . The format for the time value of the duration clause is HH:MM (HH is hours and MM is minutes).                                                                                                                           DBA FAQ   • The backup duration . When you use the minimize load clause. 14 ORAFACT . minimize load command to evenly distribute RMAN I/O over a period of time..

the CONFIGURE RETENTION POLICY TO REDUNDANCY 3.Allows specified blocks to be recovered without affecting the entire datafile. When using minimize load. there is Oracle Block Change Tracking feature. Once enabled. Dbverify utility. The recovery window always keeps in pace with the current time.All backups older than the most recent backup that satisfied the above conditions are obsolete. RMAN could reduce its I/O to a rate that is too low to keep the tape device streaming. Configure Retention policy to redundancy 3.. This improves RMAN's 15 ORAFACT . Specifying redundancy by using the CONFIGURE RETENTION POLICY TO REDUNDANCY command: The REDUNDANCY parameter specifies that any number of backups or copies beyond a specified number does not need to be retained. Oracle records SCN # from header of a database file. BLOCKRECOVER DATAFILE 3 BLOCK 121.Analyze Table Command. this new 10g feature records the modified since last backup and stores the log of it in a block change tracking file. Example of Using Block Recovery in RMAN. minimize load when using tape devices. command specifies that a maximum of three backups or copies of a data file or control file can be retained. A. During backups RMAN uses the log file to identify the specific blocks that must be backed up. 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.V$Backup_Corruption & V$Copy_Corruption command. Block Media Recovery A. For example. Which Files must be backed up? Database Files (with RMAN) Control Files (with RMAN) Offline Redolog Files (with RMAN) INIT. Redundancy is the default type of retention policy. It is only intended for use where a known and limited number of block is affected.. What is RMAN ? Recovery Manager (RMAN) is a utility that can manage your entire Oracle backup and recovery activities.                                                                                                                           DBA FAQ   Note: Oracle does not recommend using backup duration ..ORA (manually) Password Files (manually) When you take a hot backup putting Tablespace in begin backup mode. This results in a reduced mean time to recover (MTTR) and higher availability as only the affected blocks are offline during operation The information regarding which block has to be recovered in found in The alert log file. Trace File.

A backup set is composed of one or more backup pieces. A backup consists of one or more backup sets. It is through the allocation of channels that you govern I/O characteristics such as: Type of I/O device being read or written to.the backup pieces -. Logging of changed blocks is performed by the CTRW process which is also responsible for writing data to the block change tracking file.Media management layer (optional) 7. What RMAN does not require is to put the tablespace in BACKUP mode. it requires a place to store necessary information about the database. The recovery catalog schema must be stored in a database other than the target database. Rather. RMAN always stores this information in the target database control file. A channel is what reads and writes RMAN backup files. You can also store RMAN metadata in a recovery catalog schema contained in a separate database. What are the Architectural components of RMAN? 1. and backup pieces What are Channels? A channel is an RMAN server process started when there is a need to communicate with an I/O device. A backup set is RMAN's name for a collection of files associated with a backup. RMAN uses SCNs on the block level and the archived redo logs to resolve any inconsistencies in the datafiles from a hot backup.Target database 5. Recovery Catalog).RMAN executable 2..e. thus freezing the SCN in the header. What is a Backup set? A logical grouping of backup files -. This results from issuing an RMAN backup command.                                                                                                                           DBA FAQ   performance as it does not have to scan whole datafiles to detect changed blocks. backup sets. such as a disk or a tape. either a disk or an sbt_tape Number of processes simultaneously accessing an I/O device Maximum size of files created on I/O devices Maximum rate at which database files are read Maximum number of files open at a time Why is the catalog optional? Because RMAN manages backup and recovery operations. What is a Backup piece? A physical binary file created by RMAN during a backup. RMAN keeps this information in either your control files or in the RMAN repository (i.Server processes 3.that are created when you issue an RMAN backup command.Recovery catalog database (optional) 6. What does complete RMAN backup consist of ? A backup of all or part of your database. Backup pieces are written to your backup 16 ORAFACT .Channels 4.Backups.

4). archived redo log files. 2. Once the backup is complete we will restart the database again. 6). We will perform the backup.e. can create and store the backup and recover scripts. to perform our backup we will shutdown the database from RMAN and then mount the database. RMAN>sql ’alter database open’. detection of corrupted blocks during backup. 17 ORAFACT . catalog and no catalog option. Detection of corrupt blocks during backups. Hence. thus there is noextra redo log generation during online backups. What 1 is the advantage of RMAN utility? 1). incremental and accumulative backup. Automatic logging of all backup and recovery operations. How RMAN improves backup time? RMAN backup time consumption is very less than compared to regular online backup as RMAN copies only modified blocks Can you take Offline backups using RMAN? RMAN Offline Backup is possiable Recall that an offline backup is a backup of the database while it is not running. you must use RMAN to do it. whether to disk or tape. Tablespaces are not put in backup mode. You must use RMAN to restore files from a backup piece. Here is an example of this process: RMAN>shutdown immediate RMAN>startup mount RMAN>backup database. If you need to restore a file from an RMAN backup. There's no way for you to manually reconstruct database files from the backup pieces. Built-in reporting and listing commands. Parallelization of I/O operations. They contain blocks from the target database's datafiles. 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. and control files. 4. 3). 6. 3. copies only the filled blocks i. 5. 2). 5). 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. What are the benefits of using RMAN? 1.Incremental backups that only copy data blocks that have changed since the last backup. increase performance through automatic parallelization( allocating channels) less redo generation.                                                                                                                           DBA FAQ   medium.

RMAN uses this metadata to conduct its backup. and data file copies) about a target database (database that RMAN backups or restores). recovery. How RMAN will know about it? you should use CATALOG command to make RMAN know about it Catalog datafile'/path' if catalog is used Can you start and shutdown DB using RMAN? When an RMAN procedure requires that your database be started. and maintenance operations. The following example uses the RMAN SHUTDOWN and STARTUP commands to shut the target database down cleanly. Should you place Recovery C 1 atalog in the Same DB? No . you can use the RMAN client to start up and shut down the target database. What is a Recovery Catalog? A recovery catalog is a set of tables and views that Recovery Manager (RMAN) uses to store metadata (information about a database structure. Can you use Back upsets created by RMAN with any other utility? No.Recovery catalog should be place in separated database for security reason as recommended by oracle. Recovery catalog is optional.by using Target Database control file. The backup Sets created by RMAN utility cannot be used in other utility other than RMAN.. Can you use RMAN without Recovery catalog? Yes we can use rman without recovery catalog as the metadata information is stored in controlfile Can you take Image Backups using RMAN? yes we can take image backup using rman by issuing the following command RMAN> backup as copy database. Although RMAN can conduct all major backup and recovery operations by using the control file. if a recovery catalog is not created.e. RMAN uses the target database’s control file to store the metadata about the target database. and then mount it in preparation for a backup: % rman TARGET / RMAN> SHUTDOWN IMMEDIATE # closes database consistently RMAN> STARTUP MOUNT 18 ORAFACT .                                                                                                                           DBA FAQ   How do you see information about backups in RMAN? List Backup. some RMAN commands work only if a recovery catalog exists. 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. backup sets. we can use RMAN without RC. archived redo logs. shut down or brought to MOUNT or NOMOUNT state. i.

Only some blocks are damaged in a datafile. 3. You have taken a manual backup of a datafile using o/s. You loss one datafile and DB is running in ARCHIVELOG mode. 6.                                                                                                                           DBA FAQ   Is it possible to take backup of catalog database using RMAN? If Yes. After listing we can restore the datafiles or the tablespaces corresponding to a particular schema. ii) Parent Incarnation: The database incarnation from which the current incarnation branched following an OPEN RESETLOGS operation. Incunation means: Database incarnation is effectively a new “version” of the database that happens when you reset the online redo logs using “alter database open resetlogs. You can use BACKUP COPIES 2. Restore the files in it and recover the datafiles. 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. 5. Run the recovery catalog database in ARCHIVELOG mode. Any parent of an ancestor incarnation is also an ancestor incarnation. configure the controlfile autoback feature to ON.”. What is the significance of incarnation and DBID in the RMAN backups? DBID means database id. Backup the database onto two separate media(disk and tape). iii) Ancestor Incarnation: The parent of the parent incarnation is an ancestor incarnation. How RMAN will know about it? Answer: You have to catalog those backups with RMAN using catalog. How? Answer: Yes. Can you just recover these blocks if you are using RMAN? 19 ORAFACT . Don't use another recovery catalog as the repository for these backups. How will you recover from this situation? Answer: check whether there is sufficient space available in Primary disk. If it so. you can perform backup of catalog database using RMAN with below steps: 1. You have full database backup of 1 week old and partial backup of this datafile which is just 1 day old. set the retention policy to a REDUNDANCY value greater than 1. Start the RMAN with NOCATALOG option. This command lists all the schemas tablespace names and the corresponding data files. 2. Database incarnation falls into following category Current Parent Ancestor and Sibling i) Current Incarnation: The database incarnation in which the database is currently generating redo. or you have to mount to another server file system. 4. iv) Sibling Incarnation: Two incarnations that share a common ancestor are sibling incarnations if neither one is an ancestor of the other. 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 can be accomplished by using the RMAN CATALOG command. How does RMAN perform corruption detection? Answer: Corruption detection is actually performed by the Oracle server. 15. Answer:Yes. I noticed the shadow stayed for at least 8 minutes. Can we do Offline backups with RMAN ? How? Answer: Yes we can do it RMAN regardless of Archive Log/NO Archive log modes. if we loss our catalog in our RMAN setup then what is the procedure to recover the catalog ? Answer: Even the catalog is lost. 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. You can view this information by querying the V$COPY_CORRUPTION or V$BACKUP_CORRUPTION views. we can restore this particular catalog from the catalog DB (Tablespace/ Datafile) from the backup and recover it. RMAN does NOT perform the backup. During backup. the Oracle server detects certain types of corruptions. I did wait for too long. 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. but just directs the server to backup a specified list of datafiles. From the RMAN prompt execute the Blockrecover command by mention the File#. it will be identified as such in the alert log and also in the database controlfile. Can you use Backupsets created by RMAN with any other utility? Answer: No. target conrol files have the metadata of this catalog. How RMAN improves backup time? Answer: RMAN improving this by allocation by more channels and also Rman backups the modified blocks only. is to create the Recovery Catalog in the same database that stores the Oracle Enterprise Manager repository. Infact a configuration many customers may choose. 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). Some user has accidentally dropped one table and you realize this after two days. If a block is detected as newly corrupted.Block#.                                                                                                                           DBA FAQ   Answer: query the SELECT * FROM V$DATABASE_BLOCK_CORRUPTION view and get the status. Blocks. As soon as I 20 ORAFACT . Can you recover this table if the DB is running in ARCHIVELOG mode? Answer: we can use Flashback with time based option. Startup the databse in Mount stage and take the full backup .

RMAN can be configured to connect to all nodes within the cluster to parallelize the backup of the database files and archive logs. although the binary format of backup files offers some security. If already in an RMAN session. or I/O system problems. but Checksums allow Oracle to detect early corruption caused by underlying disk.rmn 2. 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.rmn" this will startup RMAN. 1. but for these backups. * 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. 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. from the RMAN prompt: @fullback. If files need to be restored. The idea is that these processes will be reused for further backup jobs. using set AUTOLOCATE ON alerts RMAN to search for backed up files and archive logs on all nodes. HOW TO TURN ON BLOCK CHECKING? The aim is to detect.rmn You can find some sample scripts in $ORACLE_HOME/rdbms/demo. Search for rman*. so that the backup repository for the Recovery Catalog is its own control file.sh. 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. * Use RMAN to back up the Recovery Catalog database. so that you can restore it if you ever need to restore the Recovery Catalog. and the other is kept in sync manually. 21 ORAFACT . they disappeared. storage system. start RMAN with the NOCATALOG option. and run the script fullback. connect to the target database. To run the script and connect in the same command (as you might want to do in a CRON job): rman target / nocatalog cmdfile "fullback. How do you run a RMAN script using an OS file? There are two ways to do this. Can RMAN backup Real Application Cluster databases? Answer: Absolutely. * Back up the Recovery Catalog controlfile. by periodically issuing the RESYNC CATALOG command. very early the presence of corrupt blocks in the database.                                                                                                                           DBA FAQ   exit from rman. Were they waiting pmon to clean them up? How long does this usually take? Server processes for channels will not disappear until RMAN exists. This has a slight performance overhead. not contained in any of the target databases whose backup data it contains.

HOW TO RECOVER USING RMAN? RMAN> BLOCKRECOVER DATAFILE <datafile path> BLOCK <block id>.--------------WHAT IS INCARNATION IN RMAN? Database incarnation is effectively a new “version” of the database that happens when you reset the online redo logs using “alter database open resetlogs.-----------.----------.controlfile can be taken separately * less redo generated. are the only form in which RMAN can write backups to media managers such as tape drives and tape libraries. WHAT IS THE USE OF FORMAT_STRING IN RMAN? %d The name of the database. %D The current day of the month (in format DD) RMAN ADVANTAGES? * only the used blocks can be backed up. * space and time saves. • incremental backup. * full database. The only option is connect to the target database and give list backup this will give you the backup information with date and timining. HOW DO YOU SEE INFORMATION ABOUT BACKUPS IN RMAN? RMAN> List Backup. * detected the corrupted blocks.tablespace. List of Backup Sets =================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------. Database incarnation falls into following category Current and Parent. HOW RMAN IMPROVES BACKUP TIME? Adding channel to improve the performance of rman but it create session on DB and I/O on disk will increase so configure channel at proper number.                                                                                                                           DBA FAQ   SQL> alter system set db_block_checking = true scope=both. %s The backup set number. RMAN-06089: ARCHIVED LOG XYZ NOT FOUND OR OUT OF SYNC WITH CATALOG? Execute from RMAN: RMAN> change archivelog all validate. Backup sets which are only created and accessed through RMAN.”. Can you use Backupsets created by RMAN with any other utility? NO. HOW DO YOU IDENTIFY WHAT ARE THE ALL THE TARGET DATABASES THAT ARE BEING BACKEDUP WITH RMAN DATABASE? You dont have any view to identifiy whether it is backed up or not .---. RMAN> list backup.---------. ONLY SOME BLOCKS ARE DAMAGED IN A DATAFILE. %t The backup set time stamp. i) Current Incarnation: The database incarnation in which the database is currently generating 22 ORAFACT .-.

* Backup pieces are written to your backup medium. A backup set is composed of one or more backup pieces. ii) Parent Incarnation: The database incarnation from which the current incarnation branched following an OPEN RESETLOGS operation.that are created when you issue an RMAN backup command. This results from issuing an RMAN backup command. WHAT DOES COMPLETE RMAN BACKUP CONSIST OF ? A backup of all or part of your database. and control 23 ORAFACT . A backup set is RMAN's name for a collection of files associated with a backup. backup sets.                                                                                                                           DBA FAQ   redo. and backup pieces.the backup pieces -. whether to disk or tape. WHAT IS A BACKUP SET? A logical grouping of backup files -. A backup consists of one or more backup sets. WHAT IS A BACKUP PIECE? * A physical binary file created by RMAN during a backup. 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 WHAT IS FRA ? WHEN DO YOU USE THIS ? Flash Recovery Area: * Flash recovery area where you can store not only the traditional components found in a backup strategy such as control files archived log files and Recovery Manager (RMAN) datafile copies but also a number of other file components such as flashback logs. archived redo log files. * They contain blocks from the target database's datafiles. * Because the space in the flash recovery area is limited by the initialization parameter DB_ RECOVERY_FILE_DEST_SIZE 13) * Server processes * Channels * Target database * Recovery catalog database (optional) * Media management layer (optional) * Backups. * The flash recovery area simplifies backup operations and it increases the availability of the database because many backup and recovery operations using the flash recovery area can be performed when the database is open and available to users.

WHAT IS THE USE OF V$SESSION_LONGOPS ? Displays the status of various operations that run for longer than 6 seconds (in absolute time). WHAT IS THE USE OF CONFIG RECOVERY WINDOW COMMAND ? Ensure that RMAN retains all backups needed to recover the database to any point in time in the last 7 days: RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS. NOW. STATUS FILENAME BYTES ———. HOW TO CONNECT TO OTHER SERVER TO THE TARGET DATABASE IN RMAN? $rman target sys/target_pwd@db01 WHAT PARAMETER SPECIFIES DURATION OFTHE RMAN INFORMATION TO BE 24 ORAFACT . SQL> alter database enable block change tracking using file ‘/home/oracle/change. HOW TO ENABLE FAST INCREMENTAL BACKUP IN RMAN? Now we can enable block change tracking SQL> alter database enable block change tracking. You must use RMAN to restore files from a backup piece.trc 11599872 change traking writter ctwr process writes the information in that file.————————————————– ———ENABLED /home/oracle/change.. statistics gathering.. and query execution. you must use RMAN to do it. SQL> select * from v$block_change_tracking..                                                                                                                           DBA FAQ   files. and more operations are added for every Oracle release. Database altered. RMAN> CROSSCHECK archivelog all. If you need to restore a file from an RMAN backup. 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. RMAN> CROSSCHECK backup of controlfile. These operations currently include many backup and recovery functions. There's no way for you to manually reconstruct database files from the backup pieces..trc’. VARIOUS CROSSCHECK COMMANDS ? RMAN> CROSSCHECK BACKUP. RMAN> CROSSCHECK backup of database. RMAN> CROSSCHECK COPY. When RMAN constructs a backup piece from datafiles.

                                                                                                                           DBA FAQ   STORED IN CONTROLFILE? control_file_record_keep_time HOW CAN WE LIST HE CURRENT CONFIGURATION OF THE TARGET DATABASE IN RMAN? Using REPORT COMMAND REPORT SCHEMA HOW CAN WE GET THE DETAILED REPORT OF THE BACKUP SETS LIST COMMAND.CPY'(for all datafiles) LIST COPY HOW CAN WE DETECT BLOCK CORRUPTION by querrying views V$BACKUP_CORRUPTION and V$COPY_CORRUPTION.. this new 10g feature records the modified since last backup and stores the log of it in a block change tracking file.. thus freezing the SCN in the header.. why we use dbid in rman When you have multiple databases you have to set your DBID (Database Id) which is unique to each database. You have to set this before you do any restore operation from RMAN. Logging of changed blocks is performed by the CTRW process which is also responsible for writing data to the block change tracking file.STEPS STARTUP MOUNT REPORT SCHEMA COPY DATAFILE1 TO '/BACKUP/DF2.. Once enabled. This improves RMAN's performance as it does not have to scan whole datafiles to detect changed blocks. RMAN uses SCNs on the block level and the archived redo logs to resolve any inconsistencies in the datafiles from a hot backup. Oracle records SCN # from header of a database file..e. 25 ORAFACT . 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. CAN WE MAKE A IMAGE COPY OF THE WHOLE DATABASE? YES. Rather. What RMAN does not require is to put the tablespace in BACKUP mode. During backups RMAN uses the log file to identify the specific blocks that must be backed up. RMAN keeps this information in either your control files or in the RMAN repository (i. When you take a hot backup putting Tablespace in begin backup mode.. Recovery Catalog).

1 1 YES NO D 1 2 YES NO D :: 1 1636 YES NO A 1 1637 YES NO A -But if you check. how can we make a backupset unavailable LIST BACKUPSET bs_key.--.'yyyy-mm-dd:hh24:mi:ss')". restore database. what are different encryption modes in rman transparentmode . sequence#. recover database. sql 'alter database mount'.--. STATUS from v$archived_log. this database can either on the same host or a different host. ARCHIVED. If you do not have automatic channels configured then before issuing the DUPLICATE command manually allocate at least one auxiliary channel within the same RUN command. APPLIED. THREAD# SEQUENCE# ARC APP S ---------. SET UNTIL TIME "TO_DATE('define_time'.                                                                                                                           DBA FAQ   how can we remove the invalid backup pieces from the backup sets crosscheck backup delete expired backup What is auxiliary channel in RMAN? When do you need this? An auxiliary channel is a link to auxiliary instance. does RMAN delete Standby Archivelogs SQL> select thread#. Rman>block recover datafile <dbfileid> block <blockid>. how can we restore from last week backup run { restore controlfile from autobackup. } 26 ORAFACT . CHANGE BACKUPSET bs_key UNAVAILABLE. it shows that APPLIED shows as status NO even from the 1st sequence. When a Duplicate Database created or tablespace point in time recovery is performed Auxiliary database is used. sql 'alter database open resetlogs'.dual mode and password mode how can we recover corrupted blocks .

When a Duplicate Database created or tablespace point in time recovery is performed Auxiliary database is used. catalog and no catalog option. can create and store the backup and recover scripts. ALLOCATE AUXILIARY CHANNEL aux3 DEVICE TYPE DISK.of blocks in each datafile v$backup_datafile how can we retrieve info about archive logs in backupsets v$backup_redolog how can we monitor the progress of backups and copies v$session_longops 20. 3). incremental and accumulative backup. 2). RUN { ALLOCATE AUXILIARY CHANNEL ch1 DEVICE TYPE sbt. copies only the filled blocks i.which files are recoverable because of unrecoverable operations report unrecoverable. 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. What is auxiliary channel in RMAN? When do you need this? An auxiliary channel is a link to auxiliary instance. What is the advantage of RMAN utility? Advantage over tradition backup system: 1).                                                                                                                           DBA FAQ   how can we take automatic controlfile backup RMAN does it automatically if you set CONTROLFILE AUTOBACKUP ON on RMAN configuration what view helps to create equal sized backup sets determining the no. } What is Channel? How do you enable the parallel backups with RMAN? Channel is a link that RMAN requires to link to target database.e. increase performance through automatic parallelization( allocating channels). 5). This link 27 ORAFACT . ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK. detection of corrupted blocks during backup. . this database can either on the same host or a different host. less redo generation. DUPLICATE TARGET DATABASE TO dupdb. If you do not have automatic channels configured then before issuing the DUPLICATE command manually allocate at least one auxiliary channel within the same RUN command. ALLOCATE AUXILIARY CHANNEL aux2 DEVICE TYPE DISK. 6). 4).

Can you take Offline backups using RMAN? YES. RMAN> CONFIGURE DEVICE TYPE PARALLELISM 2 BACKUP TYPE TO COMPRESSED BACKUPSET. This channel can be allocated manually or can be preconfigured by using automatic channel allocation. How do you add new database to catalog database? Follow the following steps to register the new database in catalog RMAN>connect taget username/password@ connect_string catalog cataloguser/password@connect_string 28 ORAFACT . how? RMAN>backup current controlfile. Should you take the backup of Logfiles if the database is running in ARCHIVELOG mode? Yes. RMAN>backup archivelog all. Then controlfile behaves has a recovery catalog. Can you use RMAN without Recovery catalog? YES.but put the database is in mount state. How do you see information about backups in RMAN? RMAN>list backup. For example if you allocate 4 channels for a backup operation 4 background processes for the operation can run concurrently.                                                                                                                           DBA FAQ   is required when backup and recovery operations are performed and recorded. but its recommended by oracle that we need to have recovery catalog in other DB Which is more efficient Incremental Backups using RMAN or Incremental Export? RMAN in more efficient than incremental Export 12)How do you find out from the RMAN catalog if a particular archive log has been backed-up? RMAN> list archivelog all. Should you place Recovery Catalog in the Same DB? Recovery catalog can be in the same database. Can you take online backup of a Control file if yes. The number of allocated channels determines the maximum degree of parallelism that is used during backup restore or recovery. How RMAN improves backup time? Add channel to improve the performance of rman but it create session on DB and I/O on disk will increase so configure channel at proper number.

so that the block which is copied to the backup media might only have been updated in its first half.GETPARM Diffarance between increamental and cumulative backups 29 ORAFACT . stored procedure "SYS. instead of logging just the changed bytes to the redo log. which is to 'freeze' the checkpoint in the header of the file until the file is removed from backup mode. we also log a copy of the entire block image before the change.                                                                                                                           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. If this backup needs to be restored later. we read the block again to obtain a complete block before backing it up. as required before attempting backups of that target database. A non-RMAN online backup consists of a non-Oracle tool.DBMS_BACKUP_RESTORE" does not exist ORA-01403: no data found ORA-06512: at line 221 RMAN-10035: exception raised in RPC: ORA-04067: not executed. and that block needs to be recovered. while the second half contains older data. so that we can reconstruct this block if media recovery finds that this block was fractured. 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. the non-Oracle tool might read a block in a halfupdated state. and a change is made to a data block. When a tablespace is in backup mode. RMAN-00569: ================error message stack follows================ RMAN-00600: internal error. Can I have my target database on a Sun box and the recovery catalog on a WinNT machine? A: Yes. arguments [10053] [1] [] [] [] RMAN-03008: error while performing automatic resync of recovery catalog RMAN-07004: unhandled exception during command execution on channel default RMAN-10032: unhandled exception during execution of job step 1: ORA-04067: not executed. The 'alter tablespace begin backup' command is our solution for the fractured block problem. If we read a fractured block.DBMS_BACKUP_RESTORE" does not exist RMAN-10031: ORA-4067 occurred during call to DBMS_BACKUP_RESTORE. Backup mode has another effect. 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. backing up a datafile at the same time that DBWR is updating the file. That block image logging is what causes extra redo to be generated while files are in backup mode. This is called a "fractured block".DBMS_BACKUP_RESTORE" does not exist A: An error message stack like the following indicates that CATPROC. Registering a database gives error messages including: ORA-04067: not executed. recovery will fail because that block is not usable. you must first understand why those features are required for non-RMAN online backups.SQL did NOT execute successfully on the target database. stored procedure "SYS. We can't prevent the tool from reading a particular block at the exact same time that DBWR is updating that block. 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. stored procedure "SYS. which enables us to capture a known good checkpoint for the file. RMAN does not need to freeze the file header checkpoint because we know the order in which we will read the blocks. When that happens. We do this because we cannot guarantee that the third-party backup tool will copy the file header prior to copying the data blocks. The reason that RMAN does not require extra logging is that it guarantees that it will never back up a fractured block. such as cp or dd.

When you take a hot backup putting Tablespace in begin backup mode and RMAN backup Oracle records SCN # from header of a database file.                                                                                                                           DBA FAQ   A differential backup. which backs up all blocks changed after the most recent incremental backup at level 0. Incremental backups are differential by default.e. Recovery Catalog).Server processes 3. During backups RMAN uses the log file to identify the specific blocks that must be backed up. which backs up all blocks changed after the most recent incremental backup at level 1 or. Logging of changed blocks is performed by the CTRW process which is also responsible for writing data to the block change tracking file. Once enabled.Recovery catalog database (optional) 6. Rather. We even dont need to bring the data file offline. Recovering a block using RMAN If we can restore a few blocks rather than an entire file we only need few blocks. there is Oracle Block Change Tracking feature. What RMAN does not require is to put the tablespace in BACKUP mode.RMAN executable 2. RMAN uses SCNs on the block level and the archived redo logs to resolve any inconsistencies in the datafiles from a hot backup.. What are the Architectural components of RMAN? 1.Media management layer (optional) 30 ORAFACT .Channels 4. thus freezing the SCN in the header. This improves RMAN's performance as it does not have to scan whole datafiles to detect changed blocks. 0 A cumulative backup. 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.Target database 5. this new 10g feature records the modified since last backup and stores the log of it in a block change tracking file. Syntax for it as follows Block Recover datafile 8 block 22. 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. RMAN keeps this information in either your control files or in the RMAN repository (i.

A backup set is RMAN's name for a collection of files associated with a backup. They contain blocks from the target database's datafiles. When RMAN constructs a backup piece from datafiles. RMAN always stores this information in the target database control file. it requires a place to store necessary information about the database. If you need to restore a file from an RMAN backup. either a disk or an sbt_tape · Number of processes simultaneously accessing an I/O device · Maximum size of files created on I/O devices · Maximum rate at which database files are read · Maximum number of files open at a time Why is the catalog optional? Because RMAN manages backup and recovery operations. What does complete RMAN backup consist of ? A backup of all or part of your database. You can also store RMAN metadata in a recovery catalog schema contained in a separate database. A backup consists of one or more backup sets. What is a Backup piece? A physical binary file created by RMAN during a backup. Backup pieces are written to your backup medium. Tablespaces are not put in backup mode. What is a Backup set? A logical grouping of backup files the backup pieces that are created when you issue an RMAN backup command. There's no way for you to manually reconstruct database files from the backup pieces. A backup set is composed of one or more backup pieces. It is through the allocation of channels that you govern I/O characteristics such as: · Type of I/O device being read or written to. such as a disk or a tape. thus there is noextra redo log generation during online backups. backup sets. The recovery catalog schema must be stored in a database other than the target database. 2. whether to disk or tape. A channel is what reads and writes RMAN backup files.Backups. archived redo log files. What are the benefits of using RMAN? 1 Incremental backups that only copy data blocks that have changed since the last backup. and backup pieces What are Channels? A channel is an RMAN server process started when there is a need to communicate with an I/O device. You must use RMAN to restore files from a backup piece.                                                                                                                           DBA FAQ   7. 31 ORAFACT . This results from issuing an RMAN backup command. and control files. you must use RMAN to do it. 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.

SQL> exit. Next. 5. log in to rman and create the catalog schema. Prior to Oracle 8i this was done by running the catrman. How do you go for it in RMAN? CONFIGURE RETENTION POLICY TO REDUNDANCY 3 how many days RMAN keeps the information in controlfile? It is depends upon the retention polocy we configured Which Files must be backed up? Database Files (with RMAN) Control Files (with RMAN) Offline Redolog Files (with RMAN) INIT. Parallelization of I/O operations. 4. what is recovery catalog? Recovery catalog holds RMAN repository data for one or more databases in a separate database schema. > rman catalog rman/rman RMAN> create catalog tablespace tools. 6. Automatic logging of all backup and recovery operations. You want to retain only last 3 backups of datafiles. You can now continue by registering your databases in the catalog. in addition to using the control files of the databases. Using RMAN how to restore a database in archivelog rman target / RMAN>startup mount RMAN>restore database RMAN>recover database 32 ORAFACT . Look at this example: sqlplus sys/ as sysdba SQL> create user rman identified by rman.sql script.                                                                                                                           DBA FAQ   3. recovery_catalog_owner to rman. Builtin reporting and listing commands. SQL> grant connect. RMAN> exit. RMAN>backup incremental level 1 database. SQL> alter user rman quota unlimited on tools. Detection of corrupt blocks during backups. Start by creating a database schema (usually called rman). Assign an appropriate tablespace to it and grant it the recovery_catalog_owner role. SQL> alter user rman default tablespace tools temporary tablespace temp.ORA (manually) Password Files (manually) How to take differential incremental and cumulative backups in RMAN? RMAN>backup incremental level2 database. Look at this example: rman catalog rman/rman target backdba/backdba RMAN> register database. resource.

What is RMAN and how does one use it? Recovery Manager (or RMAN) is an Oracle provided utility for backingup.sql and prvtrmns.bsq file). is just a Pro*C application that translates commands to a PL/SQL interface. In fact RMAN. but various 3rdparty tools (like Veritas.How to configure channels in RMAN? RMAN>configure channel device type disk format '/d01/backup/%U'. or from command line. etc) can integrate with RMAN to handle tape library management. and does not require the database to be opened (mapped from the ?/rdbms/admin/recover. RMAN can do offline and online database backups. The RMAN executable is located in your ORACLE_HOME/bin directory. It cannot. 18. RMAN>crosscheck copy.pieces in RMAN? RMAN>crosscheck backupset of database.plb which are called by catproc. undocumented packages created by the create catalaog command DBMS_RCVMAN is create din the target database by the scripts dbmsrman. RMAN can be operated from Oracle Enterprise Manager. restoring and recovering Oracle Databases. Omiback. however. write directly to tape. what is meant by DBMS_RCVCAT and DBMS_RCVMAN these are internal. Here are the command line arguments: Argument Value Description target quotedstring connectstring for target database catalog quotedstring connectstring 33 ORAFACT . 17.                                                                                                                           DBA FAQ   RMAN>alter database open 16. RMAN ships with the database server and doesn't require a separate installation.How to configure retention policy in RMAN? RMAN>configure retention policy to recovery window of 7 days. The PL/SQL calls are stallically linked into the Oracle kernel.How to checkup backups.sql DBMS_RCVCAT is used by recovery manager to maintain information in the recovery catalog and DBMS_RCVMAN quesries the controlfile or recovery catalog what is REPORT command in RMAN what files need to be backup RMAN>report need backup which backups can be delted RMAN>report obsolete.

backup format '/app/oracle/backup/%d_t%t_s%s_p%p' (database).0. 2004.1. RMAN will reread database blocks until it gets a consistent image of it. then no recovery catalog cmdfile quotedstring name of input command file log quotedstring name of output message log file trace quotedstring name of output debugging message log file append none if specified.                                                                                                                           DBA FAQ   for recovery catalog nocatalog none if specified. How does one backup and restore a database using RMAN? The biggest advantage of RMAN is that it only backup used space in the database. RMAN> connect target. Oracle. . log is opened in append mode debug optionalargs activate debugging msgno none show RMANnnnn prefix for all messages send quotedstring send a command to the media manager pipe string building block for pipe names timeout integer number of seconds to wait for pipe input Here is an example: [oracle@localhost oracle]$ rman Recovery Manager: Release 10. All rights reserved. } Example RMAN restore: rman target sys/*** nocatalog run { 34 ORAFACT . rman target sys/*** nocatalog run { allocate channel t1 type disk. Look at this simple backup example.0 Production Copyright (c) 1995. release channel t1... connected to target database: ORCL (DBID=1058957020) RMAN> backup database. RMAN doesn't put tablespaces in backup mode. saving on redo generation overhead.2.

Remember to delete files after backing them up to prevent the archive log directory from filling up. How does one backup and restore archived log files? One can backup archived log files using RMAN or any operating system backup utility. Alternatively one can backup to disk and then manually copy the backups to tape. 4> release channel dev1. recover tablespace users. # set until time 'Aug 07 2000 :51'. 3> backup 4> format '/app/oracle/archback/log_%t_%sp%p' 5> (archivelog all delete input). Note: RMAN cannot write image copies directly to tape. your database will hang! Look at this simple RMAN backup scripts: RMAN> run { 2> allocate channel dev1 type disk. SQL> alter user rman quota unlimited on tools. By default Oracle uses the database controlfiles to store information about backups. Normally one would rather setup a RMAN catalog database to store RMAN metadata in. 35 ORAFACT . If the archive log directory becomes full. Assign an appropriate tablespace to it and grant it the recovery_catalog_owner role.                                                                                                                           DBA FAQ   allocate channel t1 type disk. 6> release channel dev1. List all archivelog backups for the past 24 hours: RMAN> LIST BACKUP OF ARCHIVELOG FROM TIME 'sysdate1'. Read the Oracle Backup and Recovery Guide before implementing any RMAN backups. release channel t1. Look at this example: sqlplus sys SQL> create user rman identified by rman. Here is a restore example: RMAN> run { 2> allocate channel dev1 type disk. SQL> alter user rman default tablespace tools temporary tablespace temp. 5> } How does one create a RMAN recovery catalog? Start by creating a database schema (usually called rman). One needs to use a thirdparty media manager that integrates with RMAN to backup directly to tape. 3> restore (archivelog low logseq 78311 high logseq 78340 thread 1 all). 7> } The "delete input" clause will delete the archived logs as they as backedup. restore tablespace users. } The examples above are extremely simplistic and only useful for illustrating basic concepts.

emc.                                                                                                                           DBA FAQ   SQL> grant connect. A complete list of supported Media Management Vendors can be found at: http://www.com/storage/ · EMC Networker http:// www.sun. Next.tivoli." command to upgrade to a new RMAN release.commvault.com/ · EMC Data Manager (EDM) http:// www.emc.sql script.veritas. SQL> exit. Look at this example: rman catalog rman/rman target backdba/backdba RMAN> register database.oracle. These commands need to be entered twice to confirm the operation. The above Media Management Vendors will provide first line technical support (and installation guides) for their respective products.com/ · IBM's Tivoli Storage Manager (formerly ADSM) http:// www.. aspx · Sterling Software's SAMS:Alexandria (formerly from Spectralogic) http:// www.com/us/datalossprevention. Prior to Oracle 8i this was done by running the catrman. Here are some examples: 36 ORAFACT .htm When allocating channels one can specify Media Management spesific parameters.sterling.com/software/whitepapers/backupnstorage/ · CommVault Galaxy http:// www. rman catalog rman/rman RMAN> create catalog tablespace tools.ca..com/ · etc.com/ · BrightStor ARCserve Backup http:// www.com/ · HP OMNIBack/ DataProtector http:// www. You can now continue by registering your databases in the catalog. recovery_catalog_owner to rman. log in to rman and create the catalog schema. How does one integrate RMAN with thirdparty Media Managers? The following Media Management Software Vendors have integrated their media management software with RMAN (Oracle Recovery Manager): · Veritas NetBackup http:// www. resource. One can also use the "upgrade catalog.com/sams/ · SUN's Solstice Backup http:// www." command to remove an RMAN catalog. RMAN> exit.hp.com/technology/deploy/availability/htdocs/bsp. or the "drop catalog.

dbf'. set the DB_NAME parameter to the new database's name. write a RMAN script like this to do the cloning.log') SIZE 200k REUSE. } The above script will connect to the "target" (database that will be cloned).dbf'.                                                                                                                           DBA FAQ   Netbackup on Solaris: allocate channel t1 type 'SBT_TAPE' PARMS='SBT_LIBRARY=/usr/openv/netbackup/bin/libobk. Omniback/ DataProtector on HPUX: allocate channel t1 type 'SBT_TAPE' PARMS='SBT_LIBRARY= /opt/omni/lib/libob2oracle8_64bit. GROUP 2 ('/ORADATA/u03/redo02.ORA and password file (use the orapwd utility) on the machine you need to clone the database to.dbf'. set newname for datafile 2 to '/ORADATA/u02/undotbs01.rcv": connect target sys/secure@origdb connect catalog rman/rman@catdb connect auxiliary / run { set newname for datafile 1 to '/ORADATA/u01/system01. This database is referred to as the AUXILIARY in the script below. allocate auxiliary channel dupdb1 type disk. you need to change your environment variables. Notes: the "set newname" commands are only required if your datafile names will 37 ORAFACT . Previous backups will be restored and the database recovered to the "set until time" specified in the script. duplicate target database to dupdb logfile GROUP 1 ('/ORADATA/u02/redo01. or: allocate channel 'dev_1' type 'sbt_tape' parms 'ENV=OB2BARTYPE=Oracle8. How does one clone/duplicate a database with RMAN? The first step to clone or duplicate a database with RMAN is to create a new INIT. Lastly. and call it with "rman cmdfile dupdb.OB2APPNAME=orcl.sl'.so.1'. set newname for datafile 5 to '/ORADATA/u02/example01.log') SIZE 200k REUSE.dbf'. For example. and do a STARTUP NOMOUNT from sqlplus.OB2BARLIST=machinename_orcl_a rchlogs)'. and the auxiliary database (new duplicate DB). the recovery catalog (to get backup info). set until sequence 2 thread 1. set newname for datafile 4 to '/ORADATA/u03/indx01. set newname for datafile 3 to '/ORADATA/u03/users01. Review all parameters and make the required changed. Secondly. Netbackup on Windows: allocate channel t1 type 'SBT_TAPE' send "NB_ORA_CLIENT=client_machine_name".dbf'.

elapsed time: 00:00:04 Finished backup at 20AUG04[/ code] Now. elapsed time: 00:00:45 channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset including current controlfile in backupset including current SPFILE in backupset channel ORA_DISK_1: starting piece 1 at 20AUG04 channel ORA_DISK_1: finished piece 1 at 20AUG04 piece handle= / flash_recovery_area/ORCL/backupset/2004_08_20/o1_mf_ncsnf_TAG20040820T153256_0l czfrx8_. All rights reserved.0 64bit Production Copyright (c) 1995.dbf channel ORA_DISK_1: starting piece 1 at 20AUG04 channel ORA_DISK_1: finished piece 1 at 20AUG04 piece handle= / flash_recovery_area/ORCL/backupset/2004_08_20/o1_mf_nnndf_TAG20040820T153256_0 lczd9tf_. let's destroy one of the control files: 38 ORAFACT . 2004. Let's look at an example: Let's take a backup (partial in our case for ilustrative purposes): $ rman target / nocatalog Recovery Manager: Release 10.                                                                                                                           DBA FAQ   different from the target database. Oracle. If both these are gone. RMAN cannot restore the database.bkp comment=NONE channel ORA_DISK_1: backup set complete. In such a situation one must extract a control file (or other files) from the backup pieces written out when the last backup was taken.2. connected to target database: ORCL (DBID=1046662649) using target database controlfile instead of recovery catalog RMAN> backup datafile 1.bkp comment=NONE channel ORA_DISK_1: backup set complete. Starting backup at 20AUG04 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=146 devtype=DISK channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00001 name=/oradata/orcl/system01. Can one restore RMAN backups without a CONTROLFILE and RECOVERY CATALOG? Details of RMAN backups are stored in the database control files and optionally a Recovery Catalog.0.1. The newly cloned DB will have its own unique DBID.

Restore the first Control File. Total System Global Area 289406976 bytes Fixed Size 1301536 bytes Variable Size 262677472 bytes Database Buffers 25165824 bytes Redo Buffers 262144 bytes</pre> Now. Allocate a channel. from SQL*Plus. First we need to start the databaase in NOMOUNT mode: SQL> startup NOMOUNT ORACLE instance started. SQL> ! mv /oradata/orcl/control01. BEGIN Define the backup pieces. v_maxPieces NUMBER. v_pieceName t_pieceName. v_done BOOLEAN. ORACLE instance shut down.bkp'.ctl SQL> shutdown abort. (Use type=>null for DISK. /oradata/orcl/control02. ident=>'d1'). type=>'sbt_tape' for TAPE) v_devtype := DBMS_BACKUP_RESTORE. CFNAME mist be the exact path and filename of a controlfile taht was backedup DBMS_BACKUP_RESTORE. /oradata/orcl/control03.restoreControlFileTo(cfname=>'/app/oracle/oradata/orcl/co 39 ORAFACT . run the following PL/SQL block to restore the file: DECLARE v_devtype VARCHAR2(100). (names from the RMAN Log file) v_pieceName(1) := '/flash_recovery_area/ORCL/backupset/2004_08_20/o1_mf_ncsnf_TAG20040820T15325 6_0lczfrx8_...                                                                                                                           DBA FAQ   SQL> show parameters CONTROL_FILES NAME TYPE VALUE control_ files string /oradata/orcl/control01. v_maxPieces := 2.ctl</pre> Now. v_pieceName(2) := '/flash_recovery_area/ORCL/backupset/2004_08_20/o1_mf_nnndf_TAG20040820T1532 56_0lczd9tf_..ctl.bkp'.restoreSetDataFile..ctl.ctl /tmp/control01. let's see if we can restore it. DBMS_BACKUP_RESTORE..deviceAllocate(type=>NULL.. TYPE t_pieceName IS TABLE OF varchar2(255) INDEX BY binary_integer.

Database altered.restoreBackupPiece(handle=>v_pieceName(i). DBMS_BACKUP_RESTORE.ctl /oradata/orcl/control02. EXCEPTION WHEN OTHERS THEN DBMS_BACKUP_RESTORE.                                                                                                                           DBA FAQ   ntrol01.log Log applied..ctl SQL> alter database mount SQL> recover database using backup controlfile.').arc ORA00280: change 7917452 for thread 1 is in sequence #671 Specify log: {<RET>=suggested | filename | AUTO | CANCEL} /oradata/orcl/redo02. FOR i IN 1.v_maxPieces LOOP dbms_output.deviceDeAllocate. Media recovery complete. DBMS_BACKUP_RESTORE.ctl'). RAISE.. Deallocate the channel. What are the Advantage over tradition backup system? Advantage over tradition backup system: 40 ORAFACT . Database altered.put_line('Restoring from piece '||v_pieceName(i)).deviceDeAllocate('d1'). dbms_output.ctl[/code] We should now be able to MOUNT the database and continue recovery.. 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_..put_line('Start restoring '||v_maxPieces||' pieces. SQL> alter database open resetlogs. END LOOP. SQL> ! cp /oradata/orcl/control01. END.ctl /oradata/orcl/control03. done=>v_done.ctl SQL> ! cp /oradata/orcl/control01. / Let's see if the controlfile was restored: SQL> ! ls l /oradata/orcl/control01. params=>null).. exit when v_done.ctl rwr1 oracle dba 3096576 Aug 20 16:45 /oradata/orcl/control01.

detection of corrupted blocks during backup. Assign an appropriate tablespace to it and grant it the recovery_catalog_owner role. It is sometimes referred to as OEBU for Oracle Enterprise Backup Utility. 3). copies only the filled blocks i. rman catalog rman/rman RMAN>create catalog tablespace tools. How can a group in a cross products be visually distinguished from a group 41 ORAFACT . incremental and accumulative backup. how many days RMAN retain the info in controlfil? Depending upon the retention polocy it will retain the copies How do you install the RMAN recovery catalog? Steps to be followed: 1 Create connection string at catalog database. catalog and no catalog option. SQL> exit. log in to rman and create the catalog schema. However. Next. 2).                                                                                                                           DBA FAQ   1). 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. Look at this example: rman catalog rman/rman target backdba/backdba RMAN> register database. 3 Login into RMAN with connection string. You can now continue by registering your databases in the catalog. SQL> grant connect.sql script. RMAN> exit. can create and store the backup and recover scripts. less redo generation. 2 At catalog database. 4). recovery_catalog_owner to rman. resource. SQL> alter user rman quota unlimited on tools. high performance interface for backing up Oracle7 databases.e. How does one create a RMAN recovery catalog? Start by creating a database schema (usually called rman). What are the differences between EBU and RMAN? Enterprise Backup Utility (EBU) is a functionally rich. Look at this example: sqlplus sys SQL>create user rman identified by rman. 6). Prior to Oracle 8i this was done by running the catrman. increase performance through automatic parallelization( allocating channels). there is no direct upgrade path from EBU to RMAN. 5). SQL> alter user rman default tablespace tools temporary tablespace temp. create one new user or use existing user and give that user a recovery_catalog_owner privilege. The Oracle Recovery Manager (RMAN) utility that ships with Oracle8 and above is similar to Oracle7's EBU utility.

archivelogs. Recovery Manager (RMAN) can avoid scanning the entire datafile during an incremental backup. RMAN Database Dropping and Deregistration . or a backup file is moved to a new location on disk.                                                                                                                           DBA FAQ   that does not form a cross product? A group that forms part of a cross product will have a thicker border. which reduces the time needed to restore a file from tape. and the equivalent of a disk cache for tape.This release supports automated disk-based backup and recovery. The result is a simplified and unified storage location for backups. It also provides automatic deletion of the files after they have been successfully backed up by RMAN.By using a new type of log file to track blocks that have changed in the database. number_of_files FROM v$recovery_file_dest. Changes to the ALTER DATABASE END BACKUP Command You can issue the ALTER DATABASE END BACKUP command when the database is open. FLASHBACK How do you set the flash recovery area? A: SQL> ALTER SYSTEM SET db_recovery_file_dest_size = 100G. space_used. SQL> ALTER SYSTEM SET db_recovery_file_dest = ‘/u10/oradata/school’. Automated TSPITR Instantiation . and any other files needed for Oracle recovery. Instead. Change-Aware Incremental Backups . the amount of data scanned is proportional to the amount of data changed. How do you gather information regarding the flash recovery area? A: SQL> SELECT name. If a backup is overwritten in the control file.The new DROP DATABASE and UNREGISTER DATABASE RMAN commands remove the database and its entry from the RMAN recovery catalog.You can now catalog RMAN proprietary backup metadata into a backup repository. What is the flashback? 42 ORAFACT . space_limit.This feature automatically creates the auxiliary instance needed to perform tablespace point-in-time recovery (TSPITR) and incorporates the RMAN TSPITR operations. then you can easily uncatalog the backup metadata from the repository. space_reclaimable. Simplified Recovery Manager Cataloging of Backup Files . It reduces the risk of an out-of-space condition on disk by deleting files that are no longer necessary for successful database recovery. Automated Disk-Based Backup and Recovery .

SQL> ALTER SYSTEM SET db_flashback_retention_target = 2880. The RVWR background process sequentially writes Flashback Database data from the flashback buffer to the Flashback Database logs which are circularly reused. To check whether it is enable do the following SQL statement. Why do need to use the flashback? A: It eliminates restore process and it is faster than traditional point-in-time recovery. How do you monitor Flashback Database? A: Use the V$FLASHBACK_DATABASE_LOG view to display the approximate lowest SCN and time to which you can flash back your database. Set the database flashback retention time target. How it works? A: Every transaction logically generates a new version of the database. and perform change analysis. one more log was added as Flashback Database log. What is its architecture? A: Now. oldest_flashback_time FROM v$flashback_database_log. SQL> ALTER DATABASE FLASHBACK ON. The Oracle database server regularly logs before images of data blocks in the Flashback Database logs from Flashback buffer in the SGA Oracle memory. How do you configure Flashback Database? A: Assuming: The database is in archive mode. the database must be in MOUNT EXCLUSIVE mode. query historical data.Ex: for two days.                                                                                                                           DBA FAQ   A: The flashback gives users the capability to query past version of schema objects. The Flashback Database must be enabled. -. 43 ORAFACT . SQL> SELECT oldest_flashback_scn. When it is enabled. all existing Flashback Database logs are deleted automatically. Enable Flashback Database. The database flash recovery area was configured. SQL> SELECT flashback_on FROM v$database . How do you Flashback a database? A: The FLASHBACK DATABASE command force the database back to a past time or SCN. If you disable the flashback (OFF). You can navigate through these versions to find an error and its cause. Before altering your database. SQL> FLASHBACK DATABASE TO SCN 65473. and the Flashback be enabled. -. the new RVWR (Recovery Version Writer) background process will be started. See the following examples: SQL> FLASHBACK DATABASE TO TIMESTAMP (sysdate-5/24). ARCHIVELOG mode.Go back 5 hours from now.

related.                                                                                                                           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. 44 ORAFACT . The control file has been restored or recreated. SQL> FLASHBACK TABLE emp TO TIMESTAMP to_timestamp (’14:45’. SQL> DROP TABLE iself. do the following SQL statement. SQL> SELECT * FROM v$flashback_database_stat. SQL> ALTER TABLESPACE users FLASHBACK OFF. When are you not able to Flashback Database? A: 1. A RESETLOSG operation is required. type. SQL> FLASHBACK TABLE emp TO BEFORE DROP. ts_name.’HH24:MI’). SQL> SHOW RECYCLEBIN How do you restore from recycle bin? A: Use the FLASHBACK TABLE command to recover a table and all its possible dependent objects form the recycle bin. SQL> SELECT original_name. space FROM dba_recyclebin WHERE original_name = ‘EMP’. A tablespace has been dropped. SQL> FLASHBACK TABLE emp TO BEFORE DROP RENAME TO employee. How do you exclude a tablespace from flashback database? A: If you do not want the USER tablespace to be included to log Flashback Database data. 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’. object_name. How do you reclaim the recycle bin? A: By using PURG option. 2. dropttime.emp. 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. 3. and 4. A data file has been shrunk.

SQL> CONNECT / AS SYSDBA Use the FLASHBACK TABLE command to recover a table and all its possible dependent objects form the recycle bin. SQL> PURGE TABLESPACE scott_ts USER scott. SQL> SELECT original_name. 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.Purges all the objects. SQL> PURGE DBA_RECYCLEBIN. retention FROM dba_tablespaces. How do you test that your recovery was successful? A: 45 ORAFACT . space FROM dba_recyclebin WHERE original_name = ‘FLASHBACK_TABLE’ / SQL> FLASHBACK TABLE iself.Purges all user objects. related. How can you check the UNDO retention? A: SQL> SELECT tablespace_name.                                                                                                                           DBA FAQ   SQL> PURGE TABLE emp. object_name. type.All the Scott’s objects. SQL> ALTER TABLESPACE my_undotbs1 RETENTION GUARANTEE. -. How can you recover deleted file? A: Connect as sysdba and flashback the table. How can you perform queries on the database as of a certain clock time or SCN? A: SQL> SELECT versions_xid. ts_name.Purges the specified table. versions_operation FROM emp VERSIONS BETWEEN TIMESTAMP sysdate-10/24 AND sysdate WHERE empno = 100. How can you enforce to guaranteed UNDO retention? A: You can do one of the following SQL statements. Check what do you have in your recycle bin.emp TO BEFORE DROP. SQL> CREATE UNDO TABLESPACE my_undotbs1 DATAFILE ‘my_undotbs01. -. -. sal.dbf’ SIZE 10G AUTOEXTEND ON RETENTION GUARANTEE. dropttime. -. SQL> PURGE RECYCLEBIN.

In such situations. which will remove the index only." In that scenario.                                                                                                                           DBA FAQ   SQL> SELECT count(*) FROM flashback_table Managing the Recycle Bin If the tables are not really dropped in this process--therefore not releasing the tablespace--what happens when the dropped objects take up all of that space? A. you may want to purge all the objects in recycle bin in a tablespace USERS. Oracle automatically purges objects belonging to that user in that tablespace. the recycle bin can be managed in a variety of different ways to meet your specific needs. When a tablespace is completely filled up with recycle bin data such that the datafiles have to extend to make room for more data. or using its recycle bin name: PURGE TABLE "BIN$04LhcpndanfgMAAAAAANPw==$0". leaving the copy of the table in the recycle bin. 46 ORAFACT . but the user may be running out of his or her allotted portion of it. Similarly. You would issue: PURGE TABLESPACE USERS. constraints. saving some space. This approach could come handy in data warehouse-type environments where users create and drop many transient tables. 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. You as a DBA can purge all the objects in any tablespace using PURGE DBA_RECYCLEBIN. you can do so using: purge index in_test1_01. space pressure can occur with user quotas as defined for a particular tablespace. If you want to purge the specific table named TEST from the recycle bin after its drop. objects are automatically purged from the recycle bin in a first-in-first-out manner. there are several ways you can manually control the recycle bin. This command will remove table TEST and all dependent objects such as indexes. you want to permanently drop an index from the recycle bin. You may want to purge only the recycle bin for a particular user in that tablespace. If. You could modify the command above to limit the purge to a specific user only: PURGE TABLESPACE USERS USER SCOTT. you could issue PURGE TABLE TEST. The tablespace may have enough free space. 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.The answer is simple: that situation does not even arise. The dependent objects (such as indexes) are removed before a table is removed. For instance. In addition. and so on from the recycle bin. however. the tablespace is said to be under "space pressure. A user such as SCOTT would clear his own recycle bin with PURGE RECYCLEBIN. As you can see. Sometimes it might be useful to purge at a higher level.

A PURGE operation can be issued by any use to remove their objects from the recycle bin. a user creates a new table or adds data that causes their quota to be exceeded. then it is a manual process. can I flash it back further in time? You can issue a Flashback Database command and then open the database READ-ONLY. All data that is located in the database is supported. 6. If you do not allocated enough space to the Flash Recovery Area. 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. Objects in the Recycle Bin will be automatically purged by the space reclamation process if 5. Flashback Database utilizes the Flash Recovery Area to organize and manage the flashback logs. Does Flashback Database Support all data types? Yes. then you will be limited to how far back in time you will be able to rewind. The recycle bin feature is on by default. This limit is contingent upon sufficient space existing in the flash recovery area. How far back can I rewind my database? There are 2 limiting factors to how far back in time you can rewind. Does any of our competitors have any similar feature/product like Flashback Query? Thanks to our superior multiversioning read consistency technology. Flash Recovery Area. 47 ORAFACT .                                                                                                                           DBA FAQ   Once I flashback the database. How far back in time can I view the versions of a row? You can view all the versions of a row for as long as you have undo information retained in the undo tablespace to satisfy the specified timestamps or SCN. you can roll-forwards and backwards using the recover database until and flashback commands. The setting of the DB_FLASHBACK_RETENTION_TARGET initialization parameter determines. how much flashback data that Oracle should keep. Flashback Table enforces those constraints for all dependencies. Can I turn off the Recycle Bin feature? No. If you do not enforce referential integrity with software. the tablespace needs to extend its file size to accommodate create/insert operations. Until you open the database with a reset logs operation. Flashback Drop is a non-intrusive feature. Oracle is the only database product with such a capability. Is referential integrity maintained during a flashback table operation? Referential integrity can be enforced by Oracle via constraints. This will allow you to verify this is the point in which you want to open and start working again. Specify the how far back to rewind. indirectly.