Solved

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

Posted on 2002-05-13
7
2,122 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
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
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…

776 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