AI-powered database assistant

Chat with the IBM® Db2® database assistant to help you complete tasks, find out about your system status and statistics, or ask general questions about Db2.

You can open the database assistant from the IBM Db2 Intelligence Center and then ask it to help you with a range of Db2 tasks, including:

  • Answering your questions about Db2
  • Detecting and helping to resolve lock contention issues
  • Monitoring your Db2 instance, including getting information about:
    • Active connections
    • SQL activity
    • Resource usage
    • Schemas, table spaces, indexes, and tables in the system
  • Convert your plain text to SQL (for more information about this capability, see Using Text-to-SQL with the Db2 database assistant)

The Db2 database assistant uses built-in skills and is trained on the official IBM Db2 documentation so that it can provide you with the most accurate responses.

Network connectivity requirements

To enable successful IBM authentication, ensure that the following domains and endpoints are reachable without SSL interception or content inspection.

Domains to whitelist (allow direct TLS 443 traffic)

Purpose Domain / Hostname Port Protocol
IBM Verify *.verify.ibm.com 443 HTTPS (TLS 1.3)
IBM Cloud Identity Platform *.login.ibm.com 443 HTTPS
IBM Identity Support Services *.identity.ibm.com 443 HTTPS
IBM Verify static/CDN *.akamaiedge.net 443 HTTPS
Watson Orchestrate Assistant *.assistant.watson.appdomain.cloud    

Enabling the Db2 database assistant

If the Db2 database assistant is not enabled, IBM Db2 Intelligence Center prompts for user authentication when you try to access it from any page. It can be enabled or disabled only from the Administration page.

To enable the Db2 database assistant:

  1. Go to the Administration console. Scroll down to the database assistant option.
  2. If you see that the database assistant has a Disabled label, click Database assistant.
  3. In the IBM Verify login window, click Authenticate with IBMid.
  4. On the IBM Verify page, enter your IBMid, password, and other details in the fields provided for user authentication. If you do not have an IBMid, you can create one from the login page.

After successful authentication, you will see a confirmation message, and the database assistant will be set to Enabled for your IBM Db2 Intelligence Center application. The database assistant authentication is valid for 24 hours after which you need to log in again to reauthenticate.

Starting the Db2 database assistant

To get started with the database assistant:

  1. Open your IBM Db2 Intelligence Center.

  2. Click the database assistant chat icon.

  3. Type your questions and requests in the chat.

What can the database assistant do?

You can ask the database assistant to complete the actions listed in the following tables. The tables divide the assistant's skills into several categories:
  • Product information
  • Instance information
  • Workload information
  • Workload queuing
  • Storage information
  • Resource utilization
  • Database objects
  • Troubleshooting

The database assistant can monitor multiple databases within IBM Db2 Intelligence Center. When you select a specific database, any subsequent skills you run will apply to that same database. The assistant prompts you to choose a database if one is not already selected.

Note: Depending on the database workload, the database assistant might take some time to respond to certain prompts, such as requesting a database summary or getting details about the largest tables by storage size.
Table 1. Product information
Action Description Example prompt phrases
Answer your questions about Db2 Ask the assistant anything about Db2 and it generates an answer based on its knowledge of the product. The assistant is trained on the official IBM Db2 documentation.
  • What's new in Db2?
  • Tell me about the MON_GET_PKG_CACHE_STMT table function
  • How do I troubleshoot Db2?
  • What is error code SQL0911N?
  • How can I manage my database workload?
Table 2. Instance information
Action Description Example prompt phrases
Show database summary Get a summary of basic database details such as name, version, size, number of tables, number of schemas, uptime, and more.
  • Report on my database
  • Check my database details
  • Tell me about this instance
Show database version Get the version of Db2.
  • What Db2 version am I running?
  • What is the database version?
  • Current Db2 database version
  • Show me the database version
Show system settings Get a summary of the host names and endpoints configured in your system.
  • Show my system settings
  • Display database endpoint settings
  • Describe db connection details
