Get information about schema, tables, primary keys

pindare

How to get the name of the schema, tables and primary keys? How to know his authorizations? The only information I have is obtained by the command below:

db2 => connect

   Database Connection Information

 Database server        = DB2/AIX64 11.1.3.3
 SQL authorization ID   = mkrugger
 Local database alias   = DBRCF
mao

You can use the command line (interactive command line processor), if you want, but if you are starting out then it is easier to use a GUI tool.

Example free GUI, IBM Data Studio, and there are many more (any GUI that works with JDBC should work with Db2 on Linux/Unix/Windows). These are easy to find online and download if you are permitted.

To use the Db2 command-line (clp) which is what you show in your question, Example command lines:

list tables for all
list tables for user
list tables for schema ...
describe table ...
describe indexes for table ...

Reference for LIST TABLES command You can also use plain SQL to read the catalog views, which describes the schemas, tables, primary keys as a series of views.

Look in the online free documentation for details of views like SYSCAT.TABLES, SYSCAT.COLUMNS , SYSCAT.INDEXES and hundreds of other views.

Depending on which Db2 product is installed locally, there are a range of other command-line based tools. One in particular is db2look which lets you extract all of the DDL of the database (or a subset of it) into a plain text file if you prefer that.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Get information about schema changes

From Dev

How get information about tables in SQL Server?

From Dev

Get all tables from information_schema, MySQL

From Dev

Joining Two Tables with Their Primary Keys

From Dev

There are no my tables in INFORMATION_SCHEMA.TABLES. Why?

From Dev

Triggers on two tables to get Primary Keys (Auto Increment) into third linking table mysql

From Dev

Triggers on two tables to get Primary Keys (Auto Increment) into third linking table mysql

From Dev

Associative Tables in SQL, 2 primary keys

From Dev

Relational model: Tables or primary and foreign keys?

From Dev

Laravel pivot tables with non primary keys

From Dev

Get information about file

From Java

unresolved reference to object [INFORMATION_SCHEMA].[TABLES]

From Dev

INFORMATION_SCHEMA.TABLES like 'value'

From Dev

Puzzled by MySQL information_schema.tables info

From Dev

Get information about my PSU

From Dev

Get routing information about a URL

From Dev

Get information about my PSU

From Dev

Get weekly information about transactions

From Dev

Get routing information about a URL

From Dev

get information about a particular object

From Dev

buildLoadSettings, get information about references

From Dev

Get primary keys inserted after executemany

From Dev

How big can Django primary keys get?

From Dev

Get primary keys inserted after executemany

From Java

How to join tables with multiple primary keys in R (efficiently)?

From Dev

Will simplify inserts into tables with auto-generated primary keys?

From Dev

Composite primary key with foreign keys out to different tables

From Dev

Django automatically create primary keys for existing database tables

From Dev

Querying Tables with Composite Primary Keys using Spring-data-cassandra

Related Related

  1. 1

    Get information about schema changes

  2. 2

    How get information about tables in SQL Server?

  3. 3

    Get all tables from information_schema, MySQL

  4. 4

    Joining Two Tables with Their Primary Keys

  5. 5

    There are no my tables in INFORMATION_SCHEMA.TABLES. Why?

  6. 6

    Triggers on two tables to get Primary Keys (Auto Increment) into third linking table mysql

  7. 7

    Triggers on two tables to get Primary Keys (Auto Increment) into third linking table mysql

  8. 8

    Associative Tables in SQL, 2 primary keys

  9. 9

    Relational model: Tables or primary and foreign keys?

  10. 10

    Laravel pivot tables with non primary keys

  11. 11

    Get information about file

  12. 12

    unresolved reference to object [INFORMATION_SCHEMA].[TABLES]

  13. 13

    INFORMATION_SCHEMA.TABLES like 'value'

  14. 14

    Puzzled by MySQL information_schema.tables info

  15. 15

    Get information about my PSU

  16. 16

    Get routing information about a URL

  17. 17

    Get information about my PSU

  18. 18

    Get weekly information about transactions

  19. 19

    Get routing information about a URL

  20. 20

    get information about a particular object

  21. 21

    buildLoadSettings, get information about references

  22. 22

    Get primary keys inserted after executemany

  23. 23

    How big can Django primary keys get?

  24. 24

    Get primary keys inserted after executemany

  25. 25

    How to join tables with multiple primary keys in R (efficiently)?

  26. 26

    Will simplify inserts into tables with auto-generated primary keys?

  27. 27

    Composite primary key with foreign keys out to different tables

  28. 28

    Django automatically create primary keys for existing database tables

  29. 29

    Querying Tables with Composite Primary Keys using Spring-data-cassandra

HotTag

Archive