${database} 为数据库的名称 /*1.查看索引 (1)单位是GB*/ SELECT CONCAT(ROUND(SUM(index_length)/(**), ), ' GB') AS 'Total Index Size' FROM information_schema.TABLES WHERE table_schema LIKE '${database}'; /* +------------------+ | Total Index Size | +------------------
-新建表空间,登录名和密码 --请尽量把表空间和别的系统分离,这里以Search为例子,登录名和密码以test为例子 create tablespace Search logging datafile 'D:\oracle\product\10.2.0\oradata\orcl\Search.ora' size 15M extent management local segment space management auto; --删除test用户 drop user test cascade;
Oracle中一个表空间可能是多个用户的默认表空间,下面语句统计了用户及其默认表空间情况,如果用户多个,用户之间通过逗号分隔. select t.default_tablespace, to_char(wmsys.wm_concat(username)) all_users from dba_users t group by t.default_tablespace; 显示结果如下: 可以对结果根据用户创建的时间排序(如果多用户取第一个用户创建时间),语句如下: select t.default
1.查询表空间的总容量 as MB from sys.dba_data_files a group by a.TABLESPACE_NAME 2.查询表空间的空闲容量 select b.TABLESPACE_NAME, ) as extends, as MB, sum(b.BLOCKS) as blocks from sys.dba_free_space b group by b.TABLESPACE_NAME 3.查询表空间的使用情况 select total.TABLESPACE_NAME,
Select Sum(bytes / (1024 * 1024)), a.status From dba_undo_extents a Group By a.status Select file_name, file_id, bytes / (1024 * 1024 * 1024) g, autoextensible From dba_data_files Where tablespace_name Like '%UNDO%'