High Availbility

OS & Virtualization

Thursday, January 17, 2008

Oracle Streams setup

Streams is basically a queuing technology.

Here is how I get started. You can use Oracle 10g Enterprise Manager to create a schema level stream but apparently it has some bugs and work only on the later version.

Login as stradmin

This is a simple example of streaming data (one way) from source schema to target schema
  1. run @startup.sql
  2. On the source database , turn on supplemental logging for table or database:
    ALTER TABLE scott.dept ADD SUPPLEMENTAL LOG GROUP dept_pk(deptno) ALWAYS;
    or
    alter database add supplemental log data (primary key, unique index) columns;
  3. export schema from the source database.
    exp USERID=SYSTEM/manager@rep2 OWNER=SCOTT FILE=scott.dmp LOG=exportTables.log OBJECT_CONSISTENT=Y STATISTICS = NONE
  4. import schema into target database.
    imp USERID=SYSTEM@pluto FULL=Y CONSTRAINTS=Y FILE=scott.dmp IGNORE=Y COMMIT=Y LOG=importTables.log STREAMS_INSTANTIATION=Y
  5. run @startup.sql

Tuesday, January 15, 2008

How to move an Oracle Forms application from Windows to Linux

Log-in access as the "oracle" user

  1. Create a staging directory where the application source files (FMB, MMB, PLL, OLB) can be stored permanently or temporarily. This directory will also be where the compiled executables (FMX, MMX, PLX) will be created. For example:
    mkdir /u02/oracle/ias904_mid/forms90/myApplication
  2. Copy/transfer all of the Forms components which make up the application to the directory created in step 2. These will include FMB, MMB, PLL and OLB files.
    IMPORTANT: Unix is a case sensitive operating system. Be sure that any references to files within your application have been corrected to match files on the new file system. This will usually impact references to image (icon) files, other forms, menus, and libraries.
    Copy/transfer all other application files as needed. These files may include custom resource (.res), image or custom JARs files. These files will need to be placed in specific locations based on how you developed the application. IMPORTANT: If transferring using FTP, all files must be transferred in binary mode.
  3. Open a shell session.
  4. Set the ORACLE_HOME variable and point it to the Application Server installation. Be sure to use the appropriate syntax for the particular shell you are using. For example in csh the command would look something like this:
    export ORACLE_HOME=/u02/oracle/ias904_mid
  5. Set the FORMS90_PATH variable to the directory which was created in step 2. For example:
    export FORMS90_PATH=/u02/oracle/ias904_mid/forms90/myApplication
    Additional variables may be necessary or desired based on your needs and system configuration. Here are a few examples:
    TNS_ADMIN
    NLS_LANG
    CLASSPATH
    TERM
    DISPLAY
    In most cases, setting these will not be necessary if you use the provided script (.sh file) noted in the next step.
    When compiling a Forms application it is important to understand the application. Most important is to understand the dependencies which may exist between components. In other words, for example you will not be able to compile an FMB if it has a dependant PLL which has not yet been compiled. In most cases the order in which compiling should occur is as follows:
    PLL
    MMB
    FMB
    There are exceptions, but this will work in most cases.
  6. Using the compiler, generate "X" files for all of the application's binaries (PLL, MMB, FMB). The command will be something like the following:

    f90genm.sh module=myForm module_type=form compile_all=yes userid=scott/tiger@orcl

    Other possible module_type values:
    library
    menu
    form

How to add icons into Forms 10g using JAR

Icon image files can either be retrieved by Forms as individual files on the
filesystem or from a Java Archive (JAR file). If an application uses lots of
icon images it is recommended that they are stored in a JAR file to reduce the
number of HTTP round trips.

Steps to achieve this in a 9iDS/10gDS environments and are given below:

Oracle 9iDS/10gDS (Forms Builder / Runtime)


This example assumes an install of 9iDS/10gDS on a MS Windows.

  1. Copy all the icons files (gif or jpg) to a folder e.g c:\icons folder
  2. Open up a MS Dos/ Command prompt window
  3. Change to the target icons folder
    cd c:\icons
    and jar the icon files
    jar -cvf icons.jar *
  4. Copy icons.jar to \forms90\java
    or
    Copy icons.jar to \forms\java
  5. Changes have to be made in formsweb.cfg
    a) archive_jini=xxall_jinit.jar,icons.jar
    b) imageBase=codeBase
    This signifies that the jar file is placed under the forms90/java or forms/java
    folder.