sql数据库开发-16:dba在开发中要做的事

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%';


字符串是大小写敏感的。

 


  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

慕容屠苏

你的鼓励是我最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值