OracleSQL * PLUS

Source: Internet
Author: User
--. SQL script-the only note is the following f: dropobj. SQL is the operation. SQL; -- if your computer does not have a drive F, replace it with D or E. -- used to delete the current user

--. SQL script-the only note is the following f: \ dropobj. SQL is the operation. SQL; -- if your computer does not have a drive F, replace it with D or E. -- used to delete the current user

Homepage → Database Technology

Background:

Read News

Oracle SQL * PLUS-delete all objects of the current user

[Date: 2010-10-24] Source: Oracle community Author: langxspirit [Font:]

--. SQL script
-- The only note is that f: \ dropobj. SQL is the operated. SQL;
-- Your computer does not have a drive F. Replace it with D or E.
-- Used to delete all objects of the current user
-- Use for drop all objects in current user;
Set heading off;
Set feedback off;
Spool f: \ dropobj. SQL;

Prompt -- delete Constraints
Select 'alter table' | table_name | 'drop constraint' | constraint_name | ';'
From user_constraints where constraint_type = 'R ';

Prompt -- delete a tablespace
Select 'drop table' | table_name | ';' from user_tables;

Prompt -- delete View
Select 'drop view' | view_name | ';' from user_views;

Prompt -- delete a sequence of numbers
Select 'drop sequence '| sequence_name |'; 'from user_sequences;

Prompt -- delete a function
Select 'drop function' | object_name | ';' from user_objects
Where object_type = 'function ';

Prompt -- delete a stored procedure
Select 'drop procedure '| object_name |'; 'from user_objects
Where object_type = 'processure ';

Prompt -- delete a package
Prompt -- delete Package content
Select 'drop package' | object_name | ';' from user_objects
Where object_type = 'package ';

Prompt -- delete a database link
Select 'drop database link' | object_name | ';' from user_objects
Where object_type = 'database link ';

Spool off;
Set heading on;
Set feedback on;

@ F: \ dropobj. SQL;
Host del f: \ dropobj. SQL;
-- Done for drop objects in current user;
-- Import the entire segment in SQL * PLUS as. SQL or directly copy and paste it, and press F5 to complete the operation.

  • 0
  • Install Oracle 10.2.0.1 on the minimum RedHat i386

    MySQL tool series-mysqldump: database backup program

    Oracle

    Image Information

    View All comments in this article (0)

    Comments

    Latest Information

    Popular this week

    Introduction to Linux community-advertisement service-website map-help Info-contact us
    The articles published on this site (LinuxIDC) do not mean that they agree with the statement or description. They only provide more information and do not constitute any suggestions.


    Copyright©2006-2014 Linux community All rights reserved Zhejiang ICP backup No. 06018118

    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.