iSelfSchooling.com  Since 1999     References  |  Search more  | Oracle Syntax  | Free Online Oracle Problem Solver

    .Home      .Subscribe     .Login      .Start Learning      .Certification      .Cancel      .Password Reminder      .Password Change     .Sign out

 

. Online Accounting        .Copyright & User Agreement   |
    .Vision      .Biography     .Acknowledgement

.Contact Us      .Comments/Suggestions       .Email2aFriend    |

 

Online Oracle Training for beginners and advanced - The most comprehensive Oracle tutorial

The authors do not guarantee or take any responsibility for the accuracy, or completeness of the information.

DBAs - Fundamentals II

 

Lesson 01 | Lesson 02 | Lesson 03 | Lesson 04 | Lesson 05 | Lesson 06 | Lesson 07 | Lesson 08 | Lesson 09 | Lesson 10 | Lesson 11 | Lesson 12 | Lesson 13 | Lesson 14 | Lesson 15 | Lesson 16 | Lesson 17 | Lesson 18 | Lesson 19 | Lesson 20 | Lesson 21 | Lesson 22 | Lesson 23 | Lesson 24 | Lesson 25 | Lesson 26 | Lesson 27 | Lesson 28 | Lesson 29 |

 

Lesson 15

“Better to remain silent and be thought a fool than to speak out and remove all doubt.” Abraham Lincoln

 

Read first then play the video:

   DBA-VIDEO -Use of the RMAN commands

   

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@school 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@school


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:\your-location\file-name.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;

 

“Imagination is more important than knowledge...” Albert Einstein

 

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  TARGET system/manager@school

rman> REGISTER DATABASE;

rman> RESYNC CATALOG;

rman> CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'c:\your-location\file-name.snp';
rman> BACKUP DATAFILE 7;
rman> BACKUP CURRENT CONTROLFILE;
rman> EXIT;