Oracle dataguard 配置
2012-10-19 14:03:51 来源:WEB开发网Oracle dataguard 配置 系统 linux
说明:主服务器 ora10g01(192.168.1.252)
Standby服务器 orac10g02(192.168.1.253)
两台机器都安装相同版本的数据库
主库创建数据库
物理备库不创建数据库
1. 主库备库必须要是归档模式,主库和备库监听全部起来lsnrctl start
2. Archive log list
3. 设置主库强制归档
Conn /as sysdba
startup
Alter database force logging;
4. 修改主库的tnsnames
加上
ORA10G01 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.253)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ora10g)
)
)
ORA10G02 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.252)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ora10g)
)
)
5. 修改备库的tnsnames
加上
ORA10G01 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.253)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ora10g)
)
)
ORA10G02 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.252)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ora10g)
)
)
6.生成备用库的控制文件
Alter database create standby controlfile as ‘/u01/app/oracle/standby.ctl’
7.修改主库初始化参数文件
create pfile from spfile
加上
log_archive_dest_1='LOCATION=/u01/app/oracle/archive'
log_archive_dest_state_1=enable
log_archive_dest_2='SERVICE=ora10g01'
log_archive_dest_state_2=enable
log_archive_format='%t_%s_%r.arc'
log_archive_max_processes=2
fal_server=ora10g01
fal_client=ora10g02
db_unique_name=ora10g01
8.shutdown immediate
9.vi /etc/hosts
加上
192.168.1.252 ora10g01
192.168.1.253 ora10g02
10.主库的数据文件,控制文件,日志文件拷到备库上
scp -r ora10g ora10g02 :/u01/app/oracle/oadata
scp-r /u01/app/oracle/standby.ctl ora10g02 :/u01/app/oracle
scp –r initora10g.ora ora10g02 :/u01/oracle/oradata
11.要确保密码一样的也可以重建密码文件
Orapwd file= /u01/app/oralce/product/10.2.0/db_1/dbs/orapwora10g
12.备库初始化参数文件
加上
log_archive_dest_1='LOCATION=/u01/app/oracle/archive'
log_archive_dest_state_1=enable
log_archive_dest_2='SERVICE=ora10g02'
log_archive_dest_state_2=enable
log_archive_format='%t_%s_%r.arc'
log_archive_max_processes=2
fal_server=ora10g02
fal_client=ora10g01
db_unique_name=ora10g02
13.检查下归档的文件夹是否创建
14.删除备库的控制文件
Mv standby.ctl to control01.ctl
Cp control01.ctl control02.ctl
Cp control01.ctl control03.ctl
14.启动主库
Conn /as sysdba
Create spfile from pfile
- ››oracle 恢复误删除的表和误更新的表
- ››Oracle分页查询排序数据重复问题
- ››Oracle创建dblink报错:ORA-01017、ORA-02063解决
- ››Oracle 提高SQL执行效率的方法
- ››Oracle 动态查询,EXECUTE IMMEDIATE select into...
- ››Oracle 11g必须开启的服务及服务详细介绍
- ››oracle性能34条优化技巧
- ››oracle数据库生成随机数的函数
- ››Oracle 数据库表空间容量调整脚本
- ››oracle单库彻底删除干净的方法
- ››Oracle创建表空间、创建用户以及授权、查看权限
- ››oracle 中 UPDATE nowait 的使用方法
更多精彩
赞助商链接