The AskTOM team is taking a break over the holiday season, so we're not taking questions or responding to comments. Please have a happy and safe festive season and as always, thanks for being a member of the AskTOM community.
Thanks for the question, Duong.
Asked: September 21, 2020 - 6:00 pm UTC
Last updated: September 23, 2020 - 12:27 pm UTC
Version: 12c 1
Viewed 10K+ times! This question is
grant create session to u identified by u; create table t ( c1 int ); grant select, insert, update, delete, alter on t to u; conn u/u alter table chris.t add c2 int; insert into chris.t values ( 1, 1 ); select * from chris.t; C1 C2 1 1
Rajeshwaran, Jeyabal, September 22, 2020 - 2:14 pm UTC
demo@XEPDB1> create user a identified by a; User created. demo@XEPDB1> grant create session to a; Grant succeeded. demo@XEPDB1> drop table t purge; Table dropped. demo@XEPDB1> create table t as select * from scott.emp; Table created. demo@XEPDB1> grant select,insert,update,alter on t to a; Grant succeeded. demo@XEPDB1> conn a/a@pdb1 Connected. a@XEPDB1> alter table demo.t add constraint t_pk primary key( empno ); alter table demo.t add constraint t_pk primary key( empno ) * ERROR at line 1: ORA-01031: insufficient privileges a@XEPDB1> alter table demo.t add c2 int; Table altered. a@XEPDB1> alter table demo.t add constraint t_pk primary key( empno ) 2 using index ( create unique index demo.t_pk on demo.t(empno) ); alter table demo.t add constraint t_pk primary key( empno ) * ERROR at line 1: ORA-01031: insufficient privileges a@XEPDB1> conn demo/demo@pdb1 Connected. demo@XEPDB1> grant create any index to a; Grant succeeded. demo@XEPDB1> conn a/a@pdb1 Connected. a@XEPDB1> alter table demo.t add constraint t_pk primary key( empno ) 2 using index ( create unique index demo.t_pk on demo.t(empno) ); Table altered. a@XEPDB1>
A reader, September 23, 2020 - 2:28 am UTC
Check out more PL/SQL tutorials on our LiveSQL tool.
PL/SQL reference manual from the Oracle documentation library