Wednesday, 23 December 2015

RMAN Interview QA

2. Difference between using recovery catalog and control file?
When new incarnation happens, the old backup information in control file will be lost. It will be preserved in recovery catalog.
In recovery catalog, we can store scripts.
Recovery catalog is central and can have information of many databases.

3. Can we use same target database as catalog?
No. The recovery catalog should not reside in the target database (database to be backed up), because the database can't be recovered in the mounted state.

4. How do u know how much RMAN task has been completed?
By querying v$rman_status or v$session_longops

6. Command to delete archive logs older than 7days?
RMAN> delete archivelog all completed before sysdate-7;

8. What is the use of crosscheck command in RMAN?
Crosscheck will be useful to check whether the catalog information is intact with OS level information.

10. Which is one is good, differential (incremental) backup or cumulative (incremental) backup?
A differential backup, which backs up all blocks changed after the most recent incremental backup at level 1 or 0
A cumulative backup, which backs up all blocks changed after the most recent incremental backup at level 0

11. What is Level 0, Level 1 backup?
A level 0 incremental backup, which is the base for subsequent incremental backups, copies all blocks containing data, backing the datafile up into a backup set just as a full backup would. A level 1 incremental backup can be either of the following types:
A differential backup, which backs up all blocks changed after the most recent incremental backup at level 1 or 0
A cumulative backup, which backs up all blocks changed after the most recent incremental backup at level 0

13. Will RMAN put the database/tablespace/datafile in backup mode?
Nope.

14. What is snapshot control file?

15. What is the difference between backup set and backup piece?
Backup set is logical and backup piece is physical.

16. RMAN command to backup for creating standby database?
RMAN> duplicate target database to standby database ....

17. How to do cloning by using RMAN?
RMAN> duplicate target database …

8. You loss one datafile and DB is running in ARCHIVELOG mode. You have full database backup of 1 week/day old and don’t have backup of this (newly created) datafile. How do you restore/recover file?
create the datafile and recover that datafile.
SQL> alter database create datafile ‘…path..’ size n;
RMAN> recover datafile file_id;

19. What is obsolete backup & expired backup?
A status of "expired" means that the backup piece or backup set is not found in the backup destination.
A status of "obsolete" means the backup piece is still available, but it is no longer needed. The backup piece is no longer needed since RMAN has been configured to no longer need this piece after so many days have elapsed, or so many backups have been performed.

20. What is the difference between hot backup & RMAN backup?
For hot backup, we have to put database in begin backup mode, then take backup.
RMAN won’t put database in backup mode.


21. There was a media failure. How can you find which files you must recover?

By querying the V$RECOVER_FILE view, which lists all files that need media recovery.

22. How to check the syntax of RMAN commands?

Start the RMAN client with the operating system command-line argument checksyntax.

$ rman checksyntax

Recovery Manager: Release 11.2.0.4.0 – Production on Wed Feb 12 14:36:22 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

RMAN> connect target /

The command has no syntax errors

RMAN> backup database;

The command has no syntax errors

You can also use the checksyntax argument to check the syntax of RMAN commands that are part of a command file.

Example:

$ rman checksyntax @/tmp/rmancmdfile


23. Does using recovery catalog means RMAN won’t use the control file to store information?

No. Even when you choose to use a recovery catalog, backup information will continue to be stored in the control file as well by default.

24. What is the benefit of using Recovery Catalog?

– provides larger storage capacity, thus enabling access to a longer history of backups

– you can create and store RMAN scripts in the recovery catalog and Any client that can connect to the recovery catalog and a target database can use these stored scripts

– Can service many target databases

– you can use ‘KEEP FOREVER’ clause of RMAN backup command.

– Allows you to list the data files and tablespaces that are or  were in the target database at a given time

25. You want to move your recovery catalog from one database to another. How you can do it?

Moving Recovery catalog to another database is simple process

a) Create a new recovery catalog in the target database. You don’t need to register any database to it
b) Use the import catalog command in RMAN after connecting to the target database:

 $ rman

RMAN> connect catalog rman_new/rman@target_database

RMAN> import catalog rman_old/rman@source_database;

The import catalog command will import the source recovery catalog contents into the target recovery catalog.


26. What are the most important recovery catalog views?

Below are some of the frequently used views:

