Sop
Standard Operating Procedure (SOP) for Oracle 19c TDE Wallet Validation and Backup Automation
Document Version
Version: 1.4
Date: YYYY-MM-DD
Author: <Your Name>
Reviewed By: <Reviewer Name>
Last Updated: YYYY-MM-DD
---
1. Objective
This SOP provides a structured approach to automate Transparent Data Encryption (TDE) wallet validation and backup for all running Oracle databases (both 12c and 19c) on a given host.
Key Features of the Automation:
Detects all running Oracle databases except ASM and APX.
Determines the database version dynamically (12c or 19c) and executes version-specific queries.
Automatically sources ORACLE_SID using oraenv.
Retrieves wallet passwords securely from Cloakware (if configured).
Validates the TDE wallet status and its location.
Ensures the wallet location contains the corresponding database name.
Performs structured backups of the wallet if it exists.
Checks for encrypted tablespaces and validates wallet password correctness.
Logs outputs systematically for audit and review.
Fully automated—no manual user input required.
---
2. Scope
This procedure applies to all Oracle databases (12c and 19c) running on a given host that have TDE enabled. It is intended for database administrators responsible for encryption wallet management and compliance.
---
3. Prerequisites
3.1 Access & Permissions
Must execute as the oracle user.
Ensure sqlplus, mkstore, and Cloakware utilities are available.
Oracle environment variables should be correctly set.
/etc/oratab must be updated with all database instances.
3.2 Required Software & Tools
Oracle 12c and 19c installed and configured.
sqlplus for database queries.
mkstore for wallet operations.
Cloakware (pwEcho.exe) for secure password retrieval.
Bash shell (bash) for script execution.
3.3 Directory Structure & Naming Conventions
---
4. Execution Steps
Step 1: Prepare the Environment
1. Ensure the Oracle environment is configured correctly:
export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
2. Confirm that required utilities are available:
which sqlplus mkstore
3. Verify that running databases can be identified:
ps -ef | grep pmon | grep -v grep | grep -Ev "(\+ASM|APX)"
---
Step 2: Execute the TDE Wallet Validation Script
1. Deploy the script on the database server
Ensure it is located in a directory accessible by the Oracle user, e.g., /home/oracle/tde_wallet_validation.sh.
2. Grant execute permissions
chmod +x /home/oracle/tde_wallet_validation.sh
3. Run the script
/home/oracle/tde_wallet_validation.sh
---
Step 3: Script Execution Details
The script follows these key steps:
1. Identify Running Databases
Uses ps -ef | grep pmon to detect running Oracle instances.
Filters out ASM and APX instances.
2. Source ORACLE_SID and Set Environment
Dynamically retrieves the list of databases.
Sources the environment using oraenv without manual input.
3. Determine Oracle Database Version
The script connects to each database and retrieves the version:
SELECT version FROM v$instance;
If the database is 12c, it executes queries specific to 12c.
If the database is 19c, it executes queries specific to 19c.
4. Retrieve Wallet Password Securely
Uses Cloakware (pwEcho.exe) to fetch the correct wallet password.
Falls back to a standard password if Cloakware is unavailable.
5. Validate Wallet Status and Location
Queries V$ENCRYPTION_WALLET for wallet status:
SELECT status, wallet_type, wallet_location FROM v$encryption_wallet;
Extracts wallet location and ensures it contains the database name.
If the wallet location is missing or incorrect, logs an alert.
6. Backup TDE Wallet (if location exists and is correct)
Checks if the wallet directory exists:
if [ -d "$WALLET_LOCATION" ]; then
Verifies that the wallet directory contains the database name:
if [[ "$WALLET_LOCATION" == *"$ORACLE_SID"* ]]; then
Creates a structured backup directory.
Copies wallet files securely:
cp -p $WALLET_LOCATION/* $BACKUP_DIR/$ORACLE_SID/
7. Verify Wallet Password
Tests the wallet password using mkstore.
Compares against both Cloakware and standard passwords.
8. Check for Encrypted Tablespaces
If 12c, use:
SELECT tablespace_name, encrypted FROM dba_tablespaces WHERE encrypted='YES';
If 19c, use:
SELECT tablespace_name, encryption_algorithm FROM dba_tablespaces WHERE encrypted='YES';
9. Generate and Store Audit Logs
Logs all validation results in $LOG_DIR/tde_wallet_validation_YYYYMMDD.log.
Creates a structured report in $LOG_DIR/tde_wallet_report_YYYYMMDD.log.
---
Step 4: Post-Execution Validation
---
6. Conclusion
This automation ensures that all Oracle databases (12c and 19c) are:
✅ Properly confi
gured and secured.
✅ Backed up systematically.
✅ Validated for encryption compliance.
✅ Auditable with detailed logging.
This enhances security by verifying wallet locations, ensuring structured backups, and eliminating manual intervention.
Comments
Post a Comment