Re: Change table owner
Posted in 2014
Topics: Server Administration
To change "pedroivo".teste to "informix".teste: UPDATE systables SET owner = "informix" WHERE tabname="teste" You must be the informix dba. Regards
You cannot do what you have suggested Pedro. Even if you can, it is a VERY bad idea. The owner of every partition (table, index, or a fragment of one) is stored in the partition's header page which has nothing to do with the database catalog table systables. Changing the owner in one place when it will be different in other places is a recipe for disaster! I'll repeat what I posted when the OP originally posted: THE ONLY WAY TO CHANGE THE OWNER OF AN OBJECT IN THE DATABASE IS TO DROP IT AND RECREATE IT. Obviously if you need the contents of the object then you will have to export its data first and reload the data after recreating it with a new owner. 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 Tue, Apr 8, 2014 at 4:25 PM, PEDRO NEVES <pedroivomz@gmail.com> wrote: > To change "pedroivo".teste to "informix".teste: > > UPDATE systables > > SET owner = "informix" > WHERE tabname="teste" > > You must be the informix dba. > > Regards > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --001a113480a083961504f68e330d
To confirm and add up to what Art wrote:
castelo@primary:informix-> dbaccess -e stores test.sql
Database selected.
UPDATE systables
SET owner = 'xpto'
WHERE tabname = 'customer';
1 row(s) updated.
Database closed.
castelo@primary:informix-> oncheck -pe | grep customer
stores:'informix'.customer
1862 8
stores:'informix'.customer_tax_code 13114
30000
stores_ansi:'informix'.customer
45388 8
stores_ansi:'informix'.customer_ts_data
45573 8
stores:'informix'.ix_customer_tax_code_1 53
31056
stores:'informix'.ix_customer_tax_code_2 31109
7764
castelo@primary:informix->
DON'T PLAY WITH FIRE!
Create an RFE for it, if it does not exist yet.
Regards.
On Tue, Apr 8, 2014 at 9:55 PM, Art Kagel <art.kagel@gmail.com> wrote:
> You cannot do what you have suggested Pedro. Even if you can, it is a VERY
> bad idea. The owner of every partition (table, index, or a fragment of
> one) is stored in the partition's header page which has nothing to do with
> the database catalog table systables. Changing the owner in one place when
> it will be different in other places is a recipe for disaster!
>
> I'll repeat what I posted when the OP originally posted:
> THE ONLY WAY TO CHANGE THE OWNER OF AN OBJECT IN THE DATABASE IS TO DROP IT
> AND RECREATE IT. Obviously if you need the contents of the object then you
> will have to export its data first and reload the data after recreating it
> with a new owner.
>
> 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 Tue, Apr 8, 2014 at 4:25 PM, PEDRO NEVES <pedroivomz@gmail.com> wrote:
>
> > To change "pedroivo".teste to "informix".teste:
> >
> > UPDATE systables
> >
> > SET owner = "informix"
> > WHERE tabname="teste"
> >
> > You must be the informix dba.
> >
> > Regards
> >
> >
> >
> >
>
>
*******************************************************************************
> > Forum Note: Use "Reply" to post a response in the discussion forum.
> >
> >
>
> --001a113480a083961504f68e330d
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Fernando Nunes
Portugal
http://informix-technology.blogspot.com
My email works... but I don't check it frequently...
--001a11360a1cb29f0204f68e862f