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 # 41

Next >>


 

RMAN-Managed user and repository

 

Introduction

You, as a DBA, are responsible to create the RMAN repository and use the RMAN tool to perform a backup and recovery of your organization�s database. Your job�s responsibilities dictate that you should at least be informed of the following basic fundamental subjects:

 

Creating the RMAN user

Generating the RMAN objects

Creating the Recovery Manager Repository

Creating the RMAN tablespace

Granting privileges to the RMAN user

Granting the RECOVERY_CATALOG_OWNER to the RMAN user

Using the RMAN RCVCAT command

Using the DBA_OBJECTS dictionary view

Using the DBMS_RCVCAT package

Using the DBMS_RCVMAN package

Commands:

CREATE TABLESPACE

CREATE USER

GRANT

DOS> rman RCVCAT

RMAN> CREATE CATALOG;

RMAN> exit;

 

Hands-on

In this exercise you will learn how to create the RMAN user with all of its objects. You will also learn how to create the Recover Manager Repository.

Now, connect to SQLPlus as the SYSTEM/MANAGER user.
SQL> CONNECT system/manager@dbs4rman AS SYSDBA
 

Check RMAN user
Query all of the users in the DBS4RMAN database to verify whether or not the RMAN user exists.
SQL> SELECT username
FROM dba_users
WHERE username like 'R%'
/
You should not get any RMAN user.
 


Create RMAN tablespace

Create a tablespace and name it RMAN_TABLESPACE with a size of 50 Megabytes with the AUTOEXTEND option.
SQL> CREATE TABLESPACE rman_tablespace
DATAFILE 'c:/newfolder/rman_tablespace_01.dbf' SIZE 50M
AUTOEXTEND ON
/
 

Create RMAN user
Now, create the RMAN user with it's password, PASSWORD, and its default RMAN_TABLESPACE with unlimited quota space allocation. Then grant the CONNECT, RECOVERY_CATALOG_OWNER, and SYSDBA privileges to the RMAN user.
SQL> CREATE USER rman IDENTIFIED BY password
DEFAULT TABLESPACE rman_tablespace
QUOTA UNLIMITED ON rman_tablespace
/
 

Grant Roles to RMAN

SQL> GRANT CONNECT, RECOVERY_CATALOG_OWNER, SYSDBA

TO rman
/
 


Login to RMAN

Now, go to DOS (or any operating system such as LINUX or UNIX) and run rman, and then connect to rman as the rman user
DOS> rman RCVCAT rman/password@dbs4rman

 


Create RMAN Catalog

Once there, create the Recovery Catalog Repository.
rman> CREATE CATALOG;

Exit from the Recovery Manager.
rman> exit;
 

Check RMAN packages
Check all off the packages that were created by the CREATE CATALOG command.
SQL> SELECT object_name FROM dba_objects
WHERE owner = 'RMAN'
and object_type = 'PACKAGE'
/
Now, you are ready to use Recovery Manager (RMAN). Note that the DBMS_RCVCAT package is responsible for maintaining information in the recovery catalog. The DBMS_RCVMAN package is used for querying the recovery catalog or the control file.
 

Questions:

Q: How do you create the RMAN repository?

Q: How do you create the RMAN user?

Q: How do you create the RMAN objects?

Q: How do you create the RMAN tablespace?

Q: What does the RMAN RCVCAT command?

Q: What does the DBMS_RCVCAT package?

Q: What does the DBMS_RCVMAN package?

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

SQL> CREATE TABLESPACE rman_tablespace
DATAFILE 'c:/newfolder/rman_tablespace_01.dbf' SIZE 50M
AUTOEXTEND ON
/
 

SQL> CREATE USER rman IDENTIFIED BY password
DEFAULT TABLESPACE rman_tablespace
QUOTA UNLIMITED ON rman_tablespace
/
 

SQL> GRANT CONNECT, RECOVERY_CATALOG_OWNER, SYSDBA

TO rman
/

DOS> rman RCVCAT rman/password@dbs4rman


rman> CREATE CATALOG;

SQL> SELECT object_name FROM dba_objects
WHERE owner = 'RMAN'
and object_type = 'PACKAGE'
/

     Reviews and Templates for FrontPage
     

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