Oracle deletes user and Tablespace methods under Linux _oracle

Source: Internet
Author: User
Tags oracle database

This article illustrates the way Oracle deletes users and tablespaces under Linux. Share to everyone for your reference, specific as follows:

1. Delete a user

sql> conn/as sysdba
Connected.
sql> drop user userName cascade;

User has deleted

If the user cannot delete, and error:

ERROR at line 1:
Ora-01940:cannot drop a user is currently connected

By viewing the user's progress, kill the user process, and then delete the user.

Sql> Select sid,serial# from v$session where username= ' username ';
SID  serial#
--------------------    9019
sql> alter system kill session ' 150,9019 ';
System altered.

2. Delete a table space

Prerequisite: Before deleting a tablespace, make sure that the tablespace is not used by another user before deleting it

Copy Code code as follows:
Drop tablespace nsname including contents and datafiles cascade;

including contents delete content in a table space, if there is content in the tablespace before the table space is deleted without this parameter, the table space is not erased, so it is customary to add this parameter.
including datafiles delete data files in a tablespace。
cascade Constraints Delete foreign key references for tables in tablespace。

I hope this article will help you with your Oracle database program design.

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.