duplicate前提条件:
1,用户名必须统一,如oracle用户
2,适用于本机对本机复制
例:将DTLBERP复制,命名为dtlerp。考虑到/u02磁盘空间不够,将原DTLBERP数据文件路径改为/u01路径。
1,建立dtlerp密码文件:
2,建立dtlerp init文件:
# cp initdtlberp.ora initdtlerp.ora
# vi initdtlerp.ora
更改initdtlerp.ora:
1),删除:*.local_listener
2),新增:
*.LOG_FILE_NAME_CONVERT='/u02/app/oracle2/oradata/dtlberp','/u01/app/oracle/oradata/dtlerp'
3),更改路径:
db_name,xdump路径,Control_File路径,*.log_archive_dest_1路径
3,按initdtlerp参数新增文件夹:
$ mkdir dtlerp
$ cd dtlerp
$ mkdir adump bdump cdump dpdump pfile udump
$ cd oradata
$ mkdir dtlerp
4,配置tnsname,Listener:
Listenner:
(GLOBAL_NAME = dtlerp)
(ORACLE_HOME = /u02/app/oracle2/product/10.1.0.2.0/db_2)
(SID_NAME = dtlerp)
)
TNS:
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.91.50.5)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dtlerp)
)
)
5,启动dtlerp实例:
$ sqlplus / as sysdba
SQL> create spfile from pfile='$ORACLE_HOME/dbs/initdtlerp.ora';
SQL> startup nomount;
SQL> exit
6,分配辅助通道:
$ $ORACLE_HOME/bin/rman target / auxiliary sys/oracle@dtlerp
Recovery Manager: Release 10.1.0.2.0 - Production
Copyright (c) 1995, 2004, Oracle. All rights reserved.
connected to target database: DTLBERP (OPEN状态!!!)
connected to auxiliary database: dtlerp (not mounted)
7,确认拥有必备的备份:
8,如果dtlberp在archivelog模式,则先:
9,本地复制创建:
........
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 05-JUN-09