Change table owner
Posted in 2011
Topics: General Discussion
Hello,
I am changing owner of table by updating row in systables table. My questions
are.
1). Is this a correct way or not?
2). Any issue which i have to faced near future with this table?
3). Any fast method for changing owner of table?
Procedure
1). Create Table
create table "test_user".test_table
(
sid integer,
sname char(2)
);
2). Checking owner
select tabname,owner from systables where tabname ='test_table';tabname test_table
owner test_user
3). Changing owner using update command.
update systables set owner ='informix' where tabname ='test_table';
4). Checking owner
select tabname,owner from systables where tabname ='test_table';tabname test_table
owner informix
DO NOT UPDATE systables, syscolumns, sysindices, or most of the other system
catalog tables! There are very few such updates that you can do without
damaging your database, sometimes irreparably!
There is no safe way to change the owner of a table short of renaming the
original table, creating a new one with the same name but a different owner,
copying the data to the new table from the old one, dropping the original
table.
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog: http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, 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, Jul 12, 2011 at 6:13 PM, ABRAR RASHID <mabrar@i2cinc.com> wrote:
> Hello,
>
> I am changing owner of table by updating row in systables table. My
> questions
> are.
>
> 1). Is this a correct way or not?
> 2). Any issue which i have to faced near future with this table?
> 3). Any fast method for changing owner of table?
>
> Procedure
>
> 1). Create Table
> create table "test_user".test_table
> (
>
> sid integer,
>
> sname char(2)
> );
> 2). Checking owner
> select tabname,owner from systables where tabname ='test_table';> tabname test_table
> owner test_user
>
> 3). Changing owner using update command.
>
> update systables set owner ='informix' where tabname ='test_table';>
> 4). Checking owner
> select tabname,owner from systables where tabname ='test_table';> tabname test_table
> owner informix
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--20cf307f325ab10d9e04a7e81020