Open a specific console page Navigate directly to a specific page within the IBM Db2 Intelligence Center
  • Take me to the monitoring profile settings
  • Open my authorization settings
  • Show me the locking event monitor page
  • Take me to the SQL workbench page
Table 3. Workload information
Action Description Example prompt phrases
Show active connections Get a list of all current connections to the system.
  • Show me all connections
  • Display inflight connections
  • List the current applications
Show running queries Get a list of all currently running SQL queries and in-flight executions in the system.
  • Show me query response times
  • Query response times from 1pm to 4pm
  • Query response time summary
Show response times Get a summary of query response times in the system.
  • Show me query response times
  • Query response times from 1pm to 4pm
  • Query response time summary
Show query throughput Get information about query processing rates and throughput.
  • Get query throughput
  • What is the query processing rate from the last 2 hours?
  • How many rows have been read in the last hour?
Table 4. Workload queuing
Action Description Example prompt phrases
Check for WLM queuing Identifies if workloads are being queued by WLM
  • WLM queuing

  • Is there any WLM queuing happening?

Shows activity-based queuing Shows queuing based on activities
  • Show all running database activities using thread resources and their usage
  • Show all running database activities using shared sort memory and their usage
  • Show all running service class activities using thread resources and their usage
  • Show all running service class activities using shared sort memory and their usage
  • Show all running activities in <service class> using thread resources and their usage
  • Show the query at the head of the admission queue and its resource requirements
Show resource entitlement for hard-queued service class Shows resource entitlement for <service class> for hard queuing
  • Show the resource entitlement for service class

  • Show the resource entitlement for <service class>

Show insufficient resources in a hard resource- limited service class Shows insufficient resources in a service class with a hard resource limit
  • Show the currently executing queries in <service class> that are using a large amount of shared sort memory
  • Show all queries in <service class> using shared sort memory and their shared sort memory usage.
Table 5. Storage information
Action Description Example prompt phrases
Show table spaces Get a list of table spaces in the system and their storage utilization.
  • Obtain the table spaces list
  • List all table space names
  • Show table spaces
Show total storage Get storage details about the system.
  • Display my storage utilization statistics
  • How much disk storage capacity have I used?
  • Report on my storage consumption
Table 6. Resource utilization
Action Description Example prompt phrases
Show CPU usage summary Get a summary of how much CPU the system is using.
  • Show me CPU usage for the past 3 days
  • What was the system CPU load between August 14 and 15 2024?
  • Analyze processor utilization from the last 24 hours
Show IO usage summary Get a summary of disk usage over a specified period.
  • Analyze IO usage from the last 48 hours
  • Display IO utilization for the last 7 days
  • Show me I/O usage
Show memory usage summary Get a summary of how much memory was used by the system over a specified period.
  • Analyze memory usage for the last 15 days
  • Get a summary of memory details
  • Show me memory usage from 6 September 2024
Show database performance Get information about how your database is being used, including performance statistics.
  • Get database performance from 8 Jan 2025 to 10 Jan 2025
  • How is my database performing today?
  • Show me database performance stats for the past week
Table 7. Database object
Action Description Example prompt phrases
Show indexes for a specified schema Get a list of indexes for a given schema
  • Get index details
  • Show indexes for the schema schema-name-1
  • Fetch indexes
Show largest tables by rows Get a ranked list of the largest tables in the system based on row count
  • Get the largest 10 tables
  • Display the 3 largest tables by row count
  • What is my largest table?
Show largest tables by rows for a specified schema Get a ranked list of the largest tables in a given schema
  • What are the top 3 tables for the schema "schema-name"?
  • Get the largest tables by row count from the schemas "schema-name-1" and "schema-name-2"
  • Show me the 3 biggest tables by rows from schema-name-1, schema-name-2 schemas
Show largest tables by storage Get a ranked list of the largest tables in the system based on storage size
  • Rank the top 10 tables by storage size
  • Identify my largest tables by storage
  • Which table uses the largest amount of storage?
