当前位置:  数据库>oracle

Oracle Data Guard_启动和关闭物理备库

    来源: 互联网  发布时间:2017-06-02

    本文导语: 启动时应用重做日志,关闭时取消重做日志: 8.1Starting Up and Shutting Down a Physical Standby Database This section describes the SQL*Plus statements used to start up and shut down a physical standby database. 8.1.1Starting Up a Physical Standby Database 8.1.1 启动物理备库 ...

启动时应用重做日志,关闭时取消重做日志:

8.1Starting Up and Shutting Down a Physical Standby Database

This section describes the SQL*Plus statements used to start up and shut down a physical standby database.

8.1.1Starting Up a Physical Standby Database
8.1.1 启动物理备库
 

To start a physical standby database, use SQL*Plus to connect to the database with administrator privileges, and then use either the SQL*PlusSTARTUPorSTARTUPMOUNTstatement. When used on a physical standby database:

  • TheSTARTUPstatement starts the database, mounts the database as a physical standby database, and opens the database for read-only access.

  • TheSTARTUP MOUNTstatement starts and mounts the database as a physical standby database, but does not open the database.

  •  

Once mounted, the database can receive archived redo data from the primary database. You then have the option of either starting Redo Apply or real-time apply, or opening the database for read-only access.

一旦数据库装载后,数据库就能从主库接收归档重做日志。然后,你可以选择启用应用重做或者实时应用,再或者以只读方式打开数据库来访问。

 