RC_STORED_SCRIPT: Information about RMAN scripts stored in the recovery catalog.
RC_UNUSABLE_BACKUPFILE_DETAILS: Lists the unusable backup files recorded in the recovery catalog.
RC_RMAN_STATUS: Similar to V$RMAN_STATUS view and shows the status of all RMAN operations. This view doesn’t contain information about any operations that are currently executing.
RC_RMAN_CONFIGURATION: Information about persistent configuration settings.
RC_DATAFILE: Shows all datafiles registered in the recovery catalog.
RC_DATABASE: Shows the databases registered in the recovery catalog.
RC_ARCHIVED_LOG: Provides historical information on both archived as well as unarchived redo logs.

27. How to check the version of your recovery catalog?

You can easily check the version of your recovery catalog by issuing the following command from SQL*Plus after logging in as the recovery catalog owner:

RMAN@rmandb > select * from rcver;

VERSION
————
11.02.00.04

28. What all files can NOT be backed up by RMAN?

1) Oracle home-related files
2) External files
3) Network configuration files
4) Password files

8)How many times does oracle ask before dropping a catalog?

The default is two times one for the actual command, the other for confirmation.                    
9) What are the various reports available with RMAN?

rman>list backup;
rman> list archive;

23) How to know Number of CPUs on Oracle  

Login as SYSDBA                                                                                                                                                        
SQL>show parameter cpu_count                                                                                                                                                        
NAME TYPE VALUE                                                                                                                                                              
cpu_count integer 2

27) What kind of information is stored in UNDO segments?  

Only before image of data is stored in the UNDO segments. If transaction is rolled back information from UNDO is applied to restore original datafile. UNDO is never multiplexed.

28. What is the snapshot controlfile?

29. What is diff bw image copy and backup set.

To put it simply, back up as copy makes a simple copy of database files(the same way Linux cp command does), whereas backup sets is a logical entity to backup pieces as a tablespace to data files. Backup pieces are in an RMAN specific binary format.

To give the opportunity to perform backup and recovery more effectively and efficiently. For example, you can simply switch to an image copy of a data file avoiding, possibly time consuming, restoration process. But you cannot perform incremental backups with image copies as you be able to do so with backup sets, etc.


You can make image copies only on disk but not on a tape device. "backup as copy database;
An RMAN image copy and a copy you make with an operating system copy command such as dd (which makes image copies) are identical.
Data blocks
Image copies: all data blocks
Backup sets: no empty data blocks are copied (saves space). Typically 20% of database space is empty data block.

Granularity
Image copies: only the file we need has to be copied
Backup sets: all backup set must be retrieved even though only one of them is needed


30. What is diff bw database control file and rman catlog?

If we plan on working with several databases, it may be a smart idea to use an RMAN catalog database.
Which is a separate oracle database dedicated to storing the recovery catalog.
Although the recovery catalog isn't mandatory.
It provides two important advantages over using the database controlfile to store the RMAN metadata relating to backup and recovery activity.
We can store vastly greater amounts of data in the recovery catalog as compared to a control file
and we can store RMAN scripts inside the recovery catalog.
By default, all RMAN related records in the target database's control file are overwritten after serven days,
But we can control the lenght of retention by setting a higher value for the initialization parameter
"CONTROL_FILE_RECORD_KEEP_TIME".

31. Why we have to create separate catalog databse to store RMAN metadata. however we have controlfiles to store the RMAN metadata.

If we lose all our database contolfile copies at once. We can, of course, rebuild the control file quickly using the output of a recent "ALTER DATABASE BACKUP CONTROLFILE TO TRACE;" command.

However, when we recreate the control file using the output of that command, the one thing we do not get back is all the RMAN metadata that used to be stored in the control file.

and, the fact that oracle may always overwrite even useful RMAN metadata in the controlfile. hence, oracle recomended recovery catalog.

32. Changing RMAN Backup location

CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u02/BackupArea/RMAN_df%t_s%s_s%p.bkp';

alter system set db_writer_processes=2 scope=spfile;

alter system set log_archive_dest='LOCATION=/u01/BackupArea/arch' scope=spfile;

ALTER SYSTEM SET log_archive_format='%t_amer_%s_%r.ARC' SCOPE=spfile;

*.log_archive_dest='/u01/BackupArea/arch/'
*.log_archive_format='%t_dbname_$s_%r.ARC'

No comments:

Post a Comment