异地迁移Rman脚本

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:212

]主库备份:
]run
{
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
backup full tag 'dbfull' format '备份地址‘
include current controlfile;
sql 'alter system archive log current';
release channel c1;
release channel c2;
release channel c3;
}
ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK;
CROSSCHECK BACKUPSET;
DELETE NOPROMPT OBSOLETE;

导地恢复:
rman target /

RMSN>]set dbid xx; (select dbid from v$database)

RMAN> startup nomount pfile='xx';

RMAN> restore controlfile from 'xx';(最小的备份集)

RMAN> alter database mount;

RMAN> catalog start with 'xx';

RMAN> restore database;
这一步完成之后就停止旧库的监听器

]RMAN>recover database until sequence 8503;(alter system archive log current +1)

RMAN>alter database open resetlogs;

V$ARCHIVED_LOG

RMAN> sql 'alter session set nls_date_format="yyyy-mm-dd hh24:mi:ss"';

本文标签:
本文标题:异地迁移Rman脚本
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】