oracle rac 删除数据库

16 篇文章 0 订阅

方法一、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 完成-----

谨记:心存敬畏,行有所止。

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值