[20191112]oracle共享連線模式埠.txt
[20191112]oracle共享連線模式埠.txt
--//如果使用共享服務模式,你可以發現每次重啟資料庫對應的埠號會發生變化.
# netstat -tunlp | egrep "Active|Proto|ora_[ds]"
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 :::57864 :::* LISTEN 23134/ora_d000_book
udp 0 0 ::1:48080 :::* 23134/ora_d000_book
udp 0 0 ::1:58231 :::* 23132/ora_s000_book
--//重啟資料庫後,埠號會發生變化.
# netstat -tunlp | egrep "Active|Proto|ora_[ds]"
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 :::51056 :::* LISTEN 32421/ora_d000_book
udp 0 0 ::1:55948 :::* 32421/ora_d000_book
udp 0 0 ::1:17992 :::* 32423/ora_s000_book
--//如果透過外網使用共享模式連線埠變化對於配置防火牆非常不方便.看了連結:
--//可以透過指定埠號實現該功能,自己測試看看:
alter system set dispatchers=
'(address=(partial=true)(protocol=tcp)(host=hostname)(port=3000))(dispatchers=1)(SERVICE=TEST)',
'(address=(partial=true)(protocol=tcp)(host=hostname)(port=3005))(dispatchers=1)(SERVICE=TEST)',
'(address=(partial=true)(protocol=tcp)(host=hostname)(port=3010))(dispatchers=1)(SERVICE=TEST)',
'(address=(partial=true)(protocol=tcp)(host=hostname)(port=3015))(dispatchers=1)(SERVICE=TEST)',
'(address=(partial=true)(protocol=tcp)(host=hostname)(port=3020))(dispatchers=1)(SERVICE=TEST)'
scope=both sid='SID13';
1.環境:
SYS@book> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SYS@book> show parameter dispatchers
NAME TYPE VALUE
--------------- ------- -------------------------------------
dispatchers string (PROTOCOL=TCP) (SERVICE=book,bookXDB)
max_dispatchers integer
SYS@book> create pfile='/tmp/@.ora' from spfile;
File created.
--//儲存1份pfile引數檔案.
2. 修改dispatchers引數:
alter system set dispatchers=
'(address=(partial=true)(protocol=tcp)(host=192.168.100.78)(port=30000))(dispatchers=1)(SERVICE=book,bookXDB)',
'(address=(partial=true)(protocol=tcp)(host=192.168.100.78)(port=30005))(dispatchers=1)(SERVICE=book,bookXDB)'
scope=both sid='*';
SYS@book> show parameter dispatchers
NAME TYPE VALUE
------------------------------------ ---------------------------------------- ----------------------------------------------------------------------------------------------------
dispatchers string (PROTOCOL=TCP) (SERVICE=book,bookXDB), (address=(partial=true)(protocol=tcp)(host=192.168.100.78)(po
rt=30000))(dispatchers=1)(SERVICE=book,bookXDB), (address=(partial=true)(protocol=tcp)(host=192.168.
100.78)(port=30005))(dispatchers=1)(SERVICE=book,bookXDB)
max_dispatchers integer
3.重啟資料庫看看:
SYS@book> shutdown immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.
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.
# netstat -tunlp | egrep "Active|Proto|ora_[ds]"
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 192.168.100.78:30005 0.0.0.0:* LISTEN 32581/ora_d002_book
tcp 0 0 192.168.100.78:30000 0.0.0.0:* LISTEN 32579/ora_d001_book
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tcp 0 0 :::49854 :::* LISTEN 32577/ora_d000_book
udp 0 0 ::1:45407 :::* 32583/ora_s000_book
udp 0 0 ::1:48884 :::* 32577/ora_d000_book
udp 0 0 ::1:16168 :::* 32579/ora_d001_book
udp 0 0 ::1:16201 :::* 32581/ora_d002_book
--//你可以發現現在埠固定在30000,30005.注意下劃線資訊.
4.連線測試:
>sqlplus scott/book@192.168.100.78:30000/book
SQL*Plus: Release 12.2.0.1.0 Production on Tue Nov 12 11:28:23 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
SCOTT@192.168.100.78:30000/book> @ spid
SID SERIAL# PROCESS SERVER SPID PID P_SERIAL# C50
---------- ---------- ------------------------ --------- -------------------- ------- ---------- --------------------------------------------------
309 1 10624:9940 SHARED 32583 22 1 alter system kill session '309,1' immediate;
--//SERVER=SHARED,spid=32583
# ps -ef | grep 3258[3]
oracle 32583 1 0 11:26 ? 00:00:00 ora_s000_book
--//sqlplus scott/book@192.168.100.78:30005/book 也是ok的.
5.收尾還原:
SYS@book> shutdown immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@book> startup nomount pfile='/tmp/@.ora';
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
SYS@book> create spfile from pfile='/tmp/@.ora';
File created.
SYS@book> shutdown immediate ;
ORA-01507: database not mounted
ORACLE instance shut down.
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.
# netstat -tunlp | egrep "Active|Proto|ora_[ds]"
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 :::20791 :::* LISTEN 32896/ora_d000_book
udp 0 0 ::1:7511 :::* 32898/ora_s000_book
udp 0 0 ::1:7696 :::* 32896/ora_d000_book
--//OK,現在已經還原.埠已經不固定.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2663651/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20191113]oracle共享連線模式埠2.txtOracle模式
- Oracle共享伺服器的連線模式Oracle伺服器模式
- [20200218]連線串與專用模式.txt模式
- [20181224]使用odbc連線oracle資料庫.txtOracle資料庫
- [20191112]SQL Tuning by adding column alias (2).txtSQL
- [20191112]flock控制命令執行順序.txt
- FTP資料埠連線FTP
- [20190306]共享服務模式與SDU.txt模式
- cx_Oracle 連線 OracleOracle
- Servlet連線OracleServletOracle
- PHP 連線 OraclePHPOracle
- thinkphp連線OraclePHPOracle
- PHP 連線oraclePHPOracle
- 【CONNECT】Oracle連線方式詳細介紹(專用/共享伺服器)Oracle伺服器
- Oracle網路配置之共享模式和專有模式Oracle模式
- [20180316]非同步IO和共享服務模式.txt非同步模式
- oracle 連線查詢Oracle
- DBA ORACLE連線操作Oracle
- 3.2.2 python連線oraclePythonOracle
- [20190115]關於共享服務與專用模式.txt模式
- [20180316]共享服務模式和直接路徑讀.txt模式
- Linux中連線埠命令有哪些?Linux
- 如何用ip地址連線共享印表機 用ip地址連線共享印表機的方法
- Linux檢視埠併發連線數Linux
- Oracle左外連線、右外連線、完全外連線以及(+)號用法Oracle
- Oracle連線Db2OracleDB2
- [Oracle-> MySQL] Oracle通過dblink連線MySQL--Oracle 19c連線到MySQL 5.7OracleMySql
- [20210428]資料庫連線加密.txt資料庫加密
- [20201231]RAC連線特定例項.txt
- java操作Oracle 方式一 ( 連線-》操作-》斷開連線 )JavaOracle
- 【JDBC】java連線池模擬測試 連線oracleJDBCJavaOracle
- 【JDBC】使用OracleDataSource建立連線池用於連線OracleJDBCOracle
- [20190115]共享服務模式與啟動到mount狀態.txt模式
- Oracle 自動化運維-Python連線OracleOracle運維Python
- EOSCleos連線到非預設主機/埠
- gdbserver連線Ubuntu除錯程式(使用串列埠)ServerUbuntu除錯串列埠
- 配置Oracle DBlink連線MySQL庫OracleMySql
- PL/Plus本地連線oracle配置Oracle