Thusira Dissanayake
Thusira Dissanayake

Reputation: 153

Deploy one Oracle APEX application to multiple schemas

I have a oracle apex application resides in schema "A" initially and want to deploy it in two seperate schemas "Z1" and "Z2", When the deployment time comes, can we change the associated schema(parsing schema) dynamically to Z1 or Z2 while deploying?

Also there are schema specific logics in the application which need to be executed while the application installed in Z1 or Z2. How do we handle such situation?

Upvotes: 1

Views: 1984

Answers (1)

Tom
Tom

Reputation: 7028

Parsing Schema

When installing an application you can set the parsing schema as one of the installation steps. When done through scripts, you can use apex_application_install.set_schema. Note that the schema should already be mapped to the workspace.
Documentation on apex_application_install.set_schema

Handling specific functionality

By using Build Statusses

To handle specific functionality, you can use build options in your application. Eg: in your dev environment's application, create the processes on a page , and set the build option to each process. You create the build options yourself, and thus you could name one "Z1" and another "Z2". You can then export a baseline version of the application and export build statusses to toggle options on or off - to be ran after application install. (NOTE: exporting components and expect to install them will require workspaces with identical IDs...)
Documentation on build options (application builder user guide > deploying an application)

By using conditions / items

If for some reason build statusses don't scratch your itch, you can still handle this conditionally. In the end, build statusses are conditions to be checked by apex when evaluating what to render or run.
So you can still use, for example, an application item which is checked in the condition of all specific components.
This item could be filled in when users log on and retrieved from a parameter table for example. I would advise against hardcoding the value in the application and making different exports though.
Conditions could then look like this (with type = PLSQL Expression): :AI_ENVIRONMENT = 'Z1'

There's a case to make for both options - it'll depend on your preference or

Upvotes: 2

Related Questions