[20151023]不啟動監聽遠端能連線資料庫嗎?
[20151023]不啟動監聽遠端能連線資料庫嗎?.txt
--如果有人問你不啟動監聽遠端能連線資料庫嗎?我想我開始的回答不行。
--但是不要忘了,oracle支援專有伺服器以及共享伺服器模式,而共享伺服器模式可以不使用1521埠,這樣就可以不用啟動監聽遠端連
--接伺服器。
--透過測試來說明問題。
1.測試環境:
SYS@test> @ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- ----------------------------------------------------------------
x86_64/Linux 2.4.xx 10.2.0.4.0 Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
SYS@test> show parameter shared
NAME TYPE VALUE
------------------------------------ ------------- ----------
hi_shared_memory_address integer 0
max_shared_servers integer
shared_memory_address integer 0
shared_pool_reserved_size big integer 13421772
shared_pool_size big integer 0
shared_server_sessions integer
shared_servers integer 1
SYS@test> show parameter dispatchers
NAME TYPE VALUE
------------------------------------ -------------- --------------------------------
dispatchers string (PROTOCOL=TCP) (SERVICE=testXDB)
max_dispatchers integer
$ ps -ef | grep ora_d00[0]
oracle 7697 1 0 08:28 ? 00:00:00 ora_d000_test
--這是一個安裝好以後沒有改動以上引數的設定。可以發現預設就啟動一個ora_d000_test.這個就是用於共享伺服器的連線,預設僅僅啟
--動1個,如果多個是ora_d001_test....
$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 23-OCT-2015 08:54:02
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.89)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
$ netstat -na | grep 1521
--可以發現監聽沒有啟動。
2.修改遠端的client,在tnsnames.ora加入如下:
89S =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.89)(PORT = 1521))
)
(CONNECT_DATA =
(SID = test)
(SERVER = SHARED)
)
)
--很明顯這樣是無法連線資料庫的,因為1521埠沒有開啟。
--我們必須要要知道程式ora_d000_test開啟的埠號。
$ netstat -tnlp
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
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:111 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:29018 0.0.0.0:* LISTEN 7697/ora_d000_test
tcp 0 0 0.0.0.0:51206 0.0.0.0:* LISTEN -
tcp 0 0 :::111 :::* LISTEN -
tcp 0 0 :::22 :::* LISTEN -
--從以上輸出可以知道遠端埠29018(對應ora_d000_test程式)。修改tnsnames.ora檔案如下:
89S =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.89)(PORT = 29018))
)
(CONNECT_DATA =
(SID = test)
(SERVER = SHARED)
)
)
d:\tools\rlwrap>sqlplus scott/btbtms@89s
SQL*Plus: Release 12.1.0.1.0 Production on Fri Oct 23 08:59:14 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SCOTT@89s> @spid
SID SERIAL# SPID C50
---------- ---------- ------ --------------------------------------------------
146 21 7699 alter system kill session '146,21' immediate;
SCOTT@89s> select sysdate from dual ;
SYSDATE
-------------------
2015-10-23 09:07:33
SCOTT@89s> select sid, serial#,server from v$session where sid = ( select sid from v$mystat where rownum=1);
SID SERIAL# SERVER
---------- ---------- ---------
146 21 SHARED
--這樣遠端就可以連線資料庫。注意上面的配置只能使用(SID = test),因為dispatchers預設配置僅僅支援SERVICE=testXDB。
$ ps -ef | egrep "ora_d000|7699" | grep -v egrep
oracle 7697 1 0 08:28 ? 00:00:00 ora_d000_test
oracle 7699 1 0 08:28 ? 00:00:00 ora_s000_test
--再啟動一個會話:
SCOTT@89s> @spid
SID SERIAL# SPID C50
---------- ---------- ------ --------------------------------------------------
142 32 7699 alter system kill session '142,32' immediate;
--依舊使用程式號(ora_s000_test)是7699.這也是共享的含義,節約了伺服器記憶體的使用。特別適合連線非常巨大,執行sql語句完成很快的情況。
3.我的測試client是12c,11gR2開始增強了簡易連線魔術:
d:\tools\rlwrap>sqlplus scott/btbtms@192.168.100.89:29018/test:shared
SQL*Plus: Release 12.1.0.1.0 Production on Fri Oct 23 09:17:16 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
Enter user-name:
ERROR:
ORA-12560: TNS:protocol adapter error
--因為不支援服務名test(主要是沒有配置)。執行如下:
d:\tools\rlwrap>sqlplus scott/btbtms@192.168.100.89:29018/testXDB:shared
SQL*Plus: Release 12.1.0.1.0 Production on Fri Oct 23 09:18:32 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SCOTT@192.168.100.89:29018/testXDB:shared> @spid
SID SERIAL# SPID C50
---------- ---------- ------ --------------------------------------------------
142 40 7699 alter system kill session '142,40' immediate;
SCOTT@192.168.100.89:29018/testXDB:shared> select sid, serial#,server from v$session where sid = ( select sid from v$mystat where rownum=1);
SID SERIAL# SERVER
---------- ---------- ---------
142 40 SHARED
4.修改引數dispatchers:
SYS@test> alter system set dispatchers='(PROTOCOL=TCP) (DISP=2)(SERVICE=test,testXDB)' scope=memory;
System altered.
$ ps -ef | egrep "ora_d00|7699" | grep -v egrep
oracle 7697 1 0 08:28 ? 00:00:00 ora_d000_test
oracle 7699 1 0 08:28 ? 00:00:00 ora_s000_test
oracle 8793 1 0 09:21 ? 00:00:00 ora_d001_test
--修改引數加入DISP=2,這樣dispatchers啟動了2個。另外我還增加服務名test,下面測試使用test服務的情況:
d:\tools\rlwrap>sqlplus scott/btbtms@192.168.100.89:29018/test:shared
SQL*Plus: Release 12.1.0.1.0 Production on Fri Oct 23 09:24:17 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
--ok透過。
5.修改tnsnames.ora配置:
--說明:採用SERVICE_NAME ,不使用sid。
89S =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.89)(PORT = 29018))
)
(CONNECT_DATA =
(SERVICE_NAME = test)
(SERVER = SHARED)
)
)
d:\tools\rlwrap>sqlplus scott/btbtms@89s
...
SCOTT@89s> @spid
SID SERIAL# SPID C50
---------- ---------- ------ --------------------------------------------------
142 48 7699 alter system kill session '142,48' immediate;
SCOTT@89s> select sid, serial#,server from v$session where sid = ( select sid from v$mystat where rownum=1);
SID SERIAL# SERVER
---------- ---------- ---------
142 48 SHARED
d:\tools\rlwrap>sqlplus scott/btbtms@192.168.100.89:29018/test:shared
...
SCOTT@192.168.100.89:29018/test:shared> select sid, serial#,server from v$session where sid = ( select sid from v$mystat where rownum=1);
SID SERIAL# SERVER
---------- ---------- ---------
142 50 SHARED
6.當然共享伺服器的埠隨資料庫啟動動態變化的。
--也可以透過檢視v$dispatcher知道對應的埠號。
SYS@test> select * from v$dispatcher;
NAME NETWORK PADDR STATUS ACC MESSAGES BYTES BREAKS OWNED CREATED IDLE BUSY LISTENER CONF_INDX
----- --------------------------------------------------- ---------------- ------ --- -------- ------ ------ ----- ------- ------ ---- -------- ---------
D000 (ADDRESS=(PROTOCOL=tcp)(HOST=icaredg3)(PORT=29018)) 000000007C262C40 WAIT YES 348 133567 0 2 10 380509 2 0 0
D001 (ADDRESS=(PROTOCOL=tcp)(HOST=icaredg3)(PORT=22202)) 000000007C266398 WAIT YES 0 0 0 0 0 59654 0 0 0
7.現在啟動監聽修改tnsnames.ora檔案埠號為1521:
89S =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.89)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = test)
(SERVER = SHARED)
)
)
$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 23-OCT-2015 09:35:31
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.4.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.89)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.89)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Start Date 23-OCT-2015 09:35:33
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.89)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "test" has 1 instance(s).
Instance "test", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
$ netstat -tnlp
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
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:111 0.0.0.0:* LISTEN -
tcp 0 0 192.168.100.89:1521 0.0.0.0:* LISTEN 8931/tnslsnr
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22202 0.0.0.0:* LISTEN 8793/ora_d001_test
tcp 0 0 0.0.0.0:29018 0.0.0.0:* LISTEN 7697/ora_d000_test
tcp 0 0 0.0.0.0:51206 0.0.0.0:* LISTEN -
tcp 0 0 :::111 :::* LISTEN -
tcp 0 0 :::22 :::* LISTEN -
--可以發現啟動了1521埠。
d:\tools\rlwrap>sqlplus scott/btbtms@89s
....
SCOTT@89s> select sid, serial#,server from v$session where sid = ( select sid from v$mystat where rownum=1);
SID SERIAL# SERVER
---------- ---------- ---------
142 54 SHARED
SCOTT@89s> @spid
SID SERIAL# SPID C50
---------- ---------- ------ --------------------------------------------------
142 54 7699 alter system kill session '142,54' immediate;
--很明顯這種模式透過1521埠,因為使用共享伺服器模式,然後再轉到29018埠。我們前面的情況僅僅繞過了1521埠,也就是不通
--過監聽,而直接透過共享模式開啟的埠來連線資料庫。實際上還是透過伺服器開啟的埠來訪問伺服器的,或者用一句安全的術語講
--"蒼蠅不叮無縫的蛋"。
--如果有人問你不啟動監聽遠端能連線資料庫嗎?我想我開始的回答不行。
--但是不要忘了,oracle支援專有伺服器以及共享伺服器模式,而共享伺服器模式可以不使用1521埠,這樣就可以不用啟動監聽遠端連
--接伺服器。
--透過測試來說明問題。
1.測試環境:
SYS@test> @ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- ----------------------------------------------------------------
x86_64/Linux 2.4.xx 10.2.0.4.0 Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
SYS@test> show parameter shared
NAME TYPE VALUE
------------------------------------ ------------- ----------
hi_shared_memory_address integer 0
max_shared_servers integer
shared_memory_address integer 0
shared_pool_reserved_size big integer 13421772
shared_pool_size big integer 0
shared_server_sessions integer
shared_servers integer 1
SYS@test> show parameter dispatchers
NAME TYPE VALUE
------------------------------------ -------------- --------------------------------
dispatchers string (PROTOCOL=TCP) (SERVICE=testXDB)
max_dispatchers integer
$ ps -ef | grep ora_d00[0]
oracle 7697 1 0 08:28 ? 00:00:00 ora_d000_test
--這是一個安裝好以後沒有改動以上引數的設定。可以發現預設就啟動一個ora_d000_test.這個就是用於共享伺服器的連線,預設僅僅啟
--動1個,如果多個是ora_d001_test....
$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 23-OCT-2015 08:54:02
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.89)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
$ netstat -na | grep 1521
--可以發現監聽沒有啟動。
2.修改遠端的client,在tnsnames.ora加入如下:
89S =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.89)(PORT = 1521))
)
(CONNECT_DATA =
(SID = test)
(SERVER = SHARED)
)
)
--很明顯這樣是無法連線資料庫的,因為1521埠沒有開啟。
--我們必須要要知道程式ora_d000_test開啟的埠號。
$ netstat -tnlp
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
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:111 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:29018 0.0.0.0:* LISTEN 7697/ora_d000_test
tcp 0 0 0.0.0.0:51206 0.0.0.0:* LISTEN -
tcp 0 0 :::111 :::* LISTEN -
tcp 0 0 :::22 :::* LISTEN -
--從以上輸出可以知道遠端埠29018(對應ora_d000_test程式)。修改tnsnames.ora檔案如下:
89S =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.89)(PORT = 29018))
)
(CONNECT_DATA =
(SID = test)
(SERVER = SHARED)
)
)
d:\tools\rlwrap>sqlplus scott/btbtms@89s
SQL*Plus: Release 12.1.0.1.0 Production on Fri Oct 23 08:59:14 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SCOTT@89s> @spid
SID SERIAL# SPID C50
---------- ---------- ------ --------------------------------------------------
146 21 7699 alter system kill session '146,21' immediate;
SCOTT@89s> select sysdate from dual ;
SYSDATE
-------------------
2015-10-23 09:07:33
SCOTT@89s> select sid, serial#,server from v$session where sid = ( select sid from v$mystat where rownum=1);
SID SERIAL# SERVER
---------- ---------- ---------
146 21 SHARED
--這樣遠端就可以連線資料庫。注意上面的配置只能使用(SID = test),因為dispatchers預設配置僅僅支援SERVICE=testXDB。
$ ps -ef | egrep "ora_d000|7699" | grep -v egrep
oracle 7697 1 0 08:28 ? 00:00:00 ora_d000_test
oracle 7699 1 0 08:28 ? 00:00:00 ora_s000_test
--再啟動一個會話:
SCOTT@89s> @spid
SID SERIAL# SPID C50
---------- ---------- ------ --------------------------------------------------
142 32 7699 alter system kill session '142,32' immediate;
--依舊使用程式號(ora_s000_test)是7699.這也是共享的含義,節約了伺服器記憶體的使用。特別適合連線非常巨大,執行sql語句完成很快的情況。
3.我的測試client是12c,11gR2開始增強了簡易連線魔術:
d:\tools\rlwrap>sqlplus scott/btbtms@192.168.100.89:29018/test:shared
SQL*Plus: Release 12.1.0.1.0 Production on Fri Oct 23 09:17:16 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
Enter user-name:
ERROR:
ORA-12560: TNS:protocol adapter error
--因為不支援服務名test(主要是沒有配置)。執行如下:
d:\tools\rlwrap>sqlplus scott/btbtms@192.168.100.89:29018/testXDB:shared
SQL*Plus: Release 12.1.0.1.0 Production on Fri Oct 23 09:18:32 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SCOTT@192.168.100.89:29018/testXDB:shared> @spid
SID SERIAL# SPID C50
---------- ---------- ------ --------------------------------------------------
142 40 7699 alter system kill session '142,40' immediate;
SCOTT@192.168.100.89:29018/testXDB:shared> select sid, serial#,server from v$session where sid = ( select sid from v$mystat where rownum=1);
SID SERIAL# SERVER
---------- ---------- ---------
142 40 SHARED
4.修改引數dispatchers:
SYS@test> alter system set dispatchers='(PROTOCOL=TCP) (DISP=2)(SERVICE=test,testXDB)' scope=memory;
System altered.
$ ps -ef | egrep "ora_d00|7699" | grep -v egrep
oracle 7697 1 0 08:28 ? 00:00:00 ora_d000_test
oracle 7699 1 0 08:28 ? 00:00:00 ora_s000_test
oracle 8793 1 0 09:21 ? 00:00:00 ora_d001_test
--修改引數加入DISP=2,這樣dispatchers啟動了2個。另外我還增加服務名test,下面測試使用test服務的情況:
d:\tools\rlwrap>sqlplus scott/btbtms@192.168.100.89:29018/test:shared
SQL*Plus: Release 12.1.0.1.0 Production on Fri Oct 23 09:24:17 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
--ok透過。
5.修改tnsnames.ora配置:
--說明:採用SERVICE_NAME ,不使用sid。
89S =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.89)(PORT = 29018))
)
(CONNECT_DATA =
(SERVICE_NAME = test)
(SERVER = SHARED)
)
)
d:\tools\rlwrap>sqlplus scott/btbtms@89s
...
SCOTT@89s> @spid
SID SERIAL# SPID C50
---------- ---------- ------ --------------------------------------------------
142 48 7699 alter system kill session '142,48' immediate;
SCOTT@89s> select sid, serial#,server from v$session where sid = ( select sid from v$mystat where rownum=1);
SID SERIAL# SERVER
---------- ---------- ---------
142 48 SHARED
d:\tools\rlwrap>sqlplus scott/btbtms@192.168.100.89:29018/test:shared
...
SCOTT@192.168.100.89:29018/test:shared> select sid, serial#,server from v$session where sid = ( select sid from v$mystat where rownum=1);
SID SERIAL# SERVER
---------- ---------- ---------
142 50 SHARED
6.當然共享伺服器的埠隨資料庫啟動動態變化的。
--也可以透過檢視v$dispatcher知道對應的埠號。
SYS@test> select * from v$dispatcher;
NAME NETWORK PADDR STATUS ACC MESSAGES BYTES BREAKS OWNED CREATED IDLE BUSY LISTENER CONF_INDX
----- --------------------------------------------------- ---------------- ------ --- -------- ------ ------ ----- ------- ------ ---- -------- ---------
D000 (ADDRESS=(PROTOCOL=tcp)(HOST=icaredg3)(PORT=29018)) 000000007C262C40 WAIT YES 348 133567 0 2 10 380509 2 0 0
D001 (ADDRESS=(PROTOCOL=tcp)(HOST=icaredg3)(PORT=22202)) 000000007C266398 WAIT YES 0 0 0 0 0 59654 0 0 0
7.現在啟動監聽修改tnsnames.ora檔案埠號為1521:
89S =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.89)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = test)
(SERVER = SHARED)
)
)
$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 23-OCT-2015 09:35:31
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.4.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.89)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.89)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Start Date 23-OCT-2015 09:35:33
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.89)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "test" has 1 instance(s).
Instance "test", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
$ netstat -tnlp
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
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:111 0.0.0.0:* LISTEN -
tcp 0 0 192.168.100.89:1521 0.0.0.0:* LISTEN 8931/tnslsnr
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22202 0.0.0.0:* LISTEN 8793/ora_d001_test
tcp 0 0 0.0.0.0:29018 0.0.0.0:* LISTEN 7697/ora_d000_test
tcp 0 0 0.0.0.0:51206 0.0.0.0:* LISTEN -
tcp 0 0 :::111 :::* LISTEN -
tcp 0 0 :::22 :::* LISTEN -
--可以發現啟動了1521埠。
d:\tools\rlwrap>sqlplus scott/btbtms@89s
....
SCOTT@89s> select sid, serial#,server from v$session where sid = ( select sid from v$mystat where rownum=1);
SID SERIAL# SERVER
---------- ---------- ---------
142 54 SHARED
SCOTT@89s> @spid
SID SERIAL# SPID C50
---------- ---------- ------ --------------------------------------------------
142 54 7699 alter system kill session '142,54' immediate;
--很明顯這種模式透過1521埠,因為使用共享伺服器模式,然後再轉到29018埠。我們前面的情況僅僅繞過了1521埠,也就是不通
--過監聽,而直接透過共享模式開啟的埠來連線資料庫。實際上還是透過伺服器開啟的埠來訪問伺服器的,或者用一句安全的術語講
--"蒼蠅不叮無縫的蛋"。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-1816211/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20170825]不啟動監聽遠端能連線資料庫嗎2資料庫
- 啟動資料庫監聽資料庫
- MySQL資料庫遠端連線開啟方法MySql資料庫
- 遠端連線mysql資料庫MySql資料庫
- 遠端客戶端連線資料庫時提示TNS-12541: TNS: 無監聽程式客戶端資料庫
- spring boot 不連線資料庫啟動Spring Boot資料庫
- ORACLE 配置連線遠端資料庫Oracle資料庫
- Java連線遠端的Access資料庫Java資料庫
- 監聽狀態正常,但是資料庫不能連線,提示沒有監聽....資料庫
- 資料庫開啟監聽資料庫
- PLSQL Developer 客戶端沒有TNS監聽,無法連線資料庫SQLDeveloper客戶端資料庫
- 連線資料之遠端呼叫Access資料庫(轉)資料庫
- 啟動資料庫,啟動監聽,檢視是否歸檔資料庫
- PHP 遠端使用 PDO 連線 access 資料庫PHP資料庫
- PL/SQL Developer連線遠端Oracle資料庫SQLDeveloperOracle資料庫
- 用SQLyog或Navicat遠端連線資料庫SQL資料庫
- 設定如何遠端連線mysql資料庫MySql資料庫
- Oracle 11g連線遠端資料庫Oracle資料庫
- plsql本機不安裝資料庫連線遠端資料庫SQL資料庫
- 遠端啟動資料庫的條件資料庫
- php遠端連線mysql資料庫的步驟PHPMySql資料庫
- sqlplus 連線遠端資料庫系統SQL資料庫
- oracle資料庫監聽啟動不了的原因分析Oracle資料庫
- PL/SQL developer 遠端連線資料庫 客戶端配置SQLDeveloper資料庫客戶端
- mysql開啟遠端連線MySql
- linux配置mysql資料庫遠端連線失敗LinuxMySql資料庫
- Linux下安裝redis資料庫服務,並開啟遠端連線LinuxRedis資料庫
- 遠端控制監聽器
- Liunx開啟ssh遠端連線
- 117 遠端連線mysql資料庫的幾種方式MySql資料庫
- TimesTen學習(三)遠端連線TimesTen資料庫資料庫
- 遠端連線別人電腦上的ORACLE資料庫Oracle資料庫
- 使用instantclient和PL/SQL連線oracle遠端資料庫clientSQLOracle資料庫
- 如何遠端連線 遠端桌面軟體連線
- 配置作業系統重啟後,Oracle資料庫和監聽自動啟動作業系統Oracle資料庫
- git版本控制器 中新建遠端倉庫連線 或者 刪除舊的遠端倉庫的連線 建立新的遠端連線Git
- 客戶端連不上資料庫客戶端資料庫
- 怎麼開啟遠端桌面連線 專業遠端桌面