Liquibase : Deploying Oracle Application Express (APEX) Applications
This article demonstrates how to deploy Oracle Application Express (APEX) applications using Liquibase.
oracle miscconfigurationintermediate
by OracleDba
14 views
This article demonstrates how to deploy Oracle Application Express (APEX) applications using Liquibase.
1234567891011121314151617181920212223
Rem Windows
set PATH=c:\software\liquibase\liquibase-3.10.0;%PATH%
set JAVA_HOME=c:\Program Files\Java\jre1.8.0_221
# Linux
export PATH=/u01/software/liquibase/liquibase-3.10.0:$PATH
export JAVA_HOME=/u01/java/latest
driver: oracle.jdbc.OracleDriver
classpath: /software/liquibase/liquibase-3.10.0/lib
url: jdbc:oracle:thin:@localhost:1521/pdb1
username: apex_priv_user
password: apex_priv_user
liquibaseProLicenseKey: {put your license key here}
driver: oracle.jdbc.OracleDriver
classpath: /software/liquibase/liquibase-3.10.0/lib
url: jdbc:oracle:thin:@localhost:1521/pdb1
username: dev_ws
password: dev_ws
liquibaseProLicenseKey: {put your license key here}
sqlplus -H12345678910111213141516171819202122232425
+--- normal
| +--- changelogs
| | +--- changelog_master_dev_ws.xml
| | +--- changelog_setup_demo_app_lb_pro.xml
| | +--- changelog_setup_tab1.xml
| | +--- changelog_setup_tab2.xml
| +--- scripts
| | +--- demo_app_f101.sql
| | +--- get_tab1_count.sql
| | +--- tab1.sql
| | +--- tab1_seq.sql
| | +--- tab2.sql
| | +--- tab2_seq.sql
+--- privileged
| +--- changelogs
| | +--- changelog_create_dev_workspace_lb_pro.xml
| | +--- changelog_create_dev_workspace_user.xml
| | +--- changelog_master.xml
| +--- scripts
| | +--- create_apex_priv_user.sql
| | +--- create_dev_workspace.sql
| | +--- create_dev_workspace_user.sql
| | +--- remove_apex_priv_user.sql
| | +--- remove_dev_workspace.sql
| | +--- remove_dev_workspace_user.sql12
create user apex_priv_user identified by apex_priv_user quota unlimited on users;
grant dba, apex_administrator_role to apex_priv_user;12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
create user dev_ws identified by dev_ws quota unlimited on users;
grant create session, create cluster, create dimension, create indextype,
create job, create materialized view, create operator, create procedure,
create sequence, create synonym, create table,
create trigger, create type, create view to dev_ws;
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.9.xsd">
<changeSet author="tim" id="create_dev_workspace_user">
<sqlFile dbms="oracle"
endDelimiter=";"
path="../scripts/create_dev_workspace_user.sql"
relativeToChangelogFile="true"
splitStatements="true"
stripComments="false"/>
</changeSet>
</databaseChangeLog>
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.9.xsd">
<changeSet author="tim" id="create_dev_workspace_v1"
runWith="sqlplus"
>
<sqlFile dbms="oracle"
path="../scripts/create_dev_workspace.sql"
relativeToChangelogFile="true"/>
</changeSet>
</databaseChangeLog>
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.9.xsd">
<include file="./changelog_create_dev_workspace_user.xml" relativeToChangelogFile="true"/>
<include file="./changelog_create_dev_workspace_lb_pro.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
Rem Windows
liquibase --defaultsFile="c:\software\liquibase\apex_priv_user_liquibase.properties" ^
--changelog-file="c:\git\oraclebase\liquibase_apex_demo\privileged\changelogs\changelog_master.xml" ^
update
# Linux
liquibase --defaultsFile="/u01/software/liquibase/apex_priv_user_liquibase.properties" \
--changelog-file="/u01/git/oraclebase/liquibase_apex_demo/privileged/changelogs/changelog_master.xml" \
update123456789101112131415161718192021222324252627282930313233343536
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.9.xsd">
<changeSet author="tim" id="demo_app_v1" runOnChange="true"
runWith="sqlplus"
>
<sqlFile dbms="oracle"
path="../scripts/demo_app_f101.sql"
relativeToChangelogFile="true"/>
</changeSet>
</databaseChangeLog>
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.9.xsd">
<include file="./changelog_setup_tab1.xml" relativeToChangelogFile="true"/>
<include file="./changelog_setup_tab2.xml" relativeToChangelogFile="true"/>
<include file="./changelog_setup_demo_app_lb_pro.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
Rem Windows
liquibase --defaultsFile="c:\software\liquibase\dev_ws_liquibase.properties" ^
--changelog-file="c:\git\oraclebase\liquibase_apex_demo\normal\changelogs\changelog_master_dev_ws.xml" ^
update
# Linux
liquibase --defaultsFile="/u01/software/liquibase/dev_ws_liquibase.properties" \
--changelog-file="/u01/git/oraclebase/liquibase_apex_demo/normal/changelogs/changelog_master_dev_ws.xml" \
update123456789
-- Run as the APEX_PRIV_USER.
begin
apex_instance_admin.remove_workspace('DEV_WS', 'N', 'N');
end;
/
-- Run as another privileged user.
drop user dev_ws cascade;
drop user apex_priv_user cascade;Please to add comments
No comments yet. Be the first to comment!