ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle dataguard配置

oracle dataguard配置

原创 Linux操作系统 作者:oracle_ren 时间:2009-02-09 10:08:34 0 删除 编辑

oracle dataguard 的配置:自感觉主要是对几个参数的理解:还有就是监听与tns的配置。剩下的也就没有什么了。

也有点疑问:就是没有做过:生产机不停机的情况下,备份主库,再在备库恢复:也不是生产库不停机是否能够做。

以前做的都是需要主机停机的情况:

              Creating a Physical Standby  

主要包括:

1Preparing the Primary Database for Standby Database Creation

Table 3–1 Preparing the Primary Database for Physical Standby Database Creation

Reference Task

Section 3.1.1 Enable Forced Logging

Section 3.1.2 Create a Password File

Section 3.1.3 Configure a Standby Redo Log

Section 3.1.4 Set Primary Database Initialization Parameters

Section 3.1.5 Enable Archiving

(1)   Enable Forced Logging

         ALTER DATABASE FORCE LOGGING;

(2)   Create a Password File (如有不用创建)

(3)   Configure a Standby Redo Log 

alter database add standby logfile
        group 4 ('/u02/oradata/primary/std_redo04a.log','
/u02/oradata/primary/std_redo04b.log') size 50m,
        group 5 ('
/u02/oradata/primary/std_redo05a.log','/ /u02/oradata/primary/std_redo05b.log') size 50m,
        group 6 ('
/u02/oradata/primary/std_redo06a.log',' /u02/oradata/primary/std_redo06b.log') size 50m,
        group 7 ('
/u02/oradata/primary/std_redo07a.log',' /u02/oradata/primary/std_redo07b.dbf') size 50m;

 

单个的:

ALTER DATABASE ADD STANDBY LOGFILE THREAD 7  

   '/u02/oradata/redo07.log' size 50m;

 

 

监测一下

SQL> SELECT GROUP#,THREAD#,SEQUENCE#,ARCHIVED,STATUS FROM V$STANDBY_LOG;

GROUP# THREAD# SEQUENCE# ARC STATUS

---------- ---------- ---------- --- ----------

3 1 16 NO ACTIVE

4 0 0 YES UNASSIGNED

5 0 0 YES UNASSIGNED

(4)

 Set Primary Database Initialization Parameters

cuug.__db_cache_size=88080384

cuug.__java_pool_size=4194304

cuug.__large_pool_size=4194304

cuug.__shared_pool_size=67108864

cuug.__streams_pool_size=0

*.audit_file_dest='/home/oracle/admin/cuug/adump'

*.background_dump_dest='/home/oracle/admin/cuug/bdump'

*.compatible='10.2.0.1.0'

*.control_files='/u02/cuug/control01.ctl','/u02/cuug/control02.ctl','/u02/cuug/control03.ctl'

*.core_dump_dest='/home/oracle/admin/cuug/cdump'

*.db_block_size=8192

*.db_domain=''

*.db_file_multiblock_read_count=16

*.db_name='cuug'

#*.db_unique_name='cuug'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=cuugXDB)'

*.job_queue_processes=10

*.log_archive_dest_1='location=/u02/arch'

*.LOG_ARCHIVE_FORMAT='%t_%s_%r.arc'

*.open_cursors=300

*.pga_aggregate_target=16777216

*.processes=150

*.remote_login_passwordfile='EXCLUSIVE'

*.sga_target=167772160

*.undo_management='AUTO'

*.undo_tablespace='UNDOTBS1'

*.user_dump_dest='/home/oracle/admin/cuug/udump'

 

*.DB_FILE_NAME_CONVERT='rac2','rac1'

*.fal_client='rac1'

*.fal_server='rac2'

*.log_archive_config='dg_config=(rac1,rac2)'

*.log_archive_dest_2='service=rac2  LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=standby'

*.LOG_ARCHIVE_DEST_STATE_1='ENABLE'

*.LOG_ARCHIVE_DEST_STATE_2='ENABLE'

*.LOG_FILE_NAME_CONVERT='/u02/arch/','u02/arch'

*.STANDBY_FILE_MANAGEMENT='AUTO'

 

 

5

Enable Archiving (如果是归档的,则不用管)

 

2):Step-by-Step Instructions for Creating a Physical Standby Database

 

Table 3–2 Creating a Physical Standby Database

Reference Task Database

Section 3.2.1 Create a Backup Copy of the Primary Database Datafiles Primary

Section 3.2.2 Create a Control File for the Standby Database Primary

Section 3.2.3 Prepare an Initialization Parameter File for the Standby Database Primary

Section 3.2.4 Copy Files from the Primary System to the Standby System Primary

Section 3.2.5 Set Up the Environment to Support the Standby Database Standby

Section 3.2.6 Start the Physical Standby Database Standby

Section 3.2.7 Verify the Physical Standby Database Is Performing Properly Standby

 

1

Create a Backup Copy of the Primary Database Datafiles

2Create a Control File for the Standby Database

   主库端: 

 STARTUP MOUNT;

ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/tmp/boston.ctl';

ALTER DATABASE OPEN;

3

Prepare an Initialization Parameter File for the Standby Database

 

cuug.__db_cache_size=88080384

cuug.__java_pool_size=4194304

cuug.__large_pool_size=4194304

cuug.__shared_pool_size=67108864

cuug.__streams_pool_size=0

*.audit_file_dest='/home/oracle/admin/cuug/adump'

*.background_dump_dest='/home/oracle/admin/cuug/bdump'

*.compatible='10.2.0.1.0'

*.control_files='/u02/cuug/control01.ctl','/u02/cuug/control02.ctl','/u02/cuug/control03.ctl'

*.core_dump_dest='/home/oracle/admin/cuug/cdump'

*.db_block_size=8192

*.db_domain=''

*.db_file_multiblock_read_count=16

*.db_name='cuug'

#*.db_unique_name='cuug'

*.job_queue_processes=10

*. *.log_archive_dest_1='location=/u02/arch'

 

*.LOG_ARCHIVE_FORMAT='%t_%s_%r.arc'

*.open_cursors=300

*.pga_aggregate_target=16777216

*.processes=150

*.remote_login_passwordfile='EXCLUSIVE'

*.sga_target=167772160

*.undo_management='AUTO'

*.undo_tablespace='UNDOTBS1'

*.user_dump_dest='/home/oracle/admin/cuug/udump'

 

 

*.DB_FILE_NAME_CONVERT='rac2','rac1' 

*.dispatchers='(PROTOCOL=TCP) (SERVICE=cuugXDB)'

*.fal_client='rac2'

*.fal_server='rac1'

log_archive_config='dg_config=(rac1,rac2)'

*.log_archive_dest_2='service=rac1  LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=cuug'

*.LOG_ARCHIVE_DEST_STATE_1='ENABLE'

*.LOG_ARCHIVE_DEST_STATE_2='ENABLE'

*.LOG_FILE_NAME_CONVERT='/u02/arch/','u02/arch'

*.STANDBY_FILE_MANAGEMENT='AUTO'

 

4Copy Files from the Primary System to the Standby System

5

Configure listeners for the primary and standby databases.

Create Oracle Net service names.

 

生产库:

# listener.ora Network Configuration File: /u01/oracle/product/10.2.0.1//network/admin/listener.ora

# Generated by Oracle configuration tools.

 

LISTENER =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.2)(PORT = 1521))

  )

 

TNs 配置

# tnsnames.ora Network Configuration File: /u01/oracle/product/10.2.0.1//network/admin/tnsnames.ora

# Generated by Oracle configuration tools.

 

RAC2 =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.3)(PORT = 1521))

    )

    (CONNECT_DATA =

      (SERVICE_NAME = cuug)

    )

  )

 

RAC1 =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.2)(PORT = 1521))

    )

    (CONNECT_DATA =

      (SERVICE_NAME = cuug)

    )

  )

备库配置

Listener.ora

# listener.ora Network Configuration File: /u01/oracle/product/10.2.0.1//network/admin/listener.ora

# Generated by Oracle configuration tools.

 

SID_LIST_LISTENER =

  (S

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/17069315/viewspace-545630/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-12-26

  • 博文量
    20
  • 访问量
    64923