Thursday, November 22, 2012

Java Memory Structure Explained


    Java Memory Structure

    The JVM memory consists of the following segments:

    • Heap Memory, which is the storage for Java objects
    • Non-Heap Memory, which is used by Java to store loaded classes and other meta-data
    • JVM code itself, JVM internal structures, loaded profiler agent code and data, etc.

    Heap
    The JVM has a heap that is the runtime data area from which memory for all class instances and arrays are allocated. It is created at the JVM start-up.
    The heap size may be configured with the following VM options:
    • -Xmx<size> - to set the maximum Java heap size
    • -Xms<size> - to set the initial Java heap size

    By default, the maximum heap size is 64 Mb.
    Heap memory for objects is reclaimed by an automatic memory management system which is known as a garbage collector. The heap may be of a fixed size or may be expanded and shrunk, depending on the garbage collector's strategy.

    Non-Heap
    Also, the JVM has memory other than the heap, referred to as non-heap memory. It is created at the JVM startup and stores per-class structures such as runtime constant pool, field and method data, and the code for methods and constructors, as well as interned Strings.
    Unfortunately, the only information JVM provides on non-heap memory is its overall size. No detailed information on non-heap memory content is available.
    The abnormal growth of non-heap memory size may indicate a potential problem, in this case you may check up the following:
    • If there are class loading issues such as leaked loaders. In this case, the problem may be solved with the help of Class loaders view.
    • If there are strings being massively interned. For detection of such problem, Allocation recording may be used.

    If the application indeed needs that much of non-heap memory and the default maximum size of 64 Mb is not enough, you may enlarge the maximum size with the help of -XX:MaxPermSize VM option. For example, -XX:MaxPermSize=128m sets the size of 128 Mb.


    Allocated and Used Memory
    Allocated and used memory sizes are shown on the graphs for both heap and non-heap.
    The allocated memory is an overall amount of memory allocated by the JVM, while used memory is the amount of memory which is actually in use.
    Obviously, the allocated memory cannot be less than the used memory. The exact amount of allocated memory is determined by the JVM internal strategies.

    Memory Generations in java heap
    HotSpot VM’s garbage collector uses generational garbage collection. It separates the JVM’s memory into and they are called young generation and old generation.

    Young Generation
    Young generation memory consists of two parts, Eden space and survivor space. Shortlived objects will be available in Eden space. Every object starts its life from Eden space. When GC happens, if an object is still alive and it will be moved to survivor space and other dereferenced objects will be removed.

    Old Generation – Tenured and PermGen
    Old generation memory has two parts, tenured generation and permanent generation (PermGen). PermGen is a popular term. We used to error like PermGen space not sufficient.
    GC moves live objects from survivor space to tenured generation. The permanent generation contains meta data of the virtual machine, class and method objects.

    What does the JVM do? The Java Virtual Machine has two primary jobs:

    1. Executes Code
    2. Manages Memory  
      This includes allocating memory from  the OS, managing Java allocation including heap compaction,
      and removal of garbaged objects 
    Besides the above, the JVM also does stuff like managing monitors.

    Very Basic Java Theory

    An object is created in the heap and is garbage-collected after there are no more references to it. Objects cannot be reclaimed or freed by explicit language directives. Objects become garbage when they’re no longer reachable from the root set (e.g static objects)


    Objects inside the blue square are reachable from the thread root set, while objects outside the square (in red) are not.
    The sequence of the garbage collection process is as follows:
    1. Root set tracing and figure out objects that are not referenced at all.
    2. Put the garbage objects from above in finalizer Q
    3. Run finalize() of each of these instances
    4. Free memory

    Infant mortality in Java
    Most of the objects (80%) in a typical Java application die young. But this may not be  true for your application. Hence there is a need to figure out this rough infant mortality number so that you can tune the JVM accordingly.


    JVM flavors
    The Sun JVM understands the options -classic, -client and -server
    • classic : disables the Hotspot JIT compiler.
    • client (default): activates the Hotspot JIT for "client" applications.
    • server: activates the "server" Hotspot JIT: it requires a fair amount of time to warm up, but delivers best performance for server.
    Don't forget that, if you use them, -server or -client must be the first argument to Java.

    The Hotspot JVM uses adaptive optimization
    • JVM begins by interpreting all code, but it monitors the HotSpot
    • Fires off a background thread that compiles hotspot bytecode to native code
    • Hotspot JVM is only compiling and optimizing the "hot spot". Hotspot JVM has more time than a traditional JIT to perform optimizations
    • The Hotspot JVM keeps the old bytecodes around in case a method moves out of the hot spot.
    Java Garbage Collector

    Sun Classic (1.1 JVM) ...for historical reasons
    • Mark, Sweep & Compact
        Mark: identify garbage
        Sweep: Find garbage on heap, de-allocate it
        Compact: collect all empty memory together
    • Eligibility for garbage collection is determined by walking across memory, determining reachability and then compacting the heap
    • Compaction is just copying the live objects so that they’re adjacent in memory
    • there’s one large, contiguous block of free memory
    • The main problem with classic mark, sweep and compact is that all other threads have to be suspended while the garbage collector runs
    • Pause time is proportional to the number of objects on the heap
    Sun HotSpot( 1.2+ JVM)
    • Sun improved memory management in the Java 2 VMs by switching to a generational garbage collection scheme.
    • The JavaHeap is separated into two regions(we will exclude the Permanent Generation for the time being):
       New Objects
       Old Objects
    • The New Object Regions is subdivided into three smaller regions:
       1. 
      Eden , where objects are allocated
       2. Survivor semi-spaces:  
      From and To
    •  The Eden area is set up like a stack - an object allocation is implemented as a pointer increment. When the Eden area is full, the GC does a reachability test and then copies all the live objects from Eden to the To region.
    •  The labels on the regions are swapped
    •  To becomes  From - now the  From area has objects.
    JVM Heap:
    Java Heap is divided into 3 generations: Young(Eden), Old(Tenured), and Permanent.

    Arrangement of generations:
    The diagram below shows how objects get created in New generation and then move to survivor Spaces at every GC run, and if they survive for long to be considered old, they get moved to the Tenured generation. The number of times an object need to survive GC cycles to be considered old enough can be configured.  

    By default, Java has 2 separate  threads for GC, one each for young(minor GC) and old generation(major GC). The minor GC (smaller pause, but more frequent) occurs to clean up garbage in the young generation, while  the major GC (larger pause, but less frequent) cleans up the  garbage  in the old  generation. If the major GC too fails to free required memory, the JVM increases the current memory to help create new object. This whole  cycle  can go on till the current memory reaches the MaxMemory for the JVM (default is 64MB for client JVM), after which JVM throws OutOfMemory Error.
    Permanent Generation
    Class information is stored in the perm generation. Also constant strings are stored there. Strings created dynamically in your application with String.intern() will also be stored in the perm generation.Reflective objects (classes, methods, etc.) are stored in perm. It holds all of the reflective data for the JVM

    JVM process memory

    The windows task manager just shows the memory usage of the java.exe task/process. It is not unusual for the total memory consumption of the VM to exceed the value of -Xmx   Managed Heap(java heap, PERM, code cache) + NativeHEAP +  ThreadMemory <= 2GB (PAS on windows) 
           Code-cache contains JIT code and hotspot code.
           ThreadMemory = Thread_stack_size*Num_threads.ManagedHeap: Managed by the developer.
         Java heap: This part of the memory is used when you create new java objects.     Perm: for relfective calls etc. 
    NativeHeap : Used for native allocations.ThreadMemory: used for thread allocations. 
            
    What you see  in the TaskManager is the total PAS, while what the profiler shows is the Java Heap and the PERM(optionally)
       
     Platforms                                     Maximum PAS*
      1. x86 / Redhat Linux 32 bit             2 GB
      2. x86 / Redhat Linux 64 bit             3 GB
      3. x86 / Win98/2000/NT/Me/XP        2 GB
      4. x86 / Solaris x86 (32 bit)              4 GB
      5. Sparc / Solaris 32 bit                   4 GB

