在 RHEL5 上配置 Oracle 10g Data Guard

oracle 2009-11-12

一、环境配置
主库SID(ddd)
Global Database Name(ddd)
Service Name(ddd)
Net Server Name(ddd)
IP:192.168.0.102

DB:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
OS:rhel5

备库SID(ddd)
Global Database Name(ddd)
Service Name(ddd)
Net Service Name(dddsby)
IP:192.168.0.109

DB:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
OS:rhel5

Primary为正在使用的生产数据库,standby安装oracle软件,但不建立数据库。

二、 建立物理备用数据库
1. 准备主库的oracle环境:
编辑oracle用户的~oracle/.bash_profile文件,oracle相关环境变量如下:
export ORACLE_BASE=/oracle
export ORACLE_HOME=/oracle/product/10g
export ORACLE_SID=ddd
export PATH=$ORACLE_HOME/bin [点击图片可在新窗口打开] PATH
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LANG=zh_CN
#export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export NLS_LANG=”SIMPLIFIED Chinese_CHINA.ZHS16GBK”

2. 修改主库为归档模式
建立归档目录:
mkdir -p /oracle/oradata/arch
修改归档模式:
alter database force logging;
archive log list;
create pfile from spfile;
编辑$ORACLE_HOME/dbs/initddd.ora
主库文件配置如下 [点击图片可在新窗口打开] 红色部分为要修改的参数)
ddd.__db_cache_size=167772160
ddd.__java_pool_size=4194304
ddd.__large_pool_size=4194304
ddd.__shared_pool_size=83886080
ddd.__streams_pool_size=0
*.audit_file_dest=’/oracle//admin/ddd/adump’
*.background_dump_dest=’/oracle//admin/ddd/bdump’
*.compatible=’10.2.0.1.0′
*.control_files=’/oracle//oradata/ddd/control01.ctl’,'/oracle//oradata/ddd/control02.ctl’,'/oracle//oradata/ddd/control03.ctl’
*.core_dump_dest=’/oracle//admin/ddd/cdump’
*.db_block_size=8192
*.db_domain=”
*.db_file_multiblock_read_count=16
*.db_name=’ddd’
*.db_recovery_file_dest=’/oracle//flash_recovery_area’
*.db_recovery_file_dest_size=2147483648
*.dg_broker_start=TRUE
*.dispatchers=’(PROTOCOL=TCP) (SERVICE=dddXDB)’
*.fal_client=’ddd’ #这里的fal_client指的是net service name
*.fal_server=’dddsby1′ #这里的fal_server指的是net service name
*.job_queue_processes=10
*.log_archive_dest_1=’location=/oracle/oradata/arch’
*.log_archive_dest_2=’SERVICE=dddsby1 LGWR’ #这里的SERVICE指的是net service name
*.open_cursors=300
*.pga_aggregate_target=88080384
*.processes=150
*.remote_login_passwordfile=’EXCLUSIVE’
*.sga_target=264241152
*.standby_archive_dest=’/oracle/oradata/arch’
*.standby_file_management=’AUTO’
*.undo_management=’AUTO’
*.undo_tablespace=’UNDOTBS1′
*.user_dump_dest=’/oracle//admin/ddd/udump’

sqlplus / as sysdba;
shutdown immediate;
create spfile from pfile;
startup mount;
alter database archivelog;
alter database open;

相关推荐