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,436 @@
# Installing Oracle 21c Standard Edition on Windows
## Overview
Oracle 21c Standard Edition 2 (SE2) is a licensed product for production use.
Unlike Express Edition, SE has no resource limitations.
| Feature | Express Edition | Standard Edition 2 |
|---------|-----------------|-------------------|
| License | Free | Paid (per socket) |
| CPU | 2 threads max | Unlimited |
| RAM | 2 GB max | Unlimited |
| User Data | 12 GB max | Unlimited |
| Architecture | CDB only | CDB or non-CDB |
For large ROA installations (50+ companies), SE2 is recommended.
---
## Download
1. Go to Oracle Database Downloads:
https://www.oracle.com/database/technologies/oracle-database-software-downloads.html
2. Download **Oracle Database 21c for Windows x64**
- File: `WINDOWS.X64_213000_db_home.zip` (~2.9 GB)
- Requires Oracle account
3. You will also need the Oracle Database license key
---
## System Requirements
| Requirement | Minimum | Recommended |
|-------------|---------|-------------|
| OS | Windows Server 2016+ | Windows Server 2019/2022 |
| RAM | 8 GB | 16 GB+ |
| Disk | 30 GB | 100 GB+ |
| CPU | 4 cores | 8+ cores |
---
## Installation
### Step 1: Extract ZIP
```powershell
# Create Oracle Home directory first
mkdir C:\app\oracle\product\21c\dbhome_1
# Extract directly to Oracle Home
Expand-Archive WINDOWS.X64_213000_db_home.zip -DestinationPath C:\app\oracle\product\21c\dbhome_1
```
### Step 2: Run Installer
1. Open Command Prompt **as Administrator**
2. Navigate to Oracle Home:
```powershell
cd C:\app\oracle\product\21c\dbhome_1
```
3. Run setup:
```powershell
.\setup.exe
```
### Step 3: Installation Wizard
1. **Configuration Option**
- Select: **Create and configure a single instance database**
- Click Next
2. **System Class**
- Select: **Server Class**
- Click Next
3. **Database Edition**
- Select: **Standard Edition 2**
- Click Next
4. **Installation Type**
- Select: **Typical Install** (simpler)
- Or **Advanced Install** for custom settings
- Click Next
5. **For Typical Install:**
- Oracle base: `C:\app\oracle`
- Database file location: `C:\app\oracle\oradata`
- Database edition: Standard Edition 2
- Character set: **WE8MSWIN1252** (for Romanian support)
- Global database name: **ROA**
- Password: `romfastsoft`
- **Uncheck:** Create as Container database (for non-CDB)
6. **Summary** - Review and click Install
7. **Installation Progress** - Wait (~30-45 minutes)
8. **Finish** - Note connection information
---
## Non-CDB vs CDB Architecture
### Non-CDB (Traditional - Recommended for ROA)
Single database, simpler administration:
```
+---------------------------+
| Database: ROA |
| +---------------------+ |
| | Schema: CONTAFIN | |
| +---------------------+ |
| | Schema: COMPANY1 | |
| +---------------------+ |
| | Schema: COMPANY2 | |
| +---------------------+ |
+---------------------------+
```
Connection: `system/romfastsoft@ROA`
### CDB (Multitenant)
Container with pluggable databases:
```
+---------------------------------------------+
| CDB: ROA |
| +---------------------------------------+ |
| | CDB$ROOT | |
| +---------------------------------------+ |
| +---------------------------------------+ |
| | ROAPDB1 - Application Data | |
| +---------------------------------------+ |
+---------------------------------------------+
```
Connection: `system/romfastsoft@ROAPDB1`
> **Recommendation:** Use **non-CDB** for compatibility with Oracle 10g migration scripts.
---
## Post-Installation Configuration
### Verify Services Running
```powershell
Get-Service Oracle* | Format-Table Name, Status, StartType
```
Expected services:
| Service | Description |
|---------|-------------|
| OracleServiceROA | Database instance |
| OracleOraDB21Home1TNSListener | TNS Listener |
| OracleVssWriterROA | VSS Writer for backups |
### Test Connection
```powershell
# Set Oracle environment
$env:ORACLE_HOME = "C:\app\oracle\product\21c\dbhome_1"
$env:ORACLE_SID = "ROA"
$env:PATH = "$env:ORACLE_HOME\bin;$env:PATH"
# Test connection
sqlplus system/romfastsoft@localhost:1521/ROA
```
### Configure for Old Client Compatibility
```powershell
notepad C:\app\oracle\product\21c\dbhome_1\network\admin\sqlnet.ora
```
Add:
```
SQLNET.ALLOWED_LOGON_VERSION_SERVER=8
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8
```
Reload listener:
```powershell
lsnrctl reload
```
---
## Create DMPDIR Directory
```sql
-- Connect as SYSDBA
sqlplus sys/romfastsoft@localhost:1521/ROA as sysdba
-- Create Windows directory
host mkdir C:\DMPDIR
-- Create Oracle DIRECTORY object
CREATE OR REPLACE DIRECTORY DMPDIR AS 'C:\DMPDIR';
GRANT READ, WRITE ON DIRECTORY DMPDIR TO PUBLIC;
-- Verify
SELECT directory_name, directory_path FROM dba_directories WHERE directory_name = 'DMPDIR';
```
---
## Configure Password Policy
```sql
sqlplus sys/romfastsoft@localhost:1521/ROA as sysdba
-- Modify DEFAULT profile
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
ALTER PROFILE DEFAULT LIMIT PASSWORD_REUSE_TIME UNLIMITED;
ALTER PROFILE DEFAULT LIMIT PASSWORD_REUSE_MAX UNLIMITED;
ALTER PROFILE DEFAULT LIMIT FAILED_LOGIN_ATTEMPTS UNLIMITED;
```
---
## Memory Configuration
For Standard Edition with 16GB RAM:
```sql
-- Connect as SYSDBA
sqlplus sys/romfastsoft@localhost:1521/ROA as sysdba
-- Check current settings
SHOW PARAMETER memory;
SHOW PARAMETER sga;
SHOW PARAMETER pga;
-- Configure memory (adjust based on available RAM)
ALTER SYSTEM SET MEMORY_TARGET = 8G SCOPE = SPFILE;
ALTER SYSTEM SET MEMORY_MAX_TARGET = 10G SCOPE = SPFILE;
-- Restart database for changes
SHUTDOWN IMMEDIATE;
STARTUP;
```
Recommended memory allocation:
| RAM Available | MEMORY_TARGET | MEMORY_MAX_TARGET |
|---------------|---------------|-------------------|
| 8 GB | 4 GB | 6 GB |
| 16 GB | 8 GB | 10 GB |
| 32 GB | 16 GB | 20 GB |
---
## Create ROA Tablespace
```sql
sqlplus sys/romfastsoft@localhost:1521/ROA as sysdba
-- Create tablespace
CREATE TABLESPACE ROA
DATAFILE 'C:\app\oracle\oradata\ROA\roa01.dbf'
SIZE 2G
AUTOEXTEND ON NEXT 512M
MAXSIZE UNLIMITED;
-- Verify
SELECT tablespace_name, file_name, bytes/1024/1024 as MB
FROM dba_data_files
WHERE tablespace_name = 'ROA';
```
---
## Listener Configuration
Check `listener.ora`:
```powershell
notepad C:\app\oracle\product\21c\dbhome_1\network\admin\listener.ora
```
Should contain:
```
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ROA)
(ORACLE_HOME = C:\app\oracle\product\21c\dbhome_1)
(SID_NAME = ROA)
)
)
```
Check `tnsnames.ora`:
```powershell
notepad C:\app\oracle\product\21c\dbhome_1\network\admin\tnsnames.ora
```
Should contain:
```
ROA =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ROA)
)
)
```
---
## Enterprise Manager Database Express
Access EM Express:
```
https://localhost:5500/em/
```
If not configured, enable it:
```sql
sqlplus sys/romfastsoft@localhost:1521/ROA as sysdba
EXEC DBMS_XDB_CONFIG.SETHTTPPORT(5500);
EXEC DBMS_XDB_CONFIG.SETHTTPSPORT(5501);
```
---
## Troubleshooting
### OracleServiceROA Not Starting
1. Check Oracle alert log:
```powershell
Get-Content C:\app\oracle\diag\rdbms\roa\ROA\trace\alert_ROA.log -Tail 100
```
2. Common issues:
- Insufficient memory
- Disk space
- Port 1521 already in use
### ORA-01034: ORACLE not available
Start the database manually:
```powershell
sqlplus / as sysdba
SQL> STARTUP;
```
### ORA-12514: TNS listener does not know of service
```powershell
# Register database with listener
sqlplus / as sysdba
SQL> ALTER SYSTEM REGISTER;
# Check listener
lsnrctl status
lsnrctl services
```
### Database Won't Shut Down
```sql
-- Force shutdown
SHUTDOWN ABORT;
-- Start clean
STARTUP;
```
---
## Backup Configuration (Recommended)
### Enable Archivelog Mode
```sql
sqlplus sys/romfastsoft@localhost:1521/ROA as sysdba
-- Check current mode
ARCHIVE LOG LIST;
-- If NOARCHIVELOG, enable:
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;
-- Verify
ARCHIVE LOG LIST;
```
### Configure RMAN
```powershell
rman target sys/romfastsoft@ROA
RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
RMAN> CONFIGURE BACKUP OPTIMIZATION ON;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'C:\backup\%F';
```
---
## Next Steps
After Oracle SE installation:
1. Copy `config.example.ps1` to `config.ps1`
2. Edit `config.ps1`:
- Set `$ORACLE_HOME = "C:\app\oracle\product\21c\dbhome_1"`
- Set `$SERVICE_NAME = "ROA"`
- Set `$DATAFILE_DIR = "C:\app\oracle\oradata\ROA"`
3. Run `01-setup-database.ps1`
See main `README.md` for complete workflow.
---
**Last Updated:** 2026-01-28
**Project:** ROMFASTSQL - Oracle SE Installation Guide