Sunday, November 4, 2012

Interesting DB Queries

Database Queries

Query to Find Speed of RMAN backup :

Depending on whether RMAN is running Synch I/O or Asynch I/O to the target
(The BlockRate is the number of times RMAN went into “Wait” because I/O was blocked)

set linesize 132
set pages60

col SizeMB format 999,999
col Effective_Bytes_Per_Second format 9,999,999,999
col BlockRate format 999.99

spool RMAN_Backup_Speed

tti 'Input Speeds'
select open_time, bytes/1048576 SizeMB, elapsed_time, io_count, short_waits, long_waits, long_waits*100/io_count BlockRate, effective_bytes_per_second
from v$backup_async_io
where type = 'INPUT'
and open_time > sysdate-7
and status = 'FINISHED'
order by 1
/

tti 'Output Speeds'
select open_time, bytes/1048576 SizeMB, elapsed_time, io_count, short_waits, long_waits, long_waits*100/io_count BlockRate, effective_bytes_per_second
from v$backup_async_io
where type = 'OUTPUT'
and open_time > sysdate-7
and status = 'FINISHED'
order by 1
/

tti 'Aggregate Speeds'
select open_time, bytes/1048576 SizeMB, elapsed_time, io_count, short_waits, long_waits, long_waits*100/io_count BlockRate, effective_bytes_per_second
from v$backup_async_io
where type = 'AGGREGATE'
and open_time > sysdate-7
and status = 'FINISHED'
order by 1
/

