Create tablespace user authorization

  1. Create a temporary table space

     临时表空间主要用途是在数据库进行排序,分组,管理索引,访问视图等操作时候提供的临时空间,运算完成自动清理。
    

create temporary tablespace happyfarm_temp
logging
datafile ‘D:\Oracle\oradata\orcl\happyfarm_temp.dbf’
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;

  1. Create table space

create tablespace happyfarm
logging
datafile ‘D:\Oracle\oradata\orcl\happyfarm.dbf’
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;

--表空间名为happyfarm。
--logging 声明这个表空间上所有的用户对象的日志属性,包括表,索引,分区,物化视图,物化视图上的索引,分区。
--datafile声明这个表空间包含什么空间文件。
--size 声明表空间大小为50m。   
--autoextend on  声明表空间大小不够用时自动扩展。
--next 50m maxsize 20480m 声明每次自动扩展50m,最大20480m。
--extent management local 声明表空间本地管理,本地管理表空间是通过位图管理的。
  1. Create user

create user happyfarm identified by happyfarm
default tablespace happyfarm;

--用户名密码都为happyfarm,前者用户名后者密码。
--默认表空间名为happyfarm

- Authorization
grant connect, resource, dba to happyfarm ;

DBA: 拥有全部特权,是系统最高权限,只有DBA才可以创建数据库结构。
RESOURCE:拥有Resource权限的用户只可以创建实体,不可以创建数据库结构。
CONNECT:拥有Connect权限的用户只可以登录Oracle,不可以创建实体,不可以创建数据库结构。

Note: When creating the table structure, keywords cannot be used in the table name, otherwise the table creation will be unsuccessful, such as user.

Guess you like

Origin blog.csdn.net/DJ_ONE/article/details/103023217