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;

  • 相关阅读:
    转载-如何高效的学习技术
    Lc176-第二高的薪水
    Lc4-寻找两个有序数组的中位数
    Lc175-组合两个表
    Lc3-无重复字符的最长子串
    Lc2-俩数相加
    Lc1- 两数之和
    jpa-子查詢
    20191225页面样式
    leetcode二刷结束
  • 原文地址:https://www.cnblogs.com/miaosj/p/6932177.html
Copyright © 2011-2022 走看看