tti off
spool off

Reference: 
Tuning RMAN Performance (Oracle Documentation)
RMAN Performance Tuning (Blog)

Saturday, November 3, 2012

OFR & ODC Installation




Installing OFR

Creating AXF Schema in Oracle EBS Database
Create AXF Schema and grant appropriate rights and privileges to AXF user in Oracle ERP (EBS) Database with which you want to integrate the OFR. Execute following commands in EBS Database by logging as SYS user account.
CREATE TABLESPACE "AXF" DATAFILE
  '/<Path to Data File>/axf01.dbf' SIZE 1048576000
  LOGGING ONLINE PERMANENT BLOCKSIZE 8192
  EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT AUTO

--For ASM environments:
create tablespace "AXF" DATAFILE size 1000M

--AXF user creation script
CREATE USER AXF
  IDENTIFIED BY <password>
  DEFAULT TABLESPACE AXF
  TEMPORARY TABLESPACE TEMP
  PROFILE DEFAULT
  ACCOUNT UNLOCK;

-- 9 System Privileges for AXF
  GRANT CREATE VIEW TO AXF;
  GRANT CREATE TYPE TO AXF;
  GRANT CREATE TRIGGER TO AXF;
  GRANT CREATE PUBLIC SYNONYM TO AXF;
  GRANT CREATE PROCEDURE TO AXF;
  GRANT CREATE SEQUENCE TO AXF;
  GRANT CREATE SYNONYM TO AXF;
  GRANT CREATE TABLE TO AXF;
  GRANT CREATE SESSION TO AXF;

-- 1 Tablespace Quota for AXF
  ALTER USER AXF QUOTA UNLIMITED ON AXF;
 
-- 17 Object Privileges for AXF
    GRANT SELECT ON AP.AP_INVOICES_ALL TO AXF;
    GRANT SELECT ON APPS.AP_LOOKUP_CODES TO AXF;
    GRANT SELECT ON APPS.HR_ORGANIZATION_UNITS TO AXF;
    GRANT EXECUTE ON APPS.PO_HEADERS_SV3 TO AXF;
    GRANT SELECT ON GL.GL_CODE_COMBINATIONS TO AXF;
    GRANT SELECT ON HR.HR_ALL_ORGANIZATION_UNITS TO AXF;
    GRANT SELECT ON INV.MTL_PARAMETERS TO AXF;
    GRANT SELECT ON PO.PO_DISTRIBUTIONS_ALL TO AXF;
    GRANT SELECT ON PO.PO_HEADERS_ALL TO AXF;
    GRANT SELECT ON PO.PO_LINES_ALL TO AXF;
    GRANT SELECT ON PO.PO_LINE_LOCATIONS_ALL TO AXF;
    GRANT SELECT ON PO.PO_VENDORS TO AXF;
    GRANT SELECT ON PO.PO_VENDOR_SITES_ALL TO AXF;
    GRANT SELECT ON SYS.USER_TAB_COLS TO AXF;
    GRANT SELECT ON APPS.HR_LOCATIONS TO AXF;
    GRANT SELECT ON APPS.GL_SETS_OF_BOOKS TO AXF;
    GRANT SELECT ON APPS.HR_OPERATING_UNITS TO AXF;


Preparing for OFR Installation
Get a fresh 64 Bit version of Windows Server 2008 (R2 Standard) machine.
Create Following Folders in the Drive you are willing to install OFR Server (Preferable is D drive [D:\] )
D:\OFR
D:\OFR_Installer
D:\OraClient32Bit
D:\OraClient64Bit



Copy following Binaries and Installers in D:\OFR_Installer Folder. 
ODC and Patch3
OFR and Patch1
Oracle Client 32-bit
Oracle Client 64-bit
AdbeRdr940_en_US.exe
FileZilla_3.1.0_win32-setup.exe
Lab Instructions.pdf
OFR_ConnectString.udl
putty.exe
TNSNAMES.ORA



