Archive for the 'Oracle 11g' Category

How to list the installed patches on Oracle?

October 21st, 2008

Use Opatch.
Look in the Opatch directory in Oracle Home.
‘opatch query -all’ will allow you to query detailed information about a patch.
‘opatch lsinventory’ will list all patches with the applied date chronologically.
‘opatch lsinventory -detail’ will list all patches and which files were modified.

To block sample or to auto sample? That’s the question !

July 23rd, 2008

Because of some problems with the Oracle statistics I did a small research.
I have a custom procedure of gathering stats that i call p_x_stats_table. It will gather stats with and estimation of X% of the records. With X corresponding a percentage witch reflect 100.000 records (or all records of table if amount of records inferiuor then [...]

How to execute long dynamic statements

July 7th, 2008

PROCEDURE exec_clob_sql_statement(vv_clob_sql_statement IN clob) IS
v_cur       INTEGER     := DBMS_SQL.open_cursor;
v_offset    PLS_INTEGER :=1;
v_nb        PLS_INTEGER :=0;
v_sql_table DBMS_SQL.varchar2a;
v_len       PLS_INTEGER;
v_retval    INTEGER;
BEGIN
  v_len := DBMS_LOB.getlength(vv_clob_sql_statement);
 
LOOP
    v_nb:=v_nb+1;
    v_sql_table(v_nb):=DBMS_LOB.SUBSTR(vv_clob_sql_statement
                                        ,LEAST(4000,v_len - v_offset + 1)
                                        ,v_offset
                                        );
    v_offset:=v_offset + 4000;
    EXIT WHEN v_offset > v_len;
  END LOOP;
 
DBMS_SQL.parse(v_cur, v_sql_table, 1, v_nb, FALSE, DBMS_SQL.native);
  v_retval:=DBMS_SQL.EXECUTE(v_cur);
  DBMS_SQL.close_cursor(v_cur);
EXCEPTION WHEN OTHERS THEN
  IF DBMS_SQL.is_open(v_cur) THEN DBMS_SQL.close_cursor(v_cur); END IF;
  RAISE;
END exec_clob_sql_statement;

Oracle 11 tutorials

June 24th, 2008

http://www.oracle.com/technology/obe/11gr1_db/index.htm

shared_pool_reserved_size

March 25th, 2008

Do you need to increase the shared_pool_reserved_size. Default Oracle puts it at 5% of the shared_pool_size. General recomedations is to put it at 10% of the shared_pool_size.  A good article can be found at DBASPOT or Metalink 146599.1
select ‘You may need to increase the SHARED_POOL_RESERVED_SIZE’ Description
, ‘Request Failures = ‘||REQUEST_FAILURES Logic
from v$shared_pool_reserved
where REQUEST_FAILURES > 0
and 0 [...]

Partitioning based on a virtual column.

March 11th, 2008

Lets see here a very cool example of something virtual that really DOES work!
In Oracle Database 11g, a new feature called Virtual Columns allows you to create a column that is not stored in the table but rather is computed at run time.
That is already cool, but what is even more fun is that you [...]