這篇文章給大家介紹oracle中怎么查詢實例名與實例狀態(tài),內容非常詳細,感興趣的小伙伴們可以參考借鑒,希望對大家能有所幫助。
創(chuàng)新互聯(lián)建站長期為上千多家客戶提供的網站建設服務,團隊從業(yè)經驗10年,關注不同地域、不同群體,并針對不同對象提供差異化的產品和服務;打造開放共贏平臺,與合作伙伴共同營造健康的互聯(lián)網生態(tài)環(huán)境。為泰州企業(yè)提供專業(yè)的成都網站建設、網站制作,泰州網站改版等技術服務。擁有十載豐富建站經驗和眾多成功案例,為您定制開發(fā)。
[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
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,改變了需要重新啟動數據庫。
關于oracle中怎么查詢實例名與實例狀態(tài)就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。