Install 32-Bit Oracle client
Extract compressed file V20606-01.zip in the same location (D:\OFR_Installer\Oracle Client 32-bit)
Run Setup.exe as administrator from the extracted file location (D:\OFR_Installer\Oracle Client 32-bit\V20606-01\client)
Note:-
Do not copy any earlier extracted copy on some different machine which is 32bit or 64bit and your machine is not same as that.


Follow the Setup instruction as follows:

Screen1:
 Open File - Security Warning

Action:
 Click on Run Button.

Screen2:
Oracle Client Installer - Setting up Client - Step 1 of 6

Action:
Select Option Administrator

Click on Next Button


Screen3:
Oracle Client Installer - Setting up Client - Step 2 of 6


Action:
Selected Language will have entry for English by default,  if not then Select English

Click on Next Button

Screen4:
Oracle Client Installer - Setting up Client - Step 3 of 6


Action:
Make sure the Oracle Base path contains D:\OraClient32Bit, the full path should be:
D:\OraClient32Bit\app\ipmadm

Make sure the Software Location Path  contains D:\OraClient32Bit, and Home name Client_1 is replaced with HOME_32. The full path should be:
D:\OraClient32Bit\app\ipmadm\product\11.2.0\HOME_32

Click on Next Button

Screen5:
Oracle Client Installer - Setting up Client - Step 4 of 6

Action:
Make sure Performance Prerequisite Checks are successfully passed

Click on Next Button

Screen6:
Oracle Client Installer - Setting up Client - Step 5 of 7

Action:
Click on Finish Button

Screen7:
Oracle Client Installer - Setting up Client - Step 6 of 7

Action:
N.a.

Screen8:
Oracle Client Installer - Setting up Client - Step 7 of 7

Action:
Make sure the Finish message appear as Successful.

Click on Close Button.

Prepare 32-Bit ODBC Connection

Copy TNSNAMES.ORA file to 32bit Client Home
Copy from
D:\OFR_Installer
Copy to
D:\OraClient32Bit\app\ipmadm\product\11.2.0\HOME_32\network\admin

Open 32bit ODBC Data Source Administrator in 64bit OS machine using odbcad32.exe located at this location:
C:\Windows\SysWOW64\odbcad32.exe

Screen1:
ODBC Data Source Administrator - Step 1 of 4

Action:
Select Tab System DSN

Click on Add Button.

Screen2:
Create New Data Source - Step 2 of 4

Action:
Select Driver: Oracle in OraClient11g_home1

Click on Finish Button

Screen3:
Oracle ODBC Driver Configuration - Step 3 of 4

Action:
Key in Data Source Name as Connet_ERP

Key in Description as 32 bit ODBC Connection

Select respective Database TNS Entry. In this installation it is ITST_SG Database instance

Click on Test Connection Button

Screen4:
Oracle ODBC Driver Connect - Step 4 of 4

Action:
Input User Name as AXF and Password <password> (In this installation password is axf).

Click on OK Button

Observation:
Testing Connection should result into Connection Successful.

Action:
Click on OK Button

Observation:
You will be back to ODBC Data Source Administrator Screen with specified Data Source Name.

Action:
Click on OK Button


Install 64-Bit Oracle client
Extract compressed file V20609-01.zip in the same location (D:\OFR_Installer\Oracle Client 64-bit)
Run Setup.exe as administrator from the extracted file location (D:\OFR_Installer\Oracle Client 64-bit\V20609-01\client)
Note:-
Do not copy any earlier extracted copy on some different machine which is 32bit or 64bit and your machine is not same as that.


Follow the Setup instruction as follows:

Screen1:
Oracle Client Installer - Setting up Client - Step 1 of 6

Action:
Select Option Administrator

Click on Next Button


Screen2:
Oracle Client Installer - Setting up Client - Step 2 of 6

Action:
Selected Language will have entry for English by default,  if not then Select English

Click on Next Button

Screen3:
Oracle Client Installer - Setting up Client - Step 3 of 6

Action:
Make sure the Oracle Base path contains D:\OraClient64Bit, the full path should be:
D:\OraClient64Bit\app\ipmadm

Make sure the Software Location Path  contains D:\OraClient64Bit, and Home name Client_1 is replaced with HOME_32. The full path should be:
D:\OraClient64Bit\app\ipmadm\product\11.2.0\HOME_64

Click on Next Button

Screen4:
Oracle Client Installer - Setting up Client - Step 4 of 6

Note:-
If any of the test fails then you can check Ignore All option (in the Top-Right) to proceed further.
Action:
Make sure Performance Prerequisite Checks are successfully passed

