Professional Documents
Culture Documents
The catalog database is usually a small database it contains and maintains the
metadata of all rman backups performed using the catalog.
create the rman user that will be the owner of the rman catalog, on the catalog
database.
$ rman
Recovery Manager: Release 10.2.0.4.0 - Production on Tue Sep 8 11:16:57 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Step 7: Verify-Registration
Once a databases is registered with rman, we can get information about it from the
catalog.
In this case we execute the report schema command to get information.
===================================================================================
=================================================================================
Manual-backup-registration
Manual backups, made using Rman without a recovery catalog or user scripts, can be
cataloged and made available to the rman catalog.
Create-scripts
Rman tasks can be run using scripts, that can be stored on the rman catalog. Global
scripts will be available to all databases, non-global scripts will be available
only to the target database. This example shows how to create a global script.
{
BACKUP DATABASE PLUS ARCHIVELOG DELETE INPUT;
DELETE NOPROMPT OBSOLETE;
}
Make sure RMAN is connected to the right target database and the recovery
catalog.
Then run the CREATE SCRIPT command, as shown in this example:
Examine the output. If no errors are displayed, then the script was
successfully created and stored in the recovery catalog.
For a global script, the syntax is similar:
Export-Catalog
The database holding the rman catalog should be protected against information loss,
the minimum level of protection can be implemented by executing a full export of
the catalog schema.
In case of catalog loss an import of the schema on a new or existing database will
make the catalog available again.
Query-catalog
sqlplus "rman/rman@catdb
Get-catalog-version
sqlplus "rman/rman@catdb
Upgrade-catalog
How to upgrade the catalog to the last version, the upgrade command needs to be
entered twice to get it executed.
Unregister-database
Note that rman metadata is always stored also on the controlfile, if a database is
unregistered from the catalog, it can be afterwards registered again and all
backups contained
in the controlfile will be cataloged
Drop-catalog
An rman catalog can be removed with the drop catalog command. If executed from a
script the command needs to be entered twice to get it run.
=========================
BACKUP PRACTICAL
=========================
backup database;
backup datafile 5;
backup datafile 3;
backup datafile 2;
backup datafile 1;
backup database plus archivelog;
backup archivelog all;
===================================================================================
======================
export ORACLE_SID=db1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
$ORACLE_HOME/bin/rman target sys@db1/shad catalog rman@orcl/rman <<EOF
run
{
sql 'alter system archive log current';
backup database include current controlfile plus archivelog;
crosscheck backupset;
crosscheck archivelog all;
delete noprompt expired backup;
delete noprompt expired archivelog all;
}
EOF
==================================================================
#!/bin/bash
export ORACLE_SID=db1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
rman target sys/shad@db1 catalog rman/rman@orcl <<EOF
run
{
sql 'alter system archive log current';
backup database include current controlfile plus archivelog;
crosscheck backupset;
crosscheck archivelog all;
delete noprompt expired backup;
delete noprompt expired archivelog all;
}
======================================================================
Hot_full_rman_bkp_scirpt
Database Version : 10.1.0.2.0
OS platform : Window XP sp2
--------------------------------
Archive log >>> Enabled
Hot Backup
--------------------------------
My backup procedure.
Fri Sat Sun Mon Tue Wed Thur Fri
Incremental Level 0 - - - - - - 0
Incremental Level - 1 1 - 1 1 1 1
Inc_level_cumulative - - - 1 - - - -
---------------------------------------------------------------------
Incremental Level 0 Script
RUN
{
DELETE NOPROMPT OBSOLETE;
CROSSCHECK BACKUP;
CROSSCHECK ARCHIVELOG ALL;
DELETE NOPROMPT EXPIRED BACKUP;
DELETE NOPROMPT EXPIRED ARCHIVELOG ALL;
ALLOCATE CHANNEL C1 DEVICE TYPE DISK MAXPIECESIZE 100M;
ALLOCATE CHANNEL C2 DEVICE TYPE DISK MAXPIECESIZE 100M;
ALLOCATE CHANNEL C3 DEVICE TYPE DISK MAXPIECESIZE 100M;
BACKUP INCREMENTAL LEVEL 0 DATABASE TAG WEEKLY_THURSDAY_0_HOTORCL3_BKP;
SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP DATABASE ARCHIVELOG ALL DELETE ALL INPUT TAG WEEKLY_THURSDAY_0_HOTORCL3_BKP;
BACKUP VALIDATE DATABASE;
}
-------------------------------------------------
Incremental Level 1 Script
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CHANNEL DEVICE TYPE disk RATE 2M;
RUN
{
ALLOCATE CHANNEL C1 DEVICE TYPE DISK MAXPIECESIZE 100M;
ALLOCATE CHANNEL C2 DEVICE TYPE DISK MAXPIECESIZE 100M;
ALLOCATE CHANNEL C3 DEVICE TYPE DISK MAXPIECESIZE 100M;
BACKUP INCREMENTAL LEVEL 1 DATABASE TAG INCR_LvL_1_HotORCL3_BKP;
SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP DATABASE ARCHIVELOG ALL TAG INCR_LvL_1_HOTOTCL3_BKP;
}
-----------------------------------------------------------------
Incremental_cumulative_level_1 script
RUN
{
ALLOCATE CHANNEL C1 DEVICE TYPE DISK MAXPIECESIZE 100M;
ALLOCATE CHANNEL C2 DEVICE TYPE DISK MAXPIECESIZE 100M;
ALLOCATE CHANNEL C3 DEVICE TYPE DISK MAXPIECESIZE 100M;
BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE TAG INCR_LVL_1_CUM_HOTORCL3_BKP;
SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP DATABASE ARCHIVELOG ALL TAG INCR_LVL_1_CUM_HOTORCL3_BKP;
}
---------------------------------------------------------
Above backup procedure i scheduled every day 11.00 pm according backup procedure.
for that create one windows NT COMMAND script.
My command script file is.
backup.cmdbelow is contents.
c:\oracle\product\10.1.0\db_1\bin\RMAN TARGET /@db02 CATALOG rman/cat@catdb
CMDFILE=d:\bkp_scripts\db02\backup.rcv LOG=d:\bkp_scripts\db02\backup.log
WEEKLY :
Code: [Select all] [Show/ hide]
#*** Weekly RMAN Script weekly_full.rman
CONNECT TARGET /
EXIT;
EXIT;
EXIT;
EXIT;
====================================