多多色-多人伦交性欧美在线观看-多人伦精品一区二区三区视频-多色视频-免费黄色视屏网站-免费黄色在线

國內最全IT社區平臺 聯系我們 | 收藏本站
阿里云優惠2
您當前位置:首頁 > 數據庫 > 數據庫應用 > Oracle中su切換進去sqlplus登錄失敗的問題處理

Oracle中su切換進去sqlplus登錄失敗的問題處理

來源:程序員人生   發布時間:2015-01-20 08:13:29 閱讀次數:7683次


問題描寫:

生產環境的oracle數據庫突然登錄不上去了,rlwrap生產環境的oracle數據庫突然登錄不上去了,rlwrap sqlplus "/ as sysdba"報錯以下:rlwrap

[oracle@localhost root]$ rlwrap sqlplus "/ as sysdba"
rlwrap: warning: your $TERM is 'xterm' but rlwrap couldn't find it in the terminfo database. Expect some problems.
rlwrap: Cannot execute sqlplus: Permission denied
[oracle@localhost root]$ sqlplus "/ as sysdba"
bash: sqlplus: command not found
[oracle@localhost root]$

1,oracle登錄報錯
[oracle@localhost root]$  rlwrap sqlplus "/ as sysdba"
Error 6 initializing SQL*Plus
SP2-0667: Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
[oracle@localhost root]$ 
[oracle@localhost root]$


2,查看ORACLE_HOME變量,為空值
[oracle@localhost root]$ echo $ORACLE_HOME

[oracle@localhost root]$


3,在/etc/profile設置ORACLE_HOME變量
[root@localhost ~]# vim /etc/profile
export ORACLE_HOME=/opt/oracle/app/oracle/product/11.2.0/dbhome_1

[root@localhost ~]# source /etc/profile
[root@localhost ~]# su oracle
[oracle@localhost root]$
[oracle@localhost root]$ echo $ORACLE_HOME
/oracle/app/oracle/product/11.2.0/dbhome_1/
[oracle@localhost root]$ 




4,ORACLE_HOME環境變量有值了,再去用sqlplus登錄1下,試試看
[oracle@localhost root]$ rlwrap sqlplus "/ as sysdba"
rlwrap: warning: your $TERM is 'xterm' but rlwrap couldn't find it in the terminfo database. Expect some problems.
rlwrap: Cannot execute sqlplus: Permission denied
[oracle@localhost root]$




5,做1下sqlplus的軟連接
[oracle@localhost root]$ exit
exit
[root@localhost ~]# ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
[root@localhost ~]# su oracle
[oracle@localhost root]$ sqlplus "/ as sysdba"




SQL*Plus: Release 11.2.0.1.0 Production on Fri Jan 16 10:19:39 2015




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




ERROR:
ORA⑴2162: TNS:net service name is incorrectly specified








Enter user-name: 
ERROR:
ORA⑴2162: TNS:net service name is incorrectly specified








Enter user-name: 
ERROR:
ORA⑴2162: TNS:net service name is incorrectly specified








SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
[oracle@localhost root]$ 
[oracle@localhost root]$ echo $ORACLE_SID



[oracle@localhost root]$ 
系統環境變量里面沒有ORACLE_SID





6,設置ORACLE_SID
[oracle@localhost root]$ exit
exit
[root@localhost ~]# vim /etc/profile
export ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbhome_1/
export ORACLE_SID=pxxerxxs
[root@localhost ~]#  source /etc/profile 




[oracle@localhost root]$ exit
exit
[root@localhost ~]# vim /etc/profile
[root@localhost ~]# source /etc/profile
[root@localhost ~]# su oracle
[oracle@localhost root]$ rlwrap sqlplus "/ as sysdba"
rlwrap: warning: your $TERM is 'xterm' but rlwrap couldn't find it in the terminfo database. Expect some problems.
                                                                                                                                                                                               
SQL*Plus: Release 11.2.0.1.0 Production on Fri Jan 16 10:25:33 2015




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




Connected to an idle instance.                                                                                                                                                                 




SQL>                                                                                                                                                                                           
SQL>                                                                                                                                                                                           
SQL>




7,去oracle用戶下查看系統變量
[oracle@localhost root]$ cat ~/.bash_profile
# .bash_profile




# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi




# User specific environment and startup programs




PATH=$PATH:$HOME/bin




export PATH




#added for oracle
export ORACLE_BASE=/oracle/app/oracle
export ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=pxxerxxs
export TNS_ADMIN=$ORACLE_HOME/network/admin




export PATH=$PATH:$ORACLE_HOME/bin
[oracle@localhost root]$ 
配置里面有值,問題在哪里?




8,su的時候有差異
不加-的話的話只是切換用戶 不去更換用戶的配置,加上-后 再去sqlplus 試試
[oracle@localhost ~]$ exit
logout
[root@localhost ~]# su oracle
[oracle@localhost root]$ echo $ORACLE_BASE




[oracle@localhost root]$ exit
exit
[root@localhost ~]# su - oracle
[oracle@localhost ~]$ echo $ORACLE_BASE
/oracle/app/oracle
[oracle@localhost ~]$




9,驗證下su - oracle
[oracle@localhost ~]$ rlwrap sqlplus "/ as sysdba"
rlwrap: warning: your $TERM is 'xterm' but rlwrap couldn't find it in the terminfo database. Expect some problems.
                                                                                                                                                                                               
SQL*Plus: Release 11.2.0.1.0 Production on Fri Jan 16 10:36:51 2015




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








Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options




SQL> 






10,OK,嘗試使用非sys賬號登錄報錯
[oracle@localhost ~]$ rlwrap sqlplus "plas_prd/plrd_1628@pxxerxxs as sysdba"
rlwrap: warning: your $TERM is 'xterm' but rlwrap couldn't find it in the terminfo database. Expect some problems.




SQL*Plus: Release 11.2.0.1.0 Production on Fri Jan 16 16:53:11 2015




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




ERROR:
ORA⑴2154: TNS:could not resolve the connect identifier specified








Enter user-name:                                                                                                                                                                               
ERROR:
ORA-01017: invalid username/password; logon denied








Enter user-name:                                                                                                                                                                               
[oracle@localhost ~]$ 




11,去check下,tnsping pxxerxxs 能否成功
[oracle@localhost ~]$ tnsping  pxxerxxs




TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 16-JAN⑵015 16:53:27



Copyright (c) 1997, 2009, Oracle.  All rights reserved.




Used parameter files:
/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora




TNS-03505: Failed to resolve name
[oracle@localhost ~]$ 
tnsping失敗,得知pxxerxxs這個失效


12,去找tnsnames.ora
[oracle@localhost admin]$  more /oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
也能夠more $ORACLE_HOME/network/admin/tnsnames.ora
找到
MPMD2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.16
生活不易,碼農辛苦
如果您覺得本網站對您的學習有所幫助,可以手機掃描二維碼進行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關閉
程序員人生
主站蜘蛛池模板: 国产成人精品综合久久久 | 亚洲精品一区二区三区中文字幕 | 国产精品一区二区三区四区 | 噜噜网站 | 欧美手机看片 | 亚洲wu码| 2020国产精品| 国产一级一片免费播放i | 一次性a爱片 | 国产成人精品午夜在线播放 | 精品国产欧美一区二区三区成人 | 欧美日韩一二三四区 | 精品1州区2区3区4区产品乱码 | 一级毛片免费一级直接观看 | 男人午夜视频在线观看 | 久久精品影院一区二区三区 | 成人三级精品视频在线观看 | 高清一级做a爱免费视 | 视频一区二区三区欧美日韩 | 欧美成人久久久免费播放 | 欧洲自拍 | 国产亚洲精品久久久久久牛牛 | 1区2区3区4区 | 男女爽爽无遮挡午夜视频在线观看 | 成人精品一区二区不卡视频 | 中文字幕在线资源 | 亚洲大片免费观看 | 五月天伊人 | 伊人婷婷色 | 中文字幕组 | 国产免费播放一区二区 | 成人动漫中文字幕 | 最近中文字幕高清字幕 | 国产午夜精品久久久久 | 成人αv| 亚洲精品一区henhen色 | 欧美午夜色大片在线观看免费 | 亚洲另类视频在线观看 | 亚洲成a人片在线观看中文!!! | 欧美一级日韩一级 | 国产老女人 |