点击这里给我发消息 点击这里给我发消息
首页 > 行业资讯 > Oracle>详细内容

Oracle数据库9i DataGuard的安装与维护

添加时间:2010-1-5
    相关阅读: 数据库 Oracle 维护

一、安装

环境:

Primary 数据库:sun01

Standby 数据库:sun02

Oracle_Sid:bnet

1. 拷贝$ORACLE_BASE 到新机器上

2. 让Primary数据库处于归档模式,对Primary数据库做一个Rman热备份

startup mount

alter database archivelog;

archive log list;

rman target sys/oracle

backup database format "/....";

3.创建Data Guard数据库控制文件

alter database create standby controlfile as '/....ctl';

4.设置监听

Primary:

bnetguard =

( (DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = sun02)(PORT = 1522))

)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = bnet)

)

)

Standby:

listener.ora

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))

)

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = sun01)(PORT = 1522))

)

)

)

tnsname.ora

bnet =

( (DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = sun02)(PORT = 1522))

)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = bnet)

)

)

5. 设置主机参数

alter database force logging;

主库强制归档

主机参数:

fal_client=bnetguard

fal_server=bnet

standby_file_management=auto

remote_login_passwordfile=exclusive

备机参数:

db_file_name_convert

log_file_name_convert

standby_file_management='AUTO'

standby_archive_dest=/export/home/oracle/oradata/bnet/arch

6.创建standby 数据库

orapwd

sqlplus "sys/oracle as sysdba"

startup nomount pfile='''

alter database mount standby database;

exit

rman target sys/oracle nocatalog

restore database

7.设置自动归档

alter system set log_archive_dest_2='server=bnetguard reopen=200'

8.启动Data Guard自动恢复状态

sqlplus "sys/oracle as sysdba"<<eof

recover managed standby database;

exit

EOF

9.测试

alter system archive log current;

二、维护:

使Standby 数据库处与 read-only状态

reover cancel/recover managed standby database cancel;

取消恢复模式

alter database open read only;

启动数据库到只读状态

recover standby database;

使数据库切换到恢复模式

recover managed standby database time out 15;

如果超过15分钟没有传日志

Restarting dead background process QMN0

"Restarting dead background process QMN" message can continually

appear in the alert log during startup in RAC environment.

Workaround:

Set aq_tm_processes=0 in the init.ora.

It can be set to desired value through

"alter system set aq_tm_processes=n" once the database is open completely.

alter database activate standby database;

本文作者:
咨询热线:020-85648757 85648755 85648616 0755-27912581 客服:020-85648756 0755-27912581 业务传真:020-32579052
广州市网景网络科技有限公司 Copyright◎2003-2008 Veelink.com. All Rights Reserved.
广州商务地址:广东省广州市黄埔大道中203号(海景园区)海景花园C栋501室
= 深圳商务地址:深圳市宝源路华丰宝源大厦606
研发中心:广东广州市天河软件园海景园区 粤ICP备05103322号 工商注册