资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

oracle实例名查询、实例状态查询等

 

创新互联建站是一家以网站建设公司、网页设计、品牌设计、软件运维、网站推广、小程序App开发等移动开发为一体互联网公司。已累计为自上料搅拌车等众行业中小客户提供优质的互联网建站和软件开发服务。

一、查看实例名、表等


[oracle@shoubashou.com ~]$ sqlplus scott/tiger@orcl


SQL> show user;

USER is "SCOTT"

 

 

SQL> select * from tab;

TNAME                          TABTYPE  CLUSTERID

------------------------------ ------- ----------

BONUS                          TABLE   

DEPT                           TABLE   

EMP                            TABLE   

SALGRADE                       TABLE   

 

SQL> conn sys/oracle@orcl as sysdba

Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 

Connected as sys@orcl AS SYSDBA

 

SQL> select name from v$database;

NAME

---------

ORCL

SQL> select * from global_name; #数据库全局名称

 

GLOBAL_NAME

--------------------------------------------------------------------------------

ORCL

 

SQL> show parameter global_names;

 

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

global_names                         boolean     FALSE

 

SQL> select status from v$instance;

STATUS  #  手把手

------------

OPEN
 

二、启动几个阶段状态实验


oracle实例名查询、实例状态查询等

 

1. nomount

 

SQL> startup nomount

 

ORACLE instance started.

Total System Global Area 1286066176 bytes

Fixed Size                  2228024 bytes

Variable Size             352321736 bytes

Database Buffers          922746880 bytes

Redo Buffers                8769536 bytes

SQL> select status from v$instance;

 

STATUS

------------

STARTED

 

SQL> select open_mode from v$database;

select open_mode from v$database

                      *

ERROR at line 1:

ORA-01507: database not mounted

 

2. mount

SQL> alter database mount;

 

Database altered.

 

SQL> select status from v$instance;

 

STATUS

------------

MOUNTED

 

SQL> select open_mode from v$database;

 

OPEN_MODE

--------------------

MOUNTED

 

3.open

 

SQL> alter database open ;

 

Database altered.

 

SQL> select status from v$instance;

 

STATUS

------------

OPEN

 

SQL> select open_mode from v$database;

 

OPEN_MODE

--------------------

READ WRITE

 

4. close

 

SQL> alter database close;

 

Database altered.

 

SQL> select status from v$instance;

 

STATUS

------------

MOUNTED

 

SQL> select open_mode from v$database;

 

OPEN_MODE

--------------------

MOUNTED

 

# 数据库open_mode的read only和read write,改变了需要重新启动数据库。

原文转自:https://www.shoubashou.com/db/oracle/95.html

 


网页标题:oracle实例名查询、实例状态查询等
分享网址:http://cdkjz.cn/article/gddjeo.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220