分类: Oracle
2009-03-31 11:57:35
准备好相应的目录结构
E:oracleproduct
E:oracleproduct
E:oracleproduct
E:oracleproduct
E:oracleproduct
E:oracleproduct
创建参数文件inittest.ini(可使用原库的pfile进行修改),主要参数如下:
db_name=test
background_dump_dest=E:oracleproduct
core_dump_dest=E:oracleproduct
user_dump_dest=E:oracleproduct
control_files='E:oracleoradatatestcontrol01.ctl','E:oracleoradatatest control02.ctl','E:oracleoradatatest control03.ctl'
DB_FILE_NAME_CONVERT=('E:oracleoradataning','E:oracleoradatatest')
LOG_FILE_NAME_CONVERT=('E:oracleoradataning','E:oracleoradatatest')
置于E:oracleproduct
使用oradim创建新的instance
c:>oradim -new -sid test
例程已创建。
使用orapwd创建password文件
c:>orapwd file=E:oracleproduct
配置好监听和tnsnames,然后使用sqlplus测试连接
c:>sqlplus /nolog
SQL*Plus: Release
Copyright (c) 1982, 2004, Oracle. All rights reserved.
SQL> conn sys@test as sysdba
请输入口令:
已连接到空闲例程。
2.使用rman备份原库
RMAN> connect target sys/ning@ning
RMAN> backup full database tag 'fullbk' format 'e:oracleorabackfull%u_%s_%p';
3.使用rman复制数据库
c:>rman target sys/ning@ning AUXILIARY sys/test@test
RMAN> DUPLICATE TARGET DATABASE TO 'test';
4.检查复制库的状态
C:>sqlplus /nolog
SQL> conn sys@test as sysdba
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
test OPEN
然后去掉inittest.ora的DB_FILE_NAME_CONVERT和LOG_FILE_NAME_CONVERT参数,再使用该文件生成spfile
SQL> create spfile from pfile='E:oracleproduct 文件已创建。