Pages

Sunday, June 29, 2025

ORA-01041: internal error. hostdef extension doesn't exist. Change oracle to run in NOARCHIVEMODE

=================
Error
=================
SQL> SHUTDOWN IMMEDIATE;
ORA-24324: service handle not initialized
ORA-01041: internal error. hostdef extension doesn't exist
SQL>

=================
Issue
=================
Oracle cannot be started.
It was created in ARCHIVEMODE by mistake, with archive log dest folder missing.
Purpose: Change database to be NOARCHIVEMODE


SQL> STARTUP NOMOUNT;
SP2-0642: SQL*Plus internal error state 2133, context 3114:0:0
Unsafe to proceed
ORA-03114: not connected to ORACLE


SQL> SHUTDOWN ABORT;
ORA-24324: service handle not initialized
ORA-01041: internal error. hostdef extension doesn't exist

SQL> exit

=================
Solution
=================
Stop listener, which is preventing proper shutdown and start in NOMOUNT mode.

~> ps -ef | grep ora

oracle      1760       1  0 08:09 ?        00:00:00 /software/oracle/19c/bin/tnslsnr LISTENER -inherit

~> lsnrctl stop

~>  sqlplus / as sysdba

SQL> STARTUP NOMOUNT;
ORACLE instance started.

Total System Global Area 8589930736 bytes
Fixed Size                 13693168 bytes
Variable Size            4412407808 bytes
Database Buffers         4143972352 bytes
Redo Buffers               19857408 bytes

SQL> create pfile='/software/oracle/admin/igt/pfile/pfile.ora'
from spfile='/software/oracle/admin/igt/pfile/spfileigt.ora';

File created.

SQL> !cp /software/oracle/admin/igt/pfile/spfileigt.ora /software/oracle/admin/igt/pfile/spfileigt.ora_orig

SQL> !cp /software/oracle/admin/igt/pfile/pfile.ora /software/oracle/admin/igt/pfile/pfile.ora_orig

SQL> !vi /software/oracle/admin/igt/pfile/pfile.ora

Set log_archive_dest_1 to some valid path.
*.log_archive_dest_1='location=/some/valid/path'

SQL> CREATE SPFILE='/software/oracle/admin/igt/pfile/spfileigt.ora_new' FROM PFILE='/software/oracle/admin/igt/pfile/orig_pfile.ora';

File created.

SQL> SHUTDOWN IMMEDIATE;
ORA-01507: database not mounted


ORACLE instance shut down.

SQL> !mv /software/oracle/admin/igt/pfile/spfileigt.ora_new /software/oracle/admin/igt/pfile/spfileigt.ora

SQL>  STARTUP NOMOUNT;
ORACLE instance started.
Total System Global Area 8589930736 bytes
Fixed Size                 13693168 bytes
Variable Size            4412407808 bytes
Database Buffers         4143972352 bytes
Redo Buffers               19857408 bytes

SQL> ALTER DATABASE MOUNT;

Database altered.

SQL> ALTER DATABASE NOARCHIVELOG;

Database altered.

SQL> SHUTDOWN IMMEDIATE;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.

SQL> STARTUP;
ORACLE instance started.

Total System Global Area 8589930736 bytes
Fixed Size                 13693168 bytes
Variable Size            4412407808 bytes
Database Buffers         4143972352 bytes
Redo Buffers               19857408 bytes
Database mounted.
Database opened.

SQL> SELECT LOG_MODE FROM V$DATABASE;
LOG_MODE
---------------------
NOARCHIVELOG

SQL> exit

No comments:

Post a Comment