Click on Next Button

Screen5:
Oracle Client Installer - Setting up Client - Step 5 of 7

Action:
Click on Finish Button

Screen6:
Oracle Client Installer - Setting up Client - Step 6 of 7

Action:
N.a.

Screen7:
Oracle Client Installer - Setting up Client - Step 7 of 7

Action:
Make sure the Finish message appear as Successful.

Click on Close Button.

Prepare 64-Bit OLE DB Connection
Create a new text file in D:\OFR_Installer and rename that as 64Bit_ConnectString.udl
Double click the file to open the Data Link Properties of the udl file.
Screen1:
Data Link Properties - Step 1 of 2

Action:
Select Driver: Oracle Provider for OLE DB (Ref:-  Oracle Document  ID: 1347676.1)

Click on Next Button

Screen1:
Data Link Properties - Step 2 of 2

Action:
Key in Data Source name (the TNS Entry). In this installation it is ITST_SG Database instance

Input User Name as AXF and Password <password> (In this installation password is axf).

Select Allow saving password option

Click on Test Connection Button

Observation:
Testing Connection should result into Test Connection Successful.

Action:
Click on OK Button

Click n OK Button of Data Link Properties


Observation:
You will receive following message if you choose to Save Password in Data Link Configuration

Action:
Click on Yes Button

Obtain the Connect String that you need to supply in OFR Configuration File for Database Connections.
Open 64Bit_ConnectString.udl in Notepad, following entry will serve the purpose of Connect String.
Provider=OraOLEDB.Oracle.1;Password=AXF;Persist Security Info=True;User ID=AXF;Data Source=ITST_SG

Install FileZilla

Initiate Setup by double clicking on file FileZilla_3.1.0_win32-setup.exe located at D:\OFR_Installer.
Follow the Installation Wizard and Options selected during the following installation process.






Install Putty
Initiate Putty Application by double clicking on putty.exe located at D:\OFR_Installer.

Install Acrobat PDF reader
Initiate Adobe Reader 9.4.0 Setup by double clicking on AdbeRdr940_en_US.exe located at D:\OFR_Installer.


Follow the Installation Wizard and Options selected during the following installation process.



Prepare for OFR Installation
Unzip following compressed files in the same location (D:\OFR_Installer\OFR and Patch1).
OFR_101350_20091103.zip
p11813845_OFR_101350_Patch1.zip
p12692984_101350_Generic_Patch2.zip


Install OFR Software
Start OFR Setup setup.exe by Running it as Administrator.
Locate file setup.exe in D:\OFR_Installer\OFR and Patch1\OFR_101350_20091103, right click it and select Run as administrator.


Follow the installation Wizard and Options selected in following Screenshots.




Action:
Change the installation path by Clicking on Change Button


Action:
Choose Path D:\OFR

Click on OK Button








Observation:
You can notice following Short Cuts are created in the start Menu under Oracle Forms Recognition


Apply Patch p11813845_OFR_101350_Patch1
Go to extracted folder D:\OFR_Installer\OFR and Patch1\p11813845_OFR_101350_Patch1 and locate file ReadMe11813845.txt
Go to section Apply builds and follow the instructions.

Install Build 4159 by running the setup.exe in Administrator Mode. This file is located at
D:\OFR_Installer\OFR and Patch1\p11813845_OFR_101350_Patch1\OFR Patches\OFR 10.1.3.5.0 Build 4159



Action:
Choose Repair Option

Click on Next Button



Apply Build 4160 according to instructions in D:\OFR_Installer\OFR and Patch1\p11813845_OFR_101350_Patch1\OFR Patches\OFR 10.1.3.5.0 Build 4160\OFR 10.1.3.5.0 Build 4160 Release Notes.pdf. It is done as Follows:

Extract OFR 10.1.3.5.0 Build 4160a.Zip in the same location. It will be extracted in folder OFR 10.1.3.5.0 Build 4160a in the same directory.
Step1)
Copy the following three files (Not the folders) from the patch folder to OFR system folders by replacing the old files.
CdrBatch.dll
CdrProj.dll
CdrWkDoc.dll
Copy From
D:\OFR_Installer\OFR and Patch1\p11813845_OFR_101350_Patch1\OFR Patches\OFR 10.1.3.5.0 Build 4160\OFR 10.1.3.5.0 Build 4160a\Components\Cedar
Copy To
D:\OFR\Components\Cedar

