zoukankan      html  css  js  c++  java
  • sql学习之创建表空间创建用户并授权

    --创建表空间语法:create tablespace 【name】
    create tablespace hclTest
    --设置参数
    datafile 'F:/orcale/hclTest'--设置表空间创建位置

    size 1M -- 初始大小

    autoextend on next 50M --autoextend 设置容量为自动增长,50M是自增的大小

    maxsize unlimited--unlimited为无限制增长 可用具体值替换如:maxsize 200M

    --创建用户
    create user hcldb--创建数据库用户名
    identified by "123456"--设置用户密码
    --设置参数
    default tablespace hclTest--设置默认表空间
    profile DEFAULT--设置为系统默认
    account unlock--解锁用户


    --系统权限分类:
    --对于普通用户:授予connect, resource权限。
    --对于DBA管理用户:授予connect,resource, dba权限。
    grant connect to hcldb;--CONNECT:拥有Connect权限的用户只可以登录Oracle,不可以创建实体,不可以创建数据库结构。

    grant dba to hcldb;--DBA: 拥有全部特权,是系统最高权限,只有DBA才可以创建数据库结构。

    grant resource to hcldb;--RESOURCE:拥有Resource权限的用户只可以创建实体,不可以创建数据库结构。

    revoke dba from hcldb;

    revoke resource from hcldb;

    revoke connect from hcldb;


    --创建表
    create table users(
    loginId varchar2(9) primary key not null,--primary key 主键 not null不能为空
    userName varchar2(6) not null,
    userAge varchar2(3) not null,
    userAddress varchar2(10),
    userPhone varchar2(11),
    usersex varchar(2)

    )
    --添加注释
    comment on table users is '用户表'; --表注释
    comment on column users.loginid is '用户ID';--列注释
    comment on column users.username is '用户名';
    comment on column users.userAge is '年龄';
    comment on column users.userAddress is '地址';
    comment on column users.userphone is '电话';
    comment on column users.usersex is '性别';

  • 相关阅读:
    兼容ie和火狐firefox的js调用flash播放器代码特效
    在b/s开发中经常用到的javaScript技术整理
    用javascript+PHP随机显示图片
    1730 博弈
    1198 并查集
    Debug sharepoint
    get your current password on sharepoint(Basci Authentication )
    Site mail box
    Ews get data from exchange shared calender
    upgrade sharepoint 2007 to 2010,2010 to 2013
  • 原文地址:https://www.cnblogs.com/hcl22/p/10796566.html
Copyright © 2011-2022 走看看