Thursday, December 4, 2014

SQL query to get the details of Scheduled Concurrent Requests in Oracle applications

  SELECT r.request_id
       , p.user_concurrent_program_name
         || NVL2 (r.description
                , ' ('
                  || r.description
                  || ')'
                , NULL)
            conc_prog
       , s.user_name requestor
       , r.argument_text arguments
       , r.requested_start_date next_run
       , r.last_update_date last_run
       , r.hold_flag on_hold
       , r.increment_dates
       , DECODE (c.class_type,  'P', 'Periodic',  'S', 'On Specific Days',  'X', 'Advanced',  c.class_type) schedule_type
       , CASE
            WHEN c.class_type = 'P'
            THEN
               'Repeat every '
               || SUBSTR (c.class_info, 1, INSTR (c.class_info, ':') - 1)
               || DECODE (SUBSTR (c.class_info
                                ,   INSTR (c.class_info
                                         , ':'
                                         , 1
                                         , 1)
                                  + 1
                                , 1)
                        , 'N', ' minutes'
                        , 'M', ' months'
                        , 'H', ' hours'
                        , 'D', ' days')
               || DECODE (SUBSTR (c.class_info
                                ,   INSTR (c.class_info
                                         , ':'
                                         , 1
                                         , 2)
                                  + 1
                                , 1)
                        , 'S', ' from the start of the prior run'
                        , 'C', ' from the completion of the prior run')
            WHEN c.class_type = 'S'
            THEN
               NVL2 (dates.dates
                   , 'Dates: '
                     || dates.dates
                     || '. '
                   , NULL)
               || DECODE (SUBSTR (c.class_info, 32, 1), '1', 'Last day of month ')
               || DECODE (SIGN (TO_NUMBER (SUBSTR (c.class_info, 33)))
                        , '1', 'Days of week: '
                               || DECODE (SUBSTR (c.class_info, 33, 1), '1', 'Su ')
                               || DECODE (SUBSTR (c.class_info, 34, 1), '1', 'Mo ')
                               || DECODE (SUBSTR (c.class_info, 35, 1), '1', 'Tu ')
                               || DECODE (SUBSTR (c.class_info, 36, 1), '1', 'We ')
                               || DECODE (SUBSTR (c.class_info, 37, 1), '1', 'Th ')
                               || DECODE (SUBSTR (c.class_info, 38, 1), '1', 'Fr ')
                               || DECODE (SUBSTR (c.class_info, 39, 1), '1', 'Sa '))
         END
            AS schedule
       , c.date1 start_date
       , c.date2 end_date
       , c.class_info
    FROM apps.fnd_concurrent_requests r
       , apps.fnd_conc_release_classes c
       , apps.fnd_concurrent_programs_tl p
       , apps.fnd_user s
       , (WITH date_schedules
               AS (SELECT release_class_id, RANK () OVER (PARTITION BY release_class_id ORDER BY s) a, s
                     FROM (SELECT c.class_info
                                , l
                                , c.release_class_id
                                , DECODE (SUBSTR (c.class_info, l, 1), '1', TO_CHAR (l)) s
                             FROM (    SELECT LEVEL l
                                         FROM DUAL
                                   CONNECT BY LEVEL <= 31)
                                , apps.fnd_conc_release_classes c
                            WHERE c.class_type = 'S'
                              AND INSTR (SUBSTR (c.class_info, 1, 31), '1') > 0)
                    WHERE s IS NOT NULL)
              SELECT release_class_id, SUBSTR (MAX (SYS_CONNECT_BY_PATH (s, ' ')), 2) dates
                FROM apps.date_schedules
          START WITH a = 1
          CONNECT BY NOCYCLE PRIOR a = a - 1
            GROUP BY release_class_id) dates
   WHERE r.phase_code = 'P'
     AND c.application_id = r.release_class_app_id
     AND c.release_class_id = r.release_class_id
     AND NVL (c.date2, SYSDATE + 1) > SYSDATE
     AND c.class_type IS NOT NULL
     AND p.concurrent_program_id = r.concurrent_program_id
     AND p.language = 'US'
     AND dates.release_class_id(+) = r.release_class_id
     AND r.requested_by = s.user_id
