RMAN备份步骤

RMAN备份与恢复(WINDOW)

1、 RMAN库作为恢复目录库

set echo on
spool makedb1.log
create database rman
datafile 'd:oracleoradatarman_datasystem.dbf' size 50m autoextend on next 640K
logfile ' d:oracleoradatarman_dataredo0101.log' SIZE 10M,
' d:oracleoradatarman_data/redo0201.log' SIZE 10M
maxdatafiles 30
maxinstances 8
maxlogfiles 64
character set US7ASCII
national character set US7ASCII;

可以采用DBCA进行建RMAN

2、 建立RMAN表空间和RMAN用户

Conn / as sysdba

--创建表空间RMAN

CREATE TABLESPACE rman DATAFILE ‘E:oracleproduct10.2.0oradatarmanrman01.dbf’ SIZE 20m

DEFAULT STORAGE(INITIAL 100k NEXT 100k PCTINCREASE 0);

--创建用户RMAN

CREATE USER rman IDENTIFIED BY rman TEMPORARY TABLESPACE TEMP

DEFAULT TABLESPACE RMAN QUATO UNLIMITED ON RMAN ;

--RECOVERY_CATALOG_OWNERconnectresouce权限

GRANT RECOVERY_CATALOG_OWNER TO RMAN ;

GRANT CONNECT,RESOURCE TO RMAN ;

3、 注册目标数据库

D:>RMAN CATALOG rman/rman@rman msglog=rman.log

RMAN>CREATE CATALOG

RMAN>EXIT

D:>RMAN TARGET SYS/ADMIN@ORCL

RMAN>CONNECT CATALOG RMAN/RMAN@RMAN

RMAN>REGISTER DATABASE ;

RMAN>EXIT ;

4、 开始备份

l 全备

D:> RMAN RCVCAT rman/rman@rman TARGET sys/admin@orcl cmdfile 'E:RmanBackupfullback.rcv'

fullback.rcv全备脚本:

run{ allocate channel c1 type disk; backup full tag 'Full' filesperset 5 format 'D:backup%d_Full_%T_%u_%p_%c' database include current controlfile; sql 'alter system archive log current'; backup archivelog all filesperset 5 format 'D:backup%d_Log_%T_%u_%p_%c'; sql 'alter system archive log current'; release channel c1;}

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8354403/viewspace-1021952/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/8354403/viewspace-1021952/

你可能感兴趣的:(RMAN备份步骤)