您的位置:首页 > 数据库 > Oracle

oracle rac 删除数据库

2020-07-14 04:37 141 查看

方法一、DBCA删除库
1、oracle用户执行dbca
-----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、将数据库实例关闭
[oracle@primarydb1 trace]$ srvctl stop database -d testdb

2、启动到nomount状态(在其中一个节点执行即可)
SYS@testdb1> 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
SYS@testdb1> alter system set cluster_database=false scope=spfile;

System altered.
–关库
SYS@testdb1> shutdown immediate
ORA-01507: database not mounted

ORACLE instance shut down.

3、mount restrict状态
SYS@testdb1> 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.

–删除库
SYS@testdb1> 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 完成-----

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: