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

Oracle 10g R2 Sample Schemas: Legacy Installation Note

This is a legacy note for Oracle 10g R2. The old companion-disk workflow is specific to that release and should not be treated as the installation method for current Oracle Database versions. Oracle 10g R2 workflow Install the sample-schema components supplied for the 10g R2 release. Connect as a suitably privileged database user. Run the … Read more

Oracle: How to Prioritise Invalid Objects in a Schema

Try using this query to identify the approach to attack invalid objects in the schema   select referenced_name, count(referenced_name) cnt  from user_dependencies where referenced_name in (select distinct object_name                             from user_objects                            where status = ‘INVALID’) group by referenced_name order by cnt desc    This will list down the objects in descending order on which maximum no. of invalid objects … Read more

Oracle Sequences and Identity Columns

Oracle sequences generate numeric values independently of a table and are commonly used for surrogate keys, batch identifiers, and other incrementing values. Create and use a sequence CREATE SEQUENCE supplier_seq START WITH 1 INCREMENT BY 1 CACHE 20; INSERT INTO suppliers (supplier_id, supplier_name) VALUES (supplier_seq.NEXTVAL, ‘Example’); NEXTVAL gets the next value. Gaps are normal and … Read more

Oracle SQL*Plus COPY Command: Legacy Note

The SQL*Plus COPY command is a legacy way to copy query results between Oracle databases or schemas. It can still matter in older environments, but newer workflows usually use database links, CREATE TABLE AS SELECT, Data Pump, or application-level migration tools. Legacy COPY syntax COPY FROM user1/password@db1 TO user2/password@db2 CREATE destination_table USING SELECT * FROM … Read more

Oracle SQL and PL/SQL Profiling: Find Bottlenecks

Oracle performance tuning starts by identifying where time is actually being spent. For SQL statements, execution plans, SQL statistics, and active-session data are usually more useful than guessing from source code. For PL/SQL, profiling tools can show which procedures or lines consume the most time. Start with SQL-level evidence Inspect the execution plan with DBMS_XPLAN. … Read more