From 59e555d8a4e50c329ac3324696b57b5cecaf5081 Mon Sep 17 00:00:00 2001 From: Ottmar Gobrecht Date: Mon, 30 Dec 2019 17:18:42 +0100 Subject: [PATCH] prepare v2.1.0 --- .gitignore | 1 - README.md | 9 +++++---- plex_install.sql | 35 ++++++++++++++++++++++++++++------- src/PLEX.pkb | 26 +++++++++++++++++++++++--- src/PLEX.pks | 9 +++++---- src/plex_test.sql | 18 ++++++++++++++++++ 6 files changed, 79 insertions(+), 19 deletions(-) create mode 100644 src/plex_test.sql diff --git a/.gitignore b/.gitignore index b07950a..0e2217d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ *.zip node_modules -plex_test.sql test_export diff --git a/README.md b/README.md index ebd6f06..2cb2711 100644 --- a/README.md +++ b/README.md @@ -45,12 +45,13 @@ INSTALLATION CHANGELOG -- 2.1.0 (2019-xx-xx) +- 2.1.0 (2019-12-30) - Function BackApp: - - New parameter to include ORDS modules + - New parameter to include ORDS modules (p_include_ords_modules) + - New parameter to remove the outer column list on views, which is added by the compiler (p_object_view_remove_col_list); this was done in the past implicitly and can now be switched off; thanks to twitter.com/JKaschuba for the hint - Object DDL: Comments for tables and views are now included - Script templates: Improved export speed by using a base64 encoded zip file instead of a global temporary table to unload the files - - Fixed: Unable to export JAVA objects on systems with 30 character object names + - Fixed: Unable to export JAVA objects on systems with 30 character object names; thanks to twitter.com/JKaschuba for the hint - Fixed: Views appears two times in resulting collection, each double file is postfixed with "_2" and empty - Fixed: Tables and indices of materialized view definitions are exported (should be hidden) - New function to_base64: convert BLOB into base64 encoded CLOB - this is helpful to download a BLOB file (like a zip file) with SQL*Plus @@ -80,7 +81,7 @@ SIGNATURE ```sql PACKAGE PLEX AUTHID current_user IS c_plex_name CONSTANT VARCHAR2(30 CHAR) := 'PLEX - PL/SQL Export Utilities'; -c_plex_version CONSTANT VARCHAR2(10 CHAR) := '2.0.2'; +c_plex_version CONSTANT VARCHAR2(10 CHAR) := '2.1.0'; c_plex_url CONSTANT VARCHAR2(40 CHAR) := 'https://github.com/ogobrecht/plex'; c_plex_license CONSTANT VARCHAR2(10 CHAR) := 'MIT'; c_plex_license_url CONSTANT VARCHAR2(60 CHAR) := 'https://github.com/ogobrecht/plex/blob/master/LICENSE.txt'; diff --git a/plex_install.sql b/plex_install.sql index 9596aac..ec19847 100644 --- a/plex_install.sql +++ b/plex_install.sql @@ -38,7 +38,7 @@ END; prompt Compile package plex (spec) CREATE OR REPLACE PACKAGE PLEX AUTHID current_user IS c_plex_name CONSTANT VARCHAR2(30 CHAR) := 'PLEX - PL/SQL Export Utilities'; -c_plex_version CONSTANT VARCHAR2(10 CHAR) := '2.0.2'; +c_plex_version CONSTANT VARCHAR2(10 CHAR) := '2.1.0'; c_plex_url CONSTANT VARCHAR2(40 CHAR) := 'https://github.com/ogobrecht/plex'; c_plex_license CONSTANT VARCHAR2(10 CHAR) := 'MIT'; c_plex_license_url CONSTANT VARCHAR2(60 CHAR) := 'https://github.com/ogobrecht/plex/blob/master/LICENSE.txt'; @@ -76,12 +76,13 @@ INSTALLATION CHANGELOG -- 2.1.0 (2019-xx-xx) +- 2.1.0 (2019-12-30) - Function BackApp: - - New parameter to include ORDS modules + - New parameter to include ORDS modules (p_include_ords_modules) + - New parameter to remove the outer column list on views, which is added by the compiler (p_object_view_remove_col_list); this was done in the past implicitly and can now be switched off; thanks to twitter.com/JKaschuba for the hint - Object DDL: Comments for tables and views are now included - Script templates: Improved export speed by using a base64 encoded zip file instead of a global temporary table to unload the files - - Fixed: Unable to export JAVA objects on systems with 30 character object names + - Fixed: Unable to export JAVA objects on systems with 30 character object names; thanks to twitter.com/JKaschuba for the hint - Fixed: Views appears two times in resulting collection, each double file is postfixed with "_2" and empty - Fixed: Tables and indices of materialized view definitions are exported (should be hidden) - New function to_base64: convert BLOB into base64 encoded CLOB - this is helpful to download a BLOB file (like a zip file) with SQL*Plus @@ -2561,7 +2562,7 @@ You need to provide three parameters: - zipfile: path to the export zip file - this will be created with the spool command - app_id: the APEX app ID you want to export - only relevant when you have APEX installed -Example call for Windows (for Linux or Mac replace ^ with \): +Example call for Windows: echo exit | sqlplus -S app_schema/password@connection ^ {{@}}export_app_custom_code.sql ^ @@ -2754,8 +2755,28 @@ if %errorlevel% neq 0 exit /b %errorlevel% PROCEDURE install_sql_file IS BEGIN - v_file_template := q'^-- Template generated by PLEX version {{PLEX_VERSION}} --- More infos here: {{PLEX_URL}} + v_file_template := q'^/******************************************************************************* +Template generated by PLEX version {{PLEX_VERSION}} +More infos here: {{PLEX_URL}} + +You need to provide five parameters: +- logfile: path to the logfile for the script console output +- app_id: the APEX app ID you want to have for the installation +- app_alias: the alias you want to have for your app +- app_schema: the parsing schema for your app +- app_workspace: the workspace where your app should be installed + +Example call for Windows: + + echo exit | sqlplus -S app_schema/password@connection ^ + {{@}}install_app_custom_code.sql ^ + my_logfile.log ^ + 100 ^ + MY_APP_ALIAS ^ + MY_APP_SCHEMA ^ + MY_APP_WORKSPACE + +*******************************************************************************/ set timing on define on timing start INSTALL_APP diff --git a/src/PLEX.pkb b/src/PLEX.pkb index 836e035..04c21d7 100644 --- a/src/PLEX.pkb +++ b/src/PLEX.pkb @@ -1978,7 +1978,7 @@ You need to provide three parameters: - zipfile: path to the export zip file - this will be created with the spool command - app_id: the APEX app ID you want to export - only relevant when you have APEX installed -Example call for Windows (for Linux or Mac replace ^ with \): +Example call for Windows: echo exit | sqlplus -S app_schema/password@connection ^ {{@}}export_app_custom_code.sql ^ @@ -2171,8 +2171,28 @@ if %errorlevel% neq 0 exit /b %errorlevel% PROCEDURE install_sql_file IS BEGIN - v_file_template := q'^-- Template generated by PLEX version {{PLEX_VERSION}} --- More infos here: {{PLEX_URL}} + v_file_template := q'^/******************************************************************************* +Template generated by PLEX version {{PLEX_VERSION}} +More infos here: {{PLEX_URL}} + +You need to provide five parameters: +- logfile: path to the logfile for the script console output +- app_id: the APEX app ID you want to have for the installation +- app_alias: the alias you want to have for your app +- app_schema: the parsing schema for your app +- app_workspace: the workspace where your app should be installed + +Example call for Windows: + + echo exit | sqlplus -S app_schema/password@connection ^ + {{@}}install_app_custom_code.sql ^ + my_logfile.log ^ + 100 ^ + MY_APP_ALIAS ^ + MY_APP_SCHEMA ^ + MY_APP_WORKSPACE + +*******************************************************************************/ set timing on define on timing start INSTALL_APP diff --git a/src/PLEX.pks b/src/PLEX.pks index 414c062..ab22f66 100644 --- a/src/PLEX.pks +++ b/src/PLEX.pks @@ -1,6 +1,6 @@ CREATE OR REPLACE PACKAGE PLEX AUTHID current_user IS c_plex_name CONSTANT VARCHAR2(30 CHAR) := 'PLEX - PL/SQL Export Utilities'; -c_plex_version CONSTANT VARCHAR2(10 CHAR) := '2.0.2'; +c_plex_version CONSTANT VARCHAR2(10 CHAR) := '2.1.0'; c_plex_url CONSTANT VARCHAR2(40 CHAR) := 'https://github.com/ogobrecht/plex'; c_plex_license CONSTANT VARCHAR2(10 CHAR) := 'MIT'; c_plex_license_url CONSTANT VARCHAR2(60 CHAR) := 'https://github.com/ogobrecht/plex/blob/master/LICENSE.txt'; @@ -38,12 +38,13 @@ INSTALLATION CHANGELOG -- 2.1.0 (2019-xx-xx) +- 2.1.0 (2019-12-30) - Function BackApp: - - New parameter to include ORDS modules + - New parameter to include ORDS modules (p_include_ords_modules) + - New parameter to remove the outer column list on views, which is added by the compiler (p_object_view_remove_col_list); this was done in the past implicitly and can now be switched off; thanks to twitter.com/JKaschuba for the hint - Object DDL: Comments for tables and views are now included - Script templates: Improved export speed by using a base64 encoded zip file instead of a global temporary table to unload the files - - Fixed: Unable to export JAVA objects on systems with 30 character object names + - Fixed: Unable to export JAVA objects on systems with 30 character object names; thanks to twitter.com/JKaschuba for the hint - Fixed: Views appears two times in resulting collection, each double file is postfixed with "_2" and empty - Fixed: Tables and indices of materialized view definitions are exported (should be hidden) - New function to_base64: convert BLOB into base64 encoded CLOB - this is helpful to download a BLOB file (like a zip file) with SQL*Plus diff --git a/src/plex_test.sql b/src/plex_test.sql new file mode 100644 index 0000000..1c0ed6e --- /dev/null +++ b/src/plex_test.sql @@ -0,0 +1,18 @@ +-- Inline function because of boolean parameters (needs Oracle 12c or higher). +-- Alternative create a helper function and call that in a SQL context. +WITH + FUNCTION backapp RETURN BLOB IS + BEGIN + RETURN plex.to_zip(plex.backapp( + p_app_id => 100, + p_include_object_ddl => true, + p_include_ords_modules => true, + p_include_data => true, + p_include_templates => true)); + END backapp; +SELECT backapp FROM dual; +/ + +select * from table(plex.view_runtime_log); + +