Oracle 10G windows 平台 DataGuard
server A: 10.85.10.44 SID=orcl
target server B: 10.85.10.43
oracle version:10.2.0.1
OS platform : windows XP
Primary设置:
1. 设置主数据库为force logging 模式
SQL>sqlplus "/as sysdba"
SQL>alter database force logging;
2. 设置主数据库为归档模式
SQL> archive log list
SQL> shutdown immediate
SQL> startup mount
SQL> alter database archivelog;
SQL> archive log list
3. 添加"备用联机日志文件"
先查看日志文件位置:
SQL>select * from v$logfile;
在添加:
SQL> alter database add standby logfile group 4 ('D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\redo04.log') size 50m;
SQL> alter database add standby logfile group 5 ('D:\ORACLE\PRODUCT\10.2.0\ORADAT
A\ORCL\redo05.log') size 50m;
SQL> alter database add standby logfile group 6 ('D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\redo06.log') size 50m;
SQL> alter database add standby logfile group 7 ('D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\redo07.log') size 50m;
4. 创建主库的初始化参数给备库用
SQL>Create pfile from spfile;
产生的文件名为a 存放目录默认放在$ORACLE_HOME/database下
5. 在主库创建备库的控制文件 和密码文件
SQL>Alter database create standby controlfile as 'D:\oracle\product\10.2.l';
D:>orapwd file=D:\a password=admin entries=5;
缺省情况下,win下口令文件的格式是a,unix下的格式是orapwSID(大小写敏感)
6. 在主库创建监听和配置a
a配置如下:
# a Network Configuration File: D:\oracle\product\10.2.0\db_1\network\a
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
(SID_NAME = orcl)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.85.3.44)(PORT = 1521))
)
)
a配置如下:
# a Network Configuration File: D:\oracle\product\10.2.0\db_1\network\a
# Generated by Oracle configuration tools.
primary =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.85.3.44)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
standby =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.85.3.43)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
安装oracle10g )
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
7. 在a添加以下内容:
*.log_archive_format='%T%S%r.ARC'
*.DB_UNIQUE_NAME='primary'
*.log_archive_config='DG_CONFIG=(primary,standby)'
*.log_archive_dest_1='location=D:\oracle\product\10.2.0\oradata\arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=primary'
*.log_archive_dest_2='SERVICE=standby arch ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=standby'
*.STANDBY_FILE_MANAGEMENT=AUTO
*.LOG_ARCHIVE_DEST_STATE_1=ENABLE
*.LOG_ARCHIVE_DEST_STATE_2=ENABLE
*.FAL_SERVER='standby'
*.FAL_CLIENT='primary'
关闭数据库,在用a重启,并创建spfile文件
SQL>startup pfile='$ORACLE_HOME/a'
SQL>create spfile from pfile='$ORACLE_HOME/a'
8.
A. 拷贝数据文件,参数文件,控制文件,密码文件到备库上
a参数文件,a密码文件考到$ORACLE_HOME/database下的,
l 考到$ORACLE_base/oradata/orcl/下,并分别重命名为l
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论