Saturday, 23 May 2026

Control File Restore

                                                  Oracle RMAN

Control File Restore

Step-by-Step Guide

Oracle Database 19c  •  RMAN Recovery

  Overview

The Oracle control file is a critical binary file that records the physical structure of the database. If the control file is lost or corrupted, the database cannot be mounted or opened. Oracle RMAN provides three methods to restore the control file:

 

#

Method

When to Use

1

Restore from RMAN backup piece

You have the exact backup file path

2

Restore from autobackup

AUTOBACKUP is enabled and available

3

Re-create from trace file

No RMAN backup exists; trace was previously generated

 

📝 Note: Always start RMAN with 'rman target /' and start the instance in NOMOUNT before restoring the control file.

 

Prerequisites

       Oracle software installed and environment variables set (ORACLE_SID, ORACLE_HOME, PATH)

       RMAN backup of the control file exists (for Methods 1 and 2)

       Trace file generated via ALTER DATABASE BACKUP CONTROLFILE TO TRACE (for Method 3)

       Database must be started in NOMOUNT mode before restoring the control file

       Sufficient disk space at the control file destination paths

  

Method 1: Restore Control File from RMAN Backup Piece

Use this method when you have a specific .rman backup file on disk.

Step 1: Connect to RMAN

Open a terminal as the oracle user and connect to RMAN targeting the local database instance.

 


Step 2: Start the Instance in NOMOUNT Mode

The database must be in NOMOUNT state to restore the control file. This starts the instance using the SPFILE/PFILE only - no control file is needed at this stage.

 


📝 Note: If the instance is already started in NOMOUNT, skip this step.

 

Step 3: Restore the Control File from the Backup Piece

Specify the full path to the RMAN backup piece that contains the control file. RMAN will restore it to the locations defined in the SPFILE (DB_CREATE_FILE_DEST or control_files parameter).


Step 4:
Mount the Database

After the control file is restored, mount the database so RMAN can read it.

 Step 5: Restore and Recover the Database

Restore all datafiles from backup, then apply archived logs to bring the database to a consistent state.

 


Step 6: Open the Database

Open the database. If online logs are available use NORESETLOGS; if not, use RESETLOGS.

 


📝 Note: After RESETLOGS, a new incarnation starts. Take a full backup immediately.

  

Method 2: Restore Control File from Autobackup

Use this method when CONTROLFILE AUTOBACKUP is configured and enabled.

Step 1: Connect to RMAN and Start NOMOUNT



Step 2: Option A - Restore from a Known Autobackup Path

If you know the exact autobackup file path, specify it directly:



Step 3: Option B — Let RMAN Search for the Autobackup Automatically

If the exact path is unknown, use a RUN block. RMAN searches the Fast Recovery Area (and the configured format location) scanning backwards day by day for up to 7 days.


 

📝 Note: SET DBID is required when no recovery catalog is used and the control file is not yet available. Find the DBID in the alert log or previous RMAN output.

 

Step 4: Mount, Restore, Recover and Open

Follow the same Steps 4–6 from Method 1 to complete the recovery.

 

 

Method 3: Re-create Control File from Trace

Use this method when no RMAN backup exists but a trace file was previously generated.

Step 1: Generate a Trace File (Preventive -Do This While DB is Open)

This step should be run on a healthy database as a preventive measure. It writes a SQL script to the trace directory that can recreate the control file.

 


📝 Note: Run this after every structural change: adding datafiles, tablespaces, redo log groups, etc.

 

Step 2: Review the Trace File - Choose NORESETLOGS or RESETLOGS

The trace file contains two SQL blocks. Choose the appropriate one based on log availability:

 

Scenario

NORESETLOGS

RESETLOGS

Online redo logs

✅ Available and intact

❌ Lost or corrupted

RECOVER DATABASE

RECOVER DATABASE

RECOVER DATABASE USING BACKUP CONTROLFILE

Open database

ALTER DATABASE OPEN

ALTER DATABASE OPEN RESETLOGS

 

Step 3: Start Instance in NOMOUNT


Step 4: Execute the CREATE CONTROLFILE Script (NORESETLOGS Example)

Copy the relevant SQL block from the trace file and run it in SQL*Plus:

 



Step 5: Recover and Open the Database

After the control file is created, recover the database using archived logs:

 


Step 6: Add Temp Files to Temporary Tablespaces

Temp files are not backed up and must be re-added manually after recovery:

 


Post-Recovery Checklist

       Verify all datafiles are online: SELECT file#, status, name FROM v$datafile;

       Verify all PDBs are open: SELECT name, open_mode FROM v$pdbs;

       Check for any invalid objects: SELECT count(*) FROM dba_objects WHERE status = 'INVALID';

       Verify archived log gaps: SELECT * FROM v$archive_gap;

       Take a new full RMAN backup immediately after recovery

       Regenerate the controlfile trace: ALTER DATABASE BACKUP CONTROLFILE TO TRACE;

       Confirm RMAN autobackup is still enabled: SHOW ALL; in RMAN

 

