Oracle 10g – ORA-01031 insufficient privileges

The CONNECT role in Oracle 10g has fewer system privileges than it had in earlier versions of Oracle. When migrating databases from versions below Oracle 10g and especially if the users are recreated in the 10g databases with the privileges from the old version, certain privileges are required to be granted so that the application [...]

Share

ORA-00942/ORA-00904/EXP-00056 with Oracle exp

Oracle export utility when used to export from a lower version of database may not work due to compatibility issues as the export utility expects a set of views that are not present in the database. Even patchset difference between the exp utility and the database can lead to similar issues.

The best bet to [...]

Share

dbms_system.ksdwrt–Write messages to Oracle alert log

Oracle provides a procedure to insert messages to the alert log and/or trace files for testing/development purposes. This can be used to check the effectiveness of the monitoring tools/scripts used in the environment, to understand how well the monitoring tool captures the messages in the alert log.

Usage:

SQL> exec dbms_system.ksdwrt(1, ‘This message goes to [...]

Share

FIXED_DATE Init.ora parameter

Setting this parameter to a specified timestamp will make the time constant for the database engine (the clock will not tick) FIXED_DATE is a dynamic parameter and can be changed using the ALTER SYSTEM command.

SQL> ALTER SYSTEM SET FIXED_DATE=’2009-09-22-13:00:00′;

Once you set parameter, the value will be returned when ‘sysdate()’ is used in the [...]

Share

ORA-00054 resource busy and acquire with NOWAIT specified

The below query helps to identify the session that has locked the resource that your session is trying to lock.

You can try executing the query/job after some time (to allow the other session to complete) or kill the session that has locked the resource to proceed with this situation, use the below query [...]

Share

Export-Import Using Unix Pipe

In scenarios where there is no disk space to hold the export dumps or when migrating schemas across different versions of Oracle, this script helps to do the export/import over the network or on the same server using the Unix pipe.

In this example, data is exported from the Oracle Database instance named PROD to [...]

Share

Database/Tablespace Free space in MB

One of the most used script used by the DBA in day-to-day work, this script gives the space usage of each tablespace in the database.

set heading on set pagesize 500 set lines 400 column tablespace format a30 heading "Tablespace" column avail format 9,999,999,999,999 heading "MB Avail." column used format 9,999,999,999,999 heading "MB Used" column [...]

Share