Re: Changing table owner
Posted in 1999
Topics: Triggers, Constraints & Referential Integrity, Migration, Import/Export & Data Conversion
You can also alter the table owner directly by updating the OWNER column in
SYSTABLES, like this:
UPDATE informix.SYSTABLES SET OWNER = 'newowner' WHERE TABNAME =
(tablename);
Other object tables in which you can update the owner directly are
sysindexes, syssynonyms, syssyntable, sysconstraints, sysprocedures,
sysopclstr, systriggers, and sysobjstate.
I was never able to alter the owner of views so easily. The owner of a view
is stored within the view definition which is stored in one or many rows of
sysviews.viewtext. The easiest way I found to alter the owner of a view was
to use dbschema to dump the view DDL to ASCII, edit the owner name, and
recreate the view.
Alas, I've never found a way to alter the owner of a database directly
(there's probably a good reason for that!).
Randall Young <ryoung@BIX.com> wrote in message
news:7h04mg$kes@lotho.delphi.com...
> GQG wrote:
> >How can I change the owner of a table?
>
> dbexport the table, alter the schema, and dbimport the table. It's that
hard.
>
> Randall Young
> ryoung@bix.com
In article <a7QZ2.8123$u34.3571@news.rdc1.md.home.com>, Scott Henderson
<scotthenderson@home.com> writes
>You can also alter the table owner directly by updating the OWNER column in
>SYSTABLES, like this:
>
>UPDATE informix.SYSTABLES SET OWNER = 'newowner' WHERE TABNAME =
>(tablename);
>
>Other object tables in which you can update the owner directly are
>sysindexes, syssynonyms, syssyntable, sysconstraints, sysprocedures,
>sysopclstr, systriggers, and sysobjstate.
>
>I was never able to alter the owner of views so easily. The owner of a view
>is stored within the view definition which is stored in one or many rows of
>sysviews.viewtext. The easiest way I found to alter the owner of a view was
>to use dbschema to dump the view DDL to ASCII, edit the owner name, and
>recreate the view.
>
>Alas, I've never found a way to alter the owner of a database directly
>(there's probably a good reason for that!).
In SE you can change the owner of the DB by altering 'sysusers' - the
owner of the DB has priority 9, all other users are a lower priority.
You may have to be logged in as 'informix' to do this.
You would also have to remember to alter the owner of the '.dbs'
directory and it's contents. The group should always be 'informix'.
This also applies to altering the owner of a table.
>
>Randall Young <ryoung@BIX.com> wrote in message
>news:7h04mg$kes@lotho.delphi.com...
>> GQG wrote:
>> >How can I change the owner of a table?
>>
>> dbexport the table, alter the schema, and dbimport the table. It's that
>hard.
>>
>> Randall Young
>> ryoung@bix.com
>
>
--
Surfer!