Subject RE: [firebird-support] Changing the creator/owner of tables
Author Alan McDonald
> Hi,
>
> With Interbase 6.0, is there an easy way to change the creator of
> tables, triggers etc? We have a database that was created by a user
> that has now left. This database has now been taken over by another
> user, but as he is not the creator of most of its objects, he can not do
> things such as drop tables, alter tables, alter triggers etc. These
> actions can only be performed by the creator, sysdba or users with o/s
> root privileges. Granting the user sysdba or root is not an option, so
> it looks like I must somehow change the object's creator to the new user.
>
> I originally thought I would be able to achieve this by changing the
> database owner with a backup and restore. However, this does not change
> any of the creator information. After much reading around, the only
> possible way that I have found is to manually alter the RDB$OWNER_NAME
> field in RDB$RELATIONS. However, I'm nervous about fiddling with the
> system tables, and this situation isn't ideal anyway as a trigger is in
> place to stop anyone other than the creator from modifying this field
> (preventing sysdba from doing it!).
>
> Can anyone provide an alternate solution, or offer some guidance on
> modifying RDB$RELATIONS in a safe way?
>
> Thanks,
>
> Max Spicer
>
> PS Apologies for the cross-post from newsgroups.borland.com!

one way is to extract the metadata, create a new database with the new owner
(preferably a userid which is general enough to withstand this kind of
upheaval) and pump the data across.
another way is to ask Thomas Steinmaurer (on this list) for his, as yet,
un-published db owner migrator tool which works very reliably (for me).
Alan