TDM Model Scan Fails with 'Failed to get schema names' for SQL Server
search cancel

TDM Model Scan Fails with 'Failed to get schema names' for SQL Server

book

Article ID: 438893

calendar_today

Updated On:

Products

CA Test Data Manager (Data Finder / Grid Tools)

Issue/Introduction

When performing an environment model scan for a SQL Server application using CA Test Data Manager (TDM) Portal running in an OpenShift container, the scan fails with the following errors:

  • RuntimeException: Failed to gather metadata for schema <dbo> and catalog <Database_Name> - error Failed to get schema names
  • TDMDatabaseException: job: [ID] profile: [Profile_Name] : failed to get metadata for conprof
  • com.microsoft.sqlserver.jdbc.SQLServerException: VIEW DATABASE PERFORMANCE STATE permission denied in database '<Database_Name>'

Environment

  • CA Test Data Manager (TDM) Portal 4.11.x
  • Connection profile used is: Microsoft SQL Server

Cause

There are two primary causes for this issue:

  1. Insufficient Permissions: The SQL Server user account defined in the TDM Connection Profile does not have the required permissions (VIEW DATABASE PERFORMANCE STATE) to query system metadata and performance counters used during the indexing scan phase.
  2. Product Defect: A defect was identified where the model scan service incorrectly handles metadata retrieval in certain containerized environments or specific SQL Server configurations, leading to a failure in schema discovery even when basic permissions are present.

Resolution

Step 1: Grant SQL Server Permissions

Work with your Database Administrator (DBA) to ensure the user account in the Connection Profile has the following permissions:

Review this command before running it.

USE [Your_Database_Name];GOGRANT VIEW DATABASE PERFORMANCE STATE TO [Your_Connection_Profile_User];GRANT VIEW DATABASE STATE TO [Your_Connection_Profile_User];GO

Additionally, verify that the user has access to all required schemas (e.g., dbo) and can see them when logging in via SQL Server Management Studio (SSMS).

Step 2: Apply TDM Portal Patch

  1. Update your TDM portal version to 4.11.5034.0 or higher.
  2. Restart the TDM Portal service.
  3. Re-run the model scan to verify the resolution.