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/