RMAN-06941: Database must be closed and mounted EXCLUSIVE and RESTRICTED and How to Drop Database including Backups RMAN

Hi,

Sometimes You can get “RMAN-06941: Database must be closed and mounted EXCLUSIVE and RESTRICTED. ” error.

 

Details of error are as follows.

RMAN-06941: Database must be closed and mounted EXCLUSIVE and RESTRICTED.
Cause: DROP DATABASE was attempted while the database was open or not mounted EXCLUSIVE and RESTRICTED.
Action: Change the database state to mounted EXCLUSIVE and RESTRICTED.
This error is related with the RESTRICTED mode, if you want to drop database, you need to convert database mode into RESTRICTED mode.

Shutdown database and open it restrict mode as follows.

 

SQL> shutdown immediate

SQL> startup mount exclusive restrict;

ORACLE instance started.

Total System Global Area 8551575552 bytes
Fixed Size                  2245480 bytes
Variable Size            3036679320 bytes
Database Buffers         5502926848 bytes
Redo Buffers                9723904 bytes
Database mounted.

 

Drop database as follows.

 

$  rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Tue Apr 29 09:39:00 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: MSDB (DBID=678786456432)

RMAN> drop database including backups;

database name is "MSDB" and DBID is 678786456432
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of drop db & bck command at 29/04/2020 09:39:05
RMAN-06941: Database must be closed and mounted EXCLUSIVE and RESTRICTED.

RMAN>

 

This error is related with the cluster_database parameter, When this parameter’s value is TRUE, you can get this error.

SQL> show parameter cluster

NAME                                 TYPE        VALUE

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

cluster_database                     boolean     TRUE
Set this parameter to False, then restart database.
ALTER SYSTEM SET CLUSTER_DATABASE=FALSE scope=spfile sid='*';
shutdown immediate;


startup;

 

Now try to drop database as follows.

$  rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Tue Apr 29 09:39:46 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: MSDB (DBID=678786456432, not open)

RMAN> drop database including backups;
database name is "MSDB" and DBID is 678786456432

Do you really want to drop all backups and the database (enter YES or NO)? yes

 

 

Do you want to learn more details about RMAN, then read the following articles.

https://ittutorial.org/rman-backup-restore-and-recovery-tutorials-for-beginners-in-the-oracle-database/

 

About Mehmet Salih Deveci

I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress [email protected].-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  [email protected] a mail atabilirsiniz.

Leave a Reply

Your email address will not be published. Required fields are marked *