Hi,
I try resize SYSAUX datafile.
When I run query to check space used
SELECT NVL(b.tablespace_name, NVL(a.tablespace_name,'UNKNOWN')) "Tablespace",
ROUND( kbytes_alloc, 2) "Allocated MB",
ROUND( kbytes_alloc-NVL(kbytes_free,0), 2) "Used MB",
ROUND( NVL(kbytes_free,0), 2) "Free MB",
ROUND( ((kbytes_alloc-NVL(kbytes_free,0))/kbytes_alloc), 2) "Used",
data_files "Data Files"
FROM
(SELECT SUM(bytes)/1024/1024 Kbytes_free,
MAX(bytes) /1024/1024 largest,
tablespace_name
FROM sys.dba_free_space
GROUP BY tablespace_name
) a,
(SELECT SUM(bytes)/1024/1024 Kbytes_alloc,
tablespace_name,
COUNT(*) data_files
FROM sys.dba_data_files
GROUP BY tablespace_name
)b
WHERE a.tablespace_name (+) = b.tablespace_name
AND b.tablespace_name = 'SYSAUX'
ORDER BY 1;
I get result
>
Tablespace Allocated MB Used MB Free MB Used Data Files
----------------------------------------------------------------
SYSAUX 900 156.56 743.44 0.17 1
>
And when I run
ALTER DATABASE DATAFILE '/var/oracle/oradata/XE/sysaux.dbf' resize 500M;
I get error
>
Error starting at line 1 in command:
ALTER DATABASE DATAFILE '/var/oracle/oradata/XE/sysaux.dbf' resize 500M
Error report:
SQL Error: ORA-03297: file contains used data beyond requested RESIZE value
03297. 00000 - "file contains used data beyond requested RESIZE value"
*Cause: Some portion of the file in the region to be trimmed is
currently in use by a database object
*Action: Drop or move segments containing extents in this region prior to
resizing the file, or choose a resize value such that only free
space is in the trimmed.
>
What I do wrong and could be problem?
Regards,
Jari