Home > Database > Oracle > How to delete database in oracle?

How to delete database in oracle?

coldplay.xixi
Release: 2020-07-16 14:01:19
Original
12602 people have browsed it

How to delete a database in oracle: first confirm the database to be deleted and close the database; then reopen the database in restrict mode and start it in the mount state; finally use the drop database statement and delete the management or tracking of the database Information is enough.

How to delete database in oracle?

Oracle method to delete a database:

1. Confirm whether the current database is the one to be deleted A

select name from v$database;
Copy after login
Copy after login

2. Close the database

shutdown immediate;
Copy after login

3. Reopen the database in restrict mode and boot to mount state

sqlplus / as sysdba
startup restrict mount;    --> # 只有拥有sysdba角色权限的用户才可以登录数据库,普通用户则不可以
Copy after login

                                                                                                           -                                                                                                                                                                                    

select name from v$database;
Copy after login
Copy after login

6. Delete the management/tracking information of the database

drop database;  --> # (10g及以后版本适用)
                    # 它只删除了数据库文件(控制文件、数据文件、日志文件),
                      但并不删除ORACLEBASE/admin/ORACLE_SID目录下的文件
                      也不会删除初始化参数文件及密码文件。
Copy after login

7. Clean up the database information in the oratab file

rm ORACLEBASE/admin/ORACLE_SID
Copy after login
8. Clean up environment variables

cd /etc/
ll | grep ora
vim oratab
#orcl:/u01/app/oracle/product/10.2.0/db_1:N
Copy after login

Related learning recommendations: oracle database learning tutorial

The above is the detailed content of How to delete database in oracle?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template