windows下sqlplus / as sysdba報ora-12560的解決方案

來源:互聯網
上載者:User

標籤:

環境:win7_64位、資料庫版本ORACLE11G_R2

在CMD視窗,使用下面三個命令可正常串連資料庫:
C:\Users\Administrator> sqplus /nolog
C:\Users\Administrator> sqlplus  sys/[email protected] as sysdba;
SQL> conn scott/[email protected];

但是使用下面的命令串連資料庫就報ora-12560錯誤:
C:\Users\Administrator>sqlplus / as sysdba;

解決方案:
1、查看是否為作業系統認證
查看$ORACLE_HOME\network\admin\sqlnet.ora檔案中的參數SQLNET.AUTHENTICATION_SERVICES的值是否為為NTS或ALL。預設安裝允許作業系統認證。

2、確認windows註冊表中的ORACLE_HOME鍵及其索引值是否正確,是否有效。
比如:HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraDb10g_home1下,找到ORACLE_HOME鍵,對應的索引值為D:\app\Administrator\product\11.2.0\dbhome_1

3、注意:windows下,請不要設定ORACLE_HOME和ORACLE_SID環境變數
剛安裝好ORACLE資料庫庫後,上述兩個變數的值已被寫入到註冊表。所以不需要再設定。
=========
在CMD下,我們敲sqlplus時,其實調用的是註冊表中ORACLE_HOME/bin下的sqlplus.exe檔案。
如果直接到這個路徑下執行下面的命令是可以正常串連到資料庫的。
D:\app\Administrator\product\11.2.0\dbhome_1\BIN>sqlplus / as sysdba;
SQL*Plus: Release 11.2.0.1.0 Production on 星期五 1月 2 18:29:42 2015
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
串連到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
==================
4、在系統內容變數Path上加上D:\app\Administrator\product\11.2.0\dbhome_1\bin
這每次在執行sqlplus時保證調用資料庫服務端$ORACLE_HOME\bin目錄下的sqlplut.exe檔案。

===============================

在安裝好資料庫後,我們不需要設定任何環境變數,其實環境變數path中在資料庫軟體安裝的過程中已經加入了下面的bin目錄,我們在CMD下輸入sqlplus時才能調用到這個目錄下的sqlplus.exe檔案。D:\app\Administrator\product\11.2.0\dbhome_1\bin;

如果把這個路徑刪除,則在CMD下輸入sqlplus時提示找不到這個命令。

=========

參考檔案:

http://blog.csdn.net/msdnchina/article/details/38169095

windows下sqlplus / as sysdba報ora-12560的解決方案

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.