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 > how to change schema ownership ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-30-04, 11:27
udbdb2 udbdb2 is offline
Registered User
 
Join Date: Nov 2003
Posts: 121
how to change schema ownership ?

Can we change schema ownership ?
I mean,if set of objects owned by 'db1schema' can we change it to 'db2newuser' schema ?
if so how ?
Please help.
thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 07-30-04, 13:22
dollar489 dollar489 is offline
Registered User
 
Join Date: Sep 2002
Posts: 456
Not aware of any such command which can do this but you can use db2move utility to extract data and table structure and then change one of the log file generated by utility. Do find/replace and specify new user so when you do import tables are created for that user and data loaded.

There are other ways to do the same, db2move is only one such.

dollar
Reply With Quote
  #3 (permalink)  
Old 07-30-04, 14:51
udbdb2 udbdb2 is offline
Registered User
 
Join Date: Nov 2003
Posts: 121
OK.then can any user inpersonate other user so they don't need to make like :
select db2usr1schema.table1 ( db2user2 makes this query) instead they can just impersoname 'db2usr1schema' owner and make simple by:
select table1 , as if it were created by him ?
Reply With Quote
  #4 (permalink)  
Old 07-30-04, 16:48
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Yes, look as SET CURRENT SCHEMA SQL Command (in SQL Reference manual).

Andy
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