For example:

  • Start and mount the physical standby database:

    SQL> STARTUP MOUNT;
  • Start Redo Apply or real-time apply:

    To start Redo Apply, issue the following statement:

    SQL>
    2>
     
    #########################################################################
    Sat Mar 29 11:48:57 2014
    ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION
    Sat Mar 29 11:48:57 2014
    Attempt to start background Managed Standby Recovery process (PRODSTD)
    MRP0 started with pid=54, OS id=3158
    Sat Mar 29 11:48:57 2014
    MRP0: Background Managed Standby Recovery process started (PRODSTD)
    Managed Standby Recovery not using Real Time Apply
    Media Recovery Waiting for thread 1 sequence 29
    Sat Mar 29 11:49:03 2014
    Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION
     
    ############################################################################

    To start real-time apply, issue the following statement:

    SQL>
    2>
  •  

    On the primary database, query theRECOVERY_MODEcolumn in theV$ARCHIVE_DEST_STATUSview, which displays the standby database's operation asMANAGED_RECOVERYfor Redo Apply andMANAGED REAL TIME APPLYfor real-time apply.

    在主库上,你可以查询V$ARCHIVE_DEST_STATUS的RECOVERY_MODE列,可以显示出备库的操作是MANAGED_RECOVERY 重做应用还是MANAGED REAL TIME APPLY实时应用。

     

    SeeSection 6.3for information about Redo Apply,Section 6.2.1for information about real-time apply, andSection 8.2for information about opening a physical standby database for read-only or read/write access.

     

    Note:

    When you first start Redo Apply on a newly created physical standby database that has not yet received any redo data from the primary database, anmessage may be returned. This indicates that Redo Apply is unable to determine the starting sequence number for media recovery. If this occurs, you must either manually retrieve and register an archived redo log file on the standby database, or wait for the automatic archiving to occur before restarting Redo Apply.
    当你在一个新创建的物理备库上第一次应用重做时,主库并没有归档日志传输到备库来,于是报错ORA-01112.这意味着重做应用无法为介质恢复提供一个日志序号。如果这个情况发生,你必须手动在备库上生成一个归档日志,或者在重做应用之前自动归档。

    8.1.2Shutting Down a Physical Standby Database

    Toshut down a physical standby database and stop Redo Apply, use the SQL*PlusSHUTDOWNstatement. Control is not returned to the session that initiates a database shutdown until shutdown is complete.

    关闭物理备库以及关闭重做应用,使用SHUTDOWN 语句。

    If the primary database is up and running, defer the destination on the primary database and perform a log switch before shutting down the standby database.

    如果主库正在运行,在主数据库上推迟目的地以及在关闭备库之前先执行日志切换。

     

    To stop Redo Apply before shutting down the database, use the following steps:

    在关闭数据库之前要先停止重做应用,使用一下步骤:

     

  • Issue the following query to find out if the standby database is performing Redo Apply or real-time apply. If the MRP0 or MRP process exists, then the standby database is applying redo.

    1.通过如下查询找出备库是在重做应用还是实时应用,如果MRP0或者MRP进程存在,那么备库正在应用重做。

    SQL> SELECT PROCESS, STATUS FROM V$MANAGED_STANDBY;
     
    ###############################################################################
    PROCESS STATUS
    --------- ------------
    ARCH CONNECTED
    ARCH CONNECTED
    RFS IDLE
    RFS IDLE
    ###############################################################################
  • If Redo Apply is running, cancel it as shown in the following example:

    2.如果重做应用正在运行,用如下例子来取消它。

    SQL>
     
    ###############################################################################
    Sat Mar 29 11:49:40 2014
    ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL
    Sat Mar 29 11:49:42 2014
    MRP0: Background Media Recovery cancelled with status 16037
    Sat Mar 29 11:49:42 2014
    Errors in file /u01/app/Oracle/admin/PRODSTD/bdump/prodstd_mrp0_3158.trc:
    ORA-16037: user requested cancel of managed recovery operation
    Recovery interrupted!
    Sat Mar 29 11:49:43 2014
    Waiting for MRP0 pid 3158 to terminate
    Waiting for MRP0 pid 3158 to terminate
    Waiting for MRP0 pid 3158 to terminate
    Sat Mar 29 11:49:45 2014
    Errors in file /u01/app/oracle/admin/PRODSTD/bdump/prodstd_mrp0_3158.trc:
    ORA-16037: user requested cancel of managed recovery operation
    Sat Mar 29 11:49:45 2014
    MRP0: Background Media Recovery process shutdown (PRODSTD)
    Sat Mar 29 11:49:46 2014
    Managed Standby Recovery Canceled (PRODSTD)
    Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL
     
    取消日志应用之后,即没有MRP0的进程了。
    ###############################################################################
  • Shut down the standby database.

    3.关闭备库。

    SQL> SHUTDOWN IMMEDIATE;
  • 推荐阅读:

    RMAN 配置归档日志删除策略

    Oracle基础教程之通过RMAN复制数据库

    RMAN备份策略制定参考内容

    RMAN备份学习笔记

    Oracle数据库备份加密 RMAN加密


        
     
     

    您可能感兴趣的文章:

  • 如何将Aix上的oracle 物理备份 然后再在linux 系统上还原oracle
  • fedora10安装oracle11g提示物理内存不足怎么办?
  • Oracle物理结构概述
  • 轻松理解Oracle数据库中的物理结构
  • Oracle安装过程中物理内存检查及临时temp空间不足问题解决
  • 深入理解Oracle数据库的启动和关闭
  • 如何启动和关闭安装在UNIX下的ORACLE数据库?
  • Oracle关闭SUN的开源项目
  • Linux平台启动关闭Oracle数据库
  • 请问,在unix下,关闭oracle数据库和重起unix,的正确顺序和命令应该是怎样的!请教!
  • 选择合适的Oracle数据库关闭方法
  • 技巧分享 Oracle数据库的启动和关闭
  • 解决Linux下Oracle无法关闭数据库的问题
  • [200分]在redhatlinux9中,关闭系统时,如何设置先自动关闭oracle9i数据库(急)
  • Oracle 9i 数据库异常关闭后的启动
  • oracle 服务启动,关闭脚本(windows系统下)
  • oracle 如何关闭打开归档日志
  • Oracle9i数据库异常关闭后的启动
  • Oracle数据库的启动与关闭方法
  • Linux As4单实例Oracle系统启动/关闭脚本
  • 深刻理解Oracle数据库的启动和关闭
  • DBA_Oracle Startup / Shutdown启动和关闭过程详解(概念)(对数据库进行各种维护操作)
  • ORACLE11g随RHEL5系统自动启动与关闭的设置方法
  •  
    本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
    本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • 在linux下安装oracle,如何设置让oracle自动启动!也就是让oracle那个服务自动启动,不是手动的
  • Linux系统下Oracle的启动与Oracle监听的启动
  • linux下安装oracle后使用命令行启动的方法 linux启动oracle
  • 让Oracle服务随Linux系统的启动而启动
  • 配置Oracle management server /Oracle启动OMS
  • solaris9下怎么查看oracle服务是否启动,以及怎么启动,在线等待。
  • 启动oracle是报错了
  • Linux系统查看Oracle服务是否启动
  • linux下oracle的自启动脚本解析
  • linux oracle8.17 下的Management server 如何启动
  • Unix/Linux上启动oracle数据库
  • Linux下命令行启动oracle时报错的解决
  • Linux下如何启动ORACLE 的Managerment Server服务????
  • 记录Linux下一次oracle启动错误
  • 为何用dbstart启动oracle10g不好用
  • 高分求助:安装完oracle9i后启动不了
  • 关于Oracle启动无法启动netmgr问题的解决
  • linux上安装oracle 数据库后,是否能写shell程序实现数据库的自动启动。
  • Linux下如何启动oracle的Listener服务??
  • Linux安装Oracle启动图形界面问题
  • Oracle 12c发布简单介绍及官方下载地址
  • 请问su oracle 和su - oracle有什么不同?
  • oracle 11g最新版官方下载地址
  • 虚拟机装Oracle R12与Oracle10g
  • Oracle 数据库(oracle Database)Select 多表关联查询方式
  • Oracle 数据库开发工具 Oracle SQL Developer
  • Oracle数据库(Oracle Database)体系结构及基本组成介绍
  • Oracle EBS R12 支持 Oracle Database 11g
  • 如何设置让Oracle SQL Developer显示的时间包含时分秒
  • SCO unix下安装oracle,但没有光盘,请大家推荐一个oracle下载站点(unix版本的)。谢谢!!!!
  • Oracle 10g和Oracle 11g网格技术介绍


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,