forked from geekcomputers/Oracle-SQL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlast5.sql
More file actions
23 lines (21 loc) · 482 Bytes
/
last5.sql
File metadata and controls
23 lines (21 loc) · 482 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
REM Filename : last5.sql
REM Author : Craig Richards
REM Created :
REM Version : 1.0
REM Modifications :
REM
REM Description : Displays the last 5 extents at the end of the datafile
SELECT *
FROM (
SELECT owner, segment_name,
segment_type, block_id
FROM dba_extents
WHERE file_id =
( SELECT file_id
FROM dba_data_files
WHERE file_name = '&FILE_NAME' )
ORDER BY block_id desc
)
WHERE rownum <= 5
;
REM End of Script