Quick Reference: Which Method to Use?

Situation

Recommended Method

Key Command

Backup piece path is known

Method 1

RESTORE CONTROLFILE FROM '..path..'

AUTOBACKUP enabled, path unknown

Method 2 (Option B)

RESTORE CONTROLFILE FROM AUTOBACKUP

AUTOBACKUP known path

Method 2 (Option A)

RESTORE CONTROLFILE FROM 'c-DBID-date-seq'

No RMAN backup; trace file exists

Method 3

CREATE CONTROLFILE REUSE DATABASE ...

 

 


Friday, 22 May 2026

ORACLE AI DATABASE -26ai (Installation Guide)

 

ORACLE AI DATABASE -26ai

Complete Step-by-Step GUI Installation Guide

Version

23.26.1

OS

Oracle Linux 9

Edition

Free / Enterprise

Year

2026

 

  Overview

 

Oracle AI Database 26ai (version 23.26.1) is Oracle's latest Long-Term Release database, replacing 23ai. It adds native VECTOR data types, AI Vector Search with cosine/dot-product/Euclidean similarity, and hundreds of AI-focused improvements to the SQL engine.

 

Key features:

       Native VECTOR type for AI embedding storage and similarity search

       AI Vector Search SQL operators for hybrid queries

       Multitenant: CDB + PDB architecture

       FIPS 140-3 laboratory testing completed

 

  System Requirements

 

Component

Minimum

Recommended

OS

Oracle Linux 8

Oracle Linux 9 (OL9)

CPU

2 vCPUs

4+ vCPUs

RAM

4 GB

8 GB or more

Disk Space

20 GB free

50 GB or more

Swap

1× RAM (max 8 GB)

Equal to RAM

 

FREE LIMITS

Free Edition: max 2 CPUs, 2 GB SGA+PGA, 12 GB user data.

 

  Method A: Free Edition (RPM)

 

STEP 1

Install Preinstall RPM

 

Run as root or with sudo. This creates the oracle user, groups, and sets all kernel parameters:

 

sudo dnf -y install oracle-ai-database-preinstall-26ai

 

# Verify log: /var/log/oracle-database-preinstall-26ai/results/orakernel.log

 

After running this command proceed to download the RPM.

 

STEP 2

Download & Install the 26ai Free RPM

 

Download from oracle.com/database/free then install:

 

sudo dnf -y install ./oracle-ai-database-free-26ai-<version>.el9.x86_64.rpm

 

STEP 3

Configure the Database

 

The init script ships with the RPM. Run configure and follow prompts for SYS/SYSTEM passwords and character set:

 

sudo /etc/init.d/oracle-free-26ai configure

 

CONFIG

/etc/sysconfig/oracle-free-26ai.conf stores default settings.

 

STEP 4

Open Firewall & Verify Services

 

sudo firewall-cmd --permanent --add-port=1521/tcp && sudo firewall-cmd --reload

sudo /etc/init.d/oracle-free-26ai status

lsnrctl status

 

STEP 5

Connect with SQL*Plus

 

sudo su - oracle -c "sqlplus sys/<PASSWORD> as sysdba"

 

-- Inside SQL*Plus:

SHOW CON_NAME;

SHOW PDBS;

ALTER PLUGGABLE DATABASE FREEPDB1 OPEN;

ALTER PLUGGABLE DATABASE FREEPDB1 SAVE STATE;

 

  Method B: Enterprise Edition — OUI GUI Installer

 

The Oracle Universal Installer (OUI) provides a full graphical wizard. Below are all 8 screens with real GUI screenshots of each step.

 

STEP 1

Welcome Screen — Launch OUI

 

After unzipping the Oracle Home and setting environment variables, launch the installer:

 

su - oracle

cd /u01/app/oracle/product/23.26.1/dbhome_1

./runInstaller

 



Figure: OUI Welcome Screen — Oracle AI Database 26ai Installer

The Welcome screen confirms the version (23.26.1) and lists OS/RAM/disk prerequisites. Click Next to continue.

 

STEP 2

Select Configuration Option

 

Choose how Oracle will be installed. For a full installation with an immediately usable database, select 'Create and configure a single instance database'.

 



Figure: Configuration Option — Create single instance database selected

       Create and configure a single instance database — installs software AND creates CDB+PDB

       Set Up Software Only — install software; use DBCA separately to create the database

       Upgrade an existing database — for upgrading from a previous Oracle release

 

STEP 3

Select Database Edition

 

Choose the Oracle edition to install. Enterprise Edition is recommended for production workloads.

 



Figure: Database Edition Selection — Enterprise Edition recommended

       Enterprise Edition (EE) — highest performance, scalability, security — for production

       Standard Edition 2 (SE2) — departmental use, max 2 CPU sockets

       Personal Edition — single-user development only, no network clients

 

STEP 4

Specify Oracle Base & Home Location

 

