Unix Technical Forum

Drop table <tablename> failling

This is a discussion on Drop table <tablename> failling within the DB2 forums, part of the Database Server Software category; --> I created a very simple table in db2, the prompt gave a success message. but when I try to ...


Go Back   Unix Technical Forum > Database Server Software > DB2

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-26-2008, 10:09 AM
dotyet
 
Posts: n/a
Default Drop table <tablename> failling

I created a very simple table in db2, the prompt gave a success
message. but when I try to do a describe or select or insert or
basically anything with that table, it says the object does not exist.
i have also tried doing it by giving it's fully qualified name. also,
when I try to drop the table, it says the object does not exist. if I
try to create another table with the same name, it says the object
already exists. so far, I am unable to figure out the head and tail of
this. can anyone help me? also, the tablespaces are in normal state,
the db is working otherwise ok, there are other tables which are
working just fine. will a runstat/reorg help. i have already done
instance stop/start.

my setup is:
db2 7.1 EE running on redhat 7.3 kernel 2.4.18
ram 448 mb, hdd/concerned partition more than 3 gb free
this is a development box

regards,
dotyet
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-26-2008, 10:09 AM
Serge Rielau
 
Posts: n/a
Default Re: Drop table <tablename> failling

This wasn't a DECLARED GLOBAL TEMPORARY TABLE by any chance?
It would live in the SESSION schema?
So when dropping or select you would need to qualify it with
SESSION.<tablename>

Cheers
Serge


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-26-2008, 10:09 AM
allenj@ndr.com
 
Posts: n/a
Default Re: Drop table <tablename> failling

On Thu, 31 Jul 2003 10:12:41 -0400, "Serge Rielau"
<srielau@ca.eyebeem.com> wrote:

>This wasn't a DECLARED GLOBAL TEMPORARY TABLE by any chance?
>It would live in the SESSION schema?
>So when dropping or select you would need to qualify it with
>SESSION.<tablename>


Speaking of which....

It would be really, really nice if DB2 could do:

SELECT * FROM MYSCHEMA.TABLEA
INTO TEMP TABLEB ;

rather than:

DECLARE GLOBAL TEMPORARY TABLE SESSION.TABLEB
LIKE MYSCHEMA.TABLEA
ON COMMIT PRESERVE ROWS NOT LOGGED ;

INSERT INTO SESSION.TABLEB
SELECT * FROM MYSCHEMA.TABLEA ;

I became fond of this shorter syntax when I was an Informix DBA...

I know that DECLARE GLOBAL TEMPORARY TABLE is SQL-92 compliant, so its
obviously the way to go. But I wonder why the INTO TEMP is not
SQL-92?

allen
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-26-2008, 10:09 AM
dotyet
 
Posts: n/a
Default Re: Drop table <tablename> failling

thanks for all the efforts.

No. 1)The schema is the same as I have written, i.e. the default
schema of this user.

No. 2)This is a regular user table.

No. 3)The case was all lower. I have tried the following options to
drop the table

drop digger
drop DIGGER
drop db2inst1.digger
drop DB2INST1.DIGGER
drop db2inst1.DIGGER


Now, something new which might help. I ran db2dart on the database and
it ran successfully without reporting any errors with the database. I
also ran runstats and reorg and reorgchk, but ,ALL of them somehow did
not give the tablename in their output. I have changed the diag level
to 4 and something which I think could be of importance is this: when
I try to drop the table using it's name or fully qualified name, an
entry occurs in db2diag.log,

DIA1004C: A Cursor is still active, file token "".

I have now tried the following on the database to catch the root
cause/solution

db2dart
runstats
reorg
reorgchk
restart
db2stop/db2start

I am not sure, but what I am making out of this scene is that the
table has been 'semi' created in the database, somewhere it's
respective entries are there and somewhere they are not. but can this
happen?

regards,
dotyet

