Here’s a quick APEX tip. There are heaps of cool things within APEX to ensure you never lose or accidentally overwrite your applications, such as automatic backups and working copies.
But if you share my levels of paranoia 😁when it comes to worrying about the loss of code, data or anything else, here’s a simple script I use to regularly take a copy of all of the APEX workspace definitions and all of the applications within those workspaces.
Run it via SQLcl as an appropriate administrative user
with ws as
( select workspace_id
from apex_workspaces
where workspace not in (
'COM.ORACLE.CUST.REPOSITORY',
'COM.ORACLE.APEX.REPOSITORY',
'INTERNAL')
)
select 'apex export -expworkspace -workspaceid '||workspace_id
from ws
union all
select 'apex export -workspaceid '||workspace_id
from ws
set pages 0
set lines 200
set trimspool on
set feedback off
spool /tmp/backup_the_apex_universe.sql
/
spool off
@/tmp/backup_the_apex_universe.sql
You’ll get an export file for each workspace, and one for every app in your APEX instance.
Note: The blank line after “from ws” is deliberate and required.




Leave a reply to Connor McDonald Cancel reply