zoukankan      html  css  js  c++  java
  • 19.3 管理逻辑备用数据库

    1. 开始 SQL Apply

    C:\>sqlplus sys/orcl@standby1 as sysdba

    SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 2月 19 16:05:21 2009

    Copyright (c) 1982, 2005, Oracle.  All rights reserved.

    连接到:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options

    SQL> alter database start logical standby apply;

    数据库已更改。

    SQL> alter database stop logical standby apply;

    数据库已更改。

    SQL> alter database start logical standby apply;

    数据库已更改。

    2. 显示已经注册的归档日志

    SQL> select sequence#,applied from dba_logstdby_log;

    SEQUENCE# APPLIED
    ---------- --------
           145 CURRENT
           146 CURRENT
           147 NO
           148 NO

    3. 检查是否正在应用重做数据

    SQL> select * from v$logstdby_stats where name='coordinator state';

    NAME                           VALUE
    ------------------------------ ------------------------------
    coordinator state              IDLE

    4. 查询 SQL Apply 进度

    SQL> select applied_scn,newest_scn from dba_logstdby_progress;

    APPLIED_SCN NEWEST_SCN
    ----------- ----------
        1974603    1974603

    5. 验证数据变化

    SQL> conn sys/orcl@demo as sysdba
    已连接。
    SQL> update scott.emp set sal=1111 where empno=7788;

    已更新 1 行。

    SQL> commit;

    提交完成。

    SQL> alter system archive log current;

    系统已更改。

    SQL> conn sys/orcl@standby1 as sysdba
    已连接。
    SQL> select sal from scott.emp where empno=7788;

           SAL
    ----------
          1111

    6. 转变逻辑备用数据库为主数据库

    SQL> alter database stop logical standby apply;

    数据库已更改。

    SQL> alter database activate logical standby database;

    数据库已更改。

  • 相关阅读:
    关于OI的文学作品
    HBOI 2020 游记
    从0开始的字符串生活(选手命要没了)
    近两年HBOI选做
    NOI online #3
    2020年“美团杯”程序设计挑战赛题解(目前只有测试赛)
    退群咕咕墙
    JS 获得当前地址栏url
    你了解getBoundingClientRect()?
    字符串与数字相加
  • 原文地址:https://www.cnblogs.com/yiwuya/p/3018970.html
Copyright © 2011-2022 走看看