everythingOracle.bizhat.com

 

'Everything you wanted
to know about Oracle'

Training References Syntax Tell A Friend Contact Us

 

 

DBA Fundamentals

01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
<< Previous

Chapter # 42

Next >>


 

Use of the RMAN commands

 

Introduction

You, as a DBA, are responsible for registering a database, synchronizing a database, and backing-up a database. Your job�s responsibilities dictate that you should at least be informed of the following basic fundamental subjects:

 

Connecting to the RMAN tool

Using the source and the target database commands

Registering a database

Synchronizing a catalog

Creating a snapshot of a controlfile

Backing up a database

Backing up a datafile

Backing up the current controlfile

Commands:

DOS> CATALOG TARGET

RMAN> register database;

RMAN> resync catalog;

RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO

RMAN> BACKUP DATAFILE

RMAN> BACKUP CURRENT CONTROLFILE;

RMAN> exit;

 

Hands-on
In this exercise you will learn how to connect to the RMAN utility tool using the source and the target database commands. We will also learn how to register a database, resync a catalog, create a snapshot of a controlfile, backup a database, backup a datafile, and backup the current controlfile.

Now, begin by connect to the SCHOOL database as the SYSTEM/MANAGER user.
SQL> CONNECT system/manager@yourhost AS SYSDBA

Query the DBA_DATA_FILES dictionary view.
SQL> SELECT file_id, tablespace_name, bytes
FROM dba_data_files
/
Note the TOOLS tablespace's file id. You will use it on our following steps.
 

Connect to RMAN
Go back to RMAN and connect to the SCHOOL database as target database and the RMAN database as a repository.
DOS> rman CATALOG rman/password@dbs4rman

TARGET system/manager@yourhost
 

Register a Database

Then register the SCHOOL database.
rman> REGISTER DATABASE;
 

Resyncing a Database Controlfile
Now, resync the recovery catalog with the database control file.
rman> RESYNC CATALOG;
 

Backup a Controlfile
Issue a command to create a snapshot of the control file.
rman> CONFIGURE SNAPSHOT CONTROLFILE NAME TO -

'c:.snp';
 


Backup a Datafile

Backup the TOOLS datafile that you took a note about it. We will use the datafile number 7.
rman> BACKUP DATAFILE 7;
 


Backup the current controlfile

Use the pre-allocated channel to backup the current control file.
rman> BACKUP CURRENT CONTROLFILE;
 


Exit RMAN

Notice that the default backup destination is %ORACLE_HOEM%. Exit the Recovery Manager.
rman> EXIT;
 

Questions:

Q: How do you register a database to a RMAN utility?

Q: How do you synchronize a catalog?

Q: How do you backup a datafile of a database using RMAN?

Q: How do you backup a controlfile using RMAN?

Q: What do the following SQL and RMAN commands do?

SQL> SELECT file_id, tablespace_name, bytes
FROM dba_data_files
/
 

DOS> rman CATALOG rman/password@dbs4rman

TARGET system/manager@yourhost
 

rman> REGISTER DATABASE;
 

rman> RESYNC CATALOG;
 

rman> CONFIGURE SNAPSHOT CONTROLFILE NAME TO -

'c:.snp';

rman> BACKUP DATAFILE 7;

rman> BACKUP CURRENT CONTROLFILE;

rman> EXIT;

     Reviews and Templates for FrontPage
     

Copyright � everythingOracle.bizhat.com 2006 All Rights Reserved.