Recently (since 4.1 update) I’ve experienced issues when importing an application into an Apex environment.
After a little bit of searching I found the way to do the import on the command-line.
It is documented in the Apex documentation, but as you know I’d like this blog to be an “OPI” (one point of information) 🙂
Please have a look at the script, alter it whenever appropriate.
declare -- the name of the workspace in wich to import t_workspace varchar2(30):= 'MERIDA'; -- an application number of an existing application in the workspace. t_existing_app number := 100; -- the "new" application number, an existing number will be dropped first. t_new_app number := 100; -- security group id, you don't have to set this variable t_secgrp_id number; begin -- get the Security Group ID select workspace_id into t_secgrp_id from apex_applications where application_id = t_existing_app; -- Set the Security Group ID wwv_flow_api.set_security_group_id(p_security_group_id => t_secgrp_id); -- Set the Application ID to use apex_application_install.set_application_id(t_new_app); -- This procedure generates the offset value used during application import. -- The offset value is used to ensure that the metadata for the Application -- Express application definition does not collide with other metadata on -- the instance. For a new application installation, it is usually sufficient -- to call this procedure to have Application Express generate this offset -- value for you. apex_application_install.generate_offset; -- Set the parsing schema apex_application_install.set_schema( t_workspace ); -- Set the application alias apex_application_install.set_application_alias( 'F' || t_new_app ); end; / -- Do the actual import @D:ProjectsStaplesMeridaexportsmerida-srv022-20111222-1157.sql; commit;
That’s all folks 🙂