ORDER BY conc_prog, on_hold, next_run;

Tuesday, October 14, 2014

FRM-92095: Oracle JInitiator version too low. Please install version 1.1.8.2 or higher

Resolved this Error By performing following Steps : 
Set the system environment variable, as follows :

  1.  Ensure that all browser windows are closed.
  2.  Access the Advanced System settings from the Control Panel.
  3.  On a Windows 7 client machine, this is done as follows : Navigate to the Control Panel, select the System item, select the Advanced system settings option.
   4. On a Windows XP client machine, this is done as follows : Navigate to the Control Panel, locate and open the System item, in the System Properties dialog, navigate to the Advanced tab.
    5. Select the Environment Variables button.
    6. Go through both the User variables box and the System variables box, looking for an existing variable called JAVA_TOOL_OPTIONS.
    7. Assuming no existing JAVA_TOOL_OPTIONS variable is found, select the New button in the System variables block, at the bottom of the screen.
    8.In the resultant New System Variable dialog, create a new variable with the following information:

Variable name  : JAVA_TOOL_OPTIONS
Variable value : -Djava.vendor="New Oracle"

(Note the leading hyphen "-" in the value)

   9. Select the OK button in the Environment Variables dialog, then the OK button in the System Properties dialog to save this change.

This works by changing the vendor information for Java from Oracle to anything else; I used the string "New Oracle" to avoid confusion; you can use the "Sun Microsystems Inc." string too.

This then stops the Java code in Forms 10g (specifically, the FRMALL.JAR server-side package, I believe) from thinking that the Java client is an older version of JInitiator, which is no longer supported - hence the confusing message.

Note that this problem does not occur in Oracle Forms 11g, as the relevant JAR package has been updated. However, you can run Oracle Forms 11g systems with this workaround in place.

Hope this resolve your issue,

Thursday, October 2, 2014

Unable to locate android build tools in the specified location (Oracle ADF Mobile)

If you are facing the error while deploying the Mobile app on the Andriod emulator and the error message says "Uable to locate android build tools in the specified location" in the Platform-tools Folder then the Andriod SDK version that you are trying to install on your local machine has the required files moved to the Build-tools --> 17.0.0 folder. To make it work you need to follow the following steps.

1. Open the Command Prompt as "Run As Administrator".
2. In the Commpand promt execute the Following commands

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
C:\>mklink c:\AndroidSDK\sdk\platform-tools\aapt.exe C:\AndroidSDK\sdk\build-tools\17.0.0\aapt.exe

output for the Above Script :- symbolic link created for c:\AndroidSDK\sdk\platform-tools\aapt.exe <<===>> C:\AndroidSDK\sdk\build-tools\17.0.0\aapt.exe

C:\>mklink /D c:\AndroidSDK\sdk\platform-tools\lib c:\AndroidSDK\sdk\build-tools
\17.0.0\lib
output for the Above Script :- symbolic link created for c:\AndroidSDK\sdk\platform-tools\lib <<===>> c:\AndroidSDK\sdk\build-tools\17.0.0\lib


C:\>mklink c:\AndroidSDK\sdk\platform-tools\dx.bat C:\AndroidSDK\sdk\build-tools\17.0.0\dx.bat

output for the Above Script :- symbolic link created for c:\AndroidSDK\sdk\platform-tools\dx.bat <<===>> C:\AndroidSDK\sdk\build-tools\17.0.0\dx.bat


Once you are done with the above setup then you can try deploying Your mobile app to Andriod Emulator.


I Hope this will help you in getting rid of the Issue................

Saturday, September 13, 2014

Script To register the Custom Table In Oracle Application using AD_DD_REGISTER_TABLE


SET SERVEROUTPUT ON;

DECLARE
   l_appl_short_name                            VARCHAR2(40) := 'XXSSN';
   l_tab_name                                   VARCHAR2(32) := 'XXJG_ADDL_INFO_DFF_TBL';  -- Change the table name if you require
   l_tab_type                                   VARCHAR2(50) := 'T';
   l_next_extent                                NUMBER := 512;
   l_pct_free                                   NUMBER;
   l_pct_used                                   NUMBER;
