oracle中建立表空间和用户的过程

来源:互联网 发布:linux home 空间缩小 编辑:程序博客网 时间:2024/05/22 08:06

1.先建表空间 2.建用户。

 步骤一:  删除user

drop user ×× cascade

说明: 删除了user,只是删除了该user下的schema objects,是不会删除相应的tablespace的。

步骤二: 删除tablespace

DROP TABLESPACE tablespace_name INCLUDING CONTENTS AND DATAFILES;


//创建临时表空间


create temporary tablespace test_temp
tempfile 'E:/oracle/product/10.2.0/oradata/testserver/test_temp01.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;

//创建数据表空间
create tablespace test_data
logging
datafile 'E:\oracle\product\10.2.0\oradata\testserver\test_data01.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;

//创建用户并指定表空间
create user username identified by password
default tablespace test_data
temporary tablespace test_temp;

//给用户授予权限

grant connect,resource to username;

//以后以该用户登录,创建的任何数据库对象都属于test_temp 和test_data表空间,这就不用在每创建一个对象给其指定表空间了。



欢迎各位程序猿、程序媛们批评指正~


原创粉丝点击