changing ownership of a table
Posted in 2014
Topics: Triggers, Constraints & Referential Integrity
How do I change all the ownerships of my tables in my database, as well as their indexes, triggers and procedures to ONE owner using SQL ?
You cannot. The only way is to export the database with -ss, modify the
.sql DDL file to change the owners of all objects, drop the database, then
reimport it using the modified DDL script. A simple way to fix the DDL
file is to use:
myschema -l --set-owner newowner -d mydatabase
export/path/mydatabase.sql
The -l option causes myschema to generate a DDL file compatible with
dbimport, --set-owner causes every object to be explicitly created with the
specified owner. If you take this option there are other myschema options
you might also want to take advantage of when you recreate the DDL file.
Myschema is included in the package utils2_ak which you can download from
the IIUG Software Repository (www.iiug.org/software).
Art
Art S. Kagel, Principal Consultant
ASK Database Management
Blog: http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions
and do not reflect on the IIUG, nor any other organization with which I am
associated either explicitly, implicitly, or by inference. Neither do
those opinions reflect those of other individuals affiliated with any
entity with which I am affiliated nor those of the entities themselves.
On Wed, Mar 26, 2014 at 10:09 AM, ROB KOTTLER <robk@ethniks.co.za> wrote:
> How do I change all the ownerships of my tables in my database, as well as
> their indexes, triggers and procedures to ONE owner using SQL ?
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--001a113476de3dc59904f5833723
That's not supported and sometimes dangerous. Don't. You can export your database, change the owner names in the .sql file and import to do it. --EEM > -----Original Message----- > From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of > ROB KOTTLER > Sent: Wednesday, March 26, 2014 9:10 AM > To: ids@iiug.org > Subject: changing ownership of a table [32803] > > How do I change all the ownerships of my tables in my database, as well > as their indexes, triggers and procedures to ONE owner using SQL ? > > > *********************************************************************** > ******** > Forum Note: Use "Reply" to post a response in the discussion forum.