Thread: How to use RMAN to backup a database


Permlink Replies: 3 - Pages: 1 - Last Post: Feb 2, 2006 7:52 PM Last Post By: Ravi Prakash
helenminzhou@ho...

Posts: 59
Registered: 10/01/02
How to use RMAN to backup a database
Posted: Jan 31, 2006 4:45 PM
Click to report abuse...   Click to reply to this thread Reply
Hi

please show me detailed syntax how to use RMAN to backup a database in one laptop to another laptop. Many thanks, Helen
Sayan Sarkar

Posts: 103
Registered: 08/28/01
Re: How to use RMAN to backup a database
Posted: Jan 31, 2006 10:01 PM   in response to: helenminzhou@ho... in response to: helenminzhou@ho...
Click to report abuse...   Click to reply to this thread Reply
Sudhanshu

Posts: 238
Registered: 12/29/01
Re: How to use RMAN to backup a database
Posted: Feb 1, 2006 4:06 PM   in response to: helenminzhou@ho... in response to: helenminzhou@ho...
Click to report abuse...   Click to reply to this thread Reply
Hello,

First thing RMAN is a tool that can be configured to take backups of Oracle DB on "Disk" and on "Tape". If you want to take backup of Oracle DB from one-laptop (primary) to another (backup), then you would need to present the disk from backup laptop to primary laptop, which can be done by maping the drives

There are difference kind of backups that can be configured using RMAN. Syntax for taking backups would depend on what you want to backup, how you want to backup and how frequently you want that to be done

In most simple scenerio, I "assume" you would want to do ONLINE-CUMULATIVE-BACKUP, for which I havve given the script below. This is simply for your understanding purpose. I would also recommend you go though the RMAN documents and read more stuff on how RMAN environment is setup and how different type of backups can be taken using RMAN

-- Syntax as requested

-- E: is the mapped drive from Backup Laptop

RUN
{
ALLOCATE CHANNEL ch1 DEVICE TYPE DISK;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'e:/backup/%F.bck';
BACKUP INCREMENTAL LEVEL = 0 CUMULATIVE database
FORMAT 'e:/backup/%U';
BACKUP DATABASE TAG = 'weekly_backup';
}

RUN
{
ALLOCATE CHANNEL ch1 DEVICE TYPE DISK;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'e:/backup/%F.bck';
BACKUP INCREMENTAL LEVEL = 1 CUMULATIVE database
FORMAT 'e:/backup/%U';
BACKUP DATABASE TAG = 'mon_tue_wed_backup';
}

RUN
{
ALLOCATE CHANNEL ch1 DEVICE TYPE DISK;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'e:/backup/%F.bck';
BACKUP INCREMENTAL LEVEL = 2 CUMULATIVE database
FORMAT 'e:/backup/%U';
BACKUP DATABASE TAG = 'thu_fri_sat_backup';
}

Cheers
Sudhanshu

Ravi Prakash

Posts: 316
Registered: 01/03/06
Re: How to use RMAN to backup a database
Posted: Feb 2, 2006 7:52 PM   in response to: helenminzhou@ho... in response to: helenminzhou@ho...
Click to report abuse...   Click to reply to this thread Reply
/* Steps For Configuring Recovery Catalog */

Step 1 :
Create A Seperate Database Or Tablespace For Storing RMAN Catalog.
In This Case We Are Storing The Recovery Catalog In The Same Database.

SQL> Create Tablespace Rman_Tablespace Datafile
2 'C:\Sql\Junept\Datafile\Rman01.dbf' Size 20m Autoextend On Next 1m;

Tablespace created.

Step 2 :
Create A Rman Repository Schema.

SQL> Create User Rman_User Identified By Rman Default Tablespace Rman_Tablespace
2 Temporary Tablespace Temp Quota Unlimited On Rman_Tablespace;

User created.

Step 3 :
Grant Privileges To The Rman User Setting The Default Tablespace To The One Create In Step 1

SQL> Grant Connect,Resource To Rman_User;

Grant succeeded.

SQL> Grant Recovery_Catalog_Owner To Rman_User;

Grant succeeded.

Step 4 :
Create The Catalog Using RMAN
Invoke Rman Utility As Below :

$ORACLE_HOME\Bin> RMAN Catalog Rman_User/Rman@Service
Recovery Manager: Release 9.2.0.1.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.

connected to recovery catalog database
recovery catalog is not installed

RMAN>

Now At The Rman Prompt Create The Catalog Into Tablespace Created In Step 1

RMAN> Create Catalog Tablespace Rman_Tablespace;

recovery catalog created

Note : The Execution Of The Above Command Will Create Several Base Tables, View, Synonyms ,
Packages, Etc .

RMAN> Exit

Step 5 :
Now Register Your Database Into The Recovery Catalog.

RMAN_USER SQL> Select * From DB_Database;

no rows selected

The Above Statement Proves That Your Database Is Not Yet Registered Into The Recovery Catalog.

C:\>Rman Target /

Recovery Manager: Release 9.2.0.1.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.

connected to target database: JUNEPT (DBID=1185895820)

RMAN> Connect Catalog Rman_User/Rman@Service

connected to recovery catalog database

RMAN> Register Database;

database registered in recovery catalog (A)
starting full resync of recovery catalog
full resync complete

Note : The Above Command Updates All The Base Tables For Storing The Database Information Which Is Resistered.

To Prove The Above Said Issue The Following Commands :

RMAN_User SQL> Select Name From Rc_Database;
RMAN_User SQL> Select Tablespace_Name,Name From Rc_Datafile;
RMAN_User SQL> Select Name From Rc_Redo_Log;

/* The Configuration Of Recovery Catalog Is Completed. */

Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums