Subject | Create a role that has all rights for a database |
---|---|
Author | Josef Kokeš |
Post date | 2012-09-21T11:13:15Z |
Hi!
I have a database which was never intended to be used by more than one
user, so it never concerned itself with access rights - basically, all
objects were always created by that one user, who thus had a full access
to them.
Now I find myself in need of using another user (because I need to write
a trigger that behaves differently in two different situations, and I
can't distinguish between the situations by using a field; so I plan to
use a IF (CURRENT_USER='USER1') THEN ...). What would be the easiest way
to give the new user full rights to all objects, and preferably also to
all objects which will be created in the future?
It seems to me that I would have to create a role, give full access to
this role (how?), give this role to both my users, and then in the
future keep adding rights to this role.
It might actually be more feasible to say that one of those users will
be a SYSDBA and do an IF (CURRENT_USER='SYSDBA') THEN ...
Thanks,
Josef
I have a database which was never intended to be used by more than one
user, so it never concerned itself with access rights - basically, all
objects were always created by that one user, who thus had a full access
to them.
Now I find myself in need of using another user (because I need to write
a trigger that behaves differently in two different situations, and I
can't distinguish between the situations by using a field; so I plan to
use a IF (CURRENT_USER='USER1') THEN ...). What would be the easiest way
to give the new user full rights to all objects, and preferably also to
all objects which will be created in the future?
It seems to me that I would have to create a role, give full access to
this role (how?), give this role to both my users, and then in the
future keep adding rights to this role.
It might actually be more feasible to say that one of those users will
be a SYSDBA and do an IF (CURRENT_USER='SYSDBA') THEN ...
Thanks,
Josef