2014-01-10 50 views
0

幾天前我在虛擬機上創建了新的數據庫。克隆之後(同樣IP地址已更改),我無法使用SQL Plus連接到數據庫。什麼有趣的是,我可以用登錄到SQL導致ORA-12560錯誤

C:\Users\Administrator>set ORACLE_SID=clm 

C:\Users\Administrator>sqlplus 

SQL*Plus: Release 11.2.0.1.0 Production on Fri Jan 10 00:36:11 2014 

Copyright (c) 1982, 2010, Oracle. All rights reserved. 

Enter user-name: SYSDBA AS SYSDBA 
Enter password: 
ERROR: 
ORA-12560: TNS:protocol adapter error 

當這個數據庫的工作是相同的,當我使用以下statemanet: C:\Users\Administrator>sqlplus sysdba/[email protected]//localhost:1521/clm

這裏是我的C:\程序\管理\產品\ 11.2。 0 \ dbhome_1 \網絡\ ADMIN \ SQLNET.ORA文件:

SQLNET.AUTHENTICATION_SERVICES= (NTS) 

    NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT) ? ADR_BASE = C:\app\Administrator\product\11.2.0\dbhome_1\log 

和輸出從LSNRCTL服務

C:\Users\Administrator>lsnrctl services 

LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 10-JAN-2014 00:45 
:24 

Copyright (c) 1991, 2010, Oracle. All rights reserved. 

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) 
Services Summary... 
Service "clm" has 1 instance(s). 
    Instance "clm", status READY, has 1 handler(s) for this service... 
    Handler(s): 
     "DEDICATED" established:1036 refused:0 state:ready 
     LOCAL SERVER 
Service "clmXDB" has 1 instance(s). 
    Instance "clm", status READY, has 1 handler(s) for this service... 
    Handler(s): 
     "D000" established:0 refused:0 current:0 max:1022 state:ready 
     DISPATCHER <machine: WIN-E5E1BKVLT79, pid: 988> 
     (ADDRESS=(PROTOCOL=tcp)(HOST=WIN-E5E1BKVLT79)(PORT=62941)) 
Service "orcl" has 1 instance(s). 
    Instance "orcl", status READY, has 1 handler(s) for this service... 
    Handler(s): 
     "DEDICATED" established:85 refused:0 state:ready 
     LOCAL SERVER 
Service "orclXDB" has 1 instance(s). 
    Instance "orcl", status READY, has 1 handler(s) for this service... 
    Handler(s): 
     "D000" established:0 refused:0 current:0 max:1022 state:ready 
     DISPATCHER <machine: WIN-E5E1BKVLT79, pid: 2484> 
     (ADDRESS=(PROTOCOL=tcp)(HOST=WIN-E5E1BKVLT79)(PORT=49201)) 
The command completed successfully 

我能進一步排除故障嗎?

+0

你有沒有在克隆後的'listener.ora'改變IP地址;您現在已經刪除了HOST值,但WIN-E5E1BKVLT79是舊的或克隆的主機名,是否會解析爲您期望的IP?是否所有與數據庫相關的服務都已啓動,並且Db或偵聽器警報日誌中是否有任何內容? –

+0

我注意到,我只有listener.ora.old文件。我已經將它替換爲listener.ora並更改了IP地址並重新啓動了服務,我在lsnrctl中發現了奇怪的錯誤: ' 連接到(DESCRIPTION =(ADDRESS =(PROTOCOL = TCP)(HOST = oraclm(PORT = 1521) )) TNS-12545:連接失敗,因爲目標主機或對象不存在 TNS-12560:TNS:協議適配器錯誤 TNS-00515:連接失敗,因爲目標主機或對象不存在 64位Windows錯誤:1004 :未知錯誤 ' 當我回來重命名listener.ora文件將會消失 – kazik1616

+0

WIN-E5E1BKVLT79被映射到127.0.0.1在hosts文件 如何檢查DB相關的服務啓動,並且是有什麼在DB或監聽器t日誌?哪個命令或日誌可以爲您提供建議? – kazik1616

回答

0

a)檢查在%ORACLE_HOME%/ DBS/
B您的密碼文件)編輯您的遠程連接的tnsnames.ora C)如果是Windows主機上,因爲它看起來像你必須創建一個Windows服務使用ORADIM: 即:

oradim -startup -sid %your_oracle_sid% –usrpwd %your_password% -starttype SRVC,INST -pfile %pfile_location% 
相關問題