Step2)
Copy the following three files (Not the folders) from the patch folder to OFR system folders by replacing the old files.
CdrBatch.lng
CdrProj.lng
CdrWkDoc.lng
Copy From
D:\OFR_Installer\OFR and Patch1\p11813845_OFR_101350_Patch1\OFR Patches\OFR 10.1.3.5.0 Build 4160\OFR 10.1.3.5.0 Build 4160a\Components\Cedar\Eng
Copy To
D:\OFR\Components\Cedar\Eng

Step3)
Copy the following three files (Not the folders) from the patch folder to OFR system folders by replacing the old files.
CdrBatch.lng
CdrProj.lng
CdrWkDoc.lng
Copy From
D:\OFR_Installer\OFR and Patch1\p11813845_OFR_101350_Patch1\OFR Patches\OFR 10.1.3.5.0 Build 4160\OFR 10.1.3.5.0 Build 4160a\Components\Cedar\Ger
Copy To
D:\OFR\Components\Cedar\Ger

Step4)
Copy the following file from the patch folder to OFR system folders by replacing the old files.
DstWkBrw.exe
Copy From
D:\OFR_Installer\OFR and Patch1\p11813845_OFR_101350_Patch1\OFR Patches\OFR 10.1.3.5.0 Build 4160\OFR 10.1.3.5.0 Build 4160a\Components\Tools
Copy To
D:\OFR\Components\Tools

Step5)
Run the application batch file located in D:\OFR\Components\Cedar\RegCdr.bat.
Make sure that no errors appear during registration.


Apply Build 4161 according to instructions in OFR Patches D:\OFR_Installer\OFR and Patch1\p11813845_OFR_101350_Patch1\OFR Patches\OFR 10.1.3.5.0 Build 4161\OFR 10.1.3.5.0 Build 4161 Release Notes.pdf. It is done as follows:

Extract OFR 10.1.3.5.0 Build 4161a.Zip in the same location. It will be extracted in folder OFR OFR 10.1.3.5.0 Build 4161a in the same directory.

Step1)
Copy the following file from the patch folder to OFR system folders by replacing the old files.
CdrWkDoc.dll
Copy From
D:\OFR_Installer\OFR and Patch1\p11813845_OFR_101350_Patch1\OFR Patches\OFR 10.1.3.5.0 Build 4161\OFR 10.1.3.5.0 Build 4161a
Copy To
D:\OFR\Components\Cedar

Step2)
Copy the following file from the patch folder to OFR system folders by replacing the old files.
CdrWkDoc.lng
Copy From
D:\OFR_Installer\OFR and Patch1\p11813845_OFR_101350_Patch1\OFR Patches\OFR 10.1.3.5.0 Build 4161\OFR 10.1.3.5.0 Build 4161a\Eng
Copy To
D:\OFR\Components\Cedar\Eng

Step3)
Copy the following file from the patch folder to OFR system folders by replacing the old files.
CdrWkDoc.lng
Copy From
D:\OFR_Installer\OFR and Patch1\p11813845_OFR_101350_Patch1\OFR Patches\OFR 10.1.3.5.0 Build 4161\OFR 10.1.3.5.0 Build 4161a\Ger
Copy To
D:\OFR\Components\Cedar\Ger

Step4)
Run the application batch file located in D:\OFR\Components\Cedar\RegCdr.bat.
Make sure that no errors appear during registration.


Do not execute section Apply Upgrade Files. Instead perform following, because we have already build-Modified, Enhanced and Fine Tuned and Tested  Project File and Configuration file in Previous installation.

Apply Upgrade from Previous Project Installation
Step1)
Copy Project Repository from Public Shared folder (or previous installed instance) to OFR Server in Installer Folder.
Copy Folder
Paste Folder
D:\OFR_Installer\OFR_Project_Files

Step2)
Create Folder Back_Seeded_Files in folder D:\OFR\Projects\AP\Global
Move (Cut and Paste) following seeded Folder and Files into the new Folder
Folder
Train
Move To: D:\OFR\Projects\AP\Global\Back_Seeded_Files
File
AP Packaged Project_1004a.ini
Move To: D:\OFR\Projects\AP\Global\Back_Seeded_Files
File
AP Packaged Project_1004a.sdp
Move To: D:\OFR\Projects\AP\Global\Back_Seeded_Files

Step3)
Copy following Folder and Files from D:\OFR_Installer\OFR_Project_Files to the Global Folder
Folder
Train
Copy To: D:\OFR\Projects\AP\Global
File
AP Packaged Project_1006d.ini
Copy To: D:\OFR\Projects\AP\Global
File
AP Packaged Project_1006d.sdp
Copy To: D:\OFR\Projects\AP\Global
File
companycode.csv
Copy To: D:\OFR\Projects\AP\Global
File
Vendor.csv
Copy To: D:\OFR\Projects\AP\Global

