zoukankan      html  css  js  c++  java
  • oracle创建用户四部曲

    创建用户一般分四步:

    第一步:创建临时表空间

    第二步:创建数据表空间

    第三步:创建用户并制定表空间

    第四步:给用户授予权限

    创建临时表空间

    create temporary tablespace homehotel_temp
    tempfile 'D:/win64_Oracle_11gR2/homehotel/homehotel_temp.dbf'
    size 50m
    autoextend on
    next 50m maxsize 1024m
    extent management local;

    注意事项:文件目录要存在D:/win64_Oracle_11gR2/homehotel,dbf为oracle创建的文件名,不能存在,由oracle创建。

    创建数据表空间

    create tablespace homehotel_data
    logging
    datafile 'D:/win64_Oracle_11gR2/homehotel/homehotel_data.dbf'
    size 50m
    autoextend on
    next 50m maxsize 1024m
    extent management local;

    注意事项:与临时表空间一样要求。

    创建用户并制定表空间

    create user homehotel identified by homehotel
    default tablespace homehotel_data
    temporary tablespace homehotel_temp;

    给用户授予权限

    grant connect,resource,dba to homehotel; 

    查看用户信息以及空间存储

    select username,default_tablespace,user_users.* from user_users;

    --删除空的表空间,但是不包含物理文件
    drop tablespace tablespace_name;
    --删除非空表空间,但是不包含物理文件
    drop tablespace tablespace_name including contents;
    --删除空表空间,包含物理文件
    drop tablespace tablespace_name including datafiles;
    --删除非空表空间,包含物理文件
    drop tablespace tablespace_name including contents and datafiles;
    --如果其他表空间中的表有外键等约束关联到了本表空间中的表的字段,就要加上CASCADE CONSTRAINTS
    drop tablespace tablespace_name including contents and datafiles CASCADE CONSTRAINTS;

  • 相关阅读:
    python的argparse模块
    Robotframework之SSHLibrary库
    Python 中的 getopt 模块
    Python list 列表
    Samba windows 10 share: mount error(112): Host is down
    安装两个版本的python安装包,后安装的python程序打开时闪退
    NetScaler VPX configration
    drupal smtp could not connect to smtp
    drupal7 判断用户是否具有某个权限
    微信支付报错:time_expire时间过短,刷卡至少1分钟,其他5分钟]
  • 原文地址:https://www.cnblogs.com/miaosj/p/6932177.html
Copyright © 2011-2022 走看看