I am trying to open up sample database but i cannot go through and it pop up with these message : Existing "SAMPLE" database found... The "-force" option was not specified... Attempt to create the database "SAMPLE" failed. SQL1005N The database alias "SAMPLE" already exists in either the localdatabase directory or system database directory.
Is there anyone who can help me on it
Thank you
Tags: Help
Permalink Reply by Saidulu Nallaganthula on February 5, 2011 at 12:52pm
Permalink Reply by kunal on February 25, 2011 at 2:01pm could you please, guide me. I still did not get it
Permalink Reply by Saidulu Nallaganthula on March 4, 2011 at 2:52pm ok, you first need to find out where the leftover entry is.
STEP 1: Check first on system db directory >db2 list db directory. if you find the SAMPLE here just uncatalog it through the command >db2 uncatalog db sample. This should solve the problem because the entry is removed from system db directory. Now you can freshly create a SAMPLE database and work with it.
If you don't find SAMPLE in system db directory then go to STEP 2
STEP 2: Check in local db directory >db2 list db directory on <directory path (or) drive name>
if you find the entry SAMPLE here, then catalog the db SAMPLE first , using the command
>db2 catalog db sample as sample , this will make an entry into system db directory. Now the SAMPLE is in both System directory and local directory. So it shouldn't give you "databe not found" error. you can connect and work with it.
If you wish you can drop the database SAMPLE. Then again create it afresh and work with it.
try it, good luck!
Hi Kunal, I've been in the same situation:
$ db2 create db dbforqa
SQL1005N The database alias "DBFORQA" already exists in either the localdatabase directory or system database directory.
$ db2 list db directory
System Database Directory
Number of entries in the directory =1
Database 1 entry:
Database alias = DWDBQA
Database name = DWDBQA
Local database directory = /dw/qa/dwdb
Database release level = d.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =
$ db2 list db directory on /db2/home/db2dwqa
Local Database Directory on /db2/home/db2dwqa
Number of entries in the directory = 1
Database 1 entry:
Database alias = DBFORQA
Database name = DBFORQA
Database directory = SQL00001
Database release level = d.00
Comment =
Directory entry type = Home
Catalog database partition number = 0
Database partition number = 0
$ db2 uncatalog db dbforqa
SQL1013N The database alias name or database name "dbforqa" could not befound. SQLSTATE=42705
Just in local database directory? How can i solve that?
Permalink Reply by Saidulu Nallaganthula on February 9, 2011 at 7:29am Hi Luyza,
When you issue a UNCATALOG DB command system will first check in system database directory ...so it is throwing a "not found" error.
Probably try to catalogue it first thru CATALOG DB command , so that an entry will be made into system db directory. then you can connect and work with it. You can drop it if you wish.
Hi Saidulu,
Catalog at server again? What node should i catalog this database?
Can i uncatalog a database from local database directory?
Thanks.
Permalink Reply by Saidulu Nallaganthula on March 4, 2011 at 2:58pm Hi Luyza,
see the second reply to kunal, probably you need to follow STEP 2 in case of DBFORQA , thanks!
Permalink Reply by kunal on April 14, 2011 at 12:30am Hi Saidulu
Thank you for your help and eventually, today I can see SAMPLE DATABASE
Thank you very much and please,
keep in touch
Permalink Reply by kunal on February 16, 2011 at 10:41pm kindly apologized for taking longer to reply, though I am thankful to all for your feedback
Once more, Thank you extended DB2 family
-kunal
Thanks Saidulu.
Kunal, that's what i did:
$ db2 catalog db dbforqa
DB20000I The CATALOG DATABASE command completed successfully.
DB21056W Directory changes may not be effective until the directory cache isrefreshed.
$ db2 list db directory
Database 3 entry:
Database alias = DBFORQA
Database name = DBFORQA
Local database directory = /db2/home/db2dwqa
Database release level = d.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =
$ db2 drop db dbforqa;
DB20000I The DROP DATABASE command completed successfully.
$ db2 create db dbforqa
DB20000I The CREATE DATABASE command completed successfully.
So, try:
1- Catalog sample database (this will make an entry into system db directory, so you will have sample database in both system and local database directory);
2- Drop sample database;
3- db2sampl.
Hope help you somehow.
Luyza.
Permalink Reply by kunal on March 26, 2011 at 6:37pm hey Luyza....
Thanks and I've tried the way you said, though It looks tough time for me so you know, I am going to uninstall Express-c and then install it, & try to open the dbsampl
and will tell you what happens next!!!!
Once again Thanks
Yes, I can help you with that.
First, try to catalog the SAMPLE database which already exists on C: ( assuming Windows). Once cataloged, you may continue to use it or drop it and then create new on.
db2ca is database configuration assistant that can be used to catalog the database. This is gui tool, I always used. You can catalog from command line and then proceed with that. But I did not ever do that.
Definitely you seem to be installing on the system already having sample database from previous installation.
Let me know of any other question, or if this is not clear to you.
Explore in-memory and columnar technologies through this active approach to exploring emerging technologies.
![]() |
FREE Book: Getting started with DB2 |
© 2013 Created by channeldb2.