Step4)
Rename AP Packaged Project_1006d.ini file and AP Packaged Project_1006d.sdp file to AP_Invoices.ini and AP_Invoices.sdp respectively.
The contents of Global Folder should look like below image.


Apply the registry update by executing OFR_AP_RegistryUpdate.Reg file
Step1)
Copy file AP Packaged Project_1006d.ini file and AP Packaged Project_1006d.sdp from folder D:\OFR_Installer\OFR and Patch1\p11813845_OFR_101350_Patch1\AP Project 1006d to D:\OFR_Installer folder.

Step2)
Start the command prompt by Running as Administrator


Type following command on the command prompt:
C:\Windows\system32>D:
D:\>cd OFR_Installer
D:\OFR_Installer>
D:\OFR_Installer>OFR_AP_RegistryUpdate.Reg


Action:
Click on Yes Button to continue

Observation:
Registry Update should be successful

Action:
Click on OK Button

Exit/Close the command prompt

Do not execute section Upgrading from v1004a to v1006d. This not applicable as we are doing fresh installation of v1006d.

Do not execute section Implement Database Scripts. Instead perform following, because we have already build-Modified, Enhanced and Fine Tuned and Tested  DB Scripts in Previous installation.
Apply Database Scripts from Previous Project Installation
Step1)
Copy DB Script Repository from Public Shared folder (or previous installed instance) to OFR Server in Installer Folder.
Paste Folder
D:\OFR_Installer\OFR_Database_Scripts

Step2)
Connect Oracle ERP Database (EBS) as AXF User and Execute following scripts from this location D:\OFR_Installer\OFR_Database_Scripts in the Database in the specified sequence.
Seq 1
01-OFR-AP-Tables_Oracle.sql
Seq 2
02-OFR-AP-Reporting_Oracle.sql
Seq 3
03-XX_ROUND_IT.fnc
Seq 4
04-XX_ROUNDDOWN.fnc
Seq 5
05-XX_ROUNDUP.fnc
Seq 6
06-OFR-AP-EBS-Views.sql
Seq 7
07-INVOICE_NUMBER_FORMATS_INS.sql
Seq 8
08-Insert Into Company.sql

Setup Run Time Server Instance
Step1)
Open Windows Services Console from Control Panel -> Administrative Tools - Services Menu.
Locate for following two services
Oracle Forms Recognition Runtime Service Manager
Oracle Forms Recognition System Monitoring

Select Oracle Forms Recognition Runtime Service Manager

Action:
Select Startup Type as Automatic

Click on Start Button

Click on OK Button

Select Oracle Forms Recognition System Monitoring

Action:
Select Startup Type as Automatic

Click on Start Button

Click on OK Button

Step2)
Start Management Console
(Navigation: Start-> Oracle Forms Recognition -> Runtime Services -> Management Console)


Create New RTS Group

Action:
Right click on Runtime Server Administration and Select  New RTS Group

Supply the RTS Group Name : AP_Invoices

Create New Machine

Action:
Select RTS Group AP_Invoices and Right click on it, Select New machine



Action:
Select Domains as <company domain>

Click on Search Button

Observation:
Search will list down all the Machines running the service
Oracle Forms Recognition Runtime Service Manager
Note:-
Before clicking on search make sure that this service is running on your machine (where you are configuring Run Time Service instance.


Action:
Select Your Server form the list and move it in the right  pane. In this installation the server name is <OFR SERVER NAME>

Click on Stop Search Button



Action:
After you moved the server to right pane, click on OK button

Create RTS Instance

Action:
Select The Machine in the Tree, right click, select  New from context menu and then select RTS Instance

Supply the RTS Instance name: Transform_Invoices

Observation:
Your RTS Tree should look like below image


Configure RTS Instance (Import Settings)

Action:
Right Click on RTS Instance Transform_Invoices and select Import Settings


Action:
Select RTS_Instance_2012_09_10.set located under
D:\OFR_Installer\OFR_Project_Files\RTS_Instance_2012_09_10.set


Action:
After Importing Settings, Change the default imported settings to your  Installation specific settings.

Right click on Transform_Invoices and select Properties from the context menu

Before - General Tab
After - General Tab






Action :
Change User Project File is to D:\OFR\Projects\AP\Global\AP_Invoices.sdp

Change Batch Root Directory to D:\OFR\Projects\AP\Batches

Change Image Root Directory to D:\OFR\Projects\AP\Batches

Change Export Path to \\<ipaddress>\ipmshare
Note:-
The Export Path \\<ip address>\ipmshare must me configured as a Network Drive in Windows Explorer of your OFR machine. In this installation it is configured as:


You should not use Z:, instead use actual Share name (Samba Share/Samba Drive) which is pointing to IPM Server sgipmprdap1.

Observation:
Import Tab

Action:
Make sure that Import Directory is pointing to D:\OFR\Projects\AP\Import

Step3)
Re-Configure Project Configuration file as per your Installation

