Rman catalog 的创建和使用

Rman catalog 的创建和使用

 

1.SQL>create tablespace tbs_rman datafile '/u01/app/oracle/oradata/catadb/tbs_rman01.dbf'--创建rman恢复目录表空间

   size 200m autoextend on; 

 

SQL>create user rman identified by rman --创建rman schema

  temporary tablespace temp

  default tablespace tbs_rman

  quota unlimited on tbs_rman;

 

SQL>grant recovery_catalog_owner to rman; --角色授予

 

SQL> conn rman/rman

 

SQL>select*from session_privs;

 

PRIVILEGE

----------------------------------------

CREATE SESSION

ALTER SESSION

CREATETABLE

CREATE CLUSTER

CREATESYNONYM

CREATEVIEW

CREATE SEQUENCE

CREATEDATABASE LINK

CREATEPROCEDURE

CREATETRIGGER

CREATETYPE

SQL>select*from session_roles;

 

ROLE

------------------------------

RECOVERY_CATALOG_OWNER 

 

RMAN> connect catalog rman/rman@catadb --连接到恢复目录

 

connected to recovery catalogdatabase

 

RMAN>createcatalog tablespace tbs_rman; --创建恢复目录

 

recovery catalog created

 

[oracle@oradb ~]$ rman target sys/redhat@orcl catalog rman/rman@catadb --连接到目标数据库及恢复目录

 

connected to target database: ORCL (DBID=1260850162)

connected to recovery catalogdatabase

 

RMAN> register database; --将目标数据库注册到恢复目录

 

database registered in recovery catalog

starting full resync of recovery catalog

full resync complete

 

注册target database
[oracle@solaris ~]rman target / catalog rman/rman
Recovery Manager: Release 10.2.0.1.0 - Production on Thu Apr 22 09:50:22 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: SOLDB (DBID=2280298562)
connected to recovery catalog database

RMAN> report schema; 
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of report command at 04/22/2010 09:53:45
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog

RMAN> register database; 
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

RMAN> report schema;

Report of database schema
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 510 SYSTEM YES +DG1/soldb/datafile/system.256.714867285
2 90 UNDOTBS1 YES +DG1/soldb/datafile/undotbs1.258.714867293
3 350 SYSAUX NO +DG1/soldb/datafile/sysaux.257.714867287
4 5 USERS NO +DG1/soldb/datafile/users.259.714867295
5 20 SALESTS NO +DG1/soldb/datafile/usales.1
6 40 CRMTS NO +DG1/soldb/datafile/crm.1
7 10 RMANTS NO +DG1/soldb/datafile/rmants.1

你可能感兴趣的:(职场,rman,catalog,休闲,创建和使用)