1、前期准备
1)orapwd file=D:\oracle\product\10.2.0\db_1\database\PWDDUP.ora password=medical entries=10
----entries - maximum number of distinct DBA and force - whether to overwrite existing file (opt),OPERs (opt)
2)oradim -new -sid jssdup
----oradim -delete -sid DUPDB
3)配置静态监听,因为上面只是创建了实例名,没有PMON进程,无法注册监听信息,所以要用静态监听
4)根据target库的参数文件创建aulixiary库的参数文件,并生成spfile文件,保证spfile生成的位置正确
5) 创建目录adump bdump cdump dpdump pfile udump,同时在oradata下面创建dup目录
6)startup force nomount加载spfile
7) 启动target库,并RMAN备份数据库,生成有效的备份文件,如backup database include current controlfile plus archivelog delete input;
8) rman target / auxiliary sys/medical@dup (前提是lsnrctl status中可以看到dup状态,并且set oracle_sid=目标库名)
9)RMAN> run{
2> set newname for datafile 1 to 'D:\oracle\product\10.2.0\oradata\DUP\SYSTEM01.DBF';
3> set newname for datafile 2 to 'D:\oracle\product\10.2.0\oradata\DUP\undotbs01.DBF';
4> set newname for datafile 3 to 'D:\oracle\product\10.2.0\oradata\DUP\sysaux01.DBF';
5> set newname for datafile 4 to 'D:\oracle\product\10.2.0\oradata\DUP\users01.DBF';
6> set newname for datafile 5 to 'D:\oracle\product\10.2.0\oradata\DUP\apmedsurgery.DBF';
7> set newname for datafile 7 to 'D:\oracle\product\10.2.0\oradata\DUP\apmedcomm.DBF';
8> set newname for datafile 6 to 'D:\oracle\product\10.2.0\oradata\DUP\apmedicu.DBF';
9> set newname for tempfile 1 to 'D:\oracle\product\10.2.0\oradata\DUP\TEMP01.DBF';
10> duplicate target database to dup logfile
11> 'D:\oracle\product\10.2.0\oradata\DUP\redo01.log' size 10m,
12> 'D:\oracle\product\10.2.0\oradata\DUP\redo02.log' size 10m,
13> 'D:\oracle\product\10.2.0\oradata\DUP\redo03.log' size 10m;
14> }
注:如果在之前修改参数文件时加入了以下语句,那么在run中就不需要再set newname了
DB_FILE_NAME_CONVERT=(/oracle/oradata/trgt/,/oracle/oradata/dup/)
LOG_FILE_NAME_CONVERT=(/oracle/oradata/trgt/redo,/oracle/oradata/dup/redo)
注:一般run中会指定一个auxiliary的通道,如:
run {
ALLOCATE AUXILIARY CHANNEL aux3 DEVICE TYPE DISK;
DUPLICATE TARGET DATABASE TO dup;
}
If you configure automatic channels, then RMAN can use configured channels for duplication even if they do not specify the AUXILIARY
option. Nevertheless, if the auxiliary channels need some special parameters (for example, to point to a different media management
subsystem), then you can configure an automatic channel with the AUXILIARY option.
-----------------------------------------------------------------------------------------------------------------------------------
Refreshing a Standby Database With INCREMENTAL FROM SCN Backups
target:
BACKUP DEVICE TYPE DISK INCREMENTAL FROM SCN 750983 DATABASE FORMAT '/tmp/incr_for_standby/bkup_%U';
移动上面的备份到auxiliary可以访问的地方
auxiliary:
CATALOG START WITH '/standbydisk1/incrback/';
RECOVER DATABASE NOREDO;
本文详细介绍如何使用RMAN工具进行Oracle数据库的完整复制过程,包括前期准备步骤、参数文件的设置、监听器配置、数据文件及日志文件的重命名、以及增量备份刷新备用数据库的方法。
971

被折叠的 条评论
为什么被折叠?



