Add post-install configuration for ROA Windows setup

New files:
- 08-post-install-config.ps1: Creates ROAUPDATE folders (54 dirs),
  Oracle DIRECTORY objects, SERVER_INFO config, scheduler jobs
- directories-roaupdate.sql: 54 UPD_* directory objects for PACK_UPDATE
- server-info-init.sql: Encoded passwords, paths, email settings
- scheduler-jobs.sql: UPDATEROA_ZILNIC, UPDATERTVAI_ZILNIC (disabled)
- auth-detalii-init.sql: Customer ID for licensing

Updates:
- RunAll.cmd: Added step 6 (08-post-install-config.ps1)
- README.md: Simplified Quick Start, single execution path (RunAll.cmd)
- 00-INSTALL-ORACLE-*.md: Removed redundant manual steps (handled by scripts)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Marius
2026-01-29 01:24:15 +02:00
parent aaf5942f6b
commit 648342c0a8
9 changed files with 1614 additions and 177 deletions

View File

@@ -0,0 +1,123 @@
-- ============================================================================
-- AUTH_DETALII CUSTOMER_ID INITIALIZATION
-- ============================================================================
-- Inserts the customer ID for license verification into SYS.AUTH_DETALII
-- This is required for AUTH_PACK license decryption
--
-- Usage:
-- sqlplus sys/password@service as sysdba @auth-detalii-init.sql
--
-- Prerequisites:
-- - SYS.AUTH_DETALII table exists (created by sys-objects.sql)
--
-- Substitution Variables:
-- &customer_id - Customer ID for licensing (e.g., 138 or empty for no license)
-- ============================================================================
SET ECHO OFF
SET FEEDBACK ON
SET SERVEROUTPUT ON
SET VERIFY OFF
WHENEVER SQLERROR CONTINUE
PROMPT
PROMPT ========================================
PROMPT Initializing AUTH_DETALII Customer ID
PROMPT ========================================
PROMPT
-- Define customer_id (will prompt if not defined)
DEFINE customer_id = '&customer_id'
PROMPT Customer ID: &customer_id
PROMPT
-- ============================================================================
-- SECTION 1: CHECK EXISTING DATA
-- ============================================================================
PROMPT [1/3] Checking existing AUTH_DETALII data...
DECLARE
v_count NUMBER;
v_existing VARCHAR2(15);
BEGIN
SELECT COUNT(*), MAX(detalii)
INTO v_count, v_existing
FROM sys.auth_detalii;
IF v_count > 0 THEN
DBMS_OUTPUT.PUT_LINE(' Existing records found: ' || v_count);
DBMS_OUTPUT.PUT_LINE(' Current value: ' || NVL(v_existing, '(null)'));
ELSE
DBMS_OUTPUT.PUT_LINE(' No existing records found');
END IF;
END;
/
-- ============================================================================
-- SECTION 2: INSERT/UPDATE CUSTOMER ID
-- ============================================================================
PROMPT [2/3] Setting Customer ID...
DECLARE
v_customer_id VARCHAR2(15) := '&customer_id';
v_count NUMBER;
BEGIN
-- Trim whitespace
v_customer_id := TRIM(v_customer_id);
-- Check if empty or null
IF v_customer_id IS NULL OR v_customer_id = '' OR UPPER(v_customer_id) = 'NULL' THEN
DBMS_OUTPUT.PUT_LINE(' Customer ID not specified - skipping');
RETURN;
END IF;
-- Check for existing records
SELECT COUNT(*) INTO v_count FROM sys.auth_detalii;
IF v_count > 0 THEN
-- Update existing
UPDATE sys.auth_detalii
SET detalii = v_customer_id
WHERE ROWNUM = 1;
DBMS_OUTPUT.PUT_LINE(' Updated existing record with Customer ID: ' || v_customer_id);
ELSE
-- Insert new
INSERT INTO sys.auth_detalii (detalii)
VALUES (v_customer_id);
DBMS_OUTPUT.PUT_LINE(' Inserted new record with Customer ID: ' || v_customer_id);
END IF;
COMMIT;
END;
/
-- ============================================================================
-- SECTION 3: GRANT ACCESS
-- ============================================================================
PROMPT [3/3] Granting access to CONTAFIN_ORACLE...
GRANT SELECT ON sys.auth_detalii TO contafin_oracle;
GRANT SELECT ON sys.auth_detalii TO PUBLIC;
-- ============================================================================
-- VERIFICATION
-- ============================================================================
PROMPT
PROMPT ========================================
PROMPT AUTH_DETALII Verification
PROMPT ========================================
PROMPT
PROMPT Current AUTH_DETALII content:
SELECT detalii AS customer_id FROM sys.auth_detalii;
PROMPT
PROMPT ========================================
PROMPT AUTH_DETALII Initialization Complete
PROMPT ========================================
PROMPT