[转帖]alter system switch logfile和alter system archive log_MySQL, Oracle及数据库讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  MySQL, Oracle及数据库讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 3407 | 回复: 0   主题: [转帖]alter system switch logfile和alter system archive log        下一篇 
derek
注册用户
等级:中校
经验:1550
发帖:209
精华:0
注册:2011-7-21
状态:离线
发送短消息息给derek 加好友    发送短消息息给derek 发消息
发表于: IP:您无权察看 2011-8-1 21:57:31 | [全部帖] [楼主帖] 楼主

1、alter system switch logfile 是强制日志切换,不一定就归档当前的重做日志文件(若自动归档打开,就归档前的重做日志,若自动归档没有打开,就不归档当前重做日志。)
alter system archive log current 是归档当前的重做日志文件,不管自动归档有没有打都归档。
主要的区别在于:
ALTER SYSTEM SWITCH LOGFILE对单实例数据库RAC中的当前实例执行日志切换;
而ALTER SYSTEM ARCHIVE LOG CURRENT会对数据库中的所有实例执行日志切换。

为什么执行热备后要执行alter system archive log current 这个语句,看到很多脚本都是这样写的。
是不是必须的?

一般的RMAN脚本都是这样写的,因为RMAN是可以备份归档日志的。

alter system archive log current 这样后就可以将所有的归档都备份出来了。这样做是为了保证数据的完整和一致。

ALTER SYSTEM SWITCH LOGFILE ;
SWITCH LOGFILE Clause
TheSWITCHLOGFILEclause lets you explicitly force Oracle to begin writing to a new redo log file group, regardless of whether the files in the current redo log file group are full. When you force a log switch, Oracle begins to perform. a checkpoint but returns control to you immediately rather than when the checkpoint is complete. To use this clause, your instance must have the database open.
ALTER SYSTEM ARCHIVE LOG CURRENT ;
CURRENT Clause
SpecifyCURRENTto manually archive the current redo log file group of the specified thread, forcing a log switch. If you omit theTHREADparameter, then Oracle archives all redo log file groups from all enabled threads, including logs previous to current logs. You can specifyCURRENTonly when the database is open.
ALTER SYSTEM ARCHIVE LOG CURRENT NOSWITCH;
NOSWITCH
SpecifyNOSWITCHif you want to manually archive the current redo log file group without forcing a log switch. This setting is used primarily with standby databases to prevent data divergence when the primary database shuts down. Divergence implies the possibility of data loss in case of primary database failure.
You can use theNOSWITCHclause only when your instance has the database mounted but not open. If the database is open, then this operation closes the database automatically. You must then manually shut down the database before you can reopen it




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论