---查询ash
SQL>
1* select snap_id,to_char(sample_time,'yyyymmdd hh24:mi:ss') as sample_time,session_id,user_id,sql_id,event,program,module,action from DBA_HIST_ACTIVE_SESS_HISTORY where rownum<120
SQL> select snap_id,to_char(sample_time,'yyyymmdd hh24:mi:ss') as sample_time,session_id,user_id,sql_id,event,program,module,action from DBA_HIST_ACTIVE_SESS_HISTORY where rownum<20;
SNAP_ID SAMPLE_TIME SESSION_ID USER_ID SQL_ID EVENT PROGRAM MODULE ACTION
---------- ------------------------- ---------- ---------- ------------- ------------------------------ ------------------------------ ------------------------------ --------------------------------
2 20130707 13:55:54 167 0 oracle@rhel5 (DBW0)
8 20130708 11:03:11 159 0 rman@rhel5 (TNS V1-V3) backup full datafile 0000087 STARTED16
8 20130708 11:03:21 159 0 rman@rhel5 (TNS V1-V3) backup full datafile 0000087 STARTED16
8 20130708 11:03:31 159 0 rman@rhel5 (TNS V1-V3) backup full datafile 0000087 STARTED16
8 20130708 11:09:11 149 0 RMAN backup & recovery I/O rman@rhel5 (TNS V1-V3) backup full datafile 0000093 STARTED16
8 20130708 11:09:21 149 0 RMAN backup & recovery I/O rman@rhel5 (TNS V1-V3) backup full datafile 0000093 STARTED16
8 20130708 11:09:31 149 0 rman@rhel5 (TNS V1-V3) backup full datafile 0000093 STARTED16
3 20130707 18:39:15 148 0 RMAN backup & recovery I/O rman@rhel5 (TNS V1-V3) backup full datafile 0000033 STARTED16
3 20130707 18:39:25 148 0 RMAN backup & recovery I/O rman@rhel5 (TNS V1-V3) backup full datafile 0000033 STARTED16
3 20130707 18:39:36 148 0 RMAN backup & recovery I/O rman@rhel5 (TNS V1-V3) backup full datafile 0000033 STARTED16
3 20130707 18:39:46 148 0 RMAN backup & recovery I/O rman@rhel5 (TNS V1-V3) backup full datafile 0000033 STARTED16
3 20130707 18:39:56 148 0 RMAN backup & recovery I/O rman@rhel5 (TNS V1-V3) backup full datafile 0000033 STARTED16
3 20130707 18:40:06 148 0 RMAN backup & recovery I/O rman@rhel5 (TNS V1-V3) backup full datafile 0000033 STARTED16
3 20130707 18:40:16 148 0 RMAN backup & recovery I/O rman@rhel5 (TNS V1-V3) backup full datafile 0000033 STARTED16
3 20130707 18:41:36 148 0 rman@rhel5 (TNS V1-V3) backup full datafile 0000105 STARTED16
3 20130707 18:41:46 148 0 rman@rhel5 (TNS V1-V3) backup full datafile 0000105 STARTED16
3 20130707 18:42:16 148 0 rman@rhel5 (TNS V1-V3) backup full datafile 0000181 STARTED16
3 20130707 18:42:26 148 0 rman@rhel5 (TNS V1-V3) backup full datafile 0000181 STARTED16
3 20130707 18:42:46 148 0 RMAN backup & recovery I/O rman@rhel5 (TNS V1-V3) backup full datafile 0000261 STARTED16
---在sqlplus查询上述sql各个列的格式化配置信息,目的为了调整显示效果
SQL> col
COLUMN module ON
FORMAT a30
COLUMN event ON
FORMAT a30
COLUMN program ON
FORMAT a30
COLUMN sample_time ON
FORMAT a25