QC迁移故障-服务器主体 td 无法在当前… - 51ste软件测试部落-中国软件测试者的乐园
登录|注册

QC迁移故障-服务器主体 td 无法在当前安全上下文下访问数据库 qcsiteadmin_db

楼主 znk27发布于:2016/05/31

Cannot build directory item for key '[qcsiteadmin_db@jdbc:mercury:sqlserver://SFF-QA:1433(td)]' in SA Global Struct Dir;
Failed to fill table struct for table null in database qcsiteadmin_db@jdbc:mercury:sqlserver://SFF-QA:1433(td);
Failed to obtain a connection to schema 'qcsiteadmin_db';
Can't create a new database connection for url 'jdbc:mercury:sqlserver://SFF-QA:1433';
[Mercury][SQLServer JDBC Driver][SQLServer]服务器主体 "td" 无法在当前安全上下文下访问数据库 "qcsiteadmin_db"。;

Stack Trace:
java.sql.SQLException: [Mercury][SQLServer JDBC Driver][SQLServer]服务器主体 "td" 无法在当前安全上下文下访问数据库 "qcsiteadmin_db"。
at com.mercury.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.mercury.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.mercury.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
at com.mercury.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
at com.mercury.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
at com.mercury.jdbc.sqlserver.SQLServerImplConnection.setCatalog(Unknown Source)
at com.mercury.jdbc.base.BaseConnection.setCatalog(Unknown Source)
at com.mercury.optane.core.db.CConnectionPool.newConnection(CConnectionPool.java:666)
    wrapped in com.mercury.optane.core.db.CTdDbException: Can't create a new database connection for url 'jdbc:mercury:sqlserver://SFF-QA:1433'
at com.mercury.optane.core.db.CConnectionPool.newConnection(CConnectionPool.java:689)
at com.mercury.optane.core.db.CConnectionPool.tryToGetConnection(CConnectionPool.java:491)
at com.mercury.optane.core.db.CConnectionPool.getConnection(CConnectionPool.java:316)
    wrapped in com.mercury.optane.core.db.CTdDbException: Failed to obtain a connection to schema 'qcsiteadmin_db'
at com.mercury.optane.core.db.CConnectionPool.getConnection(CConnectionPool.java:344)
at com.mercury.optane.core.db.CConnectionManager.getNotTransactedConnection(CConnectionManager.java:299)
at com.mercury.optane.core.db.CConnectionManager.getConnection(CConnectionManager.java:264)
at com.mercury.optane.core.db.CDatabaseFieldsInfo.obtainInfo(CDatabaseFieldsInfo.java:135)
    wrapped in com.mercury.optane.core.CTdException: Failed to fill table struct for table null in database qcsiteadmin_db@jdbc:mercury:sqlserver://SFF-QA:1433(td)
at com.mercury.optane.core.db.CDatabaseFieldsInfo.obtainInfo(CDatabaseFieldsInfo.java:157)
at com.mercury.optane.core.db.CDatabaseFieldsInfo.<init>(CDatabaseFieldsInfo.java:77)
at com.mercury.optane.core.db.CAbsTablesStructDirectory.createDirectoryItem(CAbsTablesStructDirectory.java:129)
at com.mercury.optane.core.directory.CAbsDirectory.getDirectoryItem(CAbsDirectory.java:81)
    wrapped in com.mercury.optane.core.CTdException: Cannot build directory item for key '[qcsiteadmin_db@jdbc:mercury:sqlserver://SFF-QA:1433(td)]' in SA Global Struct Dir
at com.mercury.optane.core.directory.CAbsDirectory.getDirectoryItem(CAbsDirectory.java:87)
at com.mercury.optane.core.db.CAbsTablesStructDirectory.getDatabaseFieldsInfo(CAbsTablesStructDirectory.java:101)
at com.mercury.td.saserver.sautil.CSaDbSchemaProperties.getDatabaseFieldsInfo(CSaDbSchemaProperties.java:114)
at com.mercury.optane.core.db.CAbsDBContext.isComparisonCaseSensitive(CAbsDBContext.java:178)
at com.mercury.optane.core.db.utils.CDbGeneralFunctions.dbLowerComparison(CDbGeneralFunctions.java:381)
at com.mercury.td.saserver.sautil.CSaServerGeneralFunctions.saDbLowerComparison(CSaServerGeneralFunctions.java:424)
at com.mercury.td.saserver.api.logics.CTdUserLogic.authenticateUserAgainstTdDB(CTdUserLogic.java:1053)
    wrapped in com.mercury.optane.core.CTdException: Failed to check authentication of user '邹年奎'
at com.mercury.td.saserver.api.logics.CTdUserLogic.authenticateUserAgainstTdDB(CTdUserLogic.java:1077)
at com.mercury.td.saserver.api.logics.CTdUserLogic.checkUserPassword(CTdUserLogic.java:994)
at com.mercury.td.saserver.api.logics.CSessionLogic.login(CSessionLogic.java:188)
at com.mercury.td.saserver.web.CTdSiteAdminServlet.redirectLogin(CTdSiteAdminServlet.java:275)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)


解决办法:

1、首先确认qcsiteadmin_db数据库中APPSERVERS表中:TDSERVER_NAME、TD_IP_ADDRESS、TD_LOG_PATH的值是否正确。
2、确认qcsiteadmin_db数据库中DBSERVERS表中的值是否正确。
3、确认在对应数据库下安全性用户dbo的登录名是否为sa,td的登录名是否为td。不是则分别执行:
exec sp_changedbowner 'sa';
EXEC sp_change_users_login 'UPDATE_ONE', 'td', 'td';

#1楼 znk27回复于:2016/05/31

把这个问题的解决方案分享出来,希望对你有用~

回复