日期:2014-05-16 浏览次数:20615 次
SQL> col file_name for a50; SQL> select tablespace_name, file_name ,bytes/1024/1024 M from dba_data_files or der by tablespace_name; TABLESPACE_NAME FILE_NAME M ---------------- -------------------------------------------------- ---------- CWMLITE D:\ORACLE\ORADATA\C_DB\CWMLITE01.DBF 20 DRSYS D:\ORACLE\ORADATA\C_DB\DRSYS01.DBF 20 EXAMPLE D:\ORACLE\ORADATA\C_DB\EXAMPLE01.DBF 149.375 INDX D:\ORACLE\ORADATA\C_DB\INDX01.DBF 25 ODM D:\ORACLE\ORADATA\C_DB\ODM01.DBF 20 SYSTEM D:\ORACLE\ORADATA\C_DB\SYSTEM01.DBF 400 TOOLS D:\ORACLE\ORADATA\C_DB\TOOLS01.DBF 10 UNDOTBS1 D:\ORACLE\ORADATA\C_DB\UNDOTBS01.DBF 200 USERS D:\ORACLE\ORADATA\C_DB\USERS01.DBF 25 XDB D:\ORACLE\ORADATA\C_DB\XDB01.DBF 38.125
SQL> select distinct segment_type,owner,tablespace_name from dba_segments where tablespace_name ='SYSTEM' order by owner ,segment_type; SEGMENT_TYPE OWNER TABLESPACE_NAME ------------------ ------------------------------ ---------------- INDEX MDSYS SYSTEM LOBINDEX MDSYS SYSTEM LOBSEGMENT MDSYS SYSTEM TABLE MDSYS SYSTEM INDEX ORDSYS SYSTEM TABLE ORDSYS SYSTEM INDEX OUTLN SYSTEM TABLE OUTLN SYSTEM INDEX SCOTT SYSTEM TABLE SCOTT SYSTEM CACHE SYS SYSTEM
SQL> select owner ,count(*) from dba_segments where tablespace_name='SYSAUX' group by owner;
--撤销管理方式 SQL> show parameter undo_management; NAME TYPE VALUE ------------------------------------ ----------- --------------------- undo_management string AUTO SQL> show parameter undo_tablespace; --撤销表空间名称 NAME TYPE VALUE ------------------------------------ ----------- --------------------- undo_tablespace string UNDOTBS1 --实例中配置的撤销保留时间 SQL> show parameter undo_retention; NAME TYPE VALUE ------------------------------------ ----------- --------------------- undo_retention integer 10800 --创建撤销表空间 create undo tablespace undo_tabs02 datafile '/OS_PATH/undo_t.dbf' size 2G; --切换UNDO表空间 alter system set undo_tablespace = undo_tabs02 ; 注:在RAC(Real application cluster)机构中,不同例程必须使用独立的UNDO表空间,不能共用同一个UNDO表空间。 --检查UNDO表空间的数据 --UNDO统计信息,每10分钟统计一次 SQL> select to_char(begin_time,'HH24:MI:SS') begin_time,to_char(end_time,'HH24:MI:SS') end_time,undoblks from v$undostat; BEGIN_TI END_TIME UNDOBLKS -------- -------- ---------- 20:15:42 20:25:42 16 20:05:42 20:15:42 19 19:55:42 20:05:42 16 19:45:42 19:55:42 17 19:35:42 19:45:42 18 19:25:42 19:35:42 17 19:15:42 19:25:42 15 19:05:42 19:15:42 19 18:55:42 19:05:42 19 --显示UNDO段统计数 select a.name undo段的名称 ,b.