--alter system [switch logfile]与[archive log current]的区别
------------------------------------------------------------2013/09/21
 
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
The SWITCH LOGFILE clause 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
Specify CURRENT to manually archive the current redo log file group of the
specified thread(instance), forcing a log
switch. If you omit the THREAD parameter, then Oracle archives all redo log
file groups from all enabled threads(instances), including logs previous to current logs.
You can specify CURRENT only when the database is open.
ALTER SYSTEM ARCHIVE LOG CURRENT NOSWITCH;
NOSWITCH
Specify NOSWITCH if 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 the NOSWITCH clause 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.
ALTER SYSTEM ARCHIVE LOG ALL
  对数据库中的非当前未归档日志进行归档,不负责归档current日志。假设一个繁忙的系统中,有日志6个组,分别是group 1~6,当前的日志组是5,而归档进程正在操作group 3的内容,未写完,这时候group 4就是未归档的非当前日志。
 
 

alter system [switch logfile]与[archive log current]的区别的更多相关文章

  1. alter system switch logfile与alter system archive log current的区别

    以前知道 ALTER SYSTEM SWITCH LOGFILE对单实例数据库或RAC中的当前实例执行日志切换, ALTER SYSTEM ARCHIVE LOG CURRENT会对数据库中的所有实例 ...

  2. alter system archive log current作用及和alter system switch logfile区别

    alter system archive log current 是归档当前的重做日志文件,不管自动归档有没有打都归档. alter system switch logfile 是强制日志切换,不一定 ...

  3. ALTER SYSTEM ARCHIVELOG CURRENT挂起案例

    最近两天,一台ORACLE数据库的作业执行delete_ob_get_epps.sh脚本清理过期备份时,执行下面SQL语句就会被阻塞,在监控工具DPA里面部分截图如下(图片分开截断) sql 'alt ...

  4. Oracle 11g的Redo Log和Archive Log的分析方法

    自Oracle 11g起,无需设置UTL_FILE_DIR就可以使用LOGMNR对本地数据库的日志进行分析,以下是使用LOGMNR的DICT_FROM_ONLINE_CATALOG分析REDO和归档日 ...

  5. DBA_Oracle Archive Log的基本应用和启用(概念)

    2014-11-15 Created By BaoXinjian

  6. LOGMNR分析redo log和archive log教程

    自Oracle 11g起,无需设置UTL_FILE_DIR就可以使用LOGMNR对本地数据库的日志进行分析,以下是使用LOGMNR的DICT_FROM_ONLINE_CATALOG分析REDO和归档日 ...

  7. archive log full ora-00257

    ############# sample 0 asmcmd show free 37G in archive_log ASMCMD> lsdgState Type Rebal Unbal Sec ...

  8. alter system set events

    格式:alter system|session set events ‘[eventnumber|immediate] trace name eventname [forever] [, level ...

  9. alter system set events相关知识

    格式:alter system|session set events ‘[eventnumber|immediate] trace name eventname [forever] [, level ...

随机推荐

  1. 在线用户数-Constants

    package com.pb.news.constants; public class Constants { public static int ONLINE_USER_COUNT=0;//在线用户 ...

  2. linux 配置Apache 、PHP

    1. 安装 Apache 安装apache,首先要使用管理员权限,如果如法获取请联系您的管理员. centos: yum install httpd httpd-devel 2. 安装PHP 同样也需 ...

  3. tp框架---验证码详解

    很多注册登录界面都会验证码,用tp如何实现验证码的功能呢? 在tp中:Think\Verify类可以支持验证码的生成和验证功能. 首先,看一下逻辑: (1)如何生成?------ 先做Yanzheng ...

  4. js中变量的连续赋值

    今天遇到了一个连续赋值的经典案例,网友们给出的答案也是五花八门,看起来有些繁琐,我也来说说自己的看法. 下面就是这个经典案例: var a = {n: 1}: var b = a; a.x = a = ...

  5. TCP简单通讯

    客户端代码: package com.kaige123.net01; import java.io.IOException; import java.io.InputStream; import ja ...

  6. 【Java IO流】File类的使用

    File类的使用 Java中的File类是在java.io.File中,Java.IO.File类表示文件或目录. File类只用于表示文件(目录)的信息(名称.大小等),不能用于文件内容的访问. 一 ...

  7. 基于.NET CORE微服务框架 -谈谈surging的服务容错降级

    一.前言 对于不久开源的surging受到不少.net同学的青睐,也受到.net core学习小组的关注,邀请加入.NET China Foundation以方便国内.net core开源项目的推广, ...

  8. #Laravel 笔记# 多语言化 App::setLocale() 持久化。

    App::getLocale();获取当前语言 App::setLocale();设置语言配置文件 语言配置文件config/app.php locale 是默认语言,fallback_locale为 ...

  9. saveOrupdate和 merge的区别

    merge和saveOrUpdate方法区别在于:merge方法是把我们提供的对象转变为托管状态的对象:而saveOrUpdate则是把我们提供的对象变成一个持久化对象:说的通俗一点就是:saveOr ...

  10. HDU 6040---Hints of sd0061(STL)

    题目链接 Problem Description sd0061, the legend of Beihang University ACM-ICPC Team, retired last year l ...