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
  • 相关阅读:
    总结几个面试题
    产生下一个排列数的算法
    所谓码农
    简记微软实习生面试
    二维数组作为函数的参数传递
    详细解说 STL 排序(Sort)
    copy()之绝版应用
    STL标准模板库(简介)
    访问控制和继承方式
    常用软件开发模型比较分析
  • 原文地址:https://www.cnblogs.com/arcer/p/2976663.html
Copyright © 2011-2022 走看看