本文共 1522 字,大约阅读时间需要 5 分钟。
1.在auxiliary 服务器上安装oracle 软件,(不要创建数据库)
2.从target 数据库上得到pfile ,拷贝到auxiliary 相对应的位置,(修改想应的参数)
3.auxiliary服务器:根据pfile 和需要创建相应的目录。
4.创建网络配制文件listener.ora sqlnet.ora tnsnames.ora 使能连上target 数据库
5.备份target 数据库,并且与archive log 一起 拷贝到auxiliary 服务器上相同的目录
6.设置sys密码文体:
orapwd file=/u01/oracle/product/10.2.0/db_1/dbs/orapwhanmi password=hanmihanmi entries=4
7.auxiliary服务器启动到nomount 状态。
8.连接两个数据库,clone数据库:
[oracle@oracle ~]$ rman target sys/nnnt@test auxiliary sys/aaa
rman> run{
allocate channel chan1 type disk;
allocate channel chan2 type disk;
ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL aux2 DEVICE TYPE DISK;
DUPLICATE TARGET DATABASE TO dupdb
# specify client-side parameter file (on same host as RMAN client) for
# auxiliary instance if necessary
PFILE = /dup/oracle/dbs/initDUPDB.ora
NOFILENAMECHECK; (目录结构相同)
}
目录结构不同用下面的脚本:
RUN
{
# set new filenames for the datafiles
allocate channel chan1 type disk;
allocate channel chan2 type disk;
ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL aux2 DEVICE TYPE DISK;
set newname for datafile 1 to '/u01/oracle/oradata/hanmi/system01.dbf';
set newname for datafile 2 to '/u01/oracle/oradata/hanmi/undotbs01.dbf';
set newname for datafile 3 to '/u01/oracle/oradata/hanmi/sysaux01.dbf';
set newname for datafile 4 to '/u01/oracle/oradata/hanmi/users01.dbf';
duplicate target DATABASE TO hanmi LOGFILE
'/u01/oracle/oradata/redo01' size 200m,
'/u01/oracle/oradata/redo02' size 200m,
'/u01/oracle/oradata/redo03' size 200m;
}
转载地址:http://qlkax.baihongyu.com/