> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexagon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# deployAPEX

> Deploys an Oracle APEX application (produced by a build workflow using the buildAPEX plugin operation) to a target database. This operation manages de

Deploys an Oracle APEX application (produced by a build workflow using the buildAPEX plugin operation) to a target database. This operation manages deployment of builds produced by both the Full Deployment and Package-Based Deployment models. 

Any supporting database objects for the application are outside the scope of this operation but can be managed in a separate project and workflows using the [JDBC](https://docs.flexagon.com/flexdeploy-10-0-documentation/flexdeploy-plugin-guides/flexdeploy-jdbc-plugin-guide.md) or [Oracle Database](https://docs.flexagon.com/flexdeploy-10-0-documentation/flexdeploy-plugin-guides/flexdeploy-oracle-database-plugin-guide.md) Plugin.

This plugin supports deploying the same APEX application to the same database. This requires setting the Offset. This situation is not typical, so most often the offset can be ignored.

* If the application has never been deployed and you do not currently have an offset, the plugin can generate the offset. Just select `Use APEX Offset` (`FDAPEX_USE_OFFSET`), make sure you note the offset value used and set the property `APEX Offset Value` (`FDAPEX_OFFSET)` for the next deployment.  

* If you know the offset, select `Use APEX Offset` (`FDAPEX_USE_OFFSET)` and set the property `APEX Offset Value` (`FDAPEX_OFFSET`).

# Target Properties

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Property Name**</th><th>**Property Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Oracle SQLcl Home</td><td>`FD_SQLCL_HOME`</td><td>Yes</td><td>Folder where SQLcl is installed.Make sure that the endpoint Java Home is a high enough version for your SQLcl version.</td></tr><tr><td>APEX User</td><td>`FDAPEX_USER`</td><td>Yes</td><td>Provide database user APEX\_xxxxx (APEX user requires INHERIT Privilege) or owner (parsing schema) of the application for export and import operations. You can use system user as well.</td></tr><tr><td>APEX Password</td><td>`FDAPEX_PASSWORD`</td><td>Yes</td><td>Password for APEX User.  </td></tr><tr><td>Run Application Only</td><td>`FDAPEX_RUN_APPLICATION_ONLY`</td><td>No</td><td>Deploy with Run Application Only as build status.</td></tr><tr><td>Oracle Database URL</td><td>`FDORA_URL`</td><td>Yes</td><td>JDBC URL for Oracle database. For example:<ul local-id="51895c6a5e88"><li local-id="68bc6a9d39fa">jdbc:oracle:thin:@HOSTNAME:PORT:SID or</li><li local-id="e10b88237c14">jdbc:oracle:thin:@//HOSTNAME:PORT/SERVICENAME</li></ul>Connecting to Oracle Autonomous DatabaseYou will need client credential zip file (wallet) to connect with Oracle Autonomous Database on Oracle cloud. You can download wallet zip file from Oracle Cloud, you will need admin userid and password to perform this download. See [Download Client Credentials (Wallets)](https://docs.oracle.com/en-us/iaas/autonomous-database/doc/download-client-credentials.html) for more details on how to download wallet file.<ul><li>**Since FlexDeploy 9.0.0.9 with Oracle Wallet Credential Type :** Instead of maintaining the wallet zip file under the file system, you can now store the wallet zip as an Oracle Credential Type in FlexDeploy. This allows for secure storage and use of the wallet.<ul><li>Use the URL syntax in the following format: `jdbc:oracle:thin:@service_low?TNS_ADMIN={{FDORACLE_WALLET_FILE}}` is replaced with the temporary wallet folder path during execution. Once execution is completed, the temporary file is cleaned up automatically.</li></ul></li><li>**Before FlexDeploy 9.0.0.9**<ul><li>You must make sure that only authorized users have access to these wallet files. Unzip the client credentials zip file (**wallet\_*****databasename*****.zip**) on FlexDeploy server and/or endpoint where it will be used. For example, /home/flexdeploy/.wallets/\<**wallet\_*****databasename***> is folder where specific wallet file was unzipped. Make sure to secure this folder to FlexDeploy and/or Endpoint user, so that it is not readable by all users.</li><li>We recommend using Oracle Wallet Credential Type for better security and easier management of Wallet usage.</li><li>**Database URL Syntax **: jdbc:oracle:thin:@service\_high?TNS\_ADMIN=/home/flexdeploy/.wallets/\<**wallet\_*****databasename***><ul><li>service\_high is one of the entries in the tnsnames.ora file where client credentials zip file was unzipped. See [Predefined Database Service Names for Autonomous Database](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/connect-predefined-generic.html) for details on services.</li><li>TNS\_ADMIN value in URL points to the location of the **unzipped client credentials zip file**.</li></ul></li><li>**Database URL Long Connection String Format Syntax **: `jdbc:oracle:thin:@(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=<hostname>))(connect_data=(service_name=<serice_name>))(security=(ssl_server_cert_dn="CN=<hostname>,OU=Oracle BMCS US,O=Oracle Corporation,L=Redwood City,ST=California,C=US")))`<ul><li>Examples for the same can be found [here](https://www.oracle.com/database/technologies/java-connectivity-to-atp.html).</li></ul></li></ul></li></ul>If using the Oracle Database Plugin with ADW or ATP databases , use the \_low connection. The \_medium and \_high connections can sometimes throw error** ORA-12839: cannot modify an object in parallel after modifying it.**</td></tr><tr><td>Oracle Wallet File</td><td>`FDORACLE_WALLET_FILE`</td><td>No</td><td>**Since 9.0.0.9** - Provide the Oracle Wallet file, see[Credential Type - Oracle Wallet](https://docs.flexagon.com/flexdeploy-10-0-documentation/flexdeploy-users-guide/administration/credentials/credential-types/credential-type-oracle-wallet.md) for more details.</td></tr></tbody></table>

# Project Properties

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Property Name**</th><th>**Property Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>APEX Workspace Name</td><td>`FDAPEX_WORKSPACE_NAME`</td><td>Yes</td><td>APEX Workspace Name. Provide uppercase name. This defaults to FD\_INSTANCE\_CODE expression, so if you keep instance code same as your workspace, you will not need to change default value.If Workspace id is different in each environment, FlexDeploy will still be able to handle that situation by deriving workspace id from workspace name provided.</td></tr><tr><td>Parsing Schema</td><td>`FDAPEX_DB_SCHEMA`</td><td>No</td><td>Parsing schema (owner) of APEX application.If not provided, value in exported sql file will be used, which means that schema name will be same in all environments.</td></tr><tr><td>APEX Application Id</td><td>`FDAPEX_APPLICATION_ID`</td><td>No</td><td>Identifying number of the application. If not specified, workspace name and application name is used to query application id, otherwise new application id will be generated.</td></tr><tr><td>APEX Application Name</td><td>`FDAPEX_APPLICATION_NAME`</td><td>No</td><td>The name of the application to deploy. This is used to derive application id if application id and Application Alias are not provided.</td></tr><tr><td>APEX Application Alias</td><td>`FDAPEX_ALIAS`</td><td>No</td><td>APEX Application Alias. Sets the alias for the application during import. If not provided, the alias from the exported SQL files is used.</td></tr><tr><td>Use APEX Offset</td><td>`FDAPEX_USE_OFFSET`</td><td>No</td><td>Determines if the plugin will attempt to set the Offset.</td></tr><tr><td>APEX Offset value</td><td>`FDAPEX_OFFSET`</td><td>No</td><td>The offset value during application import. This value is used to ensure that the metadata for the Application Express application definition does not collide with other metadata on the instance.</td></tr><tr><td>Backup files prior to deploy</td><td>`FD_BACKUP_FILES_PRIOR_TO_DEPLOY`</td><td>No</td><td>Indicates whether a backup of the files should be performed prior to deploying the files.For more information on the backups repository see: [FlexDeploy Backups Repository](https://docs.flexagon.com/flexdeploy-10-0-documentation/flexdeploy-installation-guide/advanced/flexdeploy-backups-repository.md)Allows backing up application before deployment, ensuring a smooth rollback if necessary. This was added in 9.0.0.2. See [Build & Deploy Projects](https://docs.flexagon.com/flexdeploy-10-0-documentation/flexdeploy-users-guide/workflow-request-execution/build-deploy-projects.md) for details on performing deployment rollback.</td></tr></tbody></table>

# Artifacts

This operation consumes artifacts from the artifacts repository.

# Endpoint Selection

This operation will select all available endpoints associated to the Target. You can use any Endpoint where SQLcl is installed and has connectivity to database using JDBC URL. We recommend use of LOCALHOST endpoint if connectivity can be established between FlexDeploy and your APEX database.

# Endpoint Execution 

This operation will execute on any one of the selected endpoints and will be random in the determination of which one.
