Tuesday, 15 April 2025

How to drop Oracle 19C RAC Database step by step process

 Dear All,


In this post i am sharing step by step process to drop Oracle 19C RAC database.

Note : these steps only for demo purpose only****


srvctl status database -d prod



[oracle@prodnode1 bin]$ srvctl stop database -d prod

[oracle@prodnode1 bin]$ sqlplus / as sysdba


SQL*Plus: Release 19.0.0.0.0 - Production on Tue Apr 15 17:11:31 2025

Version 19.3.0.0.0


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


Connected to an idle instance.


SQL> startup mount exclusive restrict;

ORACLE instance started.


Total System Global Area 2533358728 bytes

Fixed Size                  8899720 bytes

Variable Size             637534208 bytes

Database Buffers         1879048192 bytes

Redo Buffers                7876608 bytes

Database mounted.

SQL> drop database;

drop database

*

ERROR at line 1:

ORA-01586: database must be mounted EXCLUSIVE and not open for this operation



SQL> shut abort

ORACLE instance shut down.

SQL> startup mount restrict restrict;

SP2-0714: invalid combination of STARTUP options

SQL> startup mount restrict;

ORACLE instance started.


Total System Global Area 2533358728 bytes

Fixed Size                  8899720 bytes

Variable Size             637534208 bytes

Database Buffers         1879048192 bytes

Redo Buffers                7876608 bytes

Database mounted.

SQL> drop database;

drop database

*

ERROR at line 1:

ORA-01586: database must be mounted EXCLUSIVE and not open for this operation


SQL> shut abort

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@prodnode1 bin]$ sqlplus / as sysdba


SQL*Plus: Release 19.0.0.0.0 - Production on Tue Apr 15 17:15:00 2025

Version 19.3.0.0.0


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


Connected to an idle instance.


SQL> STARTUP NOMOUNT RESTRICT;

alter database mount;

ORACLE instance started.


Total System Global Area 2533358728 bytes

Fixed Size                  8899720 bytes

Variable Size             637534208 bytes

Database Buffers         1879048192 bytes

Redo Buffers                7876608 bytes

SQL>


Database altered.


SQL> SQL>

SQL>

SQL> drop database;

drop database

*

ERROR at line 1:

ORA-01586: database must be mounted EXCLUSIVE and not open for this operation



SQL> shut abort

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@prodnode1 bin]$ sqlplus / as sysdba


SQL*Plus: Release 19.0.0.0.0 - Production on Tue Apr 15 17:17:01 2025

Version 19.3.0.0.0


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


Connected to an idle instance.


SQL> startup mount restrict;

ORACLE instance started.


Total System Global Area 2533358728 bytes

Fixed Size                  8899720 bytes

Variable Size             637534208 bytes

Database Buffers         1879048192 bytes

Redo Buffers                7876608 bytes

Database mounted.

SQL> alter system set cluster_database=false scope=spfile;


System altered.


SQL> drop database;

drop database

*

ERROR at line 1:

ORA-01586: database must be mounted EXCLUSIVE and not open for this operation



SQL> shut abort

ORACLE instance shut down.

SQL> startup mount restrict exclusive;

ORACLE instance started.


Total System Global Area 2533358728 bytes

Fixed Size                  8899720 bytes

Variable Size             637534208 bytes

Database Buffers         1879048192 bytes

Redo Buffers                7876608 bytes

Database mounted.

SQL> drop database;


Database dropped.


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

Version 19.3.0.0.0

SQL>










Thanks,
Srini

Saturday, 22 March 2025

How to Delete 2 RAC Databases step by step process on OEL 7

 Dear All,


In this post i am sharing how to delete a unused 2 node RAC Database remove from the database server.

Environment  :: 

racnode1 ::  db 1st node ( 2 databases are running - i am removing on db UATDB1) 

racnode2 ::  db 2nd node ( 2 databases are running - i am removing on db UATDB2) 









drop/delete  a 2 node rac database >>

> take backup before drop the database and keep for some time .



> check all the files 


select name from v$datafile;

select name from v$controlfile;

select member from v$logfile;



> disable any schedule jobs on OEM /Cron

[racsinfo@racnode1 dbs]$ crontab -l

no crontab for racsinfo

[racsinfo@racnode1 dbs]$


> alter system set cluster_database=FALSE scope=spfile sid='*';




> check the db cluster parameters 



srvctl status database -d uatdb

srvctl config database -d uatdb





srvctl stop database -d uatdb

sqlplus / as sysdba

startup mount exclusive restrict;

show parameter cluster 






select logins,instance_name,status from gv$instance; 

drop database;




>> remove the configuration from the cluster 


srvctl config database -d uatdb

srvctl remove database -d uatdb

srvctl config database -d uatdb




## Remove the directories if not required like archivelog directories etc.

##Cross verify if all the associated datafiles, controlfiles and online redologs 

are removed

## Remove the entry of the database from /etc/oratab

## crosscheck and cleanup all the old dumps or any log files

##Modify/drop any of the scripts used for this database in crontab






check the database instance  status 





cluster status :  ni uat db resource .




============================ ================================

extra steps if you want to remove including homes ...

srvctl stop instance -db db_unique_name -node node_name

srvctl relocate server -servers "server_name_list" -serverpool Free



srvctl status listener -l LISTENER

srvctl disable listener -l LISTENER -n racnode1

srvctl stop listener -l LISTENER -n racnode1



[grid@racnode1 ~]$ olsnodes -s -t

racnode1        Active  Unpinned

racnode2        Active  Unpinned

[grid@racnode1 ~]$


Thanks,
Srini