Init
This commit is contained in:
79
MARS_Packages/REL01/MARS-1096/install_mars1096.sql
Normal file
79
MARS_Packages/REL01/MARS-1096/install_mars1096.sql
Normal file
@@ -0,0 +1,79 @@
|
||||
-- ===================================================================
|
||||
-- MARS-1096 INSTALL SCRIPT: Extend A_PROCESS_LOG and Enable Partitioning
|
||||
-- ===================================================================
|
||||
-- Purpose:
|
||||
-- - Extend log_message column from VARCHAR2(4000) to VARCHAR2(20000)
|
||||
-- - Convert table to daily interval partitioning on log_timestamp
|
||||
-- - Preserve all existing data during conversion
|
||||
-- Author: Grzegorz Michalski
|
||||
-- Date: 2025-12-03
|
||||
-- Version: 1.0.0
|
||||
-- ===================================================================
|
||||
|
||||
-- Dynamic spool file generation (using SYS_CONTEXT - no DBA privileges required)
|
||||
var filename VARCHAR2(100)
|
||||
BEGIN
|
||||
:filename := 'INSTALL_MARS_1096_' || SYS_CONTEXT('USERENV', 'CON_NAME') || '_' || TO_CHAR(SYSDATE,'YYYYMMDD_HH24MISS') || '.log';
|
||||
END;
|
||||
/
|
||||
column filename new_value _filename
|
||||
select :filename filename from dual;
|
||||
spool &_filename
|
||||
|
||||
SET ECHO OFF
|
||||
SET TIMING ON
|
||||
SET SERVEROUTPUT ON SIZE UNLIMITED
|
||||
SET PAUSE OFF
|
||||
|
||||
PROMPT =========================================================================
|
||||
PROMPT MARS-1096: Extend A_PROCESS_LOG and Enable Daily Partitioning
|
||||
PROMPT =========================================================================
|
||||
PROMPT
|
||||
PROMPT This script will:
|
||||
PROMPT - Extend log_message column from VARCHAR2(4000) to VARCHAR2(20000)
|
||||
PROMPT - Convert A_PROCESS_LOG table to daily interval partitioning
|
||||
PROMPT - Create backup table A_PROCESS_LOG_OLD during conversion
|
||||
PROMPT - Migrate all existing records to partitioned structure
|
||||
PROMPT - Automatically cleanup backup table after verification
|
||||
PROMPT
|
||||
PROMPT Expected Duration: 1-2 minutes (depends on data volume)
|
||||
PROMPT =========================================================================
|
||||
|
||||
-- Confirm installation with user
|
||||
ACCEPT continue CHAR PROMPT 'Type YES to continue with installation, or Ctrl+C to abort: '
|
||||
WHENEVER SQLERROR EXIT SQL.SQLCODE
|
||||
BEGIN
|
||||
IF '&continue' IS NULL OR TRIM('&continue') IS NULL OR UPPER(TRIM('&continue')) != 'YES' THEN
|
||||
RAISE_APPLICATION_ERROR(-20001, 'Installation aborted by user');
|
||||
END IF;
|
||||
END;
|
||||
/
|
||||
WHENEVER SQLERROR CONTINUE
|
||||
|
||||
PROMPT
|
||||
PROMPT =========================================================================
|
||||
PROMPT Step 1: Extend Column and Enable Partitioning
|
||||
PROMPT =========================================================================
|
||||
@@02_MARS_1096_extend_and_partition.sql
|
||||
|
||||
PROMPT
|
||||
PROMPT =========================================================================
|
||||
PROMPT Step 2: Verify Partitioning
|
||||
PROMPT =========================================================================
|
||||
@@04_MARS_1096_verify_partitioning.sql
|
||||
|
||||
PROMPT
|
||||
PROMPT =========================================================================
|
||||
PROMPT Step 3: Cleanup Backup Table
|
||||
PROMPT =========================================================================
|
||||
@@05_MARS_1096_cleanup_backup.sql
|
||||
|
||||
PROMPT
|
||||
PROMPT =========================================================================
|
||||
PROMPT MARS-1096 Installation - COMPLETED
|
||||
PROMPT =========================================================================
|
||||
PROMPT Check the log file for complete installation details.
|
||||
PROMPT =========================================================================
|
||||
|
||||
spool off
|
||||
quit;
|
||||
Reference in New Issue
Block a user