新建用户及表空间

来源:互联网 发布:python 统计文章字数 编辑:程序博客网 时间:2024/06/07 20:01

--新建表空间 CoreBank
create tablespace CoreBank
 logging
 datafile 'd:/oracle/product/10.2.0/oradata/orcl/CoreBank.dbf'
 size 32m
 autoextend on
 next 32m maxsize 2048m
 extent management local;

--删除表空间
drop tablespace CoreBank including contents and datafiles

--创建临时表空间
CREATE TEMPORARY TABLESPACE test_temp
TEMPFILE 'D:/oracle/product/10.2.0/oradata/orcl/test_temp01.dbf'
SIZE 32M
AUTOEXTEND ON
NEXT 32M MAXSIZE 2048M
EXTENT MANAGEMENT LOCAL;

--创建用户并分配表空间
create user _name identified by _password
 default tablespace CoreBank
 temporary tablespace test_temp;

 

--授权

grant   resource   to  _name

 
--查看数据库中所有表空间
select * from dba_tablespaces