[20200302]startup dba.txt

lfree發表於2020-03-02

[20200302]startup dba.txt

--//不記得那個時候看到人家這樣執行啟動資料庫的操作,不知道後面的dba什麼意思。
--//今天才知道實際上使用在rman,直接啟動到restricted模式,測試看看。

1.測試1:
--//在sqlplus下:
SYS@book> startup dba
SP2-0714: invalid combination of STARTUP options

2.測試2:
RMAN> startup dba
Oracle instance started
database mounted
database opened
Total System Global Area     643084288 bytes
Fixed Size                     2255872 bytes
Variable Size                205521920 bytes
Database Buffers             427819008 bytes
Redo Buffers                   7487488 bytes

SYS@book> select status,instance_name,logins from v$instance;
STATUS       INSTANCE_NAME    LOGINS
------------ ---------------- ----------
OPEN         book             RESTRICTED
--//重啟:

SYS@book> startup
ORACLE instance started.
Total System Global Area  643084288 bytes
Fixed Size                  2255872 bytes
Variable Size             205521920 bytes
Database Buffers          427819008 bytes
Redo Buffers                7487488 bytes
Database mounted.
Database opened.

SYS@book> select status,instance_name,logins from v$instance;
STATUS       INSTANCE_NAME    LOGINS
------------ ---------------- ----------
OPEN         book             ALLOWED


SYS@book> alter system enable restricted session;
System altered.


SYS@book> select status,instance_name,logins from v$instance;
STATUS       INSTANCE_NAME    LOGINS
------------ ---------------- ----------
OPEN         book             RESTRICTED

3.測試3:
--//在sqlplus下:
SYS@book> startup restrict
ORACLE instance started.
Total System Global Area  643084288 bytes
Fixed Size                  2255872 bytes
Variable Size             205521920 bytes
Database Buffers          427819008 bytes
Redo Buffers                7487488 bytes
Database mounted.
Database opened.
--//oracle的語法有時候很奇怪,這裡不要寫成startup restricted。否者報
SYS@book> startup restricted
SP2-0714: invalid combination of STARTUP options

SYS@book> select status,instance_name,logins from v$instance;
STATUS       INSTANCE_NAME    LOGINS
------------ ---------------- ----------
OPEN         book             RESTRICTED

SYS@book> alter system disable restricted session;
System altered.

SYS@book> select status,instance_name,logins from v$instance;
STATUS       INSTANCE_NAME    LOGINS
------------ ---------------- ----------
OPEN         book             ALLOWED

--//如果在rman下執行:

RMAN> startup restrict
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": expecting one of: "dba, force, mount, newline, nomount, pfile, ;"
RMAN-01008: the bad identifier was: restrict
RMAN-01007: at line 1 column 9 file: standard input
--//newline什麼意思!!

RMAN> startup newline
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": expecting one of: "dba, force, mount, newline, nomount, pfile, ;"
RMAN-01008: the bad identifier was: newline
RMAN-01007: at line 1 column 9 file: standard input

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2677970/,如需轉載,請註明出處,否則將追究法律責任。

相關文章