【使用rman复制数据库10g--clone-1】(一)

2015-01-22 21:38:58 · 作者: · 浏览: 34

目标数据库:jadl0g

复制的结果数据库:d10g

注意:****目标库与clone结果库在同一台机子上****

1.vi /u01/oracle/10g/network/admin/tnsnames.ora

D10G =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracle.db.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = d10g)
)
(failover = on)
)

2.vi /u01/oracle/10g/network/admin/listener.ora

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME=jadl10g)
(SID_NAME = jadl10g)
(ORACLE_HOME = /u01/oracle/10g)
)
(SID_DESC =
(GLOBAL_DBNAME=d10g)
(SID_NAME = d10g)
(ORACLE_HOME = /u01/oracle/10g)
)
)

3.重启监听

lsnrctl stop
lsnrctl start
tnsping d10g
tnsping jadl10g

4.创建密码文件和参数文件

[oracle@oracle ~]$ cd /u01/oracle/10g/dbs/
[oracle@oracle dbs]$ orapwd file=orapwd10g password=oracle
[oracle@oracle dbs]$ strings spfilejadl10g.ora > initd10g.ora
[oracle@oracle dbs]$ vi initd10g.ora
:1,$ s/jadl10g/d10g/g---执行该命令

[oracle@oracle dbs]$ grep u01 initd10g.ora
*.audit_file_dest='/u01/oracle/admin/d10g/adump'
*.background_dump_dest='/u01/oracle/admin/d10g/bdump'
*.control_files='/u01/oracle/oradata/d10g/control01.ctl','/u01/oracle/flash_recovery_area/d10g/control02.ctl'#Restore Controlfile
*.core_dump_dest='/u01/oracle/admin/d10g/cdump'
*.db_recovery_file_dest='/u01/oracle/flash_recovery_area'
*.user_dump_dest='/u01/oracle/admin/d10g/udump'

5.创建相应的文件
[oracle@oracle dbs]$ mkdir /u01/oracle/admin/d10g/adump -p
[oracle@oracle dbs]$ mkdir /u01/oracle/admin/d10g/bdump -p
[oracle@oracle dbs]$ mkdir /u01/oracle/admin/d10g/cdump -p
[oracle@oracle dbs]$ mkdir /u01/oracle/admin/d10g/udump -p
[oracle@oracle dbs]$ mkdir /u01/oracle/oradata/d10g
[oracle@oracle dbs]$ export ORACLE_SID=d10g
[oracle@oracle dbs]$ rman target /
Recovery Manager: Release 10.2.0.5.0 - Production on Fri Nov 7 12:59:20 2014
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database (not started)
RMAN> startup nomount
Oracle instance started
Total System Global Area 599785472 bytes
Fixed Size 2098112 bytes
Variable Size 171969600 bytes
Database Buffers 419430400 bytes
Redo Buffers 6287360 bytes
RMAN> exit
Recovery Manager complete.
[oracle@oracle dbs]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Fri Nov 7 13:00:15 2014
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engine
and Real Application Testing options

SQL> create spfile from pfile;
File created.

SQL> shutdown
ORA-01507: database not mounted
ORACLE instance shut down.


SQL> startup nomount
ORACLE instance started.
Total System Global Area 599785472 bytes
Fixed Size 2098112 bytes
Variable Size 171969600 bytes
Database Buffers 419430400 bytes
Redo Buffers 6287360 bytes
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engine
and Real Application Testing options

****************************
[oracle@oracle dbs]$ rman target sys/oracle@jadl10g auxiliary sys/oracle@d10g
Recovery Manager: Release 10.2.0.5.0 - Production on Fri Nov 7 13:26