DB2 Sample Database unable to create

10,617

Probably the database was created but uncataloged, that is the reason you do not see the database in the database directory, but the database files and tablespaces still exist.

You can try to recatalog the database and then, drop it if you want to recreate the sample database.

db2 catalog database sample

db2 drop database sample

db2sampl
Share:
10,617
Index Hacker
Author by

Index Hacker

Coding, investing and I like languages (coding, oral and written)

Updated on June 14, 2022

Comments

  • Index Hacker
    Index Hacker almost 2 years
    • I tried creating the db2 sample database using both DB2 First Steps GUI option "Create sample database" error:

    Creating database "SAMPLE" on path "C:"... Existing "SAMPLE" database found... The "-force" option was not specified... Attempt to create the database "SAMPLE" failed 'db2sampl' processing complete.


    • When I try the "db2sampl" command on the DB2 CLP, I get this error:

    Creating database "SAMPLE"... Existing "SAMPLE" database found... The "-force" option was not specified... Attempt to create the database "SAMPLE" failed.

    'db2sampl' processing complete.


    • Furthermore, I have double checked that my DB2 instance was started with "db2start" which returns:

    SQL1026N The database manager is already active


    which indicates that the instance is indeed started.

    • I verified that sample was not created with "db2 list database directory" which returned:

    SQL1057W The system database directory is empty. SQLSTATE=01606


    which shows that no databases have been created and discredits the possibility of the DB2 sample database creation failing because an existing one is present.

    What is causing the sample database to fail?

  • Index Hacker
    Index Hacker about 10 years
    YOU sir are an amazing gentleman. This was giving me a huge amount of grief and your suggestion work. Answer ACCEPTED. Do you know why the sample database was uncatalogued though? I was following the exact instructions from the "DB2 Academic Training - 302A Exam preparation" course on bigdatauniversity.com...