Back Up an Oracle Schema with Data Pump

For current Oracle databases, Data Pump is the preferred way to export a schema. The older exp/imp utilities are legacy tools and are mainly relevant to older environments. Export a schema with expdp expdp system@database \ schemas=SCOTT \ directory=DATA_PUMP_DIR \ dumpfile=scott_%U.dmp \ logfile=scott_export.log The Oracle directory object points to a server-side filesystem location. The database … Read more

Safely Find and Delete Files in Linux with find

The find command is useful for locating files recursively and then taking action on them. When deleting files, it is safer to list the matches first and delete only after checking the output. List matching files first List all .tmp files below the current directory: List all .log files below the current directory: Delete after … Read more

Check Oracle Schema Size

To estimate the space used by a schema, sum the bytes allocated to that schema’s segments in DBA_SEGMENTS. SELECT owner, ROUND(SUM(bytes) / 1024 / 1024 / 1024, 2) AS size_gb FROM dba_segments WHERE owner = ‘SCOTT’ GROUP BY owner; Use the schema name in uppercase unless it was created with quoted mixed-case identifiers. If you … Read more

ORA-01555 Snapshot Too Old: Developer and DBA Notes

ORA-01555: snapshot too old usually means Oracle could not reconstruct the older version of data needed by a query because the required undo information was no longer available. Why it happens A long-running query needs older row versions while other sessions keep changing the same data. The undo tablespace is too small for the workload. … Read more