oracle rac 删除数据库

时间:2024-04-07 12:51:31

方法一、DBCA删除库
1、oracle用户执行dbca
oracle rac 删除数据库oracle rac 删除数据库oracle rac 删除数据库oracle rac 删除数据库oracle rac 删除数据库-----dbca删除库完成-----

方法二、DROP DATABASE
官方文档描述:
Dropping a database involves removing its datafiles, redo log files, control files, and initialization parameter files. The DROP DATABASE statement deletes all control files and all other database files listed in the control file. It then shuts down the database instance.
To use the DROP DATABASE statement successfully, all of the following conditions must apply:
1.The database must be mounted and closed.
2.The database must be mounted exclusively–not in shared mode.
3.The database must be mounted as RESTRICTED.
An example of this statement is:DROP DATABASE;
The DROP DATABASE statement has no effect on archived log files, nor does it have any effect on copies or backups of the database. It is best to use RMAN to delete such files. If the database is on raw disks, the actual raw disk special files are not deleted.If you used the Database Configuration Assistant to create your database, you can use that tool to delete (drop) your database and remove the files.

步骤:
1、将数据库实例关闭
[[email protected] trace]$ srvctl stop database -d testdb

2、启动到nomount状态(在其中一个节点执行即可)
[email protected]> startup nomount
ORACLE instance started.

Total System Global Area 2455228416 bytes
Fixed Size 2255712 bytes
Variable Size 687867040 bytes
Database Buffers 1744830464 bytes
Redo Buffers 20275200 bytes
–设置集群模式为false
[email protected]> alter system set cluster_database=false scope=spfile;

System altered.
–关库
[email protected]> shutdown immediate
ORA-01507: database not mounted

ORACLE instance shut down.

3、mount restrict状态
[email protected]> startup mount restrict
ORACLE instance started.

Total System Global Area 2455228416 bytes
Fixed Size 2255712 bytes
Variable Size 620758176 bytes
Database Buffers 1811939328 bytes
Redo Buffers 20275200 bytes
Database mounted.

–删除库
[email protected]> drop database;

Database dropped.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

-----drop database 完成-----