您好,登錄后才能下訂單哦!
在操作系統(tǒng)本地在oracle用戶下使用sqlplus / as sysdba連接sqlplus的時(shí)候提示ORA-01031: insufficient privileges
查看操作系統(tǒng)版本信息
[oracle@OracleBak admin]$ lsb_release -a LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch Distributor ID: CentOS Description: CentOS release 6.6 (Final) Release: 6.6 Codename: Final
正常本地登陸的時(shí)候應(yīng)該不需要授權(quán)的,檢查sqlnet.ora文件,文件路徑為$ORACLE_HOME/network/admin/sqlnet.ora,
[oracle@OracleBak admin]$ cat sqlnet.ora # sqlnet.ora Network Configuration File: /opt/ora11/product/11.2/network/admin/sqlnet.ora # Generated by Oracle configuration tools. SQLNET.AUTHENTICATION_SERVICES= (NTS) NAMES.DIRECTORY_PATH= (TNSNAMES,EZCONNECT)
檢查監(jiān)聽和tnsping均正常,查閱資料后發(fā)現(xiàn)sqlnet.ora中的SQLNET.AUTHENTICATION_SERVICES
1、在windows下,SQLNET.AUTHENTICATION_SERVICES必須設(shè)置為NTS才能使用OS認(rèn)證;
不設(shè)置或者設(shè)置為其他任何值都不能使用OS認(rèn)證。
2、在linux下,在SQLNET.AUTHENTICATION_SERVICES的值設(shè)置為ALL,或者不設(shè)置的情況下,OS驗(yàn)證才能成功;
將此參數(shù)修改為ALL后即可使用sqlplus / as sysdba;直接登陸了,可是使用sqlplus sys/oracle@orcl as sysdba;登陸的時(shí)候提示ORA-12641: Authentication service failed to initialize,將sqlnet.ora中的
SQLNET.AUTHENTICATION_SERVICES= (ALL)
這一行去掉之后再使用用戶名和密碼登陸可以正常登陸了
sqlnet.ora文件內(nèi)容
# sqlnet.ora Network Configuration File: /opt/ora11/product/11.2/network/admin/sqlnet.ora # Generated by Oracle configuration tools. #SQLNET.AUTHENTICATION_SERVICES= (ALL) NAMES.DIRECTORY_PATH= (TNSNAMES,EZCONNECT)
tnsnames.ora
# tnsnames.ora Network Configuration File: /opt/ora11/product/11.2/network/admin/tnsnames.ora # Generated by Oracle configuration tools. ORCL = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = OracleBak)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )
listener.ora
# listener.ora Network Configuration File: /opt/ora11/product/11.2/network/admin/listener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = orcl) (SID_NAME = orcl) ) ) ORCL = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.10.242)(PORT = 1521)) ) ) ADR_BASE_GNNT = /opt/ora11
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。