Oracle : configure the recovery catalog database

De Wiki de Romain RUDIGER
Aller à : navigation, rechercher

Notes for a quick test of rman.

Create an empty database

I consider that you already have the database software installed. If not, check this page Oracle : install database 11g for help.

[root@lab-oem ~]# xauth lis
lab-oem/unix:10  MIT-MAGIC-COOKIE-1  715e4d78a1b48038d1201b5308716c22
lab-oem/unix:11  MIT-MAGIC-COOKIE-1  4ccea64690518d50e529fb383f511d7c
[root@lab-oem ~]# su - oracle
[oracle@lab-oem ~]$ cd $ORACLE_HOME
[oracle@lab-oem ~]$ xauth add lab-oem/unix:11  MIT-MAGIC-COOKIE-1  4ccea64690518d50e529fb383f511d7c
[oracle@lab-oem ~]$ . oraenv
ORACLE_SID = [oracle] ? oemdb
The Oracle base for ORACLE_HOME=/OEMDB/oracle/product/11.2.0 is /OEMDB/oracle
[oracle@lab-oem ~]$ unset ORACLE_SID
[oracle@lab-oem ~]$ cd $ORACLE_HOME
[oracle@lab-oem 11.2.0]$ bin/dbca

Steps:

-Welcome: Next
-1: Create database
-2: General Purpose or Transaction processing
-3: Global database name: rmandb
    SID: rmandb
-4: Register or not this DB in EM and disable the Automatic Maintenance Tasks
-5: Set the password(s)
-6: Common location for all database files: /OEMDB/oradata
-7: configure or not a FRA
-8: no sample schema and no script
-9: >memory, set at least 303MB and enable Automatic Memory Management
    >character sets: AL32UTF8
-10: you can customize the storage here but for my test everythings in the same dir is fine.
-11: create the DB

Create the catalog owner

Create the user rman and his tablespace.

[oracle@lab-oem ~]$ sqlplus '/ as sysdba'

SQL> SELECT TABLESPACE_NAME, STATUS, CONTENTS, MAX_SIZE FROM  DBA_TABLESPACES;

TABLESPACE_NAME 	       STATUS	 CONTENTS    MAX_SIZE
------------------------------ --------- --------- ----------
SYSTEM			       ONLINE	 PERMANENT 2147483645
SYSAUX			       ONLINE	 PERMANENT 2147483645
UNDOTBS1		       ONLINE	 UNDO	   2147483645
TEMP			       ONLINE	 TEMPORARY 2147483645
USERS			       ONLINE	 PERMANENT 2147483645
SQL> CREATE TABLESPACE RMAN DATAFILE 'rman01.dbf' SIZE 300M AUTOEXTEND ON NEXT 50M MAXSIZE UNLIMITED;

Tablespace created.

SQL> SELECT TABLESPACE_NAME, STATUS, CONTENTS, MAX_SIZE FROM  DBA_TABLESPACES;

TABLESPACE_NAME 	       STATUS	 CONTENTS    MAX_SIZE
------------------------------ --------- --------- ----------
SYSTEM			       ONLINE	 PERMANENT 2147483645
SYSAUX			       ONLINE	 PERMANENT 2147483645
UNDOTBS1		       ONLINE	 UNDO	   2147483645
TEMP			       ONLINE	 TEMPORARY 2147483645
USERS			       ONLINE	 PERMANENT 2147483645
RMAN			       ONLINE	 PERMANENT 2147483645

SQL> CREATE USER rman IDENTIFIED BY rman DEFAULT TABLESPACE rman QUOTA UNLIMITED ON rman;

User created.

SQL> GRANT recovery_catalog_owner TO rman;

Grant succeeded.

Create the catalog and register the rmandb database in the catalog:

[oracle@lab-oem ~]$ rman

Recovery Manager: Release 11.2.0.3.0 - Production on Fri Feb 8 12:27:35 2013

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

RMAN> connect catalog rman@rmandb

recovery catalog database Password: 
connected to recovery catalog database

RMAN> create catalog;

recovery catalog created

RMAN> connect target /

connected to target database: RMANDB (DBID=3595053987)

RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

RMAN> exit