oracle一些对表的操作命令


查询所有表空间信息

select * from dba_tablespaces;

查询是否自动扩展 (包括查询数据文件和临时文件)
select tablespace_name,file_name,autoextensible from dba_data_files;
select tablespace_name,file_name,autoextensible from dba_temp_files;

修改临时表.dbf文件大小

alter database tempfile 'C:appxroradataorclTEMP01.DBF' resize 300M;

关闭/打开自动扩展

alter database datafile '/oracle9i/data/temp01.dbf' autoextend off/on;(数据文件)
alter database tempfile '/oracle9i/data/temp01.dbf' autoextend off/on;(临时文件)

设置自动扩展表空间文件的扩展步长

ALTER DATABASE DATAFILE 'SDE.SDE_LOGFILE_DATA_IDX1'  autoextend on next 10M;(数据文件)

ALTER DATABASE TEMPFILE 'SDE.SDE_LOGFILE_DATA_IDX1'  autoextend on next 10M;(临时文件)

当前用户下是否有某个表

select count(*) from user_tables where table_name = '表名';0表示没有1表示有

某个用户下是否有某个表

select count(*) from dba_tables where owner = '用户名' and table_name = '表名';

原文地址:https://www.cnblogs.com/lettet/p/4330338.html