zoukankan      html  css  js  c++  java
  • oracle status

    1、SQL>startup mount

    数据库进入mount状态,只可以读取控制文件信息,不可以读取数据文件信息;

    2、SQL>alter database open

    将数据库切换到open状态

    3、查询数据库状态

    SQL> select dbid,name,switchover_status,db_unique_name,database_role,open_mode,current_scn from v$database;
    
          DBID NAME      SWITCHOVER_STATUS    DB_UNIQUE_NAME                 DATABASE_ROLE    OPEN_MODE            CURRENT_SCN
    ---------- --------- -------------------- ------------------------------ ---------------- -------------------- -----------
     724433656 DEVDB     TO PRIMARY           phydb                          PHYSICAL STANDBY MOUNTED                  1545869
    View Code

    4、查看监听服务的状态

    11gdg-> id
    uid=1101(oracle) gid=1000(oinstall) groups=1000(oinstall),1200(asmadmin),1201(asmdba),1300(dba),1301(oper)
    11gdg-> lsnrctl service
    
    LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 10-JUL-2013 18:28:23
    
    Copyright (c) 1991, 2011, Oracle.  All rights reserved.
    
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    Services Summary...
    Service "+ASM" has 1 instance(s).
      Instance "+ASM", status READY, has 1 handler(s) for this service...
        Handler(s):
          "DEDICATED" established:0 refused:0 state:ready
             LOCAL SERVER
    Service "phydb" has 1 instance(s).
      Instance "phydb", status READY, has 1 handler(s) for this service...
        Handler(s):
          "DEDICATED" established:1347 refused:0 state:ready
             LOCAL SERVER
    Service "phydbXDB" has 1 instance(s).
      Instance "phydb", status READY, has 1 handler(s) for this service...
        Handler(s):
          "D000" established:0 refused:0 current:0 max:1022 state:ready
             DISPATCHER <machine: 11gdg.localdomain, pid: 2176>
             (ADDRESS=(PROTOCOL=tcp)(HOST=11gdg.localdomain)(PORT=60468))
    The command completed successfully
    11gdg-> 
    View Code

    5、将数据库置于read only状态. 

    SQL> startup mount;
    ORACLE instance started.
    
    Total System Global Area  430075904 bytes
    Fixed Size                  2229064 bytes
    Variable Size             339741880 bytes
    Database Buffers           79691776 bytes
    Redo Buffers                8413184 bytes
    Database mounted.
    SQL> select open_mode from v$database;
    
    OPEN_MODE
    --------------------
    MOUNTED
    
    SQL> alter database open read only;
    
    Database altered.
    
    SQL> select open_mode from v$database;
    
    OPEN_MODE
    --------------------
    READ ONLY
    View Code

    6、查看数据库当前的scn

    SQL> select current_scn from v$database;
    
    CURRENT_SCN
    -----------
        4222245
    
    SQL> show user
    USER is "SYS"
    SQL>
    View Code
  • 相关阅读:
    码农如何通过编程赚更多的钱
    理解 OAuth 2.0 认证流程
    把同事的代码重写得干净又整洁,老板却让我做回滚?
    精读《如何做好 CodeReview》
    互联网行业的软件与人员的代际更迭随想
    十大最佳自动化测试工具
    使用 docker 高效部署你的前端应用
    在Linux 命令行中转换大小写
    Python批量检测服务器端口可用性与Socket函数使用
    基于华为云CSE微服务接口兼容常见问题
  • 原文地址:https://www.cnblogs.com/arcer/p/2976663.html
Copyright © 2011-2022 走看看