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>
84 lines
2.4 KiB
Batchfile
84 lines
2.4 KiB
Batchfile
@echo off
|
|
REM =============================================================================
|
|
REM ROA Oracle Setup Script Runner
|
|
REM =============================================================================
|
|
REM This wrapper runs PowerShell scripts with ExecutionPolicy Bypass
|
|
REM Usage: Run.cmd <script-name> [arguments]
|
|
REM Example: Run.cmd 01-setup-database.ps1
|
|
REM Run.cmd 07-verify-installation.ps1 -Detailed
|
|
REM =============================================================================
|
|
|
|
setlocal enabledelayedexpansion
|
|
|
|
if "%~1"=="" (
|
|
echo.
|
|
echo ROA Oracle Setup Script Runner
|
|
echo ==============================
|
|
echo.
|
|
echo Usage: Run.cmd ^<script-name^> [arguments]
|
|
echo.
|
|
echo Available scripts:
|
|
echo 01-setup-database.ps1 - Initial database setup
|
|
echo 02-create-sys-objects.ps1 - Create SYS objects
|
|
echo 03-import-contafin.ps1 - Import CONTAFIN_ORACLE schema
|
|
echo 04-create-synonyms-grants.ps1 - Create public synonyms and grants
|
|
echo 05-import-companies.ps1 - Batch import company schemas
|
|
echo 06-add-company.ps1 - Add new company
|
|
echo 07-verify-installation.ps1 - Verify installation
|
|
echo 99-uninstall-roa.ps1 - Uninstall ROA ^(cleanup^)
|
|
echo.
|
|
echo Examples:
|
|
echo Run.cmd 01-setup-database.ps1
|
|
echo Run.cmd 07-verify-installation.ps1 -Detailed
|
|
echo Run.cmd 99-uninstall-roa.ps1 -Force
|
|
echo.
|
|
exit /b 1
|
|
)
|
|
|
|
set SCRIPT=%~1
|
|
shift
|
|
|
|
REM Build arguments string
|
|
set ARGS=
|
|
:argloop
|
|
if "%~1"=="" goto endargs
|
|
set ARGS=%ARGS% %1
|
|
shift
|
|
goto argloop
|
|
:endargs
|
|
|
|
REM Check if script exists in scripts folder
|
|
set SCRIPT_PATH=%~dp0scripts\%SCRIPT%
|
|
if not exist "%SCRIPT_PATH%" (
|
|
REM Try in current directory
|
|
set SCRIPT_PATH=%~dp0%SCRIPT%
|
|
)
|
|
|
|
if not exist "%SCRIPT_PATH%" (
|
|
echo ERROR: Script not found: %SCRIPT%
|
|
echo Looked in:
|
|
echo - %~dp0scripts\%SCRIPT%
|
|
echo - %~dp0%SCRIPT%
|
|
exit /b 1
|
|
)
|
|
|
|
echo.
|
|
echo Running: %SCRIPT% %ARGS%
|
|
echo ============================================================
|
|
echo.
|
|
|
|
powershell.exe -ExecutionPolicy Bypass -NoProfile -File "%SCRIPT_PATH%" %ARGS%
|
|
|
|
set EXITCODE=%ERRORLEVEL%
|
|
|
|
echo.
|
|
echo ============================================================
|
|
if %EXITCODE% EQU 0 (
|
|
echo Script completed successfully.
|
|
) else (
|
|
echo Script failed with exit code: %EXITCODE%
|
|
)
|
|
echo.
|
|
|
|
exit /b %EXITCODE%
|