BEGIN
   -- Unregister the custom table if it exists
   ad_dd.delete_table( p_appl_short_name => 'XXSSN', p_tab_name => l_tab_name);

   -- Register the custom table
   FOR tab_details IN (SELECT table_name
                            , tablespace_name
                            , pct_free
                            , pct_used
                            , ini_trans
                            , max_trans
                            , initial_extent
                            , next_extent
                         FROM dba_tables
                        WHERE table_name = l_tab_name)
   LOOP
      DBMS_OUTPUT.put_line(
            'Registering Table : '
         || l_tab_name);
      ad_dd.register_table(
         p_appl_short_name                         => l_appl_short_name
       , p_tab_name                                => tab_details.table_name
       , p_tab_type                                => l_tab_type
       , p_next_extent                             => NVL(tab_details.next_extent, 512)
       , p_pct_free                                => NVL(tab_details.pct_free, 10)
       , p_pct_used                                => NVL(tab_details.pct_used, 70));
   END LOOP;

   -- Register the columns of custom table
   FOR all_tab_cols IN (SELECT column_name
                             , column_id
                             , data_type
                             , data_length
                             , nullable
                          FROM dba_tab_columns
                         WHERE table_name = l_tab_name)
   LOOP
      DBMS_OUTPUT.put_line(
            'Registering Column : '
         || all_tab_cols.column_name);
      ad_dd.register_column(
         p_appl_short_name                         => l_appl_short_name
       , p_tab_name                                => l_tab_name
       , p_col_name                                => all_tab_cols.column_name
       , p_col_seq                                 => all_tab_cols.column_id
       , p_col_type                                => all_tab_cols.data_type
       , p_col_width                               => all_tab_cols.data_length
       , p_nullable                                => all_tab_cols.nullable
       , p_translate                               => 'N'
       , p_precision                               => NULL
       , p_scale                                   => NULL);
   END LOOP;

   FOR all_keys IN (SELECT constraint_name
                         , table_name
                         , constraint_type
                      FROM all_constraints
                     WHERE constraint_type = 'P'
                       AND table_name = l_tab_name)
   LOOP
      ad_dd.register_primary_key(
         p_appl_short_name                         => l_appl_short_name
       , p_key_name                                => all_keys.constraint_name
       , p_tab_name                                => all_keys.table_name
       , p_description                             => 'Register primary key'
       , p_key_type                                => 'S'
       , p_audit_flag                              => 'N'
       , p_enabled_flag                            => 'Y');

      FOR all_columns IN (SELECT column_name
                               , position
                            FROM dba_cons_columns
                           WHERE table_name = all_keys.table_name
                             AND constraint_name = all_keys.constraint_name)
      LOOP
         ad_dd.register_primary_key_column(
            p_appl_short_name                         => l_appl_short_name
          , p_key_name                                => all_keys.constraint_name
          , p_tab_name                                => all_keys.table_name
          , p_col_name                                => all_columns.column_name
          , p_col_sequence                            => all_columns.position);
      END LOOP;
   END LOOP;

   COMMIT;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line(
            'UNEXP_ERROR : '
         || SUBSTR( SQLERRM, 1, 250));
END;
/

Tuesday, September 9, 2014

Script to Explode the DBA_DEPENDENCIES Hierachy till Nth Level

    SELECT DISTINCT referenced_name
                  , referenced_type
                  , LEVEL
                  ,    LPAD( ' ', 2 * (LEVEL - 1))
                    || name
                  , owner
                  , name
                  , TYPE
      FROM (SELECT *
              FROM dba_dependencies
             WHERE 1 = 1
               AND (referenced_name LIKE 'XX%'
                 OR referenced_name LIKE 'XX_1%')
               AND (name LIKE 'XX_%'
                 OR name LIKE 'XX_1%')
               AND name <> referenced_name)
START WITH referenced_name =<<&p_object_name>>
CONNECT BY NOCYCLE referenced_name = PRIOR name
  ORDER BY LEVEL