2014-05-24 82 views
1

我想在oracle中創建分佈式數據庫並創建快照。我把db放在一個本地網絡中的兩臺筆記本電腦上。我試圖編輯兩個配置文件(tnsnames.ora和listener.ora),並在tnsnames.ora中使用別名創建數據庫鏈接。但是如果我嘗試運行select請參考第二個數據庫,oracle拋出Ora-12541:TNS--沒有監聽器。你能幫我解決這個問題嗎?Oracle數據庫鏈接連接配置文件

我的tnsnames.ora文件:

PC1 IP 192.168.1.100

MIRASCONNECT = (DESCRIPTION = 
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.103)(PORT = 1521)) 
(CONNECT_DATA = 
    (SERVICE_NAME = orl) 
) ) 

PC2 IP 192.168.1.103

mirassecond = (DESCRIPTION = 
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.100)(PORT = 1521)) 
(CONNECT_DATA = 
    (SERVICE_NAME = database) 
) ) 
listener.ora中

我嘗試編輯只SID名稱:

PC1:

SID_LIST_LISTENER = (SID_LIST = 
(SID_DESC = 
    (SID_NAME = database) (GLOBAL_DBNAME = database) 
    (ORACLE_HOME = D:\app\Piotrek\product\11.2.0\dbhome_1) 
    (PROGRAM = extproc) 
    (ENVS = "EXTPROC_DLLS=ONLY:D:\app\Piotrek\product\11.2.0\dbhome_1\bin\oraclr11.dll") 
) ) 

PC2:

SID_LIST_LISTENER = (SID_LIST = 
(SID_DESC = 
    (SID_NAME = orl) (GLOBAL_DBNAME = orl) 
    (ORACLE_HOME = D:\app\Piotrek\product\11.2.0\dbhome_1) 
    (PROGRAM = extproc) 
    (ENVS = "EXTPROC_DLLS=ONLY:D:\app\Piotrek\product\11.2.0\dbhome_1\bin\oraclr11.dll") 
) ) 

創建DBLINK:

CREATE PUBLIC DATABASE LINK MIRAS_CONNECTION CONNECT TO MIREK IDENTIFIED BY pwdmirek USING 'MIRASCONNECT' 

,我的選擇貌似:

select * from [email protected]_connection 

回答

0

沒有監聽器是很容易理解。 ü沒有啓動監聽器上192.168.1.103

嘗試

lsnrctl start