日期:2014-05-16  浏览次数:20488 次

Oracle 11g 创建表空间命令 (转)

原作者网址:http://hi.baidu.com/enterparse/blog/item/a661f50f89a697ef36d122d7.html

?

Oracle 11g 常用命令!表空间命令

?

2009年05月20日 星期三 14:37

?

1.查看oracle数据有多少表空间

SELECT COUNT(*) FROM DBA_DATA_FILES;
SELECT FILE_NAME,TABLESPACE_NAME,BYTES,USER_BLOCKS FROM DBA_DATA_FILES;
SELECT TABLESPACE_NAME FROM DBA_DATA_FILES;


2.删除表空间

drop tablespace opencmstest including contents;

3.创建表空间

#------------------------------------------------
创建临时表空间
create temporary tablespace tmp_jportal
tempfile '/u01/app/oracle/database/tmp_jportal.dbf'
Size 32m
autoextend on
extent management local;

#------------------------------------------------
创建表空间
create tablespace jportal
logging
datafile '/u01/app/oracle/database/jportal.dbf'
Size 32m
autoextend on
extent management local;

#------------------------------------------------
创建用户
create user jboss identified by jboss
default tablespace jportal
temporary tablespace tmp_jportal;

#------------------------------------------------
授权给用户
GRANT CREATE USER,DROP USER,ALTER USER ,CREATE ANY VIEW ,DROP ANY VIEW,EXP_FULL_DATABASE,IMP_FULL_DATABASE,DBA,CONNECT,RESOURCE,CREATE SESSION TO jboss

?

?

?