6 Replies Latest reply on Feb 14, 2019 12:29 PM by Smuckers

    installing application into runtime

    Krisztian, Hegyvari

      Hi,

       

      I am trying to install our application into a runtime environment for the first time. Apex 18.2.

       

      I do not want to export and import the workspace from the development environment, the name is not appropriate and I do not need the users either. I created a workspace as seen in the doc

       

      BEGIN

        APEX_INSTANCE_ADMIN.ADD_WORKSPACE (

        p_workspace_id => 8675309,

        p_workspace => 'MY_WORKSPACE',

        p_primary_schema => 'SCOTT',

        p_additional_schemas => 'SCOTT' );

      END;

       

      (using different names of course).

       

      After that I exported the plugins and the application from the development. I try to run the install script as APEX_180200 in the uat runtime, the plugins install fine, but the application import dies with a

       

      ORA-02291: integrity constraint (APEX_180200.WWV_FLOWS_FK) violated - parent key not found

      ORA-06512: at "APEX_180200.WWV_FLOW_API", line 4046

      ORA-06512: at line 2

       

      The instruction is

       

      begin

      wwv_flow_api.create_flow(

      p_id=>wwv_flow.g_flow_id

      ,p_display_id=>nvl(wwv_flow_application_install.get_application_id,101)

      ,p_owner=>nvl(wwv_flow_application_install.get_schema,'CEB')

      ,p_name=>nvl(wwv_flow_application_install.get_application_name,'EasyBEC')

      ,p_alias=>nvl(wwv_flow_application_install.get_application_alias,'101')

      ,p_page_view_logging=>'YES'

      ,p_page_protection_enabled_y_n=>'Y'

      ,p_checksum_salt=>'23C5D02151B896ADF9B103D487CB768070FC71ED44B64952977C0193D1705ABA'

      ,p_bookmark_checksum_function=>'SH1'

      ,p_compatibility_mode=>'5.1'

      ,p_flow_language=>'en'

      ,p_flow_language_derived_from=>'FLOW_PRIMARY_LANGUAGE'

      ,p_allow_feedback_yn=>'Y'

      ,p_date_format=>'DD-MM-YYYY'

      ,p_direction_right_to_left=>'N'

      ,p_flow_image_prefix => nvl(wwv_flow_application_install.get_image_prefix,'')

      ,p_documentation_banner=>'Application created from create application wizard 2018.11.19.'

      ,p_authentication=>'PLUGIN'

      ,p_authentication_id=>wwv_flow_api.id(19497679835912767)

      ,p_application_tab_set=>0

      ,p_logo_image=>'TEXT:EasyBEC'

      ,p_public_user=>'APEX_PUBLIC_USER'

      ,p_proxy_server=>nvl(wwv_flow_application_install.get_proxy,'')

      ,p_no_proxy_domains=>nvl(wwv_flow_application_install.get_no_proxy_domains,'')

      ,p_flow_version=>'Release 0.0.0.1'

      ,p_flow_status=>'AVAILABLE_W_EDIT_LINK'

      ,p_flow_unavailable_text=>'This application is currently unavailable at this time.'

      ,p_build_status=> 'RUN_ONLY'

      ,p_exact_substitutions_only=>'Y'

      ,p_browser_cache=>'N'

      ,p_browser_frame=>'D'

      ,p_runtime_api_usage=>'T'

      ,p_rejoin_existing_sessions=>'N'

      ,p_csv_encoding=>'Y'

      ,p_auto_time_zone=>'N'

      ,p_substitution_string_01=>'APP_NAME'

      ,p_substitution_value_01=>'EasyBEC'

      ,p_last_updated_by=>'HK'

      ,p_last_upd_yyyymmddhh24miss=>'20190212160026'

      ,p_file_prefix => nvl(wwv_flow_application_install.get_static_app_file_prefix,'')

      ,p_files_version=>3

      ,p_ui_type_name => null

      );

      end;

      /

       

      The failing constraint is

       

      ALTER TABLE APEX_180200.WWV_FLOWS ADD (

        CONSTRAINT WWV_FLOWS_FK

        FOREIGN KEY (SECURITY_GROUP_ID)

        REFERENCES APEX_180200.WWV_FLOW_COMPANIES (PROVISIONING_COMPANY_ID)

        ON DELETE CASCADE

        ENABLE VALIDATE);

       

      How to set this up right, what am I missing?

       

      Thanks for the help.

       

      Krisztian

        • 1. Re: installing application into runtime
          Krisztian, Hegyvari

          Upon further thinking and checking the support site, is it possible that the workspace name in the targe has to be the same as the workspace from which the app has been exported?

          • 2. Re: installing application into runtime
            Smuckers

            I can't help you with an answer, but I received the exact same error message trying to import an application into our production environment last night.  As with your experience, my production instance is a runtime install.  The workspace is the same on both instances, so I do not believe that to be the root cause in your case. Some data:

             

            • Both my development and production instances are running 18.2.0.00.12.
            • I was importing two separate apex applications into production.  Both returned the same error.
            • Before starting the install I had successfully imported both applications into my workspace at apex.oracle.com as part of my pre-production testing.

             

            The failing statement and associated error follows:

             

            SQL> prompt --application/create_application

            --application/create_application

            SQL> begin

              2  wwv_flow_api.create_flow(

              3   p_id=>wwv_flow.g_flow_id

              4  ,p_display_id=>nvl(wwv_flow_application_install.get_application_id,900)

              5  ,p_owner=>nvl(wwv_flow_application_install.get_schema,'###')

              6  ,p_name=>nvl(wwv_flow_application_install.get_application_name,'########')

              7  ,p_alias=>nvl(wwv_flow_application_install.get_application_alias,'F_900')

              8  ,p_page_view_logging=>'YES'

              9  ,p_page_protection_enabled_y_n=>'Y'

            10  ,p_checksum_salt=>'F2E1DD6561E5BBE3BA304F40C43A65044B9C840830BD2EAB32677E407E62ED80'

            11  ,p_bookmark_checksum_function=>'SH1'

            12  ,p_compatibility_mode=>'5.1'

            13  ,p_flow_language=>'en'

            14  ,p_flow_language_derived_from=>'FLOW_PRIMARY_LANGUAGE'

            15  ,p_direction_right_to_left=>'N'

            16  ,p_flow_image_prefix => nvl(wwv_flow_application_install.get_image_prefix,'')

            17  ,p_authentication=>'PLUGIN'

            18  ,p_authentication_id=>wwv_flow_api.id(30266671699127028)

            19  ,p_populate_roles=>'A'

            20  ,p_application_tab_set=>0

            21  ,p_logo_image=>'TEXT:#####'

            22  ,p_app_builder_icon_name=>'data_table_icon.png'

            23  ,p_public_user=>'APEX_PUBLIC_USER'

            24  ,p_proxy_server=>nvl(wwv_flow_application_install.get_proxy,'')

            25  ,p_no_proxy_domains=>nvl(wwv_flow_application_install.get_no_proxy_domains,'')

            26  ,p_flow_version=>'release 1.0'

            27  ,p_flow_status=>'AVAILABLE_W_EDIT_LINK'

            28  ,p_flow_unavailable_text=>'This application is currently unavailable at this time.'

            29  ,p_exact_substitutions_only=>'Y'

            30  ,p_browser_cache=>'N'

            31  ,p_browser_frame=>'D'

            32  ,p_rejoin_existing_sessions=>'N'

            33  ,p_csv_encoding=>'Y'

            34  ,p_last_updated_by=>'MMORRIS'

            35  ,p_last_upd_yyyymmddhh24miss=>'20190212173908'

            36  ,p_file_prefix => nvl(wwv_flow_application_install.get_static_app_file_prefix,'')

            37  ,p_files_version=>2

            38  ,p_ui_type_name => null

            39  );

            40  end;

            41  /

            begin

            *

            ERROR at line 1:

            ORA-02291: integrity constraint (APEX_180200.WWV_FLOWS_FK) violated - parent

            key not found

            ORA-06512: at "APEX_180200.WWV_FLOW_API", line 4046

            ORA-06512: at line 2

            • 3. Re: installing application into runtime
              Krisztian, Hegyvari

              Finally I went back to the development environment, created a new workspace with the name I want to have in the UAT and the production, imported the application into the new workspace and exported both the workspace and the application. After that I imported the workspace into the UAT and then the application. Everything ran fine.

              • 4. Re: installing application into runtime
                Smuckers

                Well -- I'm glad you solved your problem... but I'm sorry you solved it *already*.  I opened a ticket with support and got a suggestion... but I can't test it until after business hours tomorrow (next scheduled maintenance window).  I don't really trust the answer 100%, so was hoping you still needed an answer and could test...

                 

                I *think* the solution you came up with essentially does the same thing as what I was told to do... by a different route.  In my application export script, the p_workspace_id pointed to a workspace number that exists in my development environment, but not my production one (even though the two are called by the same name).  I sent him the results of the apex_verify script.  From that, he determined the workspace ID number in my production instance and asked me to manually change the ID for the p_workspace_id parameter of the export file to that value.

                 

                Since you say that you exported and imported the workspace from your production to your UAT instances... that probably synced the workspace ID numbers between the two.  If you wanted to be REALLY helpful to me, it'd be great if you could check the workspace ID in the application export file that successfuly imported and match it to the one you get from apex_verify.  If the two match, then that pretty much clinches that this is the solution to the error.  I'd feel a whole lot more confident about spending several hours tomorrow afternoon twiddling my thumbs waiting for the maintenance window to open if I knew that was the solution for you.

                • 5. Re: installing application into runtime
                  Krisztian, Hegyvari

                  --excerpt from workspace import

                   

                  begin

                  wwv_flow_fnd_user_api.create_company (

                    p_id => 20505149860492815

                  ,p_provisioning_company_id => 20504946114492706

                  ......

                   

                  --excerpt from application import

                   

                  begin

                  wwv_flow_api.import_begin (

                  p_version_yyyy_mm_dd=>'2018.05.24'

                  ,p_release=>'18.2.0.00.12'

                  ,p_default_workspace_id=>20504946114492706

                  ,p_default_application_id=>108

                  ,p_default_owner=>'CEB'

                  );

                  end;

                  /

                   

                  I guess the workspace ID-s have to match, in other words the application import is trying to import into a workspace specified with the id "20504946114492706". Gotta go, I hope it helps,

                  • 6. Re: installing application into runtime
                    Smuckers

                    Thank you... that makes me feel a bit more optimistic about this evening's attempt.