Open the Configuration file D:\OFR\Projects\AP\Global\AP_Invoices.ini

Change SQL_VL_01_ConnectionString, SQL_VL_02_ConnectionString and SQL_VL_03_ConnectionString, entries to have Connection String generated by OLE DB Connection.

SQL_VL_01_ConnectionString=Provider=OraOLEDB.Oracle.1;Password=AXF;Persist Security Info=True;User ID=AXF;Data Source=ITST_SG
SQL_VL_02_ConnectionString=Provider=OraOLEDB.Oracle.1;Password=AXF;Persist Security Info=True;User ID=AXF;Data Source=ITST_SG
SQL_VL_03_ConnectionString=Provider=OraOLEDB.Oracle.1;Password=AXF;Persist Security Info=True;User ID=AXF;Data Source=ITST_SG

Make sure that Vendor ASSA Pool setting is pointing to AP Project

ASA_OP_01_PoolRelative=NO
ASA_VL_01_PoolPath=D:\OFR\Projects\AP\Global\Pool
ASA_VL_01_PoolDirectory=Pool
ASA_VL_01_PoolName=Vendor

ASA_OP_04_PoolRelative=NO
ASA_VL_04_PoolPath=D:\OFR\Projects\AP\Global\Pool
ASA_VL_04_PoolDirectory=Pool
ASA_VL_04_PoolName=CompanyCode

Step4)
Configure Local Project and Common Project Files

Create Two folders Local and Common under D:\OFR\Projects\AP


Copy Project File, Configuration File and Train Folder from Global Folder to Local Folder


Step5)
Setup Verifier at OFR Server

Action:
Select Oracle Forms Recognition Verifier from Start Menu as highlighted in above image.


Action:
Select Options-> Settings

Screen:
General

Action:
Key in User Project File as D:\OFR\Projects\AP\Global\AP_Invoices.sdp

Batch Root Folder as D:\OFR\Projects\AP\Batches

Image Root Folder as D:\OFR\Projects\AP\Batches

Screen:
Supervised Learning

Action:
Select Activate Supervised-Learning workflow

Key in Local project name as D:\OFR\Projects\AP\Local\AP_Invoices.sdp

Knowledge base directory as D:\OFR\Projects\AP\Common

Click on OK Button

Observation:
It will prompt for Login Credential  to load Verifier for Specified Project

Action:
Key in User name: Administrator, password leave it blank

Observation:
Notice Batch AP_Invoices.sdp is loaded and LearnSet Manager is activated


Action:
You can save the setting or once you close the verifier, it will ask you for Save.

Chose Yes Button.


Step6)
Configure Project File

Open AP+Invoices.sdp located at D:\OFR\Projects\AP\Global


Action:
Key in User name as Administrator, leave the Password  blank.

Click on OK Button

Setup Vendor Pool

Action:
Click on Definition Mode  
Machine generated alternative text:

Setup Vendor Pool for Third Party Suppliers

Action:
Double click on Class Invoices

Action :
Select Field [6] Vendor ASSA and get the Properties Context  Menu

Screen:
Vendor ASSA Properties will appear at the right hand side of the screen
Before
Prepare Pool
After






Action:
Click on Analysis Tab.

Notice the Supplier Pool Analysis does not exist

Click on ODBC Import Tab. And Click on Import Button to load the vendor Pool

Once the Vendors are loaded successfully, click on Analysis Tab and verify
Engine is Ready.

Setup Vendor Pool for Intercompany Suppliers

Action:
Click on Classes Tab in the Left Side Pane

Select Class Intercompany

Double Click Intercompany Class

Repeat the same exercise that was done for Invoices Class

Action:
Save the Project and close the project

Step7)
Stat Run Time Server Instance

Start Management Console
(Navigation: Start-> Oracle Forms Recognition -> Runtime Services -> Management Console)


Before
After




Action:
Hit the Play Button on the Tool Bar