Add ROA Oracle Database Windows setup scripts with old client support

PowerShell scripts for setting up Oracle 21c/XE with ROA application:
- Automated tablespace, user creation and imports
- sqlnet.ora config for Instant Client 11g/ODBC compatibility
- Oracle 21c read-only Home path handling (homes/OraDB21Home1)
- Listener restart + 10G password verifier for legacy auth
- Tested on VM 302 with CONTAFIN_ORACLE schema import

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Marius
2026-01-28 17:08:02 +02:00
parent 665c2b5d37
commit 989477f7a4
26 changed files with 8972 additions and 0 deletions

View File

@@ -0,0 +1,144 @@
# =============================================================================
# Oracle Data Pump Import Parameter File - Company Schema Template
# =============================================================================
#
# Purpose: Template for importing company schemas (FIRMANOUA, COMPANY1, etc.)
#
# Usage:
# 1. Copy this file to import-COMPANYNAME.par
# 2. Replace COMPANY_NAME with actual schema name
# 3. Run: impdp system/password@service parfile=import-COMPANYNAME.par
#
# Or create dynamically:
# $company = "FIRMA1"
# (Get-Content import-company.par) -replace 'COMPANY_NAME', $company |
# Set-Content "import-$company.par"
# impdp system/pass@service parfile="import-$company.par"
#
# Prerequisites:
# 1. DMPDIR directory exists
# 2. COMPANY_NAME.dmp file is in C:\DMPDIR
# 3. COMPANY_NAME user created with appropriate tablespace quota
#
# =============================================================================
# -----------------------------------------------------------------------------
# Source and Destination
# -----------------------------------------------------------------------------
# Oracle directory object containing DMP files
DIRECTORY=DMPDIR
# Source dump file name
# IMPORTANT: Replace COMPANY_NAME with actual company name
DUMPFILE=COMPANY_NAME.dmp
# Import log file (will be created in DMPDIR)
LOGFILE=import_COMPANY_NAME.log
# -----------------------------------------------------------------------------
# Schema Configuration
# -----------------------------------------------------------------------------
# Schema mapping (source:target)
# Use when source and target schema names are the same
REMAP_SCHEMA=COMPANY_NAME:COMPANY_NAME
# Alternative: If importing to different schema name
# REMAP_SCHEMA=OLD_COMPANY:NEW_COMPANY
# -----------------------------------------------------------------------------
# Import Behavior
# -----------------------------------------------------------------------------
# Action when table already exists:
# SKIP - Skip existing tables (preserves existing data) - USE FOR MIGRATION
# APPEND - Add rows to existing tables
# TRUNCATE - Delete existing rows, then import
# REPLACE - Drop and recreate tables - USE FOR FRESH INSTALL
TABLE_EXISTS_ACTION=SKIP
# Transform OID to avoid conflicts
TRANSFORM=OID:N
# -----------------------------------------------------------------------------
# Performance Settings
# -----------------------------------------------------------------------------
# Number of parallel worker processes
PARALLEL=2
# -----------------------------------------------------------------------------
# Tablespace Remapping
# -----------------------------------------------------------------------------
# Remap tablespace if source uses different tablespace
# Common scenario: source uses ROA tablespace, target uses USERS
# REMAP_TABLESPACE=ROA:USERS
# If source uses multiple tablespaces:
# REMAP_TABLESPACE=ROA:USERS,ROA2:USERS,SYSTEM:USERS
# -----------------------------------------------------------------------------
# Exclusions
# -----------------------------------------------------------------------------
# Exclude statistics (will be recalculated after import)
EXCLUDE=STATISTICS
# Exclude grants (will be recreated by setup scripts)
# EXCLUDE=GRANT
# Exclude specific objects
# EXCLUDE=TABLE:"='TEMP%'"
# EXCLUDE=INDEX:"='IDX_LOG%'"
# -----------------------------------------------------------------------------
# Data Filtering (Optional)
# -----------------------------------------------------------------------------
# Filter specific tables
# QUERY=TABLEDATA:"WHERE ROWNUM < 1000"
# Include only specific tables
# INCLUDE=TABLE:"IN ('TABLE1','TABLE2')"
# -----------------------------------------------------------------------------
# Advanced Options
# -----------------------------------------------------------------------------
# Skip errors and continue
# DATA_OPTIONS=SKIP_CONSTRAINT_ERRORS
# Disable logging during import (faster but no recovery)
# TRANSFORM=DISABLE_ARCHIVE_LOGGING:Y
# =============================================================================
# Expected Objects in Company Schema:
#
# - Tables: gestiune, contabilitate, salarii (~200 tables)
# - Views: Various reports and lookups (~100 views)
# - Packages: Business logic packages (~50)
# - Procedures/Functions: Various (~200)
# - Triggers: Various (~100)
# - Indexes: Performance indexes (~500)
#
# Total: ~3000+ objects
# =============================================================================
# =============================================================================
# Post-Import Steps:
#
# 1. Gather statistics:
# EXEC DBMS_STATS.GATHER_SCHEMA_STATS('COMPANY_NAME');
#
# 2. Recompile invalid objects:
# EXEC UTL_RECOMP.RECOMP_SERIAL('COMPANY_NAME');
#
# 3. Create public synonym (if needed):
# CREATE PUBLIC SYNONYM table_name FOR COMPANY_NAME.table_name;
#
# 4. Grant privileges:
# GRANT SELECT ON COMPANY_NAME.table_name TO PUBLIC;
#
# =============================================================================