Blair Adamache <badamache@2muchspam.yahoo.com> wrote in message news:<bgbahg$s08$1@hanover.torolab.ibm.com>...
> Did you create it in mixed case (i.e. with delimiters)? DB2 will fold
> identifiers and names to upper case unless you delimit.
>
> Examples:
>
> Case sensitivity and object names
> All database object names (tables, views, columns and so on) are stored
> in the catalog tables in uppercase unless the identifier is delimited.
> If you use a delimited name to create the identifier, the exact case of
> the name is stored in the catalog tables.
>
> An identifier, such as a column name or table name, is treated as case
> insensitive when used in an SQL statement unless it is delimited. For
> example, assume that the following statements are issued:
>
> CREATE TABLE MyTable (id INTEGER)
> CREATE TABLE "YourTable" (id INTEGER)
> Two tables -- MYTABLE and YourTable -- will exist.
>
> Now, the following two statements are equivalent:
>
> SELECT * FROM MyTable
> SELECT * FROM MYTABLE
> However, the second statement below will fail with TABLE NOT FOUND since
> there is no table named YOURTABLE:
>
> SELECT * FROM "YourTable" // executes without error
> SELECT * FROM YourTable // error, table not found
>
>
> dotyet wrote:
>
> > I created a very simple table in db2, the prompt gave a success
> > message. but when I try to do a describe or select or insert or
> > basically anything with that table, it says the object does not exist.
> > i have also tried doing it by giving it's fully qualified name. also,
> > when I try to drop the table, it says the object does not exist. if I
> > try to create another table with the same name, it says the object
> > already exists. so far, I am unable to figure out the head and tail of
> > this. can anyone help me? also, the tablespaces are in normal state,
> > the db is working otherwise ok, there are other tables which are
> > working just fine. will a runstat/reorg help. i have already done
> > instance stop/start.
> >
> > my setup is:
> > db2 7.1 EE running on redhat 7.3 kernel 2.4.18
> > ram 448 mb, hdd/concerned partition more than 3 gb free
> > this is a development box
> >
> > regards,
> > dotyet

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-26-2008, 10:10 AM
Knut Stolze
 
Posts: n/a
Default Re: Drop table <tablename> failling

dotyet <dotyet@yahoo.com> wrote:

> I created a very simple table in db2, the prompt gave a success
> message. but when I try to do a describe or select or insert or
> basically anything with that table, it says the object does not exist.
> i have also tried doing it by giving it's fully qualified name. also,
> when I try to drop the table, it says the object does not exist. if I
> try to create another table with the same name, it says the object
> already exists. so far, I am unable to figure out the head and tail of
> this. can anyone help me? also, the tablespaces are in normal state,
> the db is working otherwise ok, there are other tables which are
> working just fine. will a runstat/reorg help. i have already done
> instance stop/start.
>
> my setup is:
> db2 7.1 EE running on redhat 7.3 kernel 2.4.18
> ram 448 mb, hdd/concerned partition more than 3 gb free
> this is a development box


You do use the same connection to query the table, fire a COMMIT after the
CREATE TABLE or have auto-commit turned on?

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-26-2008, 10:10 AM
dotyet
 
Posts: n/a
Default Re: Drop table <tablename> failling

autocommit is on.

rgds,
dotyet

Knut Stolze <stolze@de.ibm.com> wrote in message news:<bgdcd0$6ni$3@fsuj29.rz.uni-jena.de>...
> dotyet <dotyet@yahoo.com> wrote:
>
> > I created a very simple table in db2, the prompt gave a success
> > message. but when I try to do a describe or select or insert or
> > basically anything with that table, it says the object does not exist.
> > i have also tried doing it by giving it's fully qualified name. also,
> > when I try to drop the table, it says the object does not exist. if I
> > try to create another table with the same name, it says the object
> > already exists. so far, I am unable to figure out the head and tail of
> > this. can anyone help me? also, the tablespaces are in normal state,
> > the db is working otherwise ok, there are other tables which are
> > working just fine. will a runstat/reorg help. i have already done
> > instance stop/start.
> >
> > my setup is:
> > db2 7.1 EE running on redhat 7.3 kernel 2.4.18
> > ram 448 mb, hdd/concerned partition more than 3 gb free
> > this is a development box

