Oracle 11g 常用表空间命令

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
#------------------------------------------------------------------------------------

你可能感兴趣的:(oracle 11g)