ITPub博客

首页 > Linux操作系统 > Linux操作系统 > ORA-01679: database must be mounted EXCLUSIVE and not open to activate

ORA-01679: database must be mounted EXCLUSIVE and not open to activate

原创 Linux操作系统 作者:tolywang 时间:2007-08-02 00:00:00 0 删除 编辑
Subject: ORA-01679 When Activating the Standby Database
Doc ID: Note:123133.1Type: PROBLEM
Last Revision Date: 04-MAY-2004Status: PUBLISHED

Problem Description
-------------------

You try to activate the standby database and you get the following error:

SVRMGR> alter database activate standby database;
alter database activate standby database
*
ORA-01679: database must be mounted EXCLUSIVE and not open to activate

Solution Description
--------------------

Solution 1:  Verify the standby site init.ora file does not have the
parameter parallel_server=true.  This parameter should not be set on
the standby site.


Solution 2:

1. Shutdown the standby database
2. Start the standby instance
3. Mount the instance as a standby database
4. Activate the standby database

Explanation
-----------
The standby database has been opened in READ ONLY mode.
Though you recovered the standby database by applying the appropriate 
archive log files, the standby database has to be shut down and then restarted
in mounted mode.

Test
----

==========================================
Start the STANDBY database in mounted mode
==========================================
SVRMGR> startup nomount
ORACLE instance started.
Total System Global Area                         23482352 bytes
Fixed Size                                          69616 bytes
Variable Size                                     6455296 bytes
Database Buffers                                 16777216 bytes
Redo Buffers                                       180224 bytes

SVRMGR> alter database mount standby database;
Statement processed.

SVRMGR> select instance_name,status from v$instance;
INSTANCE_NAME    STATUS 
---------------- -------
std              MOUNTED
1 row selected.

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

NAME      OPEN_MODE  CONTROL
--------- ---------- -------
PRIM    MOUNTED    STANDBY

===========================================
Open the STANDBY database in READ ONLY mode
===========================================
SVRMGR> alter database open read only;
Statement processed.

SVRMGR> select instance_name,status from v$instance;
INSTANCE_NAME    STATUS 
---------------- -------
std              OPEN   
1 row selected.

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

NAME      OPEN_MODE  CONTROL
--------- ---------- -------
PRIM      READ ONLY  STANDBY

1 row selected.

===============================================
Reset the STANDBY database back in mounted mode
===============================================
SVRMGR> recover standby database;
ORA-00279: change 93581 generated at 09/01/2000 17:13:52 needed for thread 1
ORA-00289: suggestion : /filer1/archivelogs/aleger/stdby/arch_1_454.arc
ORA-00280: change 93581 for thread 1 is in sequence #454
Specify log: {=suggested | filename | AUTO | CANCEL}
/filer1/archivelogs/aleger/primary/arch_1_454.arc
Log applied.
Media recovery complete.

SVRMGR> select instance_name,status from v$instance;
INSTANCE_NAME    STATUS 
---------------- -------
std              MOUNTED
1 row selected.

SVRMGR> select name, open_mode from v$database;
NAME      OPEN_MODE 
--------- ----------
PRIM      MOUNTED   
1 row selected.

=============================
Activate the STANDBY database
=============================
SVRMGR> alter database activate standby database;
alter database activate standby database
*
ORA-01679: database must be mounted EXCLUSIVE and not open to activate

============================================
Restart the STANDBY database in mounted mode
============================================
SVRMGR> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.

SVRMGR> startup nomount
ORACLE instance started.
Total System Global Area                         23482352 bytes
Fixed Size                                          69616 bytes
Variable Size                                     6455296 bytes
Database Buffers                                 16777216 bytes
Redo Buffers                                       180224 bytes

SVRMGR> alter database mount standby database;
Statement processed.

=============================
Activate the STANDBY database
=============================
SVRMGR> alter database activate standby database;
Statement processed.

SVRMGR> select instance_name,status from v$instance;
INSTANCE_NAME    STATUS 
---------------- -------
std              STARTED
1 row selected.

SVRMGR> select name, open_mode from v$database;
NAME      OPEN_MODE 
--------- ----------
ORA-01507: database not mounted

===============================================================
Follow the normal procedure to open the STANDBY database as the 
PRIMARY database
===============================================================
SVRMGR> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SVRMGR> exit

$ ORACLE_SID=prim
$ svrmgrl
SVRMGR> connect / as sysdba
Connected.

SVRMGR> shutdown immediate  
Database closed.
Database dismounted.
ORACLE instance shut down.
SVRMGR> exit
Server Manager complete.

$ ORACLE_SID=std
$ svrmgrl
SVRMGR> connect / as sysdba
Connected.

SVRMGR> startup
ORACLE instance started.
Total System Global Area                         23482352 bytes
Fixed Size                                          69616 bytes
Variable Size                                     6455296 bytes
Database Buffers                                 16777216 bytes
Redo Buffers                                       180224 bytes
Database mounted.
Database opened.

SVRMGR> select instance_name,status from v$instance;
INSTANCE_NAME    STATUS 
---------------- -------
std              OPEN   
1 row selected.

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

NAME      OPEN_MODE  CONTROL
--------- ---------- -------
PRIM    READ WRITE CURRENT

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-84841/,如需转载,请注明出处,否则将追究法律责任。

上一篇: LPI資料網站
请登录后发表评论 登录
全部评论
Oracle , MySQL, SAP IQ, SAP HANA, PostgreSQL, Tableau 技术讨论,希望在这里一起分享知识,讨论技术,畅谈人生 。

注册时间:2007-12-10

  • 博文量
    5595
  • 访问量
    13381765