Review object status
Review object counts by owner and status to establish a post-migration baseline.
SELECT
owner,
status,
COUNT(*) AS object_count
FROM dba_objects
GROUP BY owner, status
ORDER BY owner, status;ORASOLU TOOLBOX · MIGRATION
Practical Oracle SQL for validating database objects, indexes, segments, compilation status and constraints after migration.
ORASOLU TOOLBOX · MIGRATION
Transportable tablespaces can simplify large database migrations, but the source environment should be understood before the transport operation begins. These queries help review candidate tablespaces, read-only status, datafiles, self-contained checks, transport-set violations and platform compatibility.
Review object counts by owner and status to establish a post-migration baseline.
SELECT
owner,
status,
COUNT(*) AS object_count
FROM dba_objects
GROUP BY owner, status
ORDER BY owner, status;Identify invalid objects that require attention after the migration.
SELECT
owner,
object_type,
object_name,
status
FROM dba_objects
WHERE status = 'INVALID'
ORDER BY owner, object_type, object_name;Check indexes that are not currently valid after the migration.
SELECT
owner,
index_name,
table_name,
status
FROM dba_indexes
WHERE status <> 'VALID'
ORDER BY owner, index_name;Review segment counts and storage volume by owner and segment type.
SELECT
owner,
segment_type,
COUNT(*) AS segment_count,
ROUND(SUM(bytes) / 1024 / 1024, 2) AS size_mb
FROM dba_segments
GROUP BY owner, segment_type
ORDER BY owner, size_mb DESC;Review stored PL/SQL objects that require recompilation or investigation.
SELECT
owner,
name,
type,
line,
position,
text
FROM dba_errors
ORDER BY owner, name, sequence;Check disabled or invalid constraints as part of post-migration validation.
SELECT
owner,
constraint_name,
table_name,
constraint_type,
status
FROM dba_constraints
WHERE status <> 'ENABLED'
ORDER BY owner, table_name, constraint_name;