DG学习笔记(4)_建立物理Standby步骤及注意事项

DG学习笔记(4)_建立物理Standby步骤及注意事项

目录

 

1 Turn on force logging

2 Backup the primary database and create Standby Controlfile

3 Copy files to standby site

4 Set parameters on the physical standby database

5 Start the standby database

6 Configure Oracle Net

7 Set parameters on the primary database

8 Start the transport of redo

9 Notes

 

 

 

1 Turn on force logging

 

ALTER DATABASE FORCE LOGGING;

 

Perform. the command in Mount state

 

 

2 Backup the primary database and create Standby Controlfile

 

2.1 Make sure the primary is in archive log mode

 

2.2 Create a backup of the primary database.

 

You can use any backup of the primary database so long as you have archived redo logs completely recover the database. The backup can be old or new, consistent or inconsistent, Hot backups (or open backups) allow you to keep the database open while performing the backup. Nevertheless, you may prefer to make a new closed, consistent backup using the RMAN or OS utility to prevent the application of a large number of archived redo logs.( 能使用任何形式的备份, 只要有完备的归档文件. 最好的形式是一个Closed, Consistent Backup. 即准备, RMAN能做冷备吗? 不行吧.RMAN要连接数据库的,数据库状态至少为Mount)

 

 

2.3 Create the standby control file

 

ALTER DATABASE CREATE STANDBY CONTROL FILE AS file_name [reuse];

 

The filename for the created standby control file must be different from the filename of the current control file of the primary database. You can also use RMAN to create the standby database control file.(Standby control file name 必须与 Current control file name 不同, CopyStandby端时,可以改回去的.只是生成的时候不同而已.)

 

 

3 Copy files to standby site

 

Datafiles

Backup control file

Parameter file

All available archived redo logs (如果用的是冷备不需要, 拷贝过去后,是否要Register ?不用,因为Controlfile 中已做了记录,只需放到相同的目录下 )

 

Online redo logs. (Recommended for switchover and failover operations)

 

Conversion initialization parameters

DB_FILE_NAME_CONVERT

LOG_FILE_NAME_CONVERT

STANDBY_FILE_MANAGEMENT

These are set in Standby initialization file, and should be in the primary database initialization file as well. (PrimaryStandby都要设这些参数, 不是只在Standby设吗?两边都设置的原因是方便以后的Switchover)

 

 

4 Set parameters on the physical standby database

 

DB_FILE_NAME_CONVERT

LOG_FILE_NAME_CONVERT

LOG_ARCHIVE_FORMAT

STANDBY_FILE_MANAGEMENT

Maintain consistency when you add or delete a datafile on the primary database

 

= Manual(default) datafiles must be added on the standby database manually

 

= Auto: Add the datafile automatically to the standby database.

(是否需要手动添加,删除数据文件,但对数据文件的renaming还是必须手工做)

 

When you add a log file to the primary and want to add it to the standby as well then you

must:

• Set to MANUAL on the standby

• Redo log files on the primary

• Add them to the standbys

• Reset back to AUTO afterwards on the standby

(logfile不能自动添加,且必须将STANDBY_FILE_MANAGEMENT参数先围置为manual. )

 

STANDBY_ARCHIVE_DEST

LOG_ARCHIVE_START

REMOTE_ARCHIVE_ENABLE

 

Example: STBY_INIT.ORA

 

compatible='9.2.0'

control_files='D:\USER01\ORADATAB\U01\control01.ctl'

db_file_name_convert=

'D:\USER01\ORADATAA\U01','D:\USER01\ORADATAB\U01',

'D:\USER01\ORADATAA\U02','D:\USER01\ORADATAB\U02'

db_name='TESTA'

lock_name_space='testb'

log_file_name_convert=

'D:\USER01\ORADATAA\U03','D:\USER01\ORADATAB\U03'

remote_archive_enable='TRUE'

remote_login_passwordfile='exclusive'

standby_archive_dest='D:\USER01\ORADATAB\U04'

standby_file_management='auto'

 

5 Start the standby database

 

Bring it to the mount stage

Crate standby redo logs

Start the managed recover process(MRP)

SQL> STARTUP MOUNT PFILE=STBY_INIT.ORA

SQL> ALTER DATABASE ADD STANDBY LOGFILE

 (’/oracle/dbs/log1c.rdo’,’/oracle/dbs/log2c.rdo’) SIZE 500K;

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;

 

 

6 Configure Oracle Net

 

7 Set parameters on the primary database

 

LOG_ARCHIVE_DEST

LOG_ARCHIVE_STATE

 

ARCHIVE_LAG_TARGET:Set to the number of seconds after which a log switch must happen even if the log file is not full.(定时强制归档,减少Instance恢复时间)

 

LOG_ARCHIVE_TRACE

 

 

Example:

 

archive_lag_target=0

compatible='9.2.0'

db_name='TESTA'

log_archive_dest_1='LOCATION=D:\USER01\ORADATAA\ARCHIVE1'

log_archive_dest_state_1='ENABLE'

log_archive_dest_2='service=TESTB'

log_archive_dest_state_2='ENABLE'

log_archive_format='testa_%s.arc'

log_archive_max_processes=3

log_archive_start=TRUE

log_archive_trace=0

log_parallelism=1

remote_archive_enable='TRUE'

remote_login_passwordfile='exclusive'

standby_archive_dest='D:\USER01\ORADATAA\ARCHIVE2'

standby_file_management='MANUAL'

 

8 Start the transport of redo

 

ALTER SYSTEM ARCHIVE LOG CURRENT;

 

This will cause the archive process to archive the current log file and will start the transport of redo to the physical standby database. On the physical standby database the RFS process will start on reception of the redo.

 

 

9 Notes

 

1 Notes for Standby Database on The Same System

 

Set the LOCK_NAME_SPACE initialization parameter

 

Standby database datafiles must be in a different location

 

The standby database does not protect against disaster

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10248702/viewspace-629921/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10248702/viewspace-629921/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值