Home > Database > Mysql Tutorial > Oracle DataGuard建库

Oracle DataGuard建库

WBOY
Release: 2016-06-07 17:25:33
Original
907 people have browsed it

此处安装的是oracle10.2.0.1,安装过程我们基本上已经熟练了解,在此不细说。记住只安装数据库软件哦(这样可以简化后面的升级过

DataGuard原理在此不说了,这里只是说下我做的这个项目流程

一.在physical 主机创建数据库
操作系统:RedHat5.4
本项目安装一台primary,一台standby,所以要准备两台机器,命名为DG1、DG2
1、安装数据库软件
此处安装的是Oracle10.2.0.1,安装过程我们基本上已经熟练了解,,在此不细说。记住只安装数据库软件哦(这样可以简化后面的升级过程)
2、如果直接用10.2.0.1做dataguard,可能会出现一些bug,为了避免这些bug,我们要将数据库软件升级到10.2.0.5
3、建库:在DG1上用DBCA建库,DG2上面暂不建库
4、primary端设置
4.1、主库设置为force logging模式
  1. SQL > alter database force logging;
2. create a Password file
[oracle@localhost dbs]$ orapwd file=/u01/app/oracle/product/10.2.0/db_1/dbs/orapworcl password=oracle
4.2、主库设置为归档模式
  SQL > shutdown immediate;
  SQL > startup mount;
  SQL > alter database archivelog;
  SQL > archive log list;

4.3、添加redo log file
1)添加新的standby redolog组,并为该组指定成员。
SQL > alter database add standby logfile group 4 (‘/u01/app/oracle/oradata/oradg/redo04.log’)size 50M;
SQL > alter database add standby logfile group 5  (‘/u01/app/oracle/oradata/oradg/redo05.log’) size 50M;
SQL > alter database add standby logfile group 6  (‘/u01/app/oracle/oradata/oradg/redo06.log’) size 50M;
SQL > alter database add standby logfile group 7  (‘/u01/app/oracle/oradata/oradg/redo07.log’) size 50M;
2)确定standby redo log file groups已经创建:
SQL> SELECT GROUP#,THREAD#,SEQUENCE#,ARCHIVED,STATUS FROM V$STANDBY_LOG;

 
4.4 、初始化参数
DB_NAME=testdb
DB_UNIQUE_NAME=testdb
LOG_ARCHIVE_CONFIG='DG_CONFIG=(testdb,testdbst)'
LOG_ARCHIVE_DEST_1=
 'LOCATION=/u01/oradata/arch/testdb
  VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
  DB_UNIQUE_NAME=testdb’
LOG_ARCHIVE_DEST_2=
 'SERVICE=boston LGWR ASYNC
  VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
  DB_UNIQUE_NAME=testdbst’
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
LOG_ARCHIVE_MAX_PROCESSES=30
FAL_SERVER=testdbst
FAL_CLIENT=testdb
STANDBY_FILE_MANAGEMENT=AUTO

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template