今天早上接到主机工程师的电话,机房空调坏了,好多主机down了,请求重启数据库。
数据库重启完成后,业务人员报告说无法连接数据库,错误信息如下:
4 ETW000 [ dev trc,00000] charset='UTF16', ncharset='AL16UTF16', UNI_ASC=FALSE 30 0.052404
4 ETW000 [ dev trc,00000] Logon as OPS$-user to get SAPBWP's password 46 0.052450
4 ETW000 [ dev trc,00000] Connecting as /@BWP on connection 0 (nls 0) ... (dbsl 720 090112, UNICODE[2])
4 ETW000 58 0.052508
4 ETW000 [ dev trc,00000] OCIHandleAlloc(OCI_HTYPE_SVCCTX, con=0, svchp=6000000002321268) 151 0.052659
4 ETW000 [ dev trc,00000] Allocating server context handle 30 0.052689
4 ETW000 [ dev trc,00000] Attaching to database server BWP (con=0, svchp=6000000002321268, srvhp=6000000002324810)
4 ETW000 56 0.052745
4 ETW000 [ dev trc,00000] Assigning server context 6000000002324810 to service context 6000000002321268
4 ETW000 68495 0.121240
4 ETW000 [ dev trc,00000] OCIHandleAlloc(OCI_HTYPE_SESSION, con=0, usrhp=600000000239fd60) 292 0.121532
4 ETW000 [ dev trc,00000] Starting user session: OCISessionBegin(con=0, usr='/', svc=6000000002321268, srv=6000000002324810, usr=600000000239fd60)
4 ETW000 53 0.121585
4 ETW000 [ dev trc,00000] OCISessionBegin(OCI_DEFAULT) failed with -1=OCI_ERROR 7657 0.129242
4 ETW000 [ dev trc,00000] OCISessionBegin(OCI_DEFAULT) failed with SQL error 1017: 243 0.129485
4 ETW000 [ dev trc,00000] ORA-01017: invalid username/password; logon denied
4 ETW000 49 0.129534
4 ETW000 [ dbsloci.,00000] *** ERROR => CONNECT failed with sql error '1017' 122 0.129656
4 ETW000 [ dev trc,00000] set_ocica() -> SQL error code 1017 45 0.129701
4 ETW000 [ dev trc,00000] -->oci_get_errmsg (con=0, rc=1017) 101 0.129802
4 ETW000 [ dev trc,00000] OCIErrorGet -> SQL error code: 1017 110 0.129912
4 ETW000 [ dev trc,00000] ORA-01017: invalid username/password; logon denied
上面信息来源于SAP,从错误信息看看用户密码错误了。检查了用户状态没有被锁定,询问了业务,最近密码没有修改过。重新修改密码后,问题依旧。
登录到sap管理账户,无法登录到sqlplus 报如下错误:
bfbwdbci:bwpadm> sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Wed Jan 1 10:40:19 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
ERROR:
ORA-12547: TNS:lost contact
Enter user-name:
检查$ORACLE_HOME/bin/oracle权限
bfbwdbci:bwpadm> ls -l $ORACLE_HOME/bin/oracle
-rwxrwxr-x 1 orabwp dba 553652296 Sep 15 2012 /oracle/BWP/11203/bin/oracle
权限应该是如下值
bfbwapp3:orabwd 1> ls -l $ORACLE_HOME/bin/oracle
-rwsr-s--- 1 orabwd dba 553652024 Dec 14 2012 /oracle/BWD/11203/bin/oracle
修改完成后,sqlplus 可以可以登录,但是业务报问题依然。
这时开始检查参数,发现 remote_os_authent参数值为false了。
SQL> show parameter remote_os_authent
NAME TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
remote_os_authent boolean
FALSE
Oracle允许用户通过采用外部验证的方式登录数据库。默认情况下,只允许本机的用户采用外部验证登录到数据库中。当将remote_os_authent这个参数设置为true时,则允许远端用户采用外部验证的方式登录到数据库中。
看来是这个参数的问题了,修改该参数,重启数据库
SQL> alter system set remote_os_authent=true scope=spfile;
System altered.
重启后,
SQL> show parameter remote
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_dependencies_mode string TIMESTAMP
remote_listener string
remote_login_passwordfile string EXCLUSIVE
remote_os_authent boolean TRUE
remote_os_roles boolean FALSE
result_cache_remote_expiration integer 0
这时业务报告可以正常连接数据库了。真是太坑人了,也是给了自己一个教训啊。
在SAP应用中需要注意这两个参数 remote_os_authent 和 OS_AUTHENT_PREFIX
虽然在11g中,这个参数remote_os_authent被弃用了,但是他还可以起到向下兼容的作用。
alert log中信息
Deprecated system parameters with specified values:
remote_os_authent
参数信息
SQL> show parameter OS_AUTHENT_PREFIX
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
os_authent_prefix string ops$
这两个参数的关系:
REMOTE_OS_AUTHENT specifies whether remote clients will be authenticated with the value of the OS_AUTHENT_PREFIX parameter.
The REMOTE_OS_AUTHENT parameter is deprecated. It is retained for backward compatibility only.
数据库重启完成后,业务人员报告说无法连接数据库,错误信息如下:
4 ETW000 [ dev trc,00000] charset='UTF16', ncharset='AL16UTF16', UNI_ASC=FALSE 30 0.052404
4 ETW000 [ dev trc,00000] Logon as OPS$-user to get SAPBWP's password 46 0.052450
4 ETW000 [ dev trc,00000] Connecting as /@BWP on connection 0 (nls 0) ... (dbsl 720 090112, UNICODE[2])
4 ETW000 58 0.052508
4 ETW000 [ dev trc,00000] OCIHandleAlloc(OCI_HTYPE_SVCCTX, con=0, svchp=6000000002321268) 151 0.052659
4 ETW000 [ dev trc,00000] Allocating server context handle 30 0.052689
4 ETW000 [ dev trc,00000] Attaching to database server BWP (con=0, svchp=6000000002321268, srvhp=6000000002324810)
4 ETW000 56 0.052745
4 ETW000 [ dev trc,00000] Assigning server context 6000000002324810 to service context 6000000002321268
4 ETW000 68495 0.121240
4 ETW000 [ dev trc,00000] OCIHandleAlloc(OCI_HTYPE_SESSION, con=0, usrhp=600000000239fd60) 292 0.121532
4 ETW000 [ dev trc,00000] Starting user session: OCISessionBegin(con=0, usr='/', svc=6000000002321268, srv=6000000002324810, usr=600000000239fd60)
4 ETW000 53 0.121585
4 ETW000 [ dev trc,00000] OCISessionBegin(OCI_DEFAULT) failed with -1=OCI_ERROR 7657 0.129242
4 ETW000 [ dev trc,00000] OCISessionBegin(OCI_DEFAULT) failed with SQL error 1017: 243 0.129485
4 ETW000 [ dev trc,00000] ORA-01017: invalid username/password; logon denied
4 ETW000 49 0.129534
4 ETW000 [ dbsloci.,00000] *** ERROR => CONNECT failed with sql error '1017' 122 0.129656
4 ETW000 [ dev trc,00000] set_ocica() -> SQL error code 1017 45 0.129701
4 ETW000 [ dev trc,00000] -->oci_get_errmsg (con=0, rc=1017) 101 0.129802
4 ETW000 [ dev trc,00000] OCIErrorGet -> SQL error code: 1017 110 0.129912
4 ETW000 [ dev trc,00000] ORA-01017: invalid username/password; logon denied
上面信息来源于SAP,从错误信息看看用户密码错误了。检查了用户状态没有被锁定,询问了业务,最近密码没有修改过。重新修改密码后,问题依旧。
登录到sap管理账户,无法登录到sqlplus 报如下错误:
bfbwdbci:bwpadm> sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Wed Jan 1 10:40:19 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
ERROR:
ORA-12547: TNS:lost contact
Enter user-name:
检查$ORACLE_HOME/bin/oracle权限
bfbwdbci:bwpadm> ls -l $ORACLE_HOME/bin/oracle
-rwxrwxr-x 1 orabwp dba 553652296 Sep 15 2012 /oracle/BWP/11203/bin/oracle
权限应该是如下值
bfbwapp3:orabwd 1> ls -l $ORACLE_HOME/bin/oracle
-rwsr-s--- 1 orabwd dba 553652024 Dec 14 2012 /oracle/BWD/11203/bin/oracle
修改完成后,sqlplus 可以可以登录,但是业务报问题依然。
这时开始检查参数,发现 remote_os_authent参数值为false了。
SQL> show parameter remote_os_authent
NAME TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
remote_os_authent boolean
FALSE
Oracle允许用户通过采用外部验证的方式登录数据库。默认情况下,只允许本机的用户采用外部验证登录到数据库中。当将remote_os_authent这个参数设置为true时,则允许远端用户采用外部验证的方式登录到数据库中。
看来是这个参数的问题了,修改该参数,重启数据库
SQL> alter system set remote_os_authent=true scope=spfile;
System altered.
重启后,
SQL> show parameter remote
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_dependencies_mode string TIMESTAMP
remote_listener string
remote_login_passwordfile string EXCLUSIVE
remote_os_authent boolean TRUE
remote_os_roles boolean FALSE
result_cache_remote_expiration integer 0
这时业务报告可以正常连接数据库了。真是太坑人了,也是给了自己一个教训啊。
在SAP应用中需要注意这两个参数 remote_os_authent 和 OS_AUTHENT_PREFIX
虽然在11g中,这个参数remote_os_authent被弃用了,但是他还可以起到向下兼容的作用。
alert log中信息
Deprecated system parameters with specified values:
remote_os_authent
参数信息
SQL> show parameter OS_AUTHENT_PREFIX
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
os_authent_prefix string ops$
这两个参数的关系:
REMOTE_OS_AUTHENT specifies whether remote clients will be authenticated with the value of the OS_AUTHENT_PREFIX parameter.
The REMOTE_OS_AUTHENT parameter is deprecated. It is retained for backward compatibility only.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11590946/viewspace-1066158/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/11590946/viewspace-1066158/