Skip to main content

Posts

Showing posts with the label RMAN DOCS

RMAN BACKUP SCRIPT

# set environment . $HOME/.bash_profile export ORACLE_SID=TWINTMP export ORAENV_ASK=NO . $ORACLE_HOME/bin/oraenv export USER=dbadmin export PASSWD=brownbag6 export RMAN_HOME=/backup/TWINTMP export RMAN_LIST_SFX=`date '+_%y%m%d_%H%M%S'`.log export BACKUP_DEST=/backup/TWINTMP ###################################################################### # Backup database to disk backup set (rman). ######################################################################  echo running rman TARGET $USER/$PASSWD LOG $RMAN_HOME/rman_data_bkup_$RMAN_LIST_SFX $ORACLE_HOME/bin/rman TARGET $USER/$PASSWD LOG $RMAN_HOME/rman_data_bkup_$RMAN_LIST_SFX  <<EOF show all; CONFIGURE CONTROLFILE AUTOBACKUP ON; CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT = '$RMAN_HOME/rman_bkup_TWINTMP%U' MAXPIECESIZE 2G; CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '$RMAN_HOME/rman_bkup_TWINTMP%F'; CONFIGURE SNAPSHOT CONTROLFILE NAME TO '$RMAN_HOME/snapcf_TWINTMP.f'; LIST BACKUP...

BLOCK TRACKING FEATURE IN RMAN

NOTE: Once enabled; this new 10g feature records the modified since last backup and stores the log of it in a block change tracking file. During backups RMAN uses the log file to identify the specific blocks that must be backed up. This improves RMAN's performance as it does not have to scan whole datafiles to detect changed blocks. Logging of changed blocks is performed by the CTWR process which is also responsible for writing data to the block change tracking file. When using Oracle block change tracking we see this procedure.  As data blocks change, the Change Tracking Writer (CTWR) background process tracks the changed blocks in a private area of memory. When a commit is issued against the data block, the block change tracking information is copied to a shared area in Large Pool called the CTWR buffer. During the checkpoint, the CTWR process writes the information from the CTWR RAM buffer to the change-tracking file. After enabling change tracking, the first level ...

RMAN - Setup of the Recovery Catalog:

