Specifying Alternate Destinations
来源:互联网 发布:小号 软件 编辑:程序博客网 时间:2024/06/11 13:31
Specifying Alternate Destinations
To specify that a location be an archive destination only in the event of a failure of another destination, you can make it an alternate destination. Both local and remote destinations can be alternates. The following example makes LOG_ARCHIVE_DEST_4
an alternate for LOG_ARCHIVE_DEST_3
:
ALTER SYSTEM SET LOG_ARCHIVE_DEST_4 = 'LOCATION=/disk4/arch';ALTER SYSTEM SET LOG_ARCHIVE_DEST_3 = 'LOCATION=/disk3/arch MAX_FAILURE=1 ALTERNATE=LOG_ARCHIVE_DEST_4';ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_4=ALTERNATE;SQL> SELECT dest_name, status, destination FROM v$archive_dest; DEST_NAME STATUS DESTINATION----------------------- --------- ----------------------------------------------LOG_ARCHIVE_DEST_1 VALID /disk1/archLOG_ARCHIVE_DEST_2 VALID /disk2/archLOG_ARCHIVE_DEST_3 VALID /disk3/archLOG_ARCHIVE_DEST_4 ALTERNATE /disk4/arch
通过测试:ALTER SYSTEM SET LOG_ARCHIVE_DEST_2 = 'LOCATION=G:\testb' scope=spfile;ALTER SYSTEM SET LOG_ARCHIVE_DEST_1 = 'LOCATION=F:\test\a NOREOPEN MAX_FAILURE=1 ALTERNATE=LOG_ARCHIVE_DEST_2' scope=spfile;ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ALTERNATE scope=spfile;shut immediate;startupSQL> show parameter log_archive_dest_NAME TYPE VALUE------------------------------------ ----------- ------------------------------log_archive_dest_1 string LOCATION=I:\test MANDATORY M AX_FAILURE=1 ALTERNATE=LOG_ARC HIVE_DEST_2log_archive_dest_2 string LOCATION=F:\test1 MANDATORYSQL> select dest_id,dest_name,status,destination,REOPEN_SECS,failure_count,max_failure from v$archive_dest where dest_name in ('LOG_ARCHIVE_DEST_1','LOG_ARCHIVE_DEST_2'); DEST_ID DEST_NAME STATUS DESTINATION REOPEN_SECS FAILURE_COUNT MAX_FAILURE---------- -------------------------------------------------- --------- -------------------------------------------------- ----------- ------------- ----------- 1 LOG_ARCHIVE_DEST_1 VALID I:\test 300 0 1 2 LOG_ARCHIVE_DEST_2 ALTERNATE F:\test1 300 0 0alter system switch logfile;切换n个 log;alter system switch logfile;I:\test 所在的盘i盘撑满继续切换日志alter system switch logfile;可以发现日志切换到了 F:\test1 盘我们可以查看日志目录的状态:SQL> select dest_id,dest_name,status,destination,REOPEN_SECS,failure_count,max_failure from v$archive_dest where dest_name in ('LOG_ARCHIVE_DEST_1','LOG_ARCHIVE_DEST_2'); DEST_ID DEST_NAME STATUS DESTINATION REOPEN_SECS FAILURE_COUNT MAX_FAILURE---------- -------------------------------------------------- --------- -------------------------------------------------- ----------- ------------- ----------- 1 LOG_ARCHIVE_DEST_1 DISABLED I:\test 300 1 1 2 LOG_ARCHIVE_DEST_2 VALID F:\test1 300 0 0在I盘满后,如果要切换回原来的LOG_ARCHIVE_DEST_1 为主盘,LOG_ARCHIVE_DEST_2 为备盘,可以切换alter system set LOG_ARCHIVE_DEST_STATE_1=ENABLE;alter system set LOG_ARCHIVE_DEST_STATE_2=ALTERNATE;SQL> select dest_id,dest_name,status,destination,REOPEN_SECS,failure_count,max_failure from v$archive_dest where dest_name in ('LOG_ARCHIVE_DEST_1','LOG_ARCHIVE_DEST_2') DEST_ID DEST_NAME STATUS DESTINATION REOPEN_SECS FAILURE_COUNT MAX_FAILURE---------- -------------------------------------------------- --------- -------------------------------------------------- ----------- ------------- ----------- 1 LOG_ARCHIVE_DEST_1 VALID I:\test 300 1 1 2 LOG_ARCHIVE_DEST_2 ALTERNATE F:\test1 300 0 0然后再切日志alter system switch logfile; 归档又会切到LOG_ARCHIVE_DEST_1 地址
相关参数:location 配置本地归档位置service 配置远程归档位置(即DG)mandatory 必须成功归档到指定路径之后,redo日志才能被复用。备库上慎用optional 可选的归档目标,如果归档失败,放弃归档reopen=n 归档失败后重试周期,默认值300秒AFFIRM—specifies that a redo transport destination acknowledges received redo data after writing it to the standby redo log.NOAFFIRM—specifies that a redo transport destination acknowledges received redo data before writing it to the standby redo log.
0 0
- Specifying Alternate Destinations
- Virtual Destinations
- Specifying Device Types
- Specifying Attributes of Types
- Specifying Attributes of Variables
- Specifying Attributes of Variables
- alternate keys
- alternate key
- Alternate Winding
- ActiveMQ之composite destinations
- AMQ虚拟Destinations
- Specifying DPI for NVIDIA Cards
- 4.2.3. Specifying Program Options
- Cascaded Destinations/Cascaded Standby Databases
- NTFS Alternate Streams
- Alternate Data Storage Forensics
- 安装 Ubuntu Alternate 版
- ubuntu alternate安装图形界面
- Linux单机最大tcp连接数(★firecat推荐★)
- Android,在争议中逃离 Linux 内核的 GPL 约束
- Raspberry pi 2 OSMC 安装
- struts2 拦截器修改request的parameters参数失败的问题
- JVM内存管理机制和垃圾回收机制
- Specifying Alternate Destinations
- Eclipse插件开发CleanUp
- 等待执行:time.sleep()和implicitly_wait()
- 日志
- php 学习网站
- Android代码规范参考指南
- 【经典算法】:银行金额大写转换
- iOS调用系统发短信功能详解
- Android监听程序进入后台,或者恢复到前台