Thursday, November 25, 2010

Index skip scan hint explained


Index skip scan Hint Usage

 
Index skip scans improve index scans by nonprefix columns since it is often faster to scan index blocks than scanning table data blocks.
 
In this case a composite index is split logically into smaller subindexes. The number of logical subindexes depends on the cardinality of the initial column. Hence it is now possible to use the index even if the leading column is not used in a where clause.
 
Example:

SQL> create table t1(a number,b number);

Table created.

SQL> begin 
  2  for i in 1..1000
  3  loop
  4  insert into t1 values(i, 56);
  5  end loop;
  6  end;
  7  /

PL/SQL procedure successfully completed.

SQL> create index t1_i on t1(a,b);

Index created.

SQL> analyze table t1 compute statistics;

Table analyzed.

SQL> explain plan for select /*+ index_ss(t1 t1_i) */ * from t1 where b=56;

Explained.

SQL> start ?\rdbms\admin\utlxpls.sql

-----------------------------------------------------------------
| Operation  |  Name    |  Rows | Bytes|  Cost  | Pstart| Pstop |
-----------------------------------------------------------------
| SELECT STATEMENT      |     1K|    4K|   1001 |       |       |
|   INDEX SKIP SCAN T1_I|     1K|    4K|   1001 |       |       |-----------------------------------------------------------------

Tuesday, November 9, 2010

Compiling all the Forms and Reports modules residing in a directory



For Windows

Forms/Reports 6i

REM WINDOWS COMPILE FORMS 
::compile_forms.bat 
cls 
Echo compiling Forms....
for %%f IN (*.fmb) do ifcmp60 userid=scott/tiger@v817  module=%%f batch=yes 
    module_type=form compile_all=yes window_state=minimize 
ECHO FINISHED COMPILING 

REM WINDOWS COMPILE REPORT 
::compile_report.bat 
cls 
Echo compiling Report .....
for %%f IN (*.rdf) do RWCON60 userid=scott/tiger@v817 batch=yes source=%%f 
    stype=rdffile DTYPE=REPFILE  OVERWRITE=yes  logfile=log.txt
ECHO FINISHED COMPILING
Forms/Reports 9.0.X

REM WINDOWS COMPILE FORMS 
::compile_forms.bat 
cls 
Echo compiling Forms....
for %%f IN (*.fmb) do ifcmp90 userid=scott/tiger@v817  module=%%f batch=yes 
    module_type=form compile_all=yes window_state=minimize 
ECHO FINISHED COMPILING 

REM WINDOWS COMPILE REPORT 
::compile_report.bat 
cls 
Echo compiling Report .....
for %%f IN (*.rdf) do rwconverter userid=scott/tiger@v817 batch=yes 
    source=%%f stype=rdffile DTYPE=REPFILE  OVERWRITE=yes  logfile=log.txt
ECHO FINISHED COMPILING
For UNIX

Forms/Reports 6i

#UNIX Forms Compile 
#compile_forms.sh 
for i in `ls *.fmb`
do
echo Compiling Form $i ....
f60genm userid=scott/tiger@bs817 batch=yes module=$i module_type=form 
    compile_all=yes window_state=minimize
done

#UNIX COMPILE REPORTS
#compile_rep.sh
for i  in `ls  *.rdf`
do
echo Compiling Report $i  ...
rwcon60 userid=scott/tiger@bs817 batch=yes source=$i  stype=rdffile 
    dtype=repfile overwrite=yes
done
Forms/Reports 9.0.X

#UNIX Forms Compile 
#compile_forms.sh 
for i in `ls *.fmb`
do
echo Compiling Form $i ....
f90genm userid=scott/tiger@bs817 batch=yes module=$i module_type=form 
    compile_all=yes window_state=minimize
done

( For 10g = forms 9.0.4.x, you can use f90gen also)

#UNIX COMPILE REPORTS
#compile_rep.sh
for i  in `ls  *.rdf`
do
echo Compiling Report $i  ...
rwconverter.sh userid=scott/tiger@bs817 batch=yes source=$i  
    stype=rdffile dtype=repfile overwrite=yes
done