Key fixes: - Add Run.cmd/RunAll.cmd wrappers with ExecutionPolicy Bypass - Add Get-ListenerHost() to auto-detect listener IP address - Fix impdp connection using EZConnect format (host:port/service) - Add parallel=1 for Oracle XE compatibility - Fix Write-Log to accept empty strings with [AllowEmptyString()] - Fix Get-SchemaObjectCount regex for Windows line endings (\r\n) - Fix path comparison for DMP file copy operation - Add GRANT EXECUTE ON SYS.AUTH_PACK TO PUBLIC for PACK_DREPTURI - Fix VAUTH_SERII view to use SYN_NOM_PROGRAME (has DENUMIRE column) - Add sections 10-11 to grants-public.sql for SYS object grants Tested on VM 302 (10.0.20.130) with Oracle XE 21c. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
125 lines
4.2 KiB
Batchfile
125 lines
4.2 KiB
Batchfile
@echo off
|
|
REM =============================================================================
|
|
REM ROA Oracle Complete Installation
|
|
REM =============================================================================
|
|
REM Runs all setup scripts in order with ExecutionPolicy Bypass
|
|
REM =============================================================================
|
|
|
|
setlocal enabledelayedexpansion
|
|
|
|
echo.
|
|
echo ============================================================
|
|
echo ROA Oracle Complete Installation
|
|
echo ============================================================
|
|
echo.
|
|
echo This will run all setup scripts in order:
|
|
echo 1. 01-setup-database.ps1
|
|
echo 2. 02-create-sys-objects.ps1
|
|
echo 3. 03-import-contafin.ps1
|
|
echo 4. 04-create-synonyms-grants.ps1
|
|
echo 5. 05-import-companies.ps1
|
|
echo 6. 07-verify-installation.ps1
|
|
echo.
|
|
echo Prerequisites:
|
|
echo - Oracle 21c XE or SE installed and running
|
|
echo - DMP files in C:\DMPDIR
|
|
echo.
|
|
|
|
set /p CONFIRM="Continue with installation? [Y/N]: "
|
|
if /i not "%CONFIRM%"=="Y" (
|
|
echo Installation cancelled.
|
|
exit /b 0
|
|
)
|
|
|
|
echo.
|
|
set SCRIPTS_DIR=%~dp0scripts
|
|
set ERRORS=0
|
|
|
|
REM Script 1: Setup Database
|
|
echo.
|
|
echo [1/6] Running 01-setup-database.ps1...
|
|
echo ============================================================
|
|
powershell.exe -ExecutionPolicy Bypass -NoProfile -File "%SCRIPTS_DIR%\01-setup-database.ps1"
|
|
if %ERRORLEVEL% NEQ 0 (
|
|
echo [FAILED] 01-setup-database.ps1 failed!
|
|
set /a ERRORS+=1
|
|
set /p CONTINUE="Continue anyway? [Y/N]: "
|
|
if /i not "!CONTINUE!"=="Y" goto :summary
|
|
)
|
|
|
|
REM Script 2: Create SYS Objects
|
|
echo.
|
|
echo [2/6] Running 02-create-sys-objects.ps1...
|
|
echo ============================================================
|
|
powershell.exe -ExecutionPolicy Bypass -NoProfile -File "%SCRIPTS_DIR%\02-create-sys-objects.ps1"
|
|
if %ERRORLEVEL% NEQ 0 (
|
|
echo [FAILED] 02-create-sys-objects.ps1 failed!
|
|
set /a ERRORS+=1
|
|
set /p CONTINUE="Continue anyway? [Y/N]: "
|
|
if /i not "!CONTINUE!"=="Y" goto :summary
|
|
)
|
|
|
|
REM Script 3: Import CONTAFIN_ORACLE
|
|
echo.
|
|
echo [3/6] Running 03-import-contafin.ps1...
|
|
echo ============================================================
|
|
powershell.exe -ExecutionPolicy Bypass -NoProfile -File "%SCRIPTS_DIR%\03-import-contafin.ps1"
|
|
if %ERRORLEVEL% NEQ 0 (
|
|
echo [FAILED] 03-import-contafin.ps1 failed!
|
|
set /a ERRORS+=1
|
|
set /p CONTINUE="Continue anyway? [Y/N]: "
|
|
if /i not "!CONTINUE!"=="Y" goto :summary
|
|
)
|
|
|
|
REM Script 4: Create Synonyms and Grants
|
|
echo.
|
|
echo [4/6] Running 04-create-synonyms-grants.ps1...
|
|
echo ============================================================
|
|
powershell.exe -ExecutionPolicy Bypass -NoProfile -File "%SCRIPTS_DIR%\04-create-synonyms-grants.ps1"
|
|
if %ERRORLEVEL% NEQ 0 (
|
|
echo [FAILED] 04-create-synonyms-grants.ps1 failed!
|
|
set /a ERRORS+=1
|
|
set /p CONTINUE="Continue anyway? [Y/N]: "
|
|
if /i not "!CONTINUE!"=="Y" goto :summary
|
|
)
|
|
|
|
REM Script 5: Import Companies
|
|
echo.
|
|
echo [5/6] Running 05-import-companies.ps1...
|
|
echo ============================================================
|
|
powershell.exe -ExecutionPolicy Bypass -NoProfile -File "%SCRIPTS_DIR%\05-import-companies.ps1"
|
|
if %ERRORLEVEL% NEQ 0 (
|
|
echo [FAILED] 05-import-companies.ps1 failed!
|
|
set /a ERRORS+=1
|
|
set /p CONTINUE="Continue anyway? [Y/N]: "
|
|
if /i not "!CONTINUE!"=="Y" goto :summary
|
|
)
|
|
|
|
REM Script 6: Verify Installation
|
|
echo.
|
|
echo [6/6] Running 07-verify-installation.ps1...
|
|
echo ============================================================
|
|
powershell.exe -ExecutionPolicy Bypass -NoProfile -File "%SCRIPTS_DIR%\07-verify-installation.ps1"
|
|
if %ERRORLEVEL% NEQ 0 (
|
|
echo [WARNING] Verification reported issues.
|
|
set /a ERRORS+=1
|
|
)
|
|
|
|
:summary
|
|
echo.
|
|
echo ============================================================
|
|
echo Installation Summary
|
|
echo ============================================================
|
|
echo.
|
|
if %ERRORS% EQU 0 (
|
|
echo [SUCCESS] All scripts completed successfully!
|
|
) else (
|
|
echo [WARNING] Installation completed with %ERRORS% error(s).
|
|
echo Review logs in the logs\ folder for details.
|
|
)
|
|
echo.
|
|
echo Logs are saved in: %~dp0logs\
|
|
echo.
|
|
|
|
exit /b %ERRORS%
|