虽然感觉就像在没有太多研究的情况下提出一个非常基本的问题,但在Oracle论坛,AskTom,Oracle Docs& amp; SOF。我试图缩小创建唯一键约束或主键约束所需的权限。这是因为尝试使用unique / primary key创建一个简单的表失败,但权限不足。
SQL> connect sys/syspass
Connected.
SQL> show user
USER is "SYS"
SQL> grant create session, create table, create any index,
create indextype, unlimited tablespace to tuser1;
Grant succeeded.
SQL>
SQL> connect tuser1/tuserp1
Connected.
SQL> create table tab1 (
atomic int unique,
symbol varchar2(2) unique,
name char(15)
); 2 3 4 5
create table tab1 (
*
ERROR at line 1:
ORA-01031: insufficient privileges
SQL> create table tab2 (empno number, name varchar2(30), sal number,
constraint pk_tab2 primary key (empno)); 2
create table tab2(empno number, name varchar2(30), sal number,
*
ERROR at line 1:
ORA-01031: insufficient privileges
SQL>
在这种情况下可以帮我找到可能缺少的许可吗?
答案 0 :(得分:2)
授予resource
必须解决问题:
SQL> conn tuser1/tuserp1
Connected.
SQL> create table tab2 (empno number, name varchar2(30), sal number,
constraint pk_tab2 primary key (empno));
create table tab2 (empno number, name varchar2(30), sal number,
*
ERROR at line 1:
ORA-01031: insufficient privileges
SQL> conn / as sysdba
Connected.
SQL> grant resource to hr;
Grant succeeded.
SQL> conn tuser1/tuserp1
Connected.
SQL> create table tab2 (empno number, name varchar2(30), sal number,
constraint pk_tab2 primary key (empno));
Table created.