View File

@@ -0,0 +1,337 @@
# Installing Oracle 21c Express Edition on Windows
## Overview
Oracle 21c Express Edition (XE) is free to use with the following limitations:
- 2 CPU threads
- 2 GB RAM for database
- 12 GB user data
For ROA installations with up to 50 companies, XE is sufficient.
---
## Download
1. Go to Oracle XE Downloads:
https://www.oracle.com/database/technologies/xe-downloads.html
2. Download **OracleXE213_Win64.zip** (~1.5 GB)
- Requires Oracle account (free registration)
3. Verify download integrity (optional):
```powershell
Get-FileHash OracleXE213_Win64.zip -Algorithm SHA256
```
---
## System Requirements
| Requirement | Minimum | Recommended |
|-------------|---------|-------------|
| OS | Windows 10/11, Server 2016+ | Windows Server 2019+ |
| RAM | 4 GB | 8 GB |
| Disk | 15 GB | 50 GB |
| CPU | 2 cores | 4 cores |
---
## Installation
### Step 1: Extract ZIP
```powershell
Expand-Archive OracleXE213_Win64.zip -DestinationPath C:\OracleXE_Install
```
### Step 2: Run Installer
1. Open Command Prompt or PowerShell **as Administrator**
2. Navigate to extracted folder:
```powershell
cd C:\OracleXE_Install\Disk1
```
3. Run setup:
```powershell
.\setup.exe
```
### Step 3: Installation Wizard
1. **Welcome Screen** - Click Next
2. **License Agreement** - Accept and click Next
3. **Oracle Home Location**
- Default: `C:\app\oracle\product\21c\dbhomeXE`
- Keep default unless disk space is an issue
4. **Database Passwords**
- Enter password for SYS and SYSTEM: `romfastsoft`
- Confirm password
- **Important:** Remember this password!
5. **Summary** - Review and click Install
6. **Installation Progress** - Wait (~10-20 minutes)
7. **Finish** - Note the connection information:
- Multitenant container database: XE
- Pluggable database: XEPDB1
- EM Express URL: https://localhost:5500/em/
---
## Post-Installation Configuration
### Verify Services Running
Open Services (services.msc) and verify:
| Service | Status | Startup Type |
|---------|--------|--------------|
| OracleServiceXE | Running | Automatic |
| OracleOraDB21Home1TNSListener | Running | Automatic |
Or via PowerShell:
```powershell
Get-Service Oracle* | Format-Table Name, Status, StartType
```
### Test Connection
```powershell
# Set Oracle environment
$env:ORACLE_HOME = "C:\app\oracle\product\21c\dbhomeXE"
$env:PATH = "$env:ORACLE_HOME\bin;$env:PATH"
# Test connection to CDB
sqlplus system/romfastsoft@localhost:1521/XE
# Test connection to PDB (for applications)
sqlplus system/romfastsoft@localhost:1521/XEPDB1
```
Expected output:
```
Connected to:
Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0
SQL>
```
### Configure for Old Client Compatibility
If using Instant Client 10/11 (ODBC), configure `sqlnet.ora`:
```powershell
# Edit sqlnet.ora
notepad C:\app\oracle\product\21c\dbhomeXE\network\admin\sqlnet.ora
```
Add these lines:
```
SQLNET.ALLOWED_LOGON_VERSION_SERVER=8
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8
```
Reload listener:
```powershell
lsnrctl reload
```
---
## CDB/PDB Architecture
Oracle XE uses Container Database (CDB) architecture:
```
+---------------------------------------------+
| CDB: XE |
| +---------------------------------------+ |
| | CDB$ROOT - System, SYS objects | |
| +---------------------------------------+ |
| +---------------------------------------+ |
| | PDB$SEED - Template (read-only) | |
| +---------------------------------------+ |
| +---------------------------------------+ |
| | XEPDB1 - Application Data (ROA) | |
| +---------------------------------------+ |
+---------------------------------------------+
```
| Container | Purpose | Connect To |
|-----------|---------|------------|
| XE (CDB$ROOT) | Administration, SYS | Admin only |
| XEPDB1 | Application data | ROA applications |
> **Important:** Always connect to **XEPDB1** for ROA operations, not XE!
---
## Verify PDB Status
```sql
-- Connect as SYSDBA
sqlplus sys/romfastsoft@localhost:1521/XE as sysdba
-- Check PDB status
SELECT name, open_mode FROM v$pdbs;
-- Expected output:
-- NAME OPEN_MODE
-- --------- ----------
-- PDB$SEED READ ONLY
-- XEPDB1 READ WRITE
```
If XEPDB1 is MOUNTED (not READ WRITE):
```sql
ALTER PLUGGABLE DATABASE XEPDB1 OPEN;
ALTER PLUGGABLE DATABASE XEPDB1 SAVE STATE;
```
---
## Create DMPDIR Directory
```sql
-- Connect to PDB
sqlplus sys/romfastsoft@localhost:1521/XEPDB1 as sysdba
-- Create Windows directory
host mkdir C:\DMPDIR
-- Create Oracle DIRECTORY object
CREATE OR REPLACE DIRECTORY DMPDIR AS 'C:\DMPDIR';
GRANT READ, WRITE ON DIRECTORY DMPDIR TO PUBLIC;
-- Verify
SELECT directory_name, directory_path FROM dba_directories WHERE directory_name = 'DMPDIR';
```
---
## Configure Password Policy
Disable password expiration for application users:
```sql
-- Connect to PDB
sqlplus sys/romfastsoft@localhost:1521/XEPDB1 as sysdba
-- Modify DEFAULT profile
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
ALTER PROFILE DEFAULT LIMIT PASSWORD_REUSE_TIME UNLIMITED;
ALTER PROFILE DEFAULT LIMIT PASSWORD_REUSE_MAX UNLIMITED;
ALTER PROFILE DEFAULT LIMIT FAILED_LOGIN_ATTEMPTS UNLIMITED;
-- Verify
SELECT resource_name, limit FROM dba_profiles WHERE profile = 'DEFAULT' AND resource_type = 'PASSWORD';
```
---
## Enterprise Manager Express
Access EM Express web interface:
```
https://localhost:5500/em/
```
Login:
- Username: system
- Password: romfastsoft
- Container: XEPDB1 (or leave empty for CDB)
---
## Memory Configuration
Check current memory settings:
```sql
SHOW PARAMETER memory;
SHOW PARAMETER sga;
SHOW PARAMETER pga;
```
XE defaults (cannot exceed due to license):
- SGA: 2 GB max
- PGA: 2 GB max
For better performance within limits:
```sql
-- Automatic memory management
ALTER SYSTEM SET MEMORY_TARGET = 2G SCOPE = SPFILE;
ALTER SYSTEM SET MEMORY_MAX_TARGET = 2G SCOPE = SPFILE;
```
---
## Troubleshooting
### OracleServiceXE Not Starting
1. Check Windows Event Viewer for errors
2. Verify disk space (need 15+ GB free)
3. Check Oracle alert log:
```powershell
Get-Content C:\app\oracle\diag\rdbms\xe\XE\trace\alert_XE.log -Tail 50
```
### Cannot Connect to XEPDB1
```sql
-- Connect to CDB
sqlplus sys/romfastsoft@localhost:1521/XE as sysdba
-- Check PDB status
SELECT name, open_mode FROM v$pdbs;
-- Open if mounted
ALTER PLUGGABLE DATABASE XEPDB1 OPEN;
ALTER PLUGGABLE DATABASE XEPDB1 SAVE STATE;
```
### ORA-12514: TNS listener does not know of service
```powershell
# Check listener status
lsnrctl status
lsnrctl services
# Restart listener
lsnrctl stop
lsnrctl start
```
### Uninstall Oracle XE
If needed, run the universal installer in deinstall mode:
```powershell
C:\app\oracle\product\21c\dbhomeXE\deinstall\deinstall.bat
```
Or via Control Panel > Programs and Features.
---
## Next Steps
After Oracle XE installation:
1. Copy `config.example.ps1` to `config.ps1`
2. Edit `config.ps1` with your settings
3. Run `01-setup-database.ps1`
See main `README.md` for complete workflow.
---
**Last Updated:** 2026-01-28
**Project:** ROMFASTSQL - Oracle XE Installation Guide