查看表空间
select tablespace_name from dba_tablespaces;
查看临时表空间
select tablespace_name,file_name,bytes/1024/1024 file_size,autoextensible from dba_temp_files;
select status,enabled,name,bytes/1024/1024 file_size from v_$tempfile; ---sys用户查看
查看数据文件位置
select name from v$datafile;
删除表空间
drop tablespace ADATA including contents and datafiles cascade constraints;
创建表空间
CREATE SMALLFILE TABLESPACE "ADATA" DATAFILE'+DATA/toppay/datafile/adata01.dbf' SIZE 20480M AUTOEXTEND ON NEXT 200M MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
创建用户
CREATE USER "username" PROFILE "DEFAULT" IDENTIFIED BY "123456" DEFAULT TABLESPACE "PAYDATA" TEMPORARY TABLESPACE "TEMP" ACCOUNT UNLOCK ;
grant connect to xx
grant resource to xx
查看表空间大小
select tablespace_name,sum(bytes)/1024/1024 from dba_data_files group by tablespace_name;
查看已使用表空间大小
select tablespace_name,sum(bytes)/1024/1024 from dba_free_space group by tablespace_name;
查看表空间扩展属性
select file_name,autoextensible,increment_by from dba_data_files;
查看数据文件大小
select name,bytes from v$datafile;