Fix ROA Windows setup scripts for Oracle XE deployment
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>
This commit is contained in:
@@ -90,8 +90,9 @@ function Initialize-LogFile {
|
||||
function Write-Log {
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory = $true, Position = 0)]
|
||||
[string]$Message,
|
||||
[Parameter(Mandatory = $false, Position = 0)]
|
||||
[AllowEmptyString()]
|
||||
[string]$Message = "",
|
||||
|
||||
[Parameter(Mandatory = $false)]
|
||||
[ValidateSet('Info', 'Warning', 'Error', 'Success', 'Debug')]
|
||||
@@ -101,6 +102,17 @@ function Write-Log {
|
||||
[switch]$NoConsole
|
||||
)
|
||||
|
||||
# Handle empty messages (blank lines)
|
||||
if ([string]::IsNullOrEmpty($Message)) {
|
||||
if ($script:LogFile) {
|
||||
Add-Content -Path $script:LogFile -Value "" -Encoding UTF8
|
||||
}
|
||||
if (-not $NoConsole) {
|
||||
Write-Host ""
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
$timestamp = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'
|
||||
$logMessage = "[$timestamp] [$Level] $Message"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user