Monday, March 18, 2019

ORA-01126: database must be mounted in this instance and not open in any instance


There are certain administration tasks that need database to be mounted, not open, while performing the task, otherwise ORA-01126 would be returned. In the following I am explaining one of those operations that returned me ORA-01126 because I had my database open while converting my database to archivelog mode.

SQL> alter database archivelog;
*
ERROR at line 1:
ORA-01126: database must be mounted in this instance and not open in any instance

-- Confirm that database is open that caused this error.
SQL> select status from v$instance;

STATUS
------------
OPEN

To enable archivelog mode, first shutdown the database (if already open), mount the database, and then enable the archivelog mode. After that, now you can open the database. Following are the steps to perform this task.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 1610612736 bytes
Fixed Size                  3046176 bytes
Variable Size             520094944 bytes
Database Buffers         1073741824 bytes
Redo Buffers               13729792 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> alter database open ;

Database altered.

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     1014
Next log sequence to archive   1016
Current log sequence           1016

No comments:

Post a Comment

Popular Posts - All Times