zoukankan      html  css  js  c++  java
  • oracle对用户、 表、字段的基本操作

    1.创建用户并设置密码
        create user username identified by password ;
     
    2.修改用户密码
        alter username identified by password ;
     
    3.删除用户
        drop user username
     
    4.赋予用户权限
     赋予用户所有权限:
        grant all privileges to username;
     赋予用户部分权限:
       grant connect to username;
       grant resource to username;
       grant create snapshot to username;
       grant create synonym to username;
       grant create table to username;
       grant create view to username;
       grant select any table to username;
       grant create any trigger to username;
       grant create any view to username;
       grant select any dictionary to username;
       grant unlimited tablespace to username;
     

    5.添加表

       create table sys_log (

         log_id nvarchar2(36) not null,

         create_time number(13) default null,

        CONSTRAINT pk_logId PRIMARY KEY (log_id) --指定主键
      );
     
    6.为表的某个字段添加索引
        create INDEX createTime_index --索引名称
        on
        sys_log --表名 (create_time --字段名);
     
    7.插入数据
        insert into sys_log (log_id,CREATE_TIME) values('1',1528787854000);
     
    8.修改某个字段允许为空
        ALTER TABLE 表名 MODIFY 字段名 字段类型 NULL;
     
    9.增加字段
       alter table sys_file add(
         ip NVARCHAR2(20) default null
       );
       comment on column sys_file.ip is '上传人的ip';

     

  • 相关阅读:
    CSS布局之盒子模型[二]
    CSS布局之盒子模型[一]
    CSS文本相关之垂直排列[5]
    网站迁移之后,中文路径都变成乱码
    Linux中shell搜索多文件中的字符串
    mysql数据库报错
    使用Flarum轻松搭建自己的论坛
    CSS雪碧图-html优化
    CSS-定位模式
    ul当做div标签的使用
  • 原文地址:https://www.cnblogs.com/dhjmjava/p/9175923.html
Copyright © 2011-2022 走看看