Oracle dataGuard专题:利用rman创建standby
使用rman来创建standby,过程相当简单,主库无需停机。本次试验演示了利用Rman热备,然后restore来创建备库的过程。
1. 演示环境
[oracle@gaojf orcl]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Dec 6 08:54:45 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL>
2. 确认主库处于归档模式
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /free/oracle/orabak
Oldest online log sequence 275
Next log sequence to archive 277
Current log sequence 277
SQL>
3:创建备库instance
windows平台利用oradim工具创建一个新的instance,unix/linux平台设置新的ORACLE_SID即可,我的是linux平台,设置ORACLE_SID即可。
4:准备好备库的参数文件
本次试验在两个系统上建主备库,另外如果主备库都在一起的话,db_name设置为主库名,lock_name_space设置为备库名,同时要注意设置好DB_FILE_NAME_CONVERT和LOG_FILE_NAME_CONVERT参数。
备库主要的几个参数如下:
*.log_archive_config='DG_CONFIG=(PRIMARY,STANDBY)'
*.LOG_ARCHIVE_DEST_1='LOCATION=/free/oracle/orabak VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=STANDBY'
*.LOG_ARCHIVE_DEST_2='SERVICE=primary VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=PRIMARY LGWR SYNC AFFIRM'
*.db_unique_name='STANDBY'
*.FAL_CLIENT='STANDBY'
*.FAL_SERVER='PRIMARY'
*.log_archive_dest_state_1='enable'
*.log_archive_dest_state_2='enable'
*.STANDBY_ARCHIVE_DEST='/free/oracle/orabak'
*.STANDBY_FILE_MANAGEMENT='AUTO'
主库几个主要参数如下:
*.log_archive_config='DG_CONFIG=(PRIMAYR,STANDBY)'
*.DB_UNIQUE_NAME='PRIMARY'
*.LOG_ARCHIVE_DEST_1= 'LOCATION=/free/oracle/orabak'
#*.LOG_ARCHIVE_DEST_2='SERVICE=STANDBYVALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=STANDBY LGWR SYNC AFFIRM' #LGWR方式
*.LOG_ARCHIVE_DEST_2='SERVICE=STANDBY DB_UNIQUE_NAME=STANDBY ARCH SYNC REOPEN=10' #arch方式
*.LOG_ARCHIVE_DEST_STATE_1=ENABLE
*.LOG_ARCHIVE_DEST_STATE_2=ENABLE
*.LOG_ARCHIVE_FORMAT='arc%s%t%r.arc'
*.FAL_SERVER='STANDBY'
*.FAL_CLIENT='PRIMARY'
*.STANDBY_FILE_MANAGEMENT='AUTO'
*.standby_archive_dest='/free/oracle/orabak'
5.在备库生成password file
[oracle@gaojfdbs]$Orapwd file=/free/oracle/product/10.2.0/db_1/orapworcl.ora password=orcl entries=5
或者可以直接复制主库密码文件到备库相应的位置也可。
6.配置网络
配置主备库的listener.ora,tnsnames.ora。修改完lisner.ora后注意重启监听。
主库Listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /free/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
LISTENER =
(DESCRIPTION_LIST =
- 发表评论
-
- 最新评论 更多>>