Saturday, January 14, 2023

ORA-00265: instance recovery required, cannot set ARCHIVELOG mode


ORA-00265: instance recovery required, cannot set ARCHIVELOG mode


Cause : database was crashed, could be database shut abort or database was not clean shutdown.

check alert log as well to get more details . 


workaround :

[oracle@10.1.1.0 ~]$

[oracle@10.1.1.0 ~]$

[oracle@10.1.1.0 ~]$ sqlplus "/as sysdba"


SQL*Plus: Release 19.0.0.0.0 - Production on Sat Jan 14 10:04:10 2023

Version 19.3.0.0.0


Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to an idle instance.


SQL>

SQL> startup mount

ORACLE instance started.


Total System Global Area 1610609200 bytes

Fixed Size                  8897072 bytes

Variable Size             385875968 bytes

Database Buffers         1207959552 bytes

Redo Buffers                7876608 bytes

Database mounted.

SQL>

SQL>

SQL>

SQL>

SQL> select log_mode from v$database;


LOG_MODE

------------

NOARCHIVELOG


SQL>

SQL> alter database archivelog;

alter database archivelog

*

ERROR at line 1:

ORA-00265: instance recovery required, cannot set ARCHIVELOG mode



SQL> alter database open;


Database altered.


SQL> shut immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> exit

Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Version 19.3.0.0.0

[oracle@10.1.1.0 ~]$

[oracle@10.1.1.0 ~]$ sqlplus "/as sysdba"


SQL*Plus: Release 19.0.0.0.0 - Production on Sat Jan 14 10:23:27 2023

Version 19.3.0.0.0


Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to an idle instance.


SQL> startup mount

ORACLE instance started.


Total System Global Area 1610609200 bytes

Fixed Size                  8897072 bytes

Variable Size             385875968 bytes

Database Buffers         1207959552 bytes

Redo Buffers                7876608 bytes

Database mounted.

SQL>

SQL> select log_mode from v$database;


LOG_MODE

------------

NOARCHIVELOG


SQL> alter database archivelog;


Database altered.


SQL> alter database open;


Database altered.


SQL> select log_mode from v$database;


LOG_MODE

------------

ARCHIVELOG


SQL>

SQL> archive log list

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     4

Next log sequence to archive   6

Current log sequence           6

SQL>

SQL>

SQL>


About the Author : Anurag Pandey | Database cloud Architect | Oracle | SQL Server | PostgreSQL | AI and Data Platform Enthusiast

Anurag Pandey is a Database Architect with expertise in Oracle, PostgreSQL, SQL Server, Linux, and enterprise database platforms and specializes in database architecture, performance tuning, high availability, disaster recovery, cloud modernization, and operational excellence. With extensive experience in enterprise-scale environments, Anurag is passionate about leveraging AI, automation, and modern data platforms to improve reliability, scalability, and business outcomes. He actively contributes to technical communities through knowledge sharing, architecture guidance, and thought leadership in database and data engineering domains.

Follow more articles at

Visit Blog

Friday, January 13, 2023

Listener.ora & Tnsnames.ora file for Oracle Database

Listener.ora & Tnsnames.ora file for Oracle Database



listener.ora file (with static listener)

-----------------------------------------------

cat listener.ora

# listener.ora Network Configuration File: /u01/app/oracle/product/19.0/dbhome1/network/admin/listener.ora

# Generated by Oracle configuration tools.


LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.31.19.48)(PORT = 1521))

          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

    )

  )


SID_LIST_LISTENER =

  (SID_LIST =

    (SID_DESC =

      (GLOBAL_DBNAME = ddb)

      (ORACLE_HOME = /u01/app/oracle/product/19.0/dbhome1)

      (SID_NAME = ddb)

    )

  )






tnsnames.ora file
--------------------------

cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/19.0/dbhome1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

DDB=
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.31.19.48 )(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ddb)
    )
  )






About the Author : Anurag Pandey | Database cloud Architect | Oracle | SQL Server | PostgreSQL | AI and Data Platform Enthusiast

Anurag Pandey is a Database Architect with expertise in Oracle, PostgreSQL, SQL Server, Linux, and enterprise database platforms and specializes in database architecture, performance tuning, high availability, disaster recovery, cloud modernization, and operational excellence. With extensive experience in enterprise-scale environments, Anurag is passionate about leveraging AI, automation, and modern data platforms to improve reliability, scalability, and business outcomes. He actively contributes to technical communities through knowledge sharing, architecture guidance, and thought leadership in database and data engineering domains.

Follow more articles at

Visit Blog

How To Create Database Using DBCA in Silent Mode on Linux – 19C

How To Create Database Using DBCA in Silent Mode on Linux – 19C


Prerequisite :

  • Oracle 19c software already install
  • Oracle Environment variable should be set 
  • create database using dbca 
  • create or update listener.ora ,tnsnames.ora 
  • verify database



Command for database create:
-------------------------------------

  1. Login as oracle user 
  2. execute on terminal 

dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName ddb -sid ddb -sysPassword Rdx@1234567890 -systemPassword Rdx@1234567890 -createAsContainerDatabase false -emConfiguration NONE -datafileDestination /u01/app/oracle/oradata -storageType FS -characterSet AL32UTF8 -totalMemory 2048 -recoveryAreaDestination /u01/app/oracle/fast_recovery_area -sampleSchema true





[oracle@10.1.1.0~]$
[oracle@10.1.1.0~]$
[oracle@10.1.1.0~]$ dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName ddb -sid ddb -sysPassword Rdx@1234567890 -systemPassword Rdx@1234567890 -createAsContainerDatabase false -emConfiguration NONE -datafileDestination /u01/app/oracle/oradata -storageType FS -characterSet AL32UTF8 -totalMemory 2048 -recoveryAreaDestination /u01/app/oracle/fast_recovery_area -sampleSchema true
Prepare for db operation
10% complete
Copying database files
40% complete
Creating and starting Oracle instance
42% complete
46% complete
50% complete
54% complete
58% complete
60% complete
Completing Database Creation
66% complete
69% complete
70% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/cfgtoollogs/dbca/ddb.
Database Information:
Global Database Name:ddb
System Identifier(SID):ddb
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ddb/ddb.log" for further details.
[oracle@10.1.1.0~]$
[oracle@10.1.1.0~]$



[oracle@10.1.1.0~]$ cat /etc/oratab
#



# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third field indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
ddb:/u01/app/oracle/product/19.0/dbhome1:N
[oracle@10.1.1.0~]$
[oracle@10.1.1.0~]$ . oraenv
ORACLE_SID = [india] ? ddb
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@10.1.1.0~]$
[oracle@10.1.1.0~]$ sqlplus "/as sysdba"

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jan 13 14:19:03 2023
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> select name ,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
DDB       READ WRITE           PRIMARY

SQL>

About the Author : Anurag Pandey | Database cloud Architect | Oracle | SQL Server | PostgreSQL | AI and Data Platform Enthusiast

Anurag Pandey is a Database Architect with expertise in Oracle, PostgreSQL, SQL Server, Linux, and enterprise database platforms and specializes in database architecture, performance tuning, high availability, disaster recovery, cloud modernization, and operational excellence. With extensive experience in enterprise-scale environments, Anurag is passionate about leveraging AI, automation, and modern data platforms to improve reliability, scalability, and business outcomes. He actively contributes to technical communities through knowledge sharing, architecture guidance, and thought leadership in database and data engineering domains.

Follow more articles at

Visit Blog

Oracle RAC vs RAC One Node

Oracle RAC One Node is best understood as Oracle RAC infrastructure with only one active database instance at a time , plus the ability to r...