Skip to Main Content

Oracle Database Express Edition (XE)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Resize SYSAUX tablespace datafile

jariolaFeb 28 2011 — edited Oct 20 2011
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 17 2011
Added on Feb 28 2011
12 comments
12,848 views