您的位置:首页技术文章
文章详情页

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

浏览:51日期:2023-11-29 10:42:22
一、安装

环境:

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'<

标签: Oracle 数据库