--以下几个为相关表SELECT * FROM v$lock;SELECT * FROM v$sqlarea;SELECT * FROM v$session;SELECT * FROM v$process ;SELECT * FROM v$locked_object;SELECT * FROM all_objects;SELECT * FROM v$session_wait; --查看被锁的表 select b.owner,b.object_name,a.session_id,a.locked_…
Oracle查看表空间及修改数据文件大小 第一步:查看所有表空间及表空间大小: select tablespace_name ,sum(bytes) / 1024 / 1024 as MB from dba_data_files group by tablespace_name; 第二步:查看所有表空间对应的数据文件: select tablespace_name,file_name from dba_data_files; 第三步:修改数据文件大小 alter database datafil…
ORACLE如何查看表空间存储了那些数据库对象呢?可以使用下面脚本简单的查询表空间存储了那些对象: SELECT TABLESPACE_NAME AS TABLESPACE_NAME , SEGMENT_NAME AS SEGMENT_NAME , SUM(BYTES)/1024/1024 AS SEGMENT_SIZE FROM DBA_SEGMENTS WHERE TABLESPACE_NAME=&TABLESPACE_NAME GROUP…
--1.查看表空间的名称及大小 )), ) ts_size FROM dba_tablespaces t, dba_data_files d WHERE t.tablespace_name = d.tablespace_name GROUP BY t.tablespace_name; --2.查看表空间物理文件的名称及大小 SELECT tablespace_name, file_id, file_name, ), ) total_space FROM dba_data_files ORDER…
查看表空间 select * from user_tablespaces where table_name = 'TableName' 查看表属主 select Owner from all_tab_columns where table_name = 'TableName' 附录: A tablespace is a storage location where the actual data underlying database objects can be kept. It prov…
--1.查看表空间的名称及大小 )), ) ts_size FROM dba_tablespaces t, dba_data_files d WHERE t.tablespace_name = d.tablespace_name GROUP BY t.tablespace_name; --2.查看表空间物理文件的名称及大小 SELECT tablespace_name, file_id, file_name, ), ) total_space FROM dba_data_files ORDER…
1.查看表所占空间 SELECT TABLESPACE_NAME,TO_CHAR(SUM(BYTES)/(1024*1024),'999G999D999') CNT_MB FROM DBA_EXTENTS WHERE OWNER='&OWNER' AND SEGMENT_NAME='&TABLE_NAME' AND SEGMENT_TYPE LIKE 'TABLE%' GROUP BY TABLESPACE_NAME;…
查看表空间剩余: ||'M' from dba_free_space group by tablespace_name 查看表空间总大小.使用大小.剩余大小,使用率.剩余率 ) useded, trunc(c.bytes) freeed from sys.sm$ts_avail a,sys.sm$ts_used b,sys.sm$ts_free c where a.tablespace_name = b.tablespace_name and a.tablespace_name = c.tabl…
select table_name from user_tables; //当前用户的表 select table_name from all_tables; //所有用户的表 select table_name from dba_tables; //包括系统表 select table_name from dba_tables where owner='用户名' user_tables: table_name,tablespace_name,last_analyzed等 dba_tables:…
--查看表空间的真实使用情况 set linesize 500 pagesize 500 col tablespace_name format a25 col TP_REAL_GB format a15 col TP_REAL_FREE_GB format a20 select all_tp.TP_NAME "TABLESPACE_NAME", to_char(trunc(all_tp.TP_ALL_SIZE_KB / 1024 / 1024, 2), 'FM9999990.0099'…
http://www.2cto.com/database/201107/95313.html 一种是分配给一个表的物理空间数量,而不管空间是否被使用.可以这样查询获得字节数:select segment_name, bytes from user_segments where segment_type = 'TABLE'; 或 Select Segment_Name,Sum(bytes)/1024/1024 from User_Extents Group By Segment_Name; 另一种…