用三個方法設置Oracle數(shù)據(jù)庫穿越防火墻
方法一:在系統(tǒng)注冊表中,hkey_local_machinesoftwareoraclehome0下加入字符串值:
USE_SHARED_SOCKET=TRUE
方法二:
1、首先,我們需要將數(shù)據(jù)庫實例改為SHARED SERVER模式
2、以SYSDBA登錄SQLPLUS,通過SQLPLUS生成系統(tǒng)當前的參數(shù)設置文件pfile:
create pfile='d:init.ora' from spfile;
3、修改d:init.ora文件,在其中增加(用editplus編輯):
*.service_names='your service name'和*.dispatchers='(address=(protocol=tcp)(host=localhost)(port=1521) (dispatchers=1)'
4、生成新的SPFILE:create spfile from pfile='d:init.ora';
5、重啟動數(shù)據(jù)庫。
6、在防火墻中開放1521端口。
方法三:
在數(shù)據(jù)庫端(可以是另外的機器,但cman的機器必須和數(shù)據(jù)庫都在防火墻的后面)安裝cman的前提下,啟動cman,然后開放防火墻端的1630端口(需要查看cman開的是什么端口),最后在客戶端的tnsnames.ora文件中添加以下內容:
cmantest = (description = (address_list = (address = <- first address is to CMAN (protocol=tcp) (host=hostname or ip of cman) (port=1610) ) (address= <- second address is to Listener (protocol=tcp) (host=hostname or ip of listener) (port=1521) ) ) (connect_data = (sid = sidname)) (source_route = yes)
