ORASOLU TOOLBOX · MIGRATION

Migration Validation

Practical Oracle SQL for validating database objects, indexes, segments, compilation status and constraints after migration.

ORASOLU TOOLBOX · MIGRATION

Validate the database after the move

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.

01 · OBJECTS

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;
02 · INVALID OBJECTS

Find invalid objects

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;
03 · INVALID INDEXES

Review invalid indexes

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;
04 · SEGMENTS

Compare segment volume

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;
05 · INVALID PL/SQL

Review compilation errors

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;
06 · CONSTRAINTS

Review constraint status

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;