Solved

How to make a user as the owner of an existing  database

Posted on 2002-05-13
7
2,216 Views
Last Modified: 2013-12-09
Hi,
I have a user called MYUSER with all permission to the table COUNTRY which
is created by SYSDBA. MYUSER has all the permission including WITH GRANT,
but  i wont be able to add/delete a field to the table COUNTRY.
How do i get privilage to add a field / delete a field for the user MYUSER
on this  table.
i think i need to make MYUSER the owner of table COUNTRY.

please help me

regards
Raj
0
Comment
Question by:mrk_raj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 4

Expert Comment

by:YodaMage
ID: 7006775
try:

grant delete, insert, update, select, reference on country to MYUSER with grant option;

-or-

create role test;
grant delete, insert, update, select, reference on country to test;
grant test to MYUSER;  
0
 

Author Comment

by:mrk_raj
ID: 7007594
thanks for ur suggetion

but i need to create/Delete a Field in COUNTRY with MYUSER...i can SELECT, DELETE,INSERT ...with this user but can not do anything with DDL statements...

hope u got my point

raj
0
 
LVL 4

Expert Comment

by:YodaMage
ID: 7008619
Did you add the "with grant option;"?
0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 

Author Comment

by:mrk_raj
ID: 7008772
yeassss..i did...then again its giving error
     unsuccessful metadata update
    -STORE RDB$RELATION_FIELDS failed
    -no permission for control access to TABLE tablname

please  help me
regards
raj
0
 
LVL 2

Accepted Solution

by:
bego earned 100 total points
ID: 7014209
Hi mrk_raj,

I did some research on that problem and it seems that there's no easy way to do it - the user can do metadata changes only to objects created by himself.

At http://community.borland.com/article/0,1410,25349,00.html the author claims that restoring the database as MYUSER may help - I tried it and the owner of the tables changed - but only for system tables - probably not what we're looking for :-).

At http://www.mers.com/IB_0335.HTML the author claims that editing system tables may help - does not seem to work either. This is what I tried:

E:\Program Files\Firebird\bin>isql -U sysdba -PAS masterkey f:\bak\friday.gdb
Database:  f:\bak\friday.gdb, User: sysdba
SQL> SELECT RDB$RELATION_NAME, RDB$OWNER_NAME FROM
CON> RDB$RELATIONS WHERE RDB$RELATION_NAME = 'FUND';

RDB$RELATION_NAME               RDB$OWNER_NAME

FUND                            SYSDBA

SQL> UPDATE RDB$RELATIONS
CON> SET RDB$OWNER_NAME = 'USER'
CON> WHERE RDB$RELATION_NAME = 'FUND';
SQL> SELECT RDB$RELATION_NAME, RDB$OWNER_NAME FROM
CON> RDB$RELATIONS WHERE RDB$RELATION_NAME = 'FUND';

RDB$RELATION_NAME               RDB$OWNER_NAME

FUND                            USER

So far, so good.

SQL> EXIT;

E:\Program Files\Firebird\bin>isql -U user -PAS password f:\bak\friday.gdb
Database:  f:\bak\friday.gdb, User: user
SQL> ALTER TABLE FUND ADD FOO VARCHAR(10);
Statement failed, SQLCODE = -607

unsuccessful metadata update
-STORE RDB$RELATION_FIELDS failed
-no permission for control access to TABLE FUND
SQL>

No luck. And editing system tables is not a good habit anyway. :-)

So it seems that a user can alter only the tables he created.

HTH,

bego
0
 
LVL 1

Expert Comment

by:thegroup
ID: 7027844
The only user authorized to change table structures is SYSDBA or the user that creates the object, without exceptions. If you are not the creator (owner) or SYSDBA you can't modify table structures.
0
 

Author Comment

by:mrk_raj
ID: 7038318
yeas...i ve also tried all these stuff..but went in vain...
but some experts says u can do with restore/or updation of sys tables..etc...i tried everything...but now i knew..its just impossible....thanks bego......

thanks for all...

regards
raj
0

Featured Post

Veeam gives away 10 full conference passes

Veeam is a VMworld 2017 US & Europe Platinum Sponsor. Enter the raffle to get the full conference pass. Pass includes the admission to all general and breakout sessions, VMware Hands-On Labs, Solutions Exchange, exclusive giveaways and the great VMworld Customer Appreciation Part

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question