前端之家收集整理的这篇文章主要介绍了
PLSQL来Oracle创建表空间和创建用户,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
//创建临时表空间
@H_
301_2@
@H_
301_2@
create temporary tablespace test_temp
@H_
301_2@tempfile 'E:/oracle/product/10.2.0/oradata/testserver/test_temp01.dbf'
@H_
301_2@size 32m
@H_
301_2@autoextend on
@H_
301_2@next 32m maxsize 2048m
@H_
301_2@extent management local;
@H_
301_2@//创建数据表空间
@H_
301_2@create tablespace test_data
@H_
301_2@logging
@H_
301_2@datafile 'E:/oracle/product/10.2.0/oradata/testserver/test_data01.dbf'
@H_
301_2@//创建
用户并指定表空间
@H_
301_2@create user username identified by password
@H_
301_2@default tablespace test_data
@H_
301_2@temporary tablespace test_temp;
@H_
301_2@//给
用户授予权限
@H_
301_2@grant connect,resource to username;
@H_
301_2@//以后以该
用户登录,创建的任何
数据库对象都属于test_temp 和test_data表空间,这就不用在每创建一个对象给其指定表空间了。