I hear from many classic developers that APEX has a weakness of version control. Well, it depends how you see a version control. In side APEX installation, there a packaged application to zip your application and store it in the database as part of version controls.
I prefer to have this outside of APEX and to have the database backed up as well as the application and versioned (in this case by time stamp).
I use linux, if you would like to have the same for window, let me know, I can create a bat file for you 🙂
I have created a directory for APEX application and one for DB, this works with APEX 5.x.
Create a file and call it appBackup.sh and put the below code to it. This exports the application just like you to inside APEX development environment.
#!/bin/sh # Apex Install directory APEX_HOME=/home/oracle/apex # Required Info export APEX_HOME BACKUP_DEST=/media/apexapp/ApexBackup/apex # APEX back up destination export BACKUP_DEST ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/db_1 # Oracle home export ORACLE_HOME # Export runs from here cd $APEX_HOME/utilities echo Running Export....... JAVA_HOME=/home/oracle/app/oracle/product/12.1.0/dbhome_1/jdk/jre/bin export JAVA_HOME java oracle.apex.APEXExport -db localhost:1521/orcl -user <apexuser> -password <apexpwd> -applicationid 139 DATE=$(date +"%Y%m%d%H%M") # Add timestamp to the application and move it the APEX folder mv f139.sql $BACKUP_DEST/f139_$DATE.sql echo removed
exp apexuser/apexpwd file=apexdmp.dmp DATE=$(date +"%Y%m%d%H%M") mv apexdmp.dmp db/apexdmp_$DATE.dmp
now create a shell file to run both together with versionAPEX.sh and put the below code to it.
sh appBackup.sh sh dbBackup.sh
The apexuser is the APPLICATION PARSING SCHEMA user.
Now every time you run versionAPEX.sh, you application is exported and backed up with data. you can revert anything anytime from your versioned app.
Notes: To keep the track on changes in the application, you should use the Comment property of the items/page.
Finally the APEX export a SQL file, it means you can use any software to compare the changes between versions.
Hi!
You do not explain the apexuser. Is this the parsing schema of the application so you grab the data the application works with in the dbExport? Or is it the workspace user?
Mathias
Hi Mathias,
In both cases is the APP_PARSING_SCHEMA. With the first script you export the application, just like you do inside APEX dev environment. The second script exports the parsing schema only.
regards,
Mazin
Hi,
may I have bat file for windows as you proposed above?
Regards,
František
Sure, send me your email address I will create one for you.
Hi! I know thisѕ is somewhat off topic but I was wondering if you knew wһere Ӏ could lοcate a ϲaptcha
plugin for my comment form? I’m using the same blog platform ass yours and I’m having problems
finding ᧐ne? Thanks a lot!
You mean in your blog or in APEX? in your blog you should download the plugin for wp.