Deploying an app from export script stored in the database.

I am in the situation where I want to deploy a copy of an application programatically into the current workspace, but each against a separate schema. The end game would be to have many copies of the same App in the same workspace (obviously with different application numbers assigned) but each app pointing to a different schema.
The workflow would be something like this:
<ol>
<li>Create a new tablespace for the new schema</li>
<li>Create the new Schema</li>
<li>create the required objects in the new schema (we're going to use DataPump for that)
</li>
<li>Assign the schema to the current workspace (make it available to use for a new APP)</li>
<li>Read the app.sql from a BLOB in the database and deploy it into the current workspace pointed to the new schema.</li>
</ol>
I was wondering if there are already API's in place that would help me do these things (especially steps 4 and 5).
I started poking around in the ApEx internals, looking specifically at the deployment of the SAMPLE apps to see if there was anything I could use, but it looks like the WWV_FLOW_SAMPLE_APP package is wrapped so I can't see what it's doing.
I also looked at the code behind the "COPY APPLICATION" function and it looks like I might be able to use wwv_flow_imp_parser.parse to install the application in the current schema, but would probably need some clarification on whether there are any "gotchas" there.
If that works, then it seems the hard part is assigning the new schema to the workspace as normally that is done from within the INTERNAL user's workspace.
Thanks in advance for the help.
Doug

Ok... For others who may be interested in this, I have figured out part of the answer...
To complete steps 2 and 4 mentioned in my original messages (Creating the user and makeing it available to a workspace) here is what I've come up with.
DECLARE
l_username varchar2(256);
l_password varchar2(256);
l_df_ts    varchar2(256);
l_tmp_ts   varchar2(256);
l_PCID     number;
l_workspace_name varchar2(255);
BEGIN
l_username := 'DOUG';
l_password := 'DOUG';
l_df_ts    := 'USERS';
l_tmp_ts   := 'TEMP';
l_workspace_name := 'HAAS';
-- CREATE THE USER AND THEN ADD THAT USER TO THE CORRECT WORKSPACE.
-- First make sure that
--  1. The name you're trying to create is not a "reserved" name like INTERNAL
--  2. We're not working in an installation that is "RUNTIME ONLY"
--  3. We're not working with a schema that is already in place or restricted.
IF  flows_030100.wwv_flow_provisioning.reserved_schema(p_schema => l_username) = false
and not (flows_030100.wwv_flow_provisioning.site_admin_is_restricted
          and
         flows_030100.wwv_flow_provisioning.restricted_schema(p_schema => l_username, p_workspace_name => l_worlkspace_name)
THEN
    -- CREATE THE USER
    flows_030100.wwv_flow_provision.create_user(
    p_username    => l_username,
    p_password    => l_password);
    -- ASSIGN THE TABLESPACEs
    flows_030100.wwv_flow_provision.set_user_tablespace(
    p_username    => l_username,
    p_default_ts  => l_df_ts,
    p_temp_ts     => l_tmp_ts);
    -- Grant the appropriate roles and privs to the user
    flows_030100.wwv_flow_provision.grant_initial_privs(l_username);
    -- Create the link between the workspace and the schema name.
     BEGIN
    -- FIRST get the Workspace ID (known as the PROVISIONING_COMPANY_ID) from the APEX Dictionary.
    -- This assumes that the workspace we're working in is HAAS
        select provisioning_company_id
          into l_PCID
          from flows_030100.wwv_flow_companies
         where short_name = l_workspace_name;
    -- Now insert a row into the company_schema table to line the schema to a workspace.   
        insert into flows_030100.wwv_flow_company_schemas (security_group_id, schema)
        values (l_pcid, upper(l_username));
        commit;
    EXCEPTION
       WHEN NO_DATA_FOUND then
            --IF things fail then we need to kill to drop the user that we created.
            flows_030100.wwv_flow_provision.drop_user(p_username => l_username);
            --Then rais the application error or do whatever...
            raise_application_error(-20100,'Trying to use an invalid worksapce - '|| l_workspace_name);
    END;
end if;
end;I'm still trying to work on deploying the APP stored in a BLOB to the workspace and so far have the following code, but get the message :
ORA-20001: You do not have privs on the DAVID schema.
ORA-06512: at "FLOWS_030100.WWV_FLOW_IMP_PARSER", line 1599
ORA-06512: at line 29
declare
  l_file_id   number := 2113831202674379;
  l_parse_as_schema varchar2(4000) := 'DAVID';
  l_new_ap_ID number;
  l_orig_ap_id number;
  l_workspace_name varchar2(255) := 'HAAS';
  l_PCID     number;
begin
    execute immediate 'alter session set current_schema = FLOWS_030100';
    flows_030100.wwv_flow_security.g_security_group_id := 10;
    flows_030100.wwv_flow_security.g_user := 'ADMIN';
  -- Import copy from application with new application ID and name
  -- First get the new Application ID
  l_new_ap_id := flows_030100.wwv_flow_utilities.minimum_free_flow;
  BEGIN
    select flow_id
      into l_orig_ap_id
      from flows_FILES.wwv_flow_file_objects$
     where id = l_file_id;
  end;
  flows_030100.wwv_flow_imp_parser.parse (
     p_file_id          => l_file_id,
     p_parse_as_schema  => l_parse_as_schema,   
     p_install_as_flow  => l_new_ap_id,
     p_original_flow_id => l_orig_ap_id,
     p_adjust_offset    => TRUE
  -- Get the Security group ID
      select provisioning_company_id
          into l_PCID
          from flows_030100.wwv_flow_companies
         where short_name = l_workspace_name;
  -- reset name with new application name
  update flows_030100.wwv_flows
  set name = 'TEST_NAME'
  where id = l_new_ap_id
  and security_group_id = l_PCID;
end;

Similar Messages

  • How Variant Configuraton data  from Sales Order stored in the database

    Hi,
    I understand that the "variant configuration" data (chosen values for each characteristics assigned to material) from a sales order is stored separately with reference of an object in SAP.
    Please let me know how SAP stores such data -source in the database tables.
    This is required to draw a report of these charateristics values for various sales orders (Transactional data).
    I also understand that there are function modules to retrieve this data, but the function modules are unable to retrieve data as accurately as the VA03 program.
    Thank you for your advice.
    Regards,
    Hemant

    Hi ,
    I do not know what a reference charactersitcs is,but there are all independant characeristics in terms of their values.
    A guess it is because the VC data is changed after the sales order is created, the updated VC data is displayed properly only in VA02 or VA03 but other function modules fail to display the updated VC data.
    I understand there is a relationship of instance -between sales order object and VC data object-which we need to update and then see the latest data.
    Please let me know if anyone has debgged VA03 to know how the standard SAP program retrieves VC data in a sales order.
    Thank you,
    Hemant

  • Unable to deploy ADF app from Jdev 10.1.3.3 to OAS 10.1.3.1

    Dear colleagues,
    I'm deploying my app from JDev 10.1.3.3 to OAS 10.1.3.1. And it is driving me crazy, my application is a J2EE ADF application. When I try to deploy I'm getting the following errors: I've tried everything during days, but still I'm not able to run it :(. The application is working fine in Jdeveloper
    This first error, I could solved adding the jhsadfrt-10.1.3.jar in the OracleAS_1\j2ee\home\applib directory. See the error solved:
    Operation failed with error:
    ******************** FIRST ERROR (SOLVED)********************************************
         Missing class: oracle.jheadstart.model.adfbc.v2.JhsApplicationModule
         Dependent class: amaos.model.common.AmaosModule
         Loader: amaos.root:0.0.1
         Code-Source: /D:/product/10.1.3.1/OracleAS_1/j2ee/home/applications/amaos/ejb2.jar
         Configuration: <ejb> in D:\product\10.1.3.1\OracleAS_1\j2ee\home\applications\amaos
    (Failure analysis caught java.lang.IllegalStateException: ClassLoader "amaos.root:0.0.1" (from <application> in /D:/product/10.1.3.1/OracleAS_1/j2ee/home/applications/amaos/): This loader has been closed and should not be in use.)
    ******************* CURRENT ERROR AFTER SOLVING THE FIRST ****************
    The missing class is available from the following locations:
    1. Code-Source: /E:/product/10.1.3.1/OracleAS_2/BC4J/lib/bc4jct.jar (from <code-source> in /E:/product/10.1.3.1/OracleAS_2/j2ee/home/config/server.xml)
    This code-source is available in loader adf.generic.domain:10.1.3.1.
    This code-source is available in loader adf.oracle.domain:10.1.3.1
    2. Code-Source: /E:/product/10.1.3.1/OracleAS_2/BC4J/lib/bc4jmt.jar (from <code-source> in /E:/product/10.1.3.1/OracleAS_2/j2ee/home/config/server.xml)
    This code-source is available in loader adf.generic.domain:10.1.3.1.
    This code-source is available in loader adf.oracle.domain:10.1.3.1
    3. Code-Source: /E:/product/10.1.3.1/OracleAS_2/BC4J/lib/adfm.jar (from <code-source> in /E:/product/10.1.3.1/OracleAS_2/j2ee/home/config/server.xml)
    This code-source is available in loader adf.generic.domain:10.1.3.1.
    This code-source is available in loader adf.oracle.domain:10.1.3.1
    Any ideas?
    Thanks
    Message was edited by:
    Benalúa

    Benalua,
    (sorry, I don't know how to type the "u" with the diacritic mark above it in your name)
    Did you deploy the ADF 10.1.3.3 libraries to the 10.1.3.1 app server? An alternative might be to apply the 10.1.3.3 patch to the 10.1.3.3 app server.
    John

  • How can I see website data from itouch 4th generation?  My 8 yr old may have been on inappropriate sites and I need to see the data from website data stored on the itouch.

    How can I see website data from itouch 4th generation?  My 8 yr old may have been on inappropriate sites and I need to see the data from website data stored on the itouch.

    There is no way to see where he has been.
    Go into Settings > General > Restrictions > Safari and turn it off. Then add the MacGruff browser from the app store. After that go back to Restrictions and turn off the ability to add apps.

  • When I select from the LOV, it is not storing in the database

    Have a field (Manager) where the user selects their manager from the select list(generated from the query below)
    select FIRST_NAME || LAST_NAME d, MANAGER_ID r
    from PERSONNEL
    where TITLE = 'MGR'
    order by 1
    After the manager is selected and Apply changes is clicked, nothing is stored to the database.
    Have the Manager field specifications set as:
    Source Used: Only when current value is session state is null
    Source Type: Database column
    Maintain Session State: Per Session
    Source Value or Expression: MANAGER_ID

    Well, how have you created this form... manually or using wizard. If you have used wizard, then it would have asked you to select the table and it would have created process to update the same.
    If you have created this form manually then you need to add a processs to update this to database...
    Regards,
    Shijesh

  • I have an Ipad 2. My wife has an Ipad mini. When we connect to Itunes it installs all the apps from one Ipad on to the other. I unchecked the box to automatically update apps, but Itunes still does so. How do I prevent Itunes from intalling apps?

    I have an Ipad 2. My wife has an Ipad mini. When we plug in to Itunes (at different times) it synchs the apps from one Ipad on to the other. We don't want this. I have uncheked the box for Automatically synch apps, but it still does this.
    How do I get Itues to see each Ipad as a separate item, and not try to keep them "equal" as far as apps installed?

    Remove the apps from iTunes with your device connected. You can basically deselect the apps that you don't want on each device. We have three IOS devices on one AppleID and they don't all have the same apps.

  • How come although iPads are getting more powerful, the iOS apps from apple are so mediocre and just not that great? We spend all this money for the latest ipad and all we get is these $5 video and music apps from apple. Why create the iOS platform and onl

    How come although iPads are getting more powerful, the iOS apps from apple are so mediocre and just not that great? We spend all this money for the latest ipad and all we get is these $5 video and music apps from apple. Why create the iOS platform and only offer so so apps like IMovie and GarageBand ? While other developers are offering much better apps like pinnacle studio for video, Cubasis and Auria for music production, apple has not showed much growth in terms of innovation. While there's nothing wrong with making an app like GarageBand where "anyone " can make a song, how about something for real musicians or an app not so basic as it get for video editing? After spending 0ver $700 on an ipad I'd be willing to spend more than $5 for a better video or audio app.

    First, try a system reset although I can't give you any confidence.  It cures many ills and it's quick, easy and harmless...
    Hold down the on/off switch and the Home button simultaneously until you see the Apple logo.  Ignore the "Slide to power off" text if it appears.  You will not lose any apps, data, music, movies, settings, etc.
    If the Reset doesn't work, try a Restore.  Note that it's nowhere near as quick as a Reset.  It could take well over an hour!  Connect via cable to the computer that you use for sync.  From iTunes, select the iPad/iPod and then select the Summary tab.  Follow directions for Restore and be sure to say "yes" to the backup.  You will be warned that all data (apps, music, movies, etc.) will be erased but, as the Restore finishes, you will be asked if you wish the contents of the backup to be copied to the iPad/iPod.  Again, say "yes."
    At the end of the basic Restore, you will be asked if you wish to sync the iPad/iPod.  As before, say "yes."  Note that that sync selection will disappear and the Restore will end if you do not respond within a reasonable time.  If that happens, only the apps that are part of the IOS will appear on your device.  Corrective action is simple -  choose manual "Sync" from the bottom right of iTunes.
    If you're unable to do the Restore, go into Recovery Mode per the instructions here.

  • How do I put the apps from my original iPad onto the substitute iPad?

    I had to send in my iPad in to get the volume button fixed. In the meantime, I've been given a substitute iPad (both are from the school at which I work). How do I put the apps from my original iPad onto the substitute iPad?

    Sync the substitute iPad to the same computer iTunes that you used previously to sync the original iPad.

  • How to stop an app from trying to download to the cloud?

    How do you stop an app from trying to download to the cloud?

    Apps do not download to icloud, no need to stop what never happens.

  • How do I delete apps from my iPhone 4s with the iOS 8 updates?

    How do I delete apps from my iPhone 4s with the iOS 8 updates?

    You simply need to press and hold the app icon on your home screen until it "shakes", then press the red icon to remove the app.

  • In the modern world why is not possible to download apps from foreign countries whilst in the uk...!?

    In the modern world why is not possible to download apps from foreign countries whilst in the uk...!?

    Because apps are licensed for sale only in specific countries by the developers, and for iTunes Store and credit card security and anti-fraud purposes you need an AppleID and billing address in the country you are buying from.
    Just because it is a digital download does not mean licensing and local commerce laws and taxes do not apply, like they would to a physical item.

  • I used the Free Flashlight O app from iHandy and cannot turn the light off. iPhone 4s, iOS 6.

    I used the Free Flashlight app from iHandy and cannot turn the light off.
    iPhone 4s, iOS 6.
    I've tried everything: Power Down, Reboot, delete to uninstall and reinstall app, turn off in tray, etc.
    Nothing works.

    I cannot see your screen shots for some reason, but here's a suggestion:
    Open iTunes on your computer, look at your playlists there.  Go to your "Voice Memos" playlist, delete all its contents, and then sync your iPhone to iTunes.

  • How do I remove or at least "hide" purchased apps from my iPad.  With the help of Apple support by phone, I "hid" unwanted purchased apps from my Macbook Pro; when I returned to the iPad all unwanted purchases were still there?

    How do I remove or at least "hide" unwanted purchased apps from my Ipad?  Posed the question to Apple senior support this evening and we went to the Itunes store and removed all the unwanted icons from the collection of hundreds, one by one.  Cleaned up the Mac Pro nicely, leaving about 10 apps I wanted to keep.  Went back to the Ipad and they were all still there.  Senior support hasn't gotten back to me yet.  Any ideas?  Thanks. kjbarnett

    Since hiding them on your Mac (you did it via the Purchased link under Quicklinks on the right-hand side of the store homepage ?) have you tried logging out and back into your account on your iPad ? I haven't tried it on the IOS 7.1.1, but with iOS 7 there was (or maybe still is) a 'feature' that meant that after hiding them you then needed to log out and back in on each iOS device for them to become hidden from the Purchased tab in the App Store app on it - tap on your id in Settings > iTunes & App Store and log out and then log back in.

  • I got n-track long time ago with my apple id... how can transfer app from that apple id to the apple id im using now?

    i got n-track long time ago with my apple id... how can transfer app from that apple id to the apple id im using now?

    Content and Apple IDs -
    Content is forever tied to the Apple ID that bought it. Apple does not transfer content from one Apple ID to another. Apple does not merge Apple IDs. You will never be able to access your content bought with one Apple ID with a new Apple ID.

  • Where is the value of report repository stored in the database?

    Hi all,
    One of our developers is trying to write a code that would send the output report (pdf)of a process through mail, typical work flow stuff.But the problem is that we are not supposed to hard code the value of report repositiry from where the report has to be picked.can anybody suggest a table in the database from where the value of report repository can be queried.
    we tried using
    select reportrepositorypt from pswebprofile.
    but this doesnt return the correct path. we went to PIA->peopletools->webprofile ->webprofie configuration
    here we updated the value in report repository field and saved it and queried again.
    But this didnt solve our problem.
    Its showing the previous value which is different from the actual report repository path.
    all the servers are in solaris box.
    please suggets.
    Thanks!

    Right now, I am trying to send a PDF (XML Publisher report) as an email to our vendors (it is their ACH Advice).
    What I have done so far is: Created an App Engine, one step to populate a state record with run control information and the second step that runs XML Publisher and creates PDF report(s) which are published to the Report Repository and saved to a file on our network. Now I think I just need to create a third step to recall the PDF(s) and send the PDF(s) out as emails to our vendors.
    I have found that the PDF information from Report Repository is stored in the Database in the CDM_LIST_VW record (this is a view and the main underlying table is CDM_LIST, but this contains what I need for now, so I'm going to try using it first). The Report ID is stored in the CONTENTID field and the Report Description (description shown on the Report Repository -- which in our case contains the email address) is stored in the CONTENT_DESCR field. So I am going to try over the next week to write the logic to query the CDM_LIST_VW for the data needed for the email address and the ReportID to go and grab the file....The hardest part is finding the actual file but I am hoping that I can also find a URL on that table. I'd pull the file from the network, but XML Publisher writes them out into numbered folders where all the PDFs are named the XML Report Defn - thus same name). I have not tried any of this yet, but am hoping I'm on the right path.
    I hope this helped answer your question.
    Good Luck!
    Jennifer

Maybe you are looking for

  • How can I transfer contents of hard drive from one iMac to another,

    Hi I have two iMacs (older G3 CRT) both are running OSX 10.2.8. I want to copy the contents of the hard drive on iMac "A' to the hard drive of iMac "B". Can I do this,,, How can this be accomplished ??

  • Payment schedule report

    Dear friend, i wants to know payment schedule repoprt where Sr.No. Project name       Building name           apr-09           may-09        Jun-09     Jul-09      Aug-09 1      company code            plant name              %                %      

  • Update query run for too long

    Oracle Database 11.1.0.7.0 UPDATE DTC SET NEW_KY=(SELECT DCTT.KY FROM DCTT WHERE DCTT.KY = DTC.KY), NEW_KY_ID=(SELECT DCTT.KY_ID FROM DCTT WHERE DCTT.KY = DTC.KY) where EXISTS ( SELECT 1 FROM DCTT WHERE DCTT.KY = DTC.KY and NEW_KY IS NULL ) and rownu

  • Uninstalling Previous versions of components

    I have presently upgraded my Photoshop to CS4, but my other Adobe products (Dreamweaver, Premiere pro, Encore) are CS3 At this moment Bridge CS4 has been installed alongside Bridge CS3 My question is, can I uninstall Bridge CS3 since I will no longer

  • Extending sales order change BAPI and updating custom fields

    Hi i added 3 new fields into VA01/02/03 screen.i added at the header level in the additional data tab B area and appended them in VBAK table. i want to change these values using sales order change BAPI.i added the fields in the structure VBAKKOZ,VBAK