Show largest tables by storage for a specified schema Get a ranked list of the largest tables in a given schema based on storage size
  • Get the top 4 tables by storage for the schema schema-name-1
  • What is the largest table by storage size in the schema schema-name-1?
  • Show the top 10 largest tables by storage from the schema-name-1 schema
Show schemas Get a list of schemas in the system
  • Display all schemas
  • Provide a list of schemas
  • Fetch me a list of schemas in the database
Show tables Get a list of tables in the system
  • View the tables in the schema "schema-name-1"
  • Get a tables list from the schema-name-1, schema-name-2, and schema-name-3 schemas
  • List my tables
Show views Get a list of views in the system
  • List my views
  • Display the views for the schema-name-1 schema
  • Collect all views
Show outdated statistics Get information about tables or schemas that have outdated statistics
  • Get a list of tables in the schema schema-name-1 that have outdated stats
  • Get the outdated stats for the schema schema-name-1 with at least 30% row changes
  • Give me list of tables that have outdated stats in the last 2 hours
Get updated statistics Get information about tables or schemas that have updated statistics
  • Get updated statistics
  • Show me updated stats for the schema schema-name-1 with at least 30% row changes
  • Get updated stats for the schema schema-name-1 with row changes of 20% or more in the last 5 hours
Table 8. Troubleshooting
Action Description Example prompt phrases
Show most active connections Get details about the most active connections
  • What are the top 5 active connections
  • Display the top 8 connections in the database
  • Get the most active connections
Show how time is spent Get details about how much time was spent by the system on various tasks
  • List wait times and bottlenecks
  • How is time being spent in my database?
  • Get time spent details
Show lock waits Get a list of blocking and waiting connections in the system
  • Troubleshoot lock waits and deadlocks
  • Report all lock waits
  • Show me lock waits from the last two hours
Show longest running queries Get information about the top queries in the system ranked by how long they have been running
  • Display the longest running SQL queries
  • What are the top 5 queries?-
  • Show long running SQL statements

Using Text-to-SQL with the Db2 database assistant

The Db2 database assistant can help you to transform all your queries from plain English to SQL.

Tech preview The assistant's Text-to-SQL capabilities are provided as a technology preview and are not supported for use in production environments.

To convert your text to SQL:
  1. Log in to IBM Db2 Intelligence Center.
  2. Click Home > SQL Workbench.
  3. Under SQL Objects, click Select connections and select the database for which you want to generate the query.
  4. Click the Database Assistant icon on the top.
  5. Type text to SQL in the database assistant chat window.
  6. Type your query in plain English. The database assistant generates the SQL statement.

    If you have not selected a database, the database assistant will prompt you to choose one after you enter your query. Even if there are no tables available, the assistant will create a general SQL query based on your question that you can then modify to suit your needs.

Troubleshooting the Db2 database assistant

If you find that you are not getting the answers and results that you expect from the Db2 database assistant, try one or more of the following troubleshooting strategies:

  • Rephrase the question. The assistant might not understand your phrasing. Try using different wording, if possible.
  • Restart the conversation. The assistant might be getting confused by other things you have discussed with it.
  • Ensure that you are asking about Db2. If you are asking about something else, it might be outside of the assistant's capabilities.
  • Try asking about something specific. If your question is too broad, the assistant is more likely to return results that aren't relevant to your request.
  • Ensure that you are not filtering by version. If an answer to your question is not available in the current documentation release, the assistant cannot find it. If you are filtering by version, some content might be missing. To broaden the search, type "change version" and then choose Any.

Data privacy and opting out

When you interact with the Db2 database assistant, your questions and requests are processed by IBM watsonx™ Orchestrate®, which is outside of your Db2 instance. Only the text that you input into the assistant gets processed by watsonx Orchestrate. None of your actual data or metrics leave your Db2 instance at any time.

To opt out of the Db2 database assistant, contact IBM Support.