这里我已经有一个安装好的数据库,版本是:10g R2 主机名称:dg1.andylhz.com 实例名dg,另外一台数据库主机,安装Oracle软件和第一台数据库的安装环境一样,但没有安装数据库。主机名称:dg2.andylhz.com,实例名,dgcXML:NAMESPACE PREFIX = O /
1、将dg1的系统参数文件,监听文件,密码文件,拷贝到dg2的相应位置。
编辑初始化参数文件initdg.ora 将文件中的dg全部替换成dgc 保存并重命名为:initdgc.ora
如下:
[oracle@dg2 dbs]$ more /u01/app/oracle/10g/dbs/initdgc.ora
dgc.__large_pool_size=4194304
dgc.__shared_pool_size=88080384
dgc.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/dgc/adump'
*.编程技术其它 iis7站长之家_dump_dest='/u01/app/oracle/admin/dgc/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/u01/app/oracle/oradata/dgc/control01.ctl','/u01/app/oracle/oradata/dgc/control02.ctl','/u01/app/oracle/oradata/dgc
/control03.ctl'
*.core_dump_dest='/u01/app/oracle/admin/dgc/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='dgc'
*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=dgXDB)'
*.log_archive_format='%t_%s_%r.dbf'
*.open_cursors=300
*.pga_aggregate_target=16777216
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=167772160
*.undo_tablespace='undotbs1'
*.user_dump_dest='/u01/app/oracle/admin/dgc/udump'
*.db_file_name_convert='/u01/app/oracle/oradata/dg','/u01/app/oracle/oradata/dgc'
*.log_file_name_convert='/u01/app/oracle/oradata/dg','/u01/app/oracle/oradata/dgc'
#红色字体的参数需要设置好,否则在执行duplicate命令的时候报告辅助数据库和目标数据库的文件命冲突。
2、将密码文件重命名:mv orapwdg orapwdgc
3、将监听文件中的主机名改成 dg2.andylhz.com 实例名改成dgc
如下:
#注意,这里的监听文件需要使用静态注册,否则客户端连接辅助数据库连接不上。所以不能使用动态链接方式。
#listener.ora
[oracle@dg2 admin]$ more /u01/app/oracle/10g/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/10g/network/admin/listener.ora
# Generated by Oracle configuration tools.
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/10g)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = dgc)
(ORACLE_HOME = /u01/app/oracle/10g)
(SID_NAME = dgc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dg2.andylhz.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
#tnsnames.ora
[oracle@dg2 admin]$ more /u01/app/oracle/10g/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/10g/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
DGC =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dg2.andylhz.com)(PORT = 1521))
)
(SERVICE_NAME = dgc)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)