Oracle 10g使用RMAN创建physical standby(二)

2014-11-24 08:48:51 · 作者: · 浏览: 3
g_archive_dest_state_2=enable

fal_server=dbprimary

fal_client=dbstandby

standby_file_management=AUTO

5.生成password file

c:/>orapwd file=d:/oracle/ora92/DATABASE/PWDtest.ORA password=pass

或者直接将主库上的密码文件copy一份到备库上

6.配置网络

配置主备库的listener.ora,tnsnames.ora。修改完listener.ora后需要重启监听器。


主库:


listener.ora


SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(SID_NAME = PLSExtProc)

(ORACLE_HOME = /u01/oracle/product/10.2.0)

(PROGRAM = extproc)

)

)


LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = s1.gti.com)(PORT = 1521))

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))

)

)

tnsnames.ora


dbprimary =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.131)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = orcl)

)

)


dbstandby =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.132)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = orcl)

)

)

备库:


listener.ora


SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(SID_NAME = orcl)

(ORACLE_HOME = /u01/oracle/product/10.2.0)

)

)


LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.132)(PORT = 1521))

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))

)

)


tnsnames.ora


dbprimary =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.131)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = orcl)

)

)


dbstandby =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.132)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = orcl)

)

)


7.使用rman备份主库


[oracle@s1 ~]$ rman target /


Recovery Manager: Release 10.2.0.1.0 - Production on Thu May 29 19:52:37 2008


Copyright (c) 1982, 2005, Oracle. All rights reserved.


connected to target database: ORCL (DBID=1171867028)


RMAN> backup full format=/u02/db_%U

database include current controlfile for standby;


...................


8.归档主库当前日志

SQL> alter system archive log current;

System altered.

9.启动备库到nomount

sqlplus "/ as sysdba"

Connected to an idle instance.

SQL> startup nomount


Total System Global Area 285212672 bytes

Fixed Size 1218992 bytes

Variable Size 96470608 bytes

Database Buffers 184549376 bytes

Redo Buffers 2973696 bytes

10.利用rman恢复备库

[oracle@s1 ~]$ rman target /


Recovery Manager: Release 10.2.0.1.0 - Production on Thu May 29 19:53:21 2008


Copyright (c) 1982, 2005, Oracle. All rights reserved.


connected to target database: ORCL (DBID=1171867028)


RMAN> connect auxiliary


connected to auxiliary database: ORCL (DBID=1171867028, not mount)