天天看點

RMAN備份 CATALOG

 在存儲恢複目錄的資料庫建立表空間用于存儲恢複目錄schema及恢複目錄資料(本文使用已經建立好的資料庫catadb來存儲恢複目錄)

SQL> create tablespace tbs_rman datafile '/s01/orabase/oradata/CWEOLQ/tbs_rman01.dbf' size 200m autoextend on;

Tablespace created.

SQL> create user rman identified by rman temporary tablespace temp default tablespace tbs_rman quota unlimited on tbs_rman;--建立rman schema

SQL> grant recovery_catalog_owner to rman;

Grant succeeded.

SQL> conn rman/rman

Connected.

SQL>  select * from session_privs;

PRIVILEGE

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

CREATE SESSION

ALTER SESSION

CREATE TABLE

CREATE CLUSTER

CREATE SYNONYM

CREATE VIEW

CREATE SEQUENCE

CREATE DATABASE LINK

CREATE PROCEDURE

CREATE TRIGGER

CREATE TYPE

11 rows selected.

SQL> select * from session_roles;

ROLE

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

RECOVERY_CATALOG_OWNER

進入要備份的資料庫:

RMAN> connect catalog rman/rman@CWEOLQ;

connected to recovery catalog database

RMAN> create catalog tablespace tbs_rman;

recovery catalog created

[oracle@cwogg admin]$ rman target sys/123123@PHUB catalog rman/rman@CWEOLQ --連接配接目标庫和恢複目錄資料庫

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Sep 24 10:25:47 2015

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

connected to target database: PHUB (DBID=536511065)

RMAN> register database; --将目标庫注冊到恢複目錄

database registered in recovery catalog

starting full resync of recovery catalog

full resync complete

全備資料庫:

run{

allocate channel ch1 device type disk;

backup as compressed backupset

database plus archivelog delete input

format='+DATA/backup/full_%d_%U'

tag='full_bak';

7> release channel ch1;}

released channel: ORA_DISK_1

released channel: ORA_DISK_2

allocated channel: ch1

channel ch1: SID=68 device type=DISK,,,,

處理另外一個需要備份的資料庫:

[oracle@rac1 admin]$ rman target sys/oracle@COWELLORC catalog rman/rman@CWEOLQ

Recovery Manager: Release 11.2.0.3.0 - Production on Thu Sep 24 11:15:50 2015

connected to target database: COWELLOR (DBID=335454682)

RMAN> register database;

下一篇: RMAN簡單備份