使用RMAN 复制数据库 LMJ 到 系统 CLON 上为JJJ 数据库:
1) 在源数据库 LMJ 上利用RMAN 全备份数据库:
#: rman catalogrman/rman@rmantargetsys/oracle@lmj
rman> run { allocate channel c1 device type disk;
backup format '/u1/backup/db_%T_%s_%p.dbf'
database tag='db_full';
backup format '/u1/backup/arc_%T_%s_%p.dbf'
archivelog all delete input tag='arc_full';
backup format '/u1/backup/dbcontrol.bak'
current controlfile;
}
2) 在复制库 CLON 上建立相应的目录:(目录结构和源库保持一致)
A: mkdir -p /u1/oracle/admin/jjj/adump
mkdir -p /u1/oracle/admin/jjj/bdump
mkdir -p /u1/oracle/admin/jjj/cdump
mkdir -p /u1/oracle/admin/jjj/udump
B: mkdir /u1/oracle/oradata/jjj
C: mkdir /u1/backup (存放从源库COPY 过来的备份集)
D: orapwd file=$ORACLE_HOME/dbs/orapwlmj password=oracle entries=10
E: scp @test:/$ORACLE_HOME/dbs/initlmj.ora /u1/oracle/product/10.2.0/db_1/dbs/
F: sqlplus / as sysdba
startup nomount ;
G: scp @test:/u1/backup/* /u1/backup
3) 在复制库 CLON 上配置监听
A: rman --> 源库的IP,源库的服务RMAN ;
B: lmj --> 源库的IP,源库的服务lmj ;
4) 在CLON 上开始复制库:
#: rman catalogrman/rman@rmantargetsys/oracle@lmj( 先连接到源数据库和恢复目录数据库)
rman> connect auxiliary /; (连接到本地数据库进行恢复)
rman> list backupset ; ( 找到可以恢复的最后一个SEQ ,假如是 4)
run {
allocate auxiliary channel c1 device type disk;
set newname for datafile 1 to '/u1/oracle/oradata/jjj/system01.dbf';
set newname for datafile 2 to '/u1/oracle/oradata/jjj/undotbs01.dbf';
set newname for datafile 3 to '/u1/oracle/oradata/jjj/sysaux01.dbf';
set newname for datafile 4 to '/u1/oracle/oradata/jjj/users01.dbf';
set newname for tempfile 1 to '/u1/oracle/oradata/jjj/temp01.dbf';
duplicate target database to jjj logfile
group 1 ('/u1/oracle/oradata/jjj/redo01.log') size 50m reuse,
group 2 ('/u1/oracle/oradata/jjj/redo02.log') size 50m reuse,
group 3 ( '/u1/oracle/oradata/jjj/redo03.log') size 50m reuse;
}
阅读(1732) | 评论(0) | 转发(1) |