select t.table_name,t.num_rows from user_tables t ORDER BY NUM_ROWS DESC;//实际行数 analyze table emp compute statistics; select num_rows * avg_row_len from user_tables where table_name = 'TB_SYS_LOG';//某一个表占用的空间 analyze table emp compute statistics; sel
,) percent_used from (select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) a, (select tablespace_name,sum(bytes) bytes,max(bytes) largest from dba_free_space group by tablespace_name) b where a.tablespace_name=b.table
select t1.tablespace_name,curr_b/1024/1024/1024,max_b/1024/1024/1024,curr_b/max_b from(select tablespace_name,sum(maxbytes) max_b from dba_data_files group by tablespace_name) t1join(select tablespace_name,sum(bytes) curr_b from dba_segments group b
oracle 查询表的大小,表空间的使用情况,默认表空间 oracle 查询表的大小,表空间的使用情况,默认表空间 --查看某张表占用磁盘空间大小 ( 表名大写 ) Select Segment_Name,Sum(bytes)/1024/1024 From User_Extents Group By Segment_Name having Segment_Name='表名'; 查看用户默认表空是那个 select username,default_tablespace from dba_user
查询表空间对应地址 *),) total_space from dba_data_files order by tablespace_name; //方案一:修改表空间大小(32000可改为想要的数值) alter database datafile '要修改的数据文件地址' resize 32000m; //方案二:新增数据文件 ALTER TABLESPACE 表空间名(例如USERS) ADD DATAFILE '新的数据文件路径' SIZE 500M AUTOEXTEND ON NEXT
如何查询当前用户的表空间名称?因为oracle建立索引,需要知道当前用户的表空间,查找了一下资料 --查询语法-- select default_tablespace from dba_users where username='登录用户' 如,我的登录用户是TMS21,那么查询语法是 /* 查看用户所属的表空间 */ select default_tablespace from dba_users where username='TMS21'; 相关查询的用法,也顺便记录一下 1)查询当前用户
1.select file_Name from dba_data_files;(查询表空间) 2.create tablespace QUAN datafile '/app/ADMINISTRATOR/oradata/orcl/QUAN.dbf' size 400m; (创建表空间<QUAN为自定义名称>) 3.create user QUAN identified by 123;(创建一个用户并设置密码为123) 4.alter user QUAN default tablespace QU