dba
给用户授角色
grant connect,resourse to jsd1303;
connect,resourse 是角色的名字
角色:一堆权限的集合 .
create role connect;
grant create table to connect;
给用户授系统权限 .
grant create table to jsd1303;
普通用户
jsd1302 jsd1303
connect jsd1303/jsd1303
grant select on account_hiloo to jsd1303;
connect jsd1302/jsd1302
select count(*) from jsd1303.account_hiloo;
如果不知道约束名,怎么删除约束
alter table test drop primary key cascade;
oracle table
系统表 数据库的对象信息 数据字典(dba)
select constrain_name,contraint_type,search_condition from user_constraints
where table name = 'Test';
用户表 account service cost
not null 的底层是check 约束实现的。
alter table test modify(c1 not null);
修改 not null 的结束,定义c1 非空.
alter table test modify (c1 null);
定义 c1 可以 非空.
alter table drop constraint con_name;
constraint_name 约束名
constraint_type 约束类型
user_constraints 知道约束的类型
user_cons_columns 知道约束在哪个列
select constraint_name,column_name from user_cons_columns
where table_name = 'service';
查数据库中的表
select table_name from user_tables where table_name like '%KE%';
字符串是大小写敏感的。