List all databases and users in Teradata

Sometimes you may need to check all the available databases in the Teradata server. Teradata provides a couple of different ways to get the information.

The easiest way to list all the databases in Teradata using the following query:

SELECT DatabaseName, OwnerName
FROM DBC.DATABASESV
WHERE DBKind = 'D';

You will get output like this.

list all the databases in teradata

In case, you want the list of database users created in the Teradata system, you use the below query.

SELECT DatabaseName, OwnerName
FROM DBC.DATABASESV
WHERE DBKind = 'U';

You will get output something like this.

list all users in teradata