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

     

  • 相关阅读:
    Spring和SpringMVC的关系
    The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的解决方法
    java面试题
    单例模式
    java中的继承关系
    java重载
    JSP页面读取数据中的数据内容,出现乱码现象的解决方法
    java中时间与时间戳的相互转换
    java中重写
    eclipse中经常用到的修改菜单项
  • 原文地址:https://www.cnblogs.com/dhjmjava/p/9175923.html
Copyright © 2011-2022 走看看