Archive for January, 2010

Linux Commands – A practical reference

This is a linux command line reference for common operations. Examples marked with • are valid/safe to paste without modification into a terminal, so you may want to keep a terminal window open while reading this so yo[...]


Export TABLE Records into Flat File with INSERTs

The GENERATE_STMT procedure of this UTILITY package needs four parameters i.e. TABLE NAME, WHERE CLAUSE, PATH WHERE Developer WANT FILE TO BE GENERATED and FILE NAME. WHERE CLAUSE value must be passed in the form of q[...]


Trigger to Prevent Dropping Objects

This trigger secures objects, preventing a user from dropping them by mistake. To begin, create a table for the example below called secured_objects with a column objectname, with datatype varchar2(20). Insert a record i[...]


Find Invalid Synonyms

“ORA-00980: synonym translation is no longer valid” is a common error encountered in a development environment. This can happen for many reasons. Some of them are 1. You created a synonym on non-existing obje[...]


Find Full Table Scans

This query provides a list of queries (1,000 characters only) involved in full table scans. The total number of rows and blocks for each table is also displayed so that you can determine whether the full scan is degradin[...]


Instance Background Processes Information

This script displays instance background process information. The script works when the database is MOUNTed or OPENed. -- Oracle 8I select A.SID, A.SERIAL#, A.PROGRAM, P.PID, [...][...]


Comparing Contents of Two Tables with Identical Structure

This script generates a spool file that can be run from a SQL*Plus session to list the differences between 2 tables with identical structure. This can be useful if 2 similar tables need to be compared across different[...]


Compare table structure in oracle

I found an interesting script that I used sometime back to compare the structure of 2 tables. Thought I should preserve and blog it for the benefit of all. — SCRIPT START — Rem script name – compare_tab[...]


ORA-01940: Cannot drop a user that is currently connected

ORA-01940: Cannot drop a user that is currently connected Problem Description: SQL> drop user strmadmin cascade; drop user strmadmin cascade * ERROR at line 1: ORA-01940: cannot drop a user that is currently connected[...]


Create Read only user for a Schema

One thing you need to remember before read this post is there is no easy or shortcut way to make a read only user of another schema. Like grant select on username to another_username- there is no such single command like[...]




sponsored link