Check for Database Objects which will not extend in Oracle 19c
To identify "database objects that will not extend" in Oracle 19c, you need to examine the storage settings and tablespace configurations that might prevent automatic or manual space allocation. Here are the steps you can follow:
Check for Tablespace Space Issues
Database objects typically won't extend if their underlying tablespace has run out of space or does not have auto-extension enabled.
Query to check tablespace usage:
SELECT
tablespace_name,
file_name,
bytes / 1024 / 1024 AS size_in_mb,
maxbytes / 1024 / 1024 AS max_size_in_mb,
autoextensible
FROM
dba_data_files
WHERE
tablespace_name NOT IN ('SYSTEM', 'SYSAUX', 'TEMP');
Key points to check:
AUTOEXTENSIBLE = NO: The file will not grow automatically.
SIZE_IN_MB close to MAX_SIZE_IN_MB: The file is near its maximum allowed size.
Tablespaces with no free space will block object growth.
Check Free Space in Tablespaces
To confirm if there is available space in the tablespace:
SELECT
tablespace_name,
SUM(bytes) / 1024 / 1024 AS free_space_mb
FROM
dba_free_space
GROUP BY
tablespace_name;
Identify Objects Near or At Maximum Extents
Objects in Oracle 19c may fail to extend if they reach the maximum number of extents allowed by their storage clause.
Query to check objects near maximum extents:
SELECT
segment_name,
segment_type,
owner,
tablespace_name,
extents,
max_extents
FROM
dba_segments
WHERE
max_extents IS NOT NULL
AND extents >= max_extents;
Key points:
EXTENTS: The current number of extents allocated to the object.
MAX_EXTENTS: The maximum allowed extents (can be UNLIMITED for modern configurations).
Check for Space Allocation Settings of Objects
Certain storage parameters (like PCTINCREASE or INITIAL) might prevent an object from allocating more extents.
Query to check storage parameters for objects:
SELECT
segment_name,
segment_type,
owner,
tablespace_name,
initial_extent,
next_extent,
pct_increase
FROM
dba_segments
WHERE
tablespace_name = 'YOUR_TABLESPACE_NAME';
Key points:
NEXT_EXTENT: The size of the next extent to be allocated.
If NEXT_EXTENT exceeds the available free space in the tablespace, the object will not extend.
PCT_INCREASE: Ensure it is reasonable (a value of 0 is typical for modern databases).
Check for Quota Issues
Users with limited quota on a tablespace might also cause objects not to extend.
Query to check user quotas:
SELECT
tablespace_name,
username,
bytes / 1024 / 1024 AS allocated_mb,
max_bytes / 1024 / 1024 AS max_allocated_mb
FROM
dba_ts_quotas
WHERE
max_bytes > 0 -- Only users with quotas
AND bytes >= max_bytes;
Identify Objects in READ-ONLY Tablespaces
Objects in READ-ONLY tablespaces cannot extend.
Query to find tablespaces in READ-ONLY mode:
SELECT
tablespace_name,
status
FROM
dba_tablespaces
WHERE
status = 'READ ONLY';
Review Alert Logs for Space-Related Errors
If there are persistent issues with object extensions, the Oracle alert log often provides clues about which objects are failing and why.
Common Fixes
Enable Auto-extend for Tablespace Files:
ALTER DATABASE DATAFILE '/path/to/datafile.dbf'
AUTOEXTEND ON NEXT 50M MAXSIZE UNLIMITED;
Increase Tablespace Size:
ALTER DATABASE DATAFILE '/path/to/datafile.dbf' RESIZE 1G;
Move the Object to a Bigger Tablespace:
ALTER TABLE schema.table_name MOVE TABLESPACE larger_tablespace;
Adjust Storage Parameters:
ALTER TABLE schema.table_name STORAGE (NEXT 128K MAXEXTENTS UNLIMITED);
Increase User Quota:
ALTER USER username QUOTA UNLIMITED ON tablespace_name;
These steps will help you identify and resolve any issues with objects that cannot extend in Oracle 19c.
Finding objects that will fail to extend
Related to checking the amount of free space in a tablespace, you may want to check
for objects that are in imminent danger of failing to extend. To do this, you need to check for three things:
Objects with next extent values greater than the largest free extent in that object'stablespace
Tablespaces with minimum extent sizes greater than their largest free extent
Objects that have already been allocated their maximum number of extents
You can check for these cases by querying Oracle's data dictionary views.
The following series of images show some data dictionary queries that you can use to identify objects that will not be able to extend:
How to deal with this situation
You should consider adding space to any tablespaces identified by these queries to ensure that you have enough free space to allow objects that are stored in that tablespace to grow in size. You can add space by adding data files or by increasing the size of existing data files. If you
find objects that have reached their maximum in terms of the number of extents, consider increasing that maximum.
Caveats
If you use the autoextend option when creating the data files for a tablespace, Oracle will attempt to resize those files whenever more free space is needed. Consequently, segments in that tablespace may be able to extend even if there is currently not enough free space for them to do so. If you're using Oracle8i, be aware that Oracle8i implements a new type of tablespace known as the locally managed tablespace. There are different rules for extent allocation in locally managed tablespaces, and the queries shown here don't apply.
In the next lesson, you will compute the cache hit ratio.