Set the directory paths where Oracle software will be installed. These paths must already exist with correct ownership (oracle:oinstall).

 



Figure: Installation Location — Oracle Base and ORACLE_HOME paths

 

# Create directories first (as root):

mkdir -p /u01/app/oracle/product/23.26.1/dbhome_1

chown -R oracle:oinstall /u01

chmod -R 775 /u01

 

TIP

Oracle Base: /u01/app/oracle   |   Oracle Home: /u01/app/oracle/product/23.26.1/dbhome_1

 

STEP 5

Configure Operating System Groups

 

Assign Unix groups for each database privilege category. These groups must exist on the OS before proceeding.

 



Figure: OS Group Configuration — Privilege groups mapped to Unix groups

 

# Verify groups exist (run as root):

grep -E 'oinstall|dba|oper|backupdba|dgdba|kmdba|asmadmin' /etc/group

 

NOTE

The preinstall RPM from Step 1 automatically creates all required groups. You should not need to create them manually.

 

STEP 6

Review Installation Summary

 

The Summary screen shows all selected parameters. Review carefully — clicking Install begins the actual file copy and linking process, which cannot be undone without a full deinstall.

 



Figure: Installation Summary — Review all parameters before clicking Install

Key values to verify before clicking Install:

       Oracle Home path is correct and has enough disk space

       Character set is AL32UTF8 (Unicode — required for AI/multilingual apps)

       DB name and PDB name match your naming convention

 

STEP 7

Installation Progress

 

The installer copies binaries, links Oracle executables, and runs configuration scripts. This typically takes 10–25 minutes depending on disk speed.

 



Figure: Installation Progress — File copy, linking, and root scripts

 

IMPORTANT

When prompted, open a NEW root terminal and run both scripts: orainstRoot.sh then root.sh. Do NOT close the installer window.

 

# Run in a NEW terminal as root when prompted:

/u01/app/oraInventory/orainstRoot.sh

/u01/app/oracle/product/23.26.1/dbhome_1/root.sh

 

STEP 8

Installation Complete

 

The green success banner confirms Oracle AI Database 26ai is installed and the database is open. Note the Enterprise Manager URL and connection details.

 



Figure: Installation Complete — Oracle AI Database 26ai ready

 

NEXT STEP

Connect via SQL*Plus or SQL Developer using:  sqlplus sys/<pwd>@//localhost:1521/ORCLPDB1 as sysdba

 

  Creating Database with DBCA (Software-Only Install)

 

If you chose 'Set Up Software Only' in Step 2, create the database with DBCA after installation:

 

dbca

 

# In DBCA wizard:

#  1. Operation:      Create a database

#  2. Mode:           Advanced Configuration

#  3. Type:           General Purpose or Transaction Processing

#  4. Architecture:   Multitenant (CDB + PDB)

#  5. DB Name:        ORCL

#  6. PDB Name:       ORCLPDB1

#  7. Character Set:  AL32UTF8

#  8. SYS Password:   <strong password>

 

  AI Vector Search — Quick Verification Test

 

After installation, verify the AI Vector Search feature is working:

 

-- Connect to PDB

ALTER SESSION SET CONTAINER = ORCLPDB1;

 

-- Create a vector table

CREATE TABLE demo_vectors (id NUMBER PRIMARY KEY, label VARCHAR2(100), embedding VECTOR(3));

 

-- Insert sample data

INSERT INTO demo_vectors VALUES (1, 'apple',  VECTOR('[0.1, 0.2, 0.3]'));

INSERT INTO demo_vectors VALUES (2, 'banana', VECTOR('[0.4, 0.5, 0.6]'));

INSERT INTO demo_vectors VALUES (3, 'cherry', VECTOR('[0.7, 0.8, 0.9]'));

COMMIT;

 

-- Cosine similarity search

SELECT id, label FROM demo_vectors

ORDER BY VECTOR_DISTANCE(embedding, VECTOR('[0.1, 0.2, 0.3]'), COSINE)

FETCH FIRST 2 ROWS ONLY;

 

EXPECTED

apple returns as closest match (distance ≈ 0.0). If VECTOR type is unavailable, check your 26ai build version.

 

  Quick Reference Commands

 

Task

Command

Start DB (Free)

sudo /etc/init.d/oracle-free-26ai start

Stop DB (Free)

sudo /etc/init.d/oracle-free-26ai stop

Check Status

sudo /etc/init.d/oracle-free-26ai status

Start Listener

lsnrctl start

Stop Listener

lsnrctl stop

Connect SYSDBA

sqlplus sys/<pwd> as sysdba

List PDBs

SELECT name, open_mode FROM v$pdbs;

Check DB Version

SELECT * FROM v$version;

Open All PDBs

ALTER PLUGGABLE DATABASE ALL OPEN;

Save PDB State

ALTER PLUGGABLE DATABASE ALL SAVE STATE;

Check Alert Log

adrci → show alert -tail 50

Enterprise Manager

https://localhost:5500/em