How to permanently delete an Oracle database to create a database with the same instance name and an oracle instance

Source: Internet
Author: User

How to permanently delete an Oracle database to create a database with the same instance name and an oracle instance

I chose the OMF method when creating the database today. The result file name is automatically named in Oracle. I cannot understand it, so I decided to delete it and recreate it.

Oracle provides the command to delete a database: drop database.
The database needs to be in the mount state, and then alter system enable restricted session; there is a post on the Internet saying that exclusive is also required. Because I installed VM, I only have one user, so no need to use it. Because the current status is open, you need to change it to mount and execute:
SQL> alter database close;
Alter database close
*
ERROR at line 1:
ORA-01093: alter database close only permitted with no sessions connected
The reason is that a session is still connected and is executed again after exiting,
SQL> alter database close;
Database altered.

SQL> select status from v $ instance;
STATUS
------------
MOUNTED

SQL> alter system enable restricted session;
System altered.

SQL> select status from v $ instance;
STATUS
------------
MOUNTED

SQL> drop database;
Database dropped.

In this case, the alert. log record information:
Create Relation ADR_CONTROL
Create Relation ADR_INVALIDATION
Create Relation INC_METER_IMPT_DEF
Create Relation INC_METER_PK_IMPTS
USER (ospid: 8748): terminating the instance
Instance terminated by USER, pid = 8748
Deleted Oracle managed file/opt/app/ora11g/oradata/BISAL/controlfile/o1_mf_9x4fgq77 _. ctl
Deleted Oracle managed file/opt/app/ora11g/flash_recovery_area/BISAL/controlfile/o1_mf_9x4fgypb _. ctl
Completed: drop database
Shutting down instance (abort)
License high water mark = 2
Fri Jul 25 19:09:26 2014
Instance shutdown complete

There are no files in the oradata path, so I think this database has been deleted.
However, if you attempt to create a database of the same instance by executing dbca again, an error is returned:


Although the data files and log files associated with the bisal instance have been physically deleted, the configuration files related to the instance are not deleted, so you cannot create a database for the same instance again.

In this case, you need to manually delete the instance configurations:
1. Delete all directories of $ ORACLE_BASE/admin/$ ORACLE_SID.
2. Delete SID-related files and parameter files under $ ORACLE_HOME/dbs, including hc_bisal.dat, init. ora, lkBISAL, and orapwbisal.
3. Delete the instances in/etc/oratab.
4. You can run find.-name bisal in $ ORACLE_HOME to delete all instance-related files.

Run dbca again to create a database with the same instance name.


How to delete database instances in oracle

We recommend that you use DBCA to completely delete the database,
All content related to this instance will be deleted!

Start -- program -- Oracle10g -- configuration and transplantation tool-DBCA

After entering DBCA, select Delete database to display
For all instance databases, select the database to be deleted.

How can I completely delete ORACLE database data? Into

1. First turn off oralce, net stop OracleServiceORCL (ORCL is my Instance name, changed to yours), or go to my computer service to turn it off
2. Start-> Program-> Oracle-oracle version. My version is 10ghome-> Oracle Installation Products-> Universal Installer. Uninstall oracle.
3. Go to the Registry, regedit, and delete all keys under HKEY_LOCAL_MACHINE \ SOFTWARE \ ORACLE. Delete all oracle words in HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services, HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ Eventlog \ Application.
4. Delete the C drive \ Program Files \ Oracle directory and all Files and folders in the oracle installation directory.
5. Delete oracle-related classpath and path in Environment Variables
This is basically the case, and we will continue to ask questions.

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.