>
> You do use the same connection to query the table, fire a COMMIT after the
> CREATE TABLE or have auto-commit turned on?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-26-2008, 10:10 AM
dotyet
 
Posts: n/a
Default Re: Drop table <tablename> failling

sorry Wolfgang,

that was a typo.

the correct statement I used was

db2 "drop table digger"

sorry for the confusion.

regards,
dotyet

Wolfgang Riedel <wolfgang.riedel@development.retarus.de> wrote in message news:<3F2A7E80.755C5991@development.retarus.de>...
> dotyet wrote:
> >
> > thanks for all the efforts.
> >
> > No. 1)The schema is the same as I have written, i.e. the default
> > schema of this user.
> >
> > No. 2)This is a regular user table.
> >
> > No. 3)The case was all lower. I have tried the following options to
> > drop the table
> >
> > drop digger
> > drop DIGGER
> > drop db2inst1.digger
> > drop DB2INST1.DIGGER
> > drop db2inst1.DIGGER

> <snip>
> > > > regards,
> > > > dotyet

>
> just to be sure, you tried:
>
> drop Table DIGGER
> ^^^^^
> (with appr. privileges)?
>
> Wolfgang

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-26-2008, 10:14 AM
Gert van der Kooij
 
Posts: n/a
Default Re: Drop table <tablename> failling

In article <6c6dc4d2.0308040014.7e1ec98d@posting.google.com >,
dotyet@yahoo.com says...
> sorry Wolfgang,
>
> that was a typo.
>
> the correct statement I used was
>
> db2 "drop table digger"
>
> sorry for the confusion.



Is your problem solved already?

If not, how exactly is your tablename listed using the 'list tables
for all' command?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-26-2008, 10:15 AM
dotyet
 
Posts: n/a
Default Re: Drop table <tablename> failling

Gert van der Kooij <gk-ibm-db2@xs4all.nl> wrote in message news:<MPG.199f07b09c75e40c9898a7@news.xs4all.nl>.. .
> In article <6c6dc4d2.0308040014.7e1ec98d@posting.google.com >,
> dotyet@yahoo.com says...
> > sorry Wolfgang,
> >
> > that was a typo.
> >
> > the correct statement I used was
> >
> > db2 "drop table digger"
> >
> > sorry for the confusion.

>
>
> Is your problem solved already?
>
> If not, how exactly is your tablename listed using the 'list tables
> for all' command?


no my problem is still not solved. giving a 'list tables for all'
shows the table entry as any other table under that schema 'db2inst1'.
one thing which I have noticed though, i took an offline backup of the
database and dropped the existing one. then i restored the same backup
to some other containers. the problem continues. any more
suggestions!!

hth,
dotyet
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-26-2008, 10:15 AM
Gert van der Kooij
 
Posts: n/a
Default Re: Drop table <tablename> failling

In article <6c6dc4d2.0308110248.4fc45584@posting.google.com >,
dotyet@yahoo.com says...
> Gert van der Kooij <gk-ibm-db2@xs4all.nl> wrote in message news:<MPG.199f07b09c75e40c9898a7@news.xs4all.nl>.. .
> > In article <6c6dc4d2.0308040014.7e1ec98d@posting.google.com >,
> > dotyet@yahoo.com says...
> > > sorry Wolfgang,
> > >
> > > that was a typo.
> > >
> > > the correct statement I used was
> > >
> > > db2 "drop table digger"
> > >
> > > sorry for the confusion.

> >
> >
> > Is your problem solved already?
> >
> > If not, how exactly is your tablename listed using the 'list tables
> > for all' command?

>
> no my problem is still not solved. giving a 'list tables for all'
> shows the table entry as any other table under that schema 'db2inst1'.
> one thing which I have noticed though, i took an offline backup of the
> database and dropped the existing one. then i restored the same backup
> to some other containers. the problem continues. any more
> suggestions!!
>
> hth,
> dotyet
>


Does it show up in lowercase? If that's the problem you need enter the
name in lowercase, something like 'db2 drop table "db2inst"."digger"'
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:05 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com