Introduction to Oracle RMAN Maintenance (iv) How to delete a database

Source: Internet
Author: User
Tags backup

If you cannot take any other approach to the problem of the database, you can use the Rman drop database. Only the database should be placed in a restricted session mode, and the database can be deleted silently by using Rman to connect to the target database, executing the drop DB command. If you add the inculding backups parameter, delete the Rman-related backup at the same time. When the command is executed, RMAN first confirms the operation, and then continues to delete the database. You can use the noprompt parameter if you do not want to echo the prompt. Example:

DROP DATABASE;

DROP DATABASE noprompt;

DROP DATABASE including BACKUPS;

DROP DATABASE including BACKUPS noprompt;

The "DROP DATABASE" command deletes the

Datafiles

Logfiles

Controlfiles

Spfile

The "DROP DATABASE including BACKUPS" command in addition to the above files also

Archivelogs

Backup pieces generated by RMAN

sql> startup Mount;

The ORACLE routine has started.

Total System Global area 636100608 bytes

Fixed Size 1376464 bytes

Variable Size 457183024 bytes

Database buffers 171966464 bytes

Redo buffers 5574656 bytes

Database loading complete.

Sql> alter system enable restricted session;

The system has changed.

Alter system disable restricted session.

C:/users/administrator.daviddai>rman target/;

Recovery manager: Release 11.2.0.1.0-production on Sunday July 11 14:23:48 2010

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

Connected to target database: BL (dbid=680066685, not open)

Rman> DROP DATABASE including BACKUPS;

Database named "BL" and DBID is 680066685

Are you sure you want to delete all backups and databases (enter Yes or NO) Yes

Replacing the recovery directory with the target database control file

Allocated channel: Ora_disk_1

Channel ora_disk_1:sid=10 Device Type =disk

......

To add that Windows does not remove services, to remove services, requires manual running of the Ormdim command. Such as:

C:/users/administrator.daviddai>oradim-delete-sid BL

Unable to stop service, OS Error = 1062

Instance has been deleted.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.