R3tans -d连不上hana数据库解决过程
背景
SAP S4/HANA服务器因为故障强行重启了操作系统。重启后,数据库起来,可以通过hanastudio链接,使用hdbsql命令也可以链接,但是执行R3trans -d报错,导致应用起不来。
解决过程
1. 执行下面命令,提示HANA数据库没有运行
erpqas:qasadm 77> startsap -c
2. 执行下面命令,检查原因
erpqas:qasadm 58> R3trans -d
然后报错信息如下:
This is R3trans version 6.26 (release 773 - 02.05.19 - 20:19:01).
unicode enabled version
2EETW169 no connect possible: "DBMS = HDB --- SERVER = '' PORT = ''"
R3trans finished (0012).
查看trans.log日志,位于/home/qasadm目录下
4 ETW000 R3trans version 6.26 (release 773 - 02.05.19 - 20:19:01).
4 ETW000 unicode enabled version
4 ETW000 ===============================================
4 ETW000
4 ETW000 date&time : 10.04.2024 - 17:56:15
4 ETW000 control file: <no ctrlfile>
4 ETW000 R3trans was called as follows: R3trans -d
4 ETW000 trace at level 1 opened for a given file pointer
4 ETW000 [ dev trc,00000] Wed Apr 10 17:56:15 2024
4 ETW000 [ dev trc,00000] Loading DB library '/usr/sap/QAS/SYS/exe/run/dbhdbslib.so' ...
4 ETW000 [ dev trc,00000] Library '/usr/sap/QAS/SYS/exe/run/dbhdbslib.so' loaded
4 ETW000 [ dev trc,00000] Version of '/usr/sap/QAS/SYS/exe/run/dbhdbslib.so' is "773.00", patchlevel (0.201)
4 ETW000 [ dev trc,00000] switch DBSL TRACE LEVEL from 3 to 1
4 ETW000 [ dev trc,00000] DBHDBSLIB : version 773.00, patch 0.201 (Make PL 0.201)
4 ETW000 [ dev trc,00000] HDB shared library (dbhdbslib) patchlevels (last 10)
4 ETW000 [ dev trc,00000] (0.201) SAP Support Package Stack Kernel 7.73 Patch Level 201 (note 2842386)
4 ETW000 [ dev trc,00000] (0.200) SAP Support Package Stack Kernel 7.73 Patch Level 200 (note 2807671)
4 ETW000 [ dev trc,00000] (0.113) Set error class unknown object (note 2757295)
4 ETW000 [ dev trc,00000] (0.101) SAP Support Package Stack Kernel 7.73 Patch Level 101 (note 2800951)
4 ETW000 [ dev trc,00000] (0.100) SAP Support Package Stack Kernel 7.73 Patch Level 100 (note 2743628)
4 ETW000 [ dev trc,00000] (0.029) DBSQL_INTERNAL_ERROR after a PREPARE of SQL monitor stmt (note 2724052)
4 ETW000 [ dev trc,00000] (0.027) Call set transaction after EOT (note 2719496)
4 ETW000 [ dev trc,00000] (0.027) Host information updated after a database failover (note 2716586)
4 ETW000 [ dev trc,00000] (0.024) Set application id before the database connect (note 2709354)
4 ETW000 [ dev trc,00000] (0.024) Call always TH callback after CANCEL (note 2707185)
4 ETW000 [ dev trc,00000]
4 ETW000 [ dev trc,00000] Loading SQLDBC client runtime (pid=12865)...
4 ETW000 [ dev trc,00000] SQLDBC Module : /usr/sap/QAS/hdbclient/libSQLDBCHDB.so
4 ETW000 [ dev trc,00000] SQLDBC Runtime : libSQLDBCHDB 2.04.126.1551801496
4 ETW000 [ dev trc,00000] SQLDBC client runtime is 2.04.126.1551801496
4 ETW000 [ dev trc,00000] Try to connect via secure store (DEFAULT) on connection 0 ...
4 ETW000 [ dev trc,00000] connect property [APPLICATION = ABAP:QAS]
4 ETW000 [ dev trc,00000] connect property [APPLICATIONVERSION = 773 PL 201]
4 ETW000 [ dev trc,00000] Wed Apr 10 17:56:25 2024
4 ETW000 [ dev trc,00000] no connection data found for key (DEFAULT) in HANA secure store
4 ETW000 [ dev trc,00000] Try to connect via environment (localhost:7878) on connection 0 ...
4 ETW000 [dbhdbsql.cpp,00000] *** ERROR => Connect to database failed, rc=1, rcSQL=-10709
4 ETW000 [ dev trc,00000] SQLCODE : -10709
4 ETW000 [ dev trc,00000] SQLERRTEXT : Connection failed (RTE:[89006] System call 'connect' failed, rc=111:Connection refused (localhost:78\
4 ETW000 [ dev trc,00000] 78))
4 ETW000 [ dblink ,00000] ***LOG BY2=>sql error -10709 performing CON
4 ETW000 [ dblink ,00000] ***LOG BY0=>Connection failed (RTE:[89006] System call 'connect' failed, rc=111:Connection refused (localhost:7878))
2EETW169 no connect possible: "DBMS = HDB
3.从上面红色字体描述的错误信息,初步判断是链接数据库的信息有问题,执行如下命令检查
erpqas:qasadm 63> hdbuserstore list
有如下报错信息
DATA FILE : /home/qasadm/.hdb/erpqas/SSFS_HDB.DAT
KEY FILE : /home/qasadm/.hdb/erpqas/SSFS_HDB.KEYError 91009: Timeout acquiring the secure store access lock.
上面内容明显有问题,正常应该是类似这样的:
DATA FILE : /home/qasadm/.hdb/erpqas/SSFS_HDB.DAT
KEY FILE : /home/qasadm/.hdb/erpqas/SSFS_HDB.KEYKEY DEFAULT
ENV : erpqas:31013
USER: SAPHANADB
DATABASE: HAQ
也可以直接查询DEFAULT的存储信息
erpqas:qasadm 66> hdbuserstore list DEFAULT
报错如下:
Error 91009: Timeout acquiring the secure store access lock.
4. 添加数据库连接信息
erpqas:qasadm 68> hdbuserstore set DEFAULT erpqas:31013@QHA SAPHANADB Mypassword
如果报如下错误
Error 91009: Timeout acquiring the secure store access lock.
删除下面的锁文件,然后重新执行上述命令,设置HANA数据库的链接信息
rm /home/qasadm/.hdb/erpqas/SSFS_HDB.LCK
5.再次执行R3trans -d ,问题解决。
This is R3trans version 6.26 (release 773 - 02.05.19 - 20:19:01).
unicode enabled version
R3trans finished (0000).