Skip to content

ORA-01034 Oracle Not Available - Database Startup and Connection Issues

Error Text: ORA-01034: ORACLE not available

This error occurs when attempting to connect to an Oracle database instance that is not running or not accessible. It indicates that the Oracle database instance is either shut down, in the process of starting up, or has encountered a critical failure that prevents normal operation.

Database Instance States
├── SHUTDOWN - Instance completely stopped
├── NOMOUNT - Instance started, no database mounted
├── MOUNT - Database mounted, not open
├── OPEN - Database fully operational
└── RESTRICTED - Limited access mode
-- Complete startup sequence
STARTUP NOMOUNT; -- Start instance only
ALTER DATABASE MOUNT; -- Mount database
ALTER DATABASE OPEN; -- Open database
-- Or combined
STARTUP; -- Complete startup to OPEN state
  • Database was shut down normally
  • System reboot without auto-start
  • Manual shutdown by DBA
  • Scheduled maintenance window
-- Common startup issues
-- Parameter file problems
-- Memory allocation failures
-- Control file corruption
-- Redo log issues
  • Insufficient memory
  • Disk space problems
  • Permission issues
  • Network connectivity problems
Terminal window
# Check if Oracle processes are running
ps -ef | grep oracle
ps -ef | grep pmon # Process Monitor
ps -ef | grep smon # System Monitor
# Check listener status
lsnrctl status
# Check database status (if possible)
sqlplus / as sysdba
Terminal window
# Verify Oracle environment variables
echo $ORACLE_HOME
echo $ORACLE_SID
echo $PATH
# Check Oracle inventory
cat $ORACLE_HOME/oraInst.loc
# Verify Oracle installation
ls -la $ORACLE_HOME/bin/oracle
Terminal window
# Check available memory
free -m
# or
top
# Check disk space
df -h $ORACLE_HOME
df -h $ORACLE_BASE
# Check system logs
tail -f /var/log/messages
dmesg | grep -i oracle
-- Connect as SYSDBA
sqlplus / as sysdba
-- Check current status
SELECT status FROM v$instance;
-- Start the database
STARTUP;
-- Verify status
SELECT name, open_mode, database_status FROM v$database;
-- Start with parameter file
STARTUP PFILE='/path/to/init.ora';
-- Start in restricted mode
STARTUP RESTRICT;
-- Start in mount mode only
STARTUP MOUNT;
-- Force startup after abnormal shutdown
STARTUP FORCE;
-- Manual step-by-step startup
STARTUP NOMOUNT;
-- Check: Instance started but database not mounted
ALTER DATABASE MOUNT;
-- Check: Database mounted but not open
ALTER DATABASE OPEN;
-- Check: Database fully operational
-- If SPFILE is corrupted
STARTUP PFILE='/path/to/backup/init.ora';
-- Create new SPFILE from working PFILE
CREATE SPFILE FROM PFILE='/path/to/init.ora';
-- Check parameter file location
SHOW PARAMETER spfile;
-- Check SGA requirements
SHOW PARAMETER sga_target;
SHOW PARAMETER sga_max_size;
-- Reduce memory if needed (emergency)
STARTUP PFILE='/tmp/reduced_memory.ora';
-- Sample reduced memory parameter file
-- db_name=your_db
-- sga_target=512M # Reduced from higher value
-- pga_aggregate_target=256M
-- Check control file locations
SHOW PARAMETER control_files;
-- If control files are missing/corrupted
-- Restore from backup or recreate
STARTUP NOMOUNT;
-- Then restore control file from backup
-- Or recreate using CREATE CONTROLFILE script
-- Check redo log status
SELECT * FROM v$log;
SELECT * FROM v$logfile;
-- If redo logs are corrupted
STARTUP MOUNT;
RECOVER DATABASE;
ALTER DATABASE OPEN;
-- Attempt normal startup
STARTUP;
-- If recovery is needed
STARTUP MOUNT;
RECOVER DATABASE;
ALTER DATABASE OPEN;
-- If incomplete recovery needed
RECOVER DATABASE UNTIL TIME '2024-01-01 12:00:00';
ALTER DATABASE OPEN RESETLOGS;
-- Force startup (use with caution)
STARTUP FORCE;
-- Start with minimal parameters
STARTUP PFILE='/tmp/minimal.ora';
-- Minimal parameter file example:
-- db_name=testdb
-- control_files='/path/to/control01.ctl'
-- compatible=19.0.0
Terminal window
# Connect to RMAN
rman target /
# Start instance if needed
startup nomount;
# Restore and recover
restore database;
recover database;
alter database open;
Terminal window
# Create systemd service file
sudo vi /etc/systemd/system/oracle.service
# Service file content:
[Unit]
Description=Oracle Database
After=network.target
[Service]
Type=forking
User=oracle
Group=oinstall
Environment=ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
Environment=ORACLE_SID=ORCL
ExecStart=/u01/app/oracle/product/19.0.0/dbhome_1/bin/dbstart
ExecStop=/u01/app/oracle/product/19.0.0/dbhome_1/bin/dbshut
Restart=always
[Install]
WantedBy=multi-user.target
# Enable service
sudo systemctl enable oracle.service
sudo systemctl start oracle.service
#!/bin/bash
# Oracle startup script
ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
ORACLE_SID=ORCL
export ORACLE_HOME ORACLE_SID
# Start listener
$ORACLE_HOME/bin/lsnrctl start
# Start database
$ORACLE_HOME/bin/sqlplus -s / as sysdba << EOF
startup;
exit;
EOF
echo "Oracle database startup completed"
-- Database availability check
SET PAGESIZE 0 FEEDBACK OFF HEADING OFF
SELECT
CASE
WHEN COUNT(*) > 0 THEN 'DATABASE_AVAILABLE'
ELSE 'DATABASE_NOT_AVAILABLE'
END
FROM v$database;
#!/bin/bash
# Oracle availability monitor
ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
ORACLE_SID=ORCL
export ORACLE_HOME ORACLE_SID
# Check if database is available
RESULT=$($ORACLE_HOME/bin/sqlplus -s / as sysdba << EOF
SET PAGESIZE 0 FEEDBACK OFF HEADING OFF
SELECT 'AVAILABLE' FROM v\$database WHERE ROWNUM = 1;
EXIT;
EOF
)
if [[ "$RESULT" != *"AVAILABLE"* ]]; then
echo "Database not available - attempting startup"
$ORACLE_HOME/bin/sqlplus -s / as sysdba << EOF
startup;
exit;
EOF
# Send alert
echo "Oracle database was down and startup attempted" | \
mail -s "Oracle Database Alert" [email protected]
fi
-- Create monitoring table
CREATE TABLE db_availability_log (
check_time TIMESTAMP,
status VARCHAR2(20),
message VARCHAR2(200)
);
-- Monitoring procedure
CREATE OR REPLACE PROCEDURE log_db_status AS
BEGIN
INSERT INTO db_availability_log VALUES (
SYSTIMESTAMP,
'AVAILABLE',
'Database operational'
);
COMMIT;
EXCEPTION
WHEN OTHERS THEN
-- Log to OS file if database not available
NULL;
END;
/
Terminal window
# Quick status check
ps -ef | grep pmon | grep -v grep
# If no processes found, attempt startup
sqlplus / as sysdba << EOF
startup;
exit;
EOF
Terminal window
# 1. Check Oracle processes
ps -ef | grep oracle
# 2. Check available resources
free -m && df -h
# 3. Check Oracle environment
echo $ORACLE_HOME $ORACLE_SID
# 4. Attempt startup
sqlplus / as sysdba
startup;
# 5. Check alert log
tail -100 $ORACLE_BASE/diag/rdbms/$ORACLE_SID/$ORACLE_SID/trace/alert_$ORACLE_SID.log
  • ORA-01033: Oracle initialization or shutdown in progress
  • ORA-01092: Oracle instance terminated
  • ORA-12514: TNS listener does not currently know of service
  • ORA-12541: TNS no listener
  1. Implement automated startup procedures
  2. Monitor database availability continuously
  3. Maintain proper backup and recovery procedures
  4. Document startup/shutdown procedures
  5. Set up alerting for database unavailability
  6. Regular health checks and maintenance
  • Check if Oracle processes are running
  • Verify Oracle environment variables
  • Check system resources (memory, disk)
  • Attempt database startup
  • Review alert log for errors
  • Check listener status
  • Verify parameter file integrity
  • Test database connectivity after startup