martes, 18 de agosto de 2009

VISTAS CATALOGO RMAN

How does one create a RMAN recovery catalog?
Submitted by admin on Sun, 2005-10-16 03:36.
Start by creating a database schema (usually called rman). Assign an appropriate tablespace to it and grant it the recovery_catalog_owner role. Look at this example:
sqlplus sys

SQL> create user rman identified by rman;

CREATE SMALLFILE
TABLESPACE "TOOLS"
LOGGING
DATAFILE '/u03/app/oracle/oradata/cat11g/tools01.dbf' SIZE 100M
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO

SQL> alter user rman default tablespace tools temporary tablespace temp;

SQL> select username,default_tablespace from dba_users;

SQL> alter user rman quota unlimited on tools;
SQL> grant connect, resource, recovery_catalog_owner to rman;
SQL> exit;


rman catalog rman/rmanRMAN>
create catalog tablespace tools;
RMAN> exit;

/etc/hosts Agregar Servidor de Backups

172.28.250.207 dboraclenew



REGISTRAR UNA INSTANCIA EN EL CATALOGO DE RMAN


telbesg1() -TCPPGA- admin > rman target /

Recovery Manager: Release 10.2.0.3.0 - Production on Mar Ago 18 14:13:04 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: TCPPGA (DBID=3926676825)

RMAN> connect catalog rman/rman@cat10g;

connected to recovery catalog database

RMAN> register database;

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

VER INSTANCIAS REGISTRADAS EN EL CATALOGO DE RMAN

SQL> connect rman/password
Conectado.
SQL> select * from rc_database;

DB_KEY DBINC_KEY DBID NAME RESETLOGS_CHANGE# RESETLOG
---------- ---------- ---------- -------- ----------------- --------
1 2 3173394589 BDDWSGRD 526290 20/12/07
2969 2970 3814852239 LETODB 186029 03/03/07
45025 45026 217801452 IVDB 1 04/06/07
50801 50802 1638475926 VPDB 543066 20/10/08
52385 52386 262046602 IVDB 1 20/10/08
68203 68204 1927027167 CAREDM 1 14/11/08
73337 73338 3851637185 CAREOLTP 1 14/11/08
78542 78543 3392160091 SIRS 1 28/03/08

8 filas seleccionadas.

SQL> /

UNREGISTER DATABASE ORACLE 9I

SQL> select * from rc_database;

DB_KEY DBINC_KEY DBID NAME RESETLOGS_CHANGE# RESETLOGS
---------- ---------- ---------- -------- ----------------- ---------
1 2 2220393743 SERA 1 07-MAR-07
2276 2277 2222621424 SERA 1 02-APR-07
8209 8210 887613172 ORAC 1 17-APR-07
8438 8439 887777038 ORAC 1 19-APR-07
8616 8617 888297452 ORAC 1 25-APR-07
8845 8846 882104236 ORAC 1 15-FEB-07
9301 9302 2128016642 CAT9I 174968 05-JUN-07
44081 125951 4007731659 NETCOOL 9510756 07-SEP-07
135468 135469 895732053 ORAC 1 18-JUL-07

9 rows selected.

SQL> select db_key from db where db_id=4007731659;

DB_KEY
----------
44081

SQL> exec dbms_rcvcat.unregisterdatabase(44081,4007731659);


TABLAS DE CATALOGOS

TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
RC_BACKUP_CONTROLFILE VIEW
RC_BACKUP_CORRUPTION VIEW
RC_BACKUP_DATAFILE VIEW
RC_BACKUP_PIECE VIEW
RC_BACKUP_REDOLOG VIEW
RC_BACKUP_SET VIEW
RC_BACKUP_SPFILE VIEW
RC_CHECKPOINT VIEW
RC_CONTROLFILE_COPY VIEW
RC_COPY_CORRUPTION VIEW
RC_DATABASE VIEW

TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
RC_DATABASE_BLOCK_CORRUPTION VIEW
RC_DATABASE_INCARNATION VIEW
RC_DATAFILE VIEW
RC_DATAFILE_COPY VIEW
RC_LOG_HISTORY VIEW
RC_OFFLINE_RANGE VIEW
RC_PROXY_CONTROLFILE VIEW
RC_PROXY_DATAFILE VIEW
RC_REDO_LOG VIEW
RC_REDO_THREAD VIEW
RC_RESYNC VIEW

TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
RC_RMAN_CONFIGURATION VIEW
RC_STORED_SCRIPT VIEW
RC_STORED_SCRIPT_LINE VIEW
RC_TABLESPACE VIEW
RLH TABLE
RR TABLE
RT TABLE
SCR TABLE
SCRL TABLE
TS TABLE
TSATT TABLE

TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
XCF TABLE
XDF TABLE


UNREGISTER DATABASE

RMAN> CONNECT CATALOG rman@catdb

recovery catalog database Password: password
connected to recovery catalog database

RMAN> SET DBID 28014364;

executing command: SET DBID
database name is "PROD" and DBID is 28014364

RMAN> UNREGISTER DATABASE;

Do you really want to unregister the database (enter YES or NO)? YES
database unregistered from the recovery catalog


Unregister a Database From RMAN
First we start up RMAN with a connection to the catalog and the target, making a note of the DBID in the banner:

C:\>rman catalog=rman/rman@dba1 target=sys/password@w2k1

Recovery Manager: Release 9.2.0.1.0 - Production

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

connected to target database: W2K1 (DBID=1487421514)
connected to recovery catalog database

RMAN>Next we list and delete any backupsets recorded in the repository:

RMAN> LIST BACKUP SUMMARY;
RMAN> DELETE BACKUP DEVICE TYPE SBT;
RMAN> DELETE BACKUP DEVICE TYPE DISK;Next we connect to the RMAN catalog owner using SQL*Plus and issue the following statement:


SQL> CONNECT rman/rman@dba1
Connected.
SQL> SELECT db_key, db_id
2 FROM db
3 WHERE db_id = 1487421514;

DB_KEY DB_ID
---------- ----------
1 1487421514

1 row selected.

SQL>The resulting key and id can then be used to unregister the database:

SQL> EXECUTE dbms_rcvcat.unregisterdatabase(1, 1487421514);

PL/SQL procedure successfully completed.

SQL>