[20190115]共享服務模式與啟動到mount狀態.txt
[20190115]共享服務模式與啟動到mount狀態.txt
--//當資料庫啟動到mount狀態時是看不到共享服務模式的.測試是否直接使用埠連線資料庫.
1.環境:
SYS@book> @ ver
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SYS@book> startup mount
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.
SYS@book> show parameter dispatchers
NAME TYPE VALUE
----------- ------ -------------------------------------
dispatchers string (PROTOCOL=TCP) (SERVICE=book,bookXDB)
SYS@book> show parameter service_names
NAME TYPE VALUE
------------- ------ ---------------
service_names string BOOK, BOOKSHARE
$ lsnrctl services
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 15-JAN-2019 16:21:20
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(ARGV0=LLLLLL)(HOST=0.0.0.0)(PORT=1521)(ARGV0=KKKKK)))
Services Summary...
Service "BOOKSHARE" has 1 instance(s).
Instance "book", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "booK123" has 1 instance(s).
Instance "book", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "book" has 1 instance(s).
Instance "book", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
The command completed successfully
$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 15-JAN-2019 16:21:30
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(ARGV0=LLLLLL)(HOST=0.0.0.0)(PORT=1521)(ARGV0=KKKKK)))
STATUS of the LISTENER
------------------------
Alias listener
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 15-JAN-2019 16:10:13
Uptime 0 days 0 hr. 11 min. 17 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0.4/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/11.2.0.4/dbhome_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "BOOKSHARE" has 1 instance(s).
Instance "book", status READY, has 1 handler(s) for this service...
Service "booK123" has 1 instance(s).
Instance "book", status UNKNOWN, has 1 handler(s) for this service...
Service "book" has 1 instance(s).
Instance "book", status READY, has 1 handler(s) for this service...
The command completed successfully
--//啟動沒有看到共享服務模式.
2.查詢共享模式開啟的監聽埠,測試是否能連上資料庫.
$ ps -ef | egrep "d00[0]|s00[0]"
oracle 51897 1 0 16:10 ? 00:00:00 ora_d000_book
oracle 51899 1 0 16:10 ? 00:00:00 ora_s000_book
--//而實際上在mount狀態,s000,d000程式已經啟動.
# netstat -tunlp | egrep 'Active|Proto|tnslsnr|book'
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:1521 0.0.0.0:* LISTEN 51849/tnslsnr
tcp 0 0 :::52642 :::* LISTEN 51897/ora_d000_book
udp 0 0 ::1:14493 :::* 51861/ora_pmon_book
udp 0 0 ::1:30118 :::* 51899/ora_s000_book
udp 0 0 ::1:31628 :::* 51897/ora_d000_book
--//程式ora_d000_book(51897),已經開啟了52642埠,在監聽狀態.
d:\>sqlplus sys/oracle@192.168.100.78:52642/book as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Tue Jan 15 16:33:43 2019
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@192.168.100.78:52642/book> select open_mode from v$database ;
OPEN_MODE
--------------------
MOUNTED
--//可以連上資料庫.
d:\>sqlplus -s -l sys/oracle@192.168.100.78:52642/bookxdb as sysdba
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
SP2-0751: Unable to connect to Oracle. Exiting SQL*Plus
d:\>sqlplus -s -l sys/oracle@192.168.100.78:52642/bookshare as sysdba
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
SP2-0751: Unable to connect to Oracle. Exiting SQL*Plus
d:\>sqlplus -s -l sys/oracle@192.168.100.78:52642/book123 as sysdba
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
SP2-0751: Unable to connect to Oracle. Exiting SQL*Plus
--//說明僅僅book服務名可以連上.
3.啟動到open,繼續觀察測試:
SYS@book> alter database open ;
Database altered.
$ lsnrctl services
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 15-JAN-2019 16:43:26
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(ARGV0=LLLLLL)(HOST=0.0.0.0)(PORT=1521)(ARGV0=KKKKK)))
Services Summary...
Service "BOOKSHARE" has 1 instance(s).
Instance "book", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "booK123" has 1 instance(s).
Instance "book", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "book" has 1 instance(s).
Instance "book", status READY, has 2 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
"D000" established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER <machine: xxxxxyyy, pid: 51897>
(ADDRESS=(PROTOCOL=tcp)(HOST=xxxxxyyy.com)(PORT=52642))
Service "bookXDB" has 1 instance(s).
Instance "book", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER <machine: xxxxxyyy, pid: 51897>
(ADDRESS=(PROTOCOL=tcp)(HOST=xxxxxyyy.com)(PORT=52642))
The command completed successfully
d:\>sqlplus -l sys/oracle@192.168.100.78:52642/book as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Tue Jan 15 16:44:44 2019
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
d:\tools\sqltemp>sqlplus -l sys/oracle@192.168.100.78:52642/bookxdb as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Tue Jan 15 16:45:05 2019
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@192.168.100.78:52642/bookxdb> select open_mode from v$database ;
OPEN_MODE
--------------------
READ WRITE
--//這個時候使用book,bookxdb服務名都可以連上.
--//從這裡說明看出,從安全形度考慮,配置服務名也許最佳的方法就是不要每個服務名支援兩種連線模式.
--//靜態註冊使用服務名最好也與資料庫動態的服務名不同.共享模式的服務名也最好分開配置.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2558415/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20190115]關於共享服務與專用模式.txt模式
- [20161212]ezconnect與共享服務模式.txt模式
- [20190306]共享服務模式與SDU.txt模式
- 資料庫啟動在mount狀態,無任何報錯資料庫
- [20160830]使用共享服務模式的弊端.txt模式
- 啟動dataguard備庫到read-only狀態
- [20180316]非同步IO和共享服務模式.txt非同步模式
- [20180316]共享服務模式和直接路徑讀.txt模式
- 啟動、關閉與資料庫的特殊狀態資料庫
- win10如何關閉共享服務_win10共享服務怎麼開啟Win10
- 從狀態模式看 JavaScript 與 Java模式JavaScript
- 狀態模式模式
- Activity啟動模式(GIF 動態演示)模式
- JavaStatePattern(狀態模式)JavaAST模式
- JS 狀態模式JS模式
- (三)狀態模式模式
- 狀態模式(State)模式
- 設計模式-狀態模式設計模式
- 設計模式:狀態模式設計模式
- 策略模式與狀態模式不是雙胞胎,而是情侶!模式
- 資料庫啟動的不同狀態資料庫
- 3.1.5.5 啟動例項到限制模式模式
- 行為型模式:狀態模式模式
- 設計模式(十五)狀態模式設計模式
- 設計模式之——狀態模式設計模式
- javascript設計模式狀態模式JavaScript設計模式
- 設計模式(六):狀態模式設計模式
- 《JavaScript設計模式與開發實踐》模式篇(13)—— 狀態模式JavaScript設計模式
- 狀態變化模式模式
- 狀態模式(State pattern)模式
- 17_狀態模式模式
- 檔案共享服務
- QuickStart:專案快速啟動之模型與共識UI模型
- 任務的分解綜合狀態與單據
- 用設計模式去掉沒必要的狀態變數 —— 狀態模式設計模式變數
- 狀態機模式 與 ajax 的結合運用模式
- Waymo在美國推出自動駕駛汽車共享服務自動駕駛
- Oracle 在mount狀態下重新命名資料檔案Oracle