View File

@@ -0,0 +1,104 @@
# =============================================================================
# Oracle Data Pump Import Parameter File - CONTAFIN_ORACLE Schema
# =============================================================================
#
# Purpose: Import CONTAFIN_ORACLE schema (common schema with rights, updates)
#
# Usage:
# impdp system/password@service parfile=import-contafin.par
#
# Or with explicit password prompt:
# impdp system@service parfile=import-contafin.par
#
# Prerequisites:
# 1. DMPDIR directory exists: CREATE DIRECTORY DMPDIR AS 'C:\DMPDIR';
# 2. contafin_oracle.dmp file is in C:\DMPDIR
# 3. CONTAFIN_ORACLE user created (or will be created by import)
#
# =============================================================================
# -----------------------------------------------------------------------------
# Source and Destination
# -----------------------------------------------------------------------------
# Oracle directory object containing DMP files
DIRECTORY=DMPDIR
# Source dump file name
DUMPFILE=contafin_oracle.dmp
# Import log file (will be created in DMPDIR)
LOGFILE=import_contafin_oracle.log
# -----------------------------------------------------------------------------
# Schema Configuration
# -----------------------------------------------------------------------------
# Schema to import
SCHEMAS=CONTAFIN_ORACLE
# -----------------------------------------------------------------------------
# Import Behavior
# -----------------------------------------------------------------------------
# Action when table already exists:
# SKIP - Skip existing tables (preserves data)
# APPEND - Add rows to existing tables
# TRUNCATE - Delete existing rows, then import
# REPLACE - Drop and recreate tables
TABLE_EXISTS_ACTION=REPLACE
# Transform OID to avoid conflicts
# Required when importing between different databases
TRANSFORM=OID:N
# -----------------------------------------------------------------------------
# Performance Settings
# -----------------------------------------------------------------------------
# Number of parallel worker processes
# Adjust based on CPU cores available
PARALLEL=2
# -----------------------------------------------------------------------------
# Exclusions (Optional)
# -----------------------------------------------------------------------------
# Exclude specific object types if needed
# EXCLUDE=STATISTICS
# EXCLUDE=INDEX:"='IDX_TEMP%'"
# -----------------------------------------------------------------------------
# Remapping (Optional)
# -----------------------------------------------------------------------------
# Remap tablespace if source uses different tablespace name
# REMAP_TABLESPACE=SOURCE_TS:ROA
# Remap schema if importing to different schema name
# REMAP_SCHEMA=CONTAFIN_ORACLE:CONTAFIN_ORACLE
# -----------------------------------------------------------------------------
# Advanced Options
# -----------------------------------------------------------------------------
# Continue import even if some objects fail
# CONTENT=ALL
# Import metadata only (no data)
# CONTENT=METADATA_ONLY
# Import data only (no DDL)
# CONTENT=DATA_ONLY
# =============================================================================
# Expected Objects in CONTAFIN_ORACLE:
#
# - Tables: NOM_FIRME, NOM_USERI, NOM_DREPTURI, etc. (~50 tables)
# - Views: Various application views (~20 views)
# - Packages: PACK_MIGRARE, AUTH_PACK, etc. (~10 packages)
# - Procedures/Functions: Various utilities (~50)
# - Triggers: Various (~20)
#
# Total: ~300+ objects
# =============================================================================