RMAN - Setup of the Recovery Catalog: Setting up the recovery catalog RMAN is the first task the DBA completes when preparing to use RMAN. Lets look at the basic steps required to set up the recovery catalog. Creating The Recovery Catalog Creating the recovery catalog is not a terribly complicated process. It requires the DBA to set up a user in the database that will be used to store the recover catalog schema objects. Then the DBA needs to grant certain user rights to that userid, and then run a script to create the recovery catalog. The example below shows the creation of a user/schema in a database that will store the recovery catalog: CREATE USER MYRMAN IDENTIFIED BY MYRMAN DEFAULT TABLESPACE myrman_catalog_tbs TEMPORARY TABLESPACE temp QUOTA UNLIMITED ON myrman_catalog_tbs; Once the user has been created, follow these steps to complete the setup of the schema and to create the recovery catalog in that schema: GRANT the userid (in this example, myrm...

RMAN - Data Dictionary Views

RMAN - Data Dictionary Views Several views exist to assist the DBA in interacting with RMAN. The views from the target database include: View Description V$ARCHIVED_LOG Displays information about archived redo logs from the control file. V$BACKUP_CORRPUTION Displays information about corrupted blocks discovered during database backups with RMAN. V$BACKUP_DATAFILE Provides information from the control file about backup datafiles and control files. V$BACKUP_DEVICE Provides information about various devices available from various third-party manufacturers. V$BACKUP_PIECE Displays information about all backup sets from the control file. V$BACKUP_REDOLOG Displays information about backed up redo logs in backup sets. V$BACKUP_SET Displays information about all backup sets from the control file. V$DATAFILE Lists datafile information from the database. V$DATAFILE_HEADER Lists information about database datafile headers. Selected views that are available f...

Registering The Database to RMAN catalog database:

Registering The Database to RMAN catalog database: Need to start RMAN as follows: RMAN target=sys/password@database_to_backup rcvcat=sys/password@recovery_catalog_database Another variation on the command, if the recovery catalog and the database were on the same server, might be as shown: oraenv ORACLE_SID = [KKUY] ? KKUY RMAN rcvcat=sys/password@recovery_catalog_database RMAN> connect target Recovery Manager: Release 8.0.5.1.0 - Production RMAN-06005: connected to target database: KKUY RMAN-06008: connected to recovery catalog database Use the below command to register the database. RMAN>register database; Want to verify if a database is registered in the recovery catalog. To do this, connect to RMAN and issue the command LIST INCARNATION OF DATABASE. RMAN> list incarnation of database; RMAN-03022: compiling command: list RMAN-06240: List of Database Incarnations RMAN-06241: DB Key Inc Key DB Name DB ID      CUR Reset SCN ...

RMAN - Backup File Optimization

RMAN - Backup File Optimization Feature Overall backup times of a database can be reduced when you choose not to back up your read-only or offline tablespaces all the time. It used be quite tedious to track when these tablespaces were last backed up. With Oracle9i, RMAN offers the backup file optimization (BFO) feature. With BFO, if RMAN is about to back up a file, and the file has already been backed up by the same device type, RMAN will skip the backup of that file. This includes both data files and archived redo logs backed up by RMAN. Oracle determines if the file has changed by comparing the datafile to the header of the backed up datafile. If they match, the file is not backed up. Before RMAN decides to skip a given datafile, it will determine if the datafile backup that is available meets the established retention policy. If the latest backup violates the retention policy, then RMAN will back up the datafile anyway. There may be cases when you want to back up all tabl...

RMAN RETENTION POLICIES - REDUNDANCY AND RECOVERY WINDOW

RECOVER WINDOW AND REDUNDANCY The redundancy retention policy defines a fixed number of backups that need to be retained by RMAN. If there are a number of backups later than the number defined by the retention policy, then those backups can be deleted using the DELETE OBSOLETE command, which we will discuss in the next section. To set a redundancy retention policy, use the configure retention policy command, as shown here: RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 7; RMAN> show all; RMAN configuration parameters are: RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 1; - NOTE: Here it will keep only 1 backup copy. Rest all previous backups marked as OBSOLETE RMAN> REPORT OBSOLETE; RMAN retention policy will be applied to the command RMAN retention policy is set to redundancy 1 Report of obsolete backups and copies Type                 Key    C...

BACKUP & RECOVERY CONCEPTS RMAN

RMAN: Recovery Manager (RMAN) is an Oracle utility that can back up, restore, and recover database files. The product is a feature of the Oracle database server and does not require separate installation. Recovery Manager is a client/server application that uses database server sessions to perform backup and recovery. RMAN must include the following components: A TARGET DATABASE: An Oracle database, To which RMAN is connected with the TARGET keyword.  A target database is a database on which RMAN is performing backup and recovery operations. RMAN always maintains metadata about its operations on a database in the control file of the database. The RMAN metadata is known as the RMAN repository. RMAN CLIENT: The RMAN executable is automatically installed with the database and is typically located in the same directory as the other database executables. For example, the RMAN client on Linux is located in $ORACLE_HOME/bin. Some environments use the following...

RMAN - DATABASE RESTORE USING RMAN COLD BACKUP

NOTE: Here I'm doing backup & restore for the database name => ORCL RMAN COLD BACKUP : We can only take. When the database is in MOUNT state. And the database is in noarchivelog mode. RMAN HOT BACKUP : We can only take if database running in archivelog mode. Here we can take the backup in 'OPEN' state. No need to mount the database. Please see below steps: SQL> select name from v$database; NAME --------- ORCL SQL> select open_mode from v$database;  OPEN_MODE ------------ READ_WRITE SQL> archive log list; Database log mode              No Archive Mode Automatic archival             Disabled Archive destination            USE_DB_RECOVERY_FILE_DEST Oldest online log sequence     14 Current log sequence           14 SQL> exit Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Productio...