linux_db:10.2.0.4
1)linux_db创建catalog用户
sqlplus /nolog << EOF
conn system/oracle@linux_db
create user RMAN identified by RMAN default tablespace users temporary tablespace TEMP;
grant connect,resource,recovery_catalog_owner to RMAN;
EOF
2)linux_db创建catalog
rman
connect catalog rman/rman@linux_db
create catalog;
3)wind_db注册到catalog库
C:\>rman target system/oracle@win_db catalog rman/rman@linux_db
Recovery Manager: Release 10.2.0.1.0 - Production on Tue Nov 23 12:45:43 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: TEST01 (DBID=3524386065)
connected to recovery catalog database
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
4)备份win_db
rman target system/oracle@win_db catalog rman/rman@linux_db
run
{
# Backup Database full
allocate channel ch1 type disk;
allocate channel ch2 type disk;
resync catalog;
set command id to 'bkrs';
set limit channel ch1 kbytes 2000000;
set limit channel ch2 kbytes 2000000;
BACKUP
SKIP INACCESSIBLE
TAG hot_db_bk_level
FILESPERSET 5
FORMAT 'C:\bak\bk_s%s_p%p_t%T'
DATABASE
INCLUDE CURRENT CONTROLFILE;
RELEASE CHANNEL ch1;
RELEASE CHANNEL ch2;
# Backup Archived Logs
sql 'alter system archive log current';
change archivelog all crosscheck;
ALLOCATE CHANNEL ch1 type disk;
ALLOCATE CHANNEL ch2 type disk;
set command id to 'bkrs';
set limit channel ch1 kbytes 2000000;
set limit channel ch2 kbytes 2000000;
BACKUP
filesperset 5
FORMAT 'C:\bak\ar_s%s_p%p_t%T'
ARCHIVELOG ALL DELETE ALL INPUT;
RELEASE CHANNEL ch1;
RELEASE CHANNEL ch2;
# Control file backup
ALLOCATE CHANNEL ch1 type disk;
BACKUP
FORMAT 'C:\bak\cf_s%s_p%p_t%T'
CURRENT CONTROLFILE;
RELEASE CHANNEL ch1;
# spfile backup
ALLOCATE CHANNEL ch1 type disk;
backup spfile format='C:\bak\spfile_s%s_p%p_t%T';
RELEASE CHANNEL ch1;
}
crosscheck backup;
delete noprompt expired backup;
report obsolete;
delete noprompt obsolete recovery window of 5 days;
list backup summary;
5)还原win_db
rman target system/oracle@win_db catalog rman/rman@linux_db
list incarnation;
startup nomount
restore controlfile;
alter database mount;
restore database;
alter database open resetlogs;
6)注销/删除catalog
rman target system/oracle@win_db catalog rman/rman@linux_db
unregister database;
rman
connect catalog rman/rman@linux_db
drop catalog;
阅读(1289) | 评论(0) | 转发(0) |