Monthly Archives: January 2010

ORA-06512 at string line string Tips and Example

Cause: Backtrace message as the stack is unwound by unhandled exceptions. This is basically to indicate where a particular error number occurred in an operation.

Example 1:

declare
l_fname varchar2(3);
begin
l_fname := ‘abcd’;
end;
/
Continue reading

Alter system kill session in Oracle

The command you use to kill an Oracle session is

Alter system kill session ‘SID, SERIAL#’;


So why should I need to kill an Oracle session.  There are many reasons why you might want to kill a session. To give you a few exmaple:

Continue reading

Oracle create or replace Stored Procedure example basics

An Oracle stored procedure is an Oracle object that you create using PL/SQL. PL/SQL is a procedural language which is used by Oracle developers to process and manipulate data stored in an Oracle database.

The basic form of an Oracle stored procedure is

CREATE OR REPLACE PROCEDURE p_procedure1 IS
BEGIN

null;

END p_procedure1;

Continue reading

How to view all tablespaces and their size in an Oracle database?

Answer:

Yse can use the command:

SELECT tablespace_name, sum((bytes/1024)/1024) “free space in MB” FROM DBA_FREE_SPACE GROUP BY tablespace_name;

This will give you the table space size in MB.

You can also see the size of each of the datafiles of a tablespace using the following command:

select file_name, (bytes/1024)/1024 “free space in MB” from dba_data_files where tablespace_name=’USERDATA’;


What is the function of PMON (process monitor)

Answer: This Oracle core process is responsible for recovering/freeing up resources when a user process fail. It cleans up the cache of the failed user process.



Loading