If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Removing Schema's

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-15-07, 21:14
drogomoss drogomoss is offline
Registered User
 
Join Date: Mar 2007
Posts: 30
Removing Schema's

Hello All,

Good day.

I'd like to have a few ideas on how to effectively drop an unused schema. I've been using Toad for DB2 and dropping a schema from there is not working. I've already removed all the tables and functions and still it cannot be dropped.

Am I missing something here? Is there a way to drop a schema with the least commands?

Thanks a lot,

Drogo
Reply With Quote
  #2 (permalink)  
Old 11-15-07, 21:20
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
There must be some objects somewhere that are tied to the schema, which prevents it from being dropped. If such objects do exist, you should get a SQLSTATE 42893 error message using the Drop Schema command (I don't know whether TOAD supports the drop schema).
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 11-16-07, 06:47
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
i think there are some functionalities on v9 to manipulate with schema.

check following article (still requires v8.2.2)
http://www.ibm.com/developerworks/db...lau/index.html
__________________
Rahul Singh
Certified DB2 9 DBA / Application Developer
Reply With Quote
  #4 (permalink)  
Old 11-22-07, 00:35
drogomoss drogomoss is offline
Registered User
 
Join Date: Mar 2007
Posts: 30
I'll check them... I've dropped everything under the schema but still returns an error:

ERROR [42893] [IBM][DB2/6000] SQL0478N DROP or REVOKE on object type "SCHEMA" cannot be processed because there is an object "MDMETEST.SQL060207181935000", of type "FUNCTION", which depends on it. SQLSTATE=42893

I can't find this object. I don't see any functions in this schema anymore. How do I drop schemas using the db2 command line?

Thanks a lot guys,

Drogo
Reply With Quote
  #5 (permalink)  
Old 11-22-07, 01:32
fsledge fsledge is offline
Registered User
 
Join Date: Oct 2005
Posts: 8
look in the catalog to see if the function exist
Reply With Quote
  #6 (permalink)  
Old 11-22-07, 04:53
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
What do you mean with "I don't see any functions in this schema anymore"? How do you check that?

You should query the SYSCAT.ROUTINES catalog view to verify the existence of such a function exists. Also, the SQL060... in the specific function name - not the regular function name.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #7 (permalink)  
Old 11-25-07, 21:14
drogomoss drogomoss is offline
Registered User
 
Join Date: Mar 2007
Posts: 30
Well its in the interface of Toad for DB2. I selected the Schema... checked everything under Funtion (some sort of directory tree)... and then right clicked everything and dropped them. If I check again no function are under that directory anymore. :-)
Reply With Quote
  #8 (permalink)  
Old 11-25-07, 22:40
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by drogomoss
Well its in the interface of Toad for DB2. I selected the Schema... checked everything under Funtion (some sort of directory tree)... and then right clicked everything and dropped them. If I check again no function are under that directory anymore. :-)
Try looking at SYSCAT.ROUTINES. If DB2 says it cannot drop a schema and names the dependent object, try dropping the dependent object.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On