How to drop schema objects without dropping user in one pass?

HI,
I am after some PL/SQL that can drop all the objects that a user has, without dropping the user himself.
I can write a query that spool SQL to a script to drop all the appropriate objects, but it has to be run multiple times as some things can not be dropped before other objects which may appear later in the script.
I want a script that developers can run once to drop all their objects.
Can anyone point me in the right direction?
Thanks

Hi,
but it has to be run multiple times as some things can not be dropped beforeDid you use cascade constraints ?
select 'drop '||object_type||' '|| object_name||  DECODE(OBJECT_TYPE,'TABLE',' CASCADE CONSTRAINTS;',';')
from user_objects
I want a script that developers can run once to drop all their objects.With a PL/SQL, and a loop on user_object.
But if you drop all objects, why not drop/recreate user ?
Nicolas.
Message was edited by:
N. Gasparotto

Similar Messages

  • How to drop user giving error ORA-03113

    hello,
    I am trying to drop user as follows
    SQL> drop user jbponm_trf cascade;
    drop user jbponm_trf cascade
    ERROR at line 1:
    ORA-03113: end-of-file on communication channel
    SQL>
    pls suggest me how to drop user.

    Hi Dear,
    Please reconnect from SYS and try again ,Looking there is some problem in your oracle connection or network problem.
    Best Regards
    Faheem latif
    Senior Database Architect
    Genie Technologies (Pvt.) Ltd.

  • How to drag and drop user from one node to other node.

    Dear All,
    How to drag and drop user from one node to other node.I tried but no success.
    What are precautions to be taken.
    Cay anybody kindly explain it.
    Thank you.

    Hello, if you had this message you had created BP....
    Now you don't have to user USERS_GEN this transaction is used only in first action, when you create the user in R/3 and then you pass this user to EBP in the organizational structure.
    Now you have to:
    1) Go to PPOMA_BBP
    2) Double click on organizational unit that you want to put this user (purchasing organization or purchasing group box for example)
    3) Select assign button in the top of the functions in the transaction
    4) Click on incorporates -- position
    5) Put userID that you want to add in this organizational unit
    6) Click Save
    Thanks
    Rosa

  • How can we import object from 1 user to another user using DATA PUMP

    hi,
    i have taken full export by EXPDP( data pump) now i want to import user objects from target user of one database to another user of different database.
    plz reply me solution
    Thanks

    Hi,
    impdp 'user/user@db' DIRECTORY=DATA_PUMP_DIR(DEFAULT) DUMPFILE=FILENAME.dmp LOGFILE=IMPORT.LOG REMAP_SCHEMA=SOURCE SCHEMA:TArget SCHEMA
    1.Before Import check whether user importing has read,write on directory.
    2.Always Try to Add logfile clause This will help.
    3.Add TABLE_EXISTS_ACTION=REPLACE if you want target schema tables to be replaced by source schema table(if both has same table)
    Regards,
    NEerav

  • Photoshop cs6 crashes with "appcrash - module ig75icd64.dll; no problem for a local admin user however. i've tried giving specified user full access to photoshop.exe and set it to Win XP compatibility. how do i fix this without giving user local admin acc

    photoshop cs6 crashes with "appcrash - module ig75icd64.dll; no problem for a local admin user however. i've tried giving specified user full access to photoshop.exe and set it to Win XP compatibility. how do i fix this without giving user local admin access?

    Danny,
    Topic or subject titles should be clear, pertinent and concise so that individual users can tell at a glance if they can help or not.
    That field is not for attempting to fit your entire question in there.
    Please keep this in mind next time you post.  Thank you.

  • How to Use Discoverer Desktop without Database User ?

    Hi,
    I am new to Discoverer Desktop,
    How to Use Discoverer Desktop without Database User ?
    Suresh

    You'll need to have access to some sort of database account to use the tool. If you just loaded the tool onto a machine, Disco is not going to be useful - you need to create an end user layer, and business areas.
    I suggest you start here:
    www.oracle.com/technology/documentation/bi.html

  • How to delete a page without deleting more than one

    how to delete a page without deleting more than one in pages

    Hi alldogsgotoheaven,
    Method 1.
    Menu > View > Show Thumbnails
    Click on a thumbnail.
    If it shows a yellow border around all the pages, they a part on a single section.
    Click in your document at the beginning of the page you want to delete, and Menu > Insert > Section Break.
    Insert another Section Break at the end of that page.
    The page is now isolated in its own section and you can delete its thumbnail.
    Regards,
    Ian.

  • HT4539 I followed the instructions given to turn my automatic download icon in my iphone 3 and still goes back to off position. Any idea how to fix this issue without getting a new one?

    I followed the instructions given to turn my automatic download icon in my iphone 3 and still goes back to off position. Any idea how to fix this issue without getting a new one?

    Something may have gone amiss on your iPhone.
    To attempt to correct this follow these steps:
    Backup your iPhone using iTunes or iCloud.
    Use iTunes to completely restore your iPhone as Factory new.
    Monitor battery usage to see if it is normal. If not, you may have a hardware problem - if so, contact Apple support.
    Restore your iPhone from your backup above.
    Check battery usage to confirm that it is still normal.

  • Access schema objects without having to specify the user.

    I've just created a role in a schema and assigned some priveleges.Then I created a user and granted the role to it. But as the newly created user is not the owner of the schema when I say a simle select query like this:
    SELECT EMLOYEENAME FROM EMPLOYEES
    I get "table or view does not exist" error. Is there a way I can wirte refer to objects in this schema without having to indicate the owner. So instead of writing SCOT.EMPLOYEES I want to write just EMPLOYEES.

    >
    I get "table or view does not exist" error. Is there a way I can wirte refer to objects in this schema without having to indicate the owner. So instead of writing SCOT.EMPLOYEES I want to write just EMPLOYEES.
    >
    Create a public synonym for the object.
    CREATE PUBLIC SYNONYM EMP32 FOR SCOTT.EMP;Then you do not need to specify the schema.
    --- edited to add doc reference
    See CREATE SYNONYM in the SQL Language doc
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_7001.htm
    >
    CREATE SYNONYM Purpose
    Use the CREATE SYNONYM statement to create a synonym, which is an alternative name for a table, view, sequence, operator, procedure, stored function, package, materialized view, Java class schema object, user-defined object type, or another synonym. A synonym places a dependency on its target object and becomes invalid if the target object is changed or dropped.
    >
    Edited by: rp0428 on Apr 5, 2012 10:56 PM

  • How to drop Users DBF file in oracle 11g?

    Hi All
    I dropped the user and want to free the table space(To import another user(Which has more than 10 GB of record).
    the below is my query which i used to import the data and schema
    impdp system/test DIRECTORY=dump_dir DUMPFILE=exp_test.dmp FULL=Y LOGFILE=import_test.log REMAP_TABLESPACE=TEST_DATA:USERS
    After dropping my user i checked into the folder C:\oradata\orcl and i found two files USERS01.DBF(21.1GB,its 21.1 gb because i tried to cretae an another schema nd i got stuc up with low disk space.) and TEMP01.DBF(1.66GB).
    I tried to drop USERS tablespace and i could nt able to do it.
    Can any one help me to reduce the size of both two files?
    Thanks & Regards
    Vijay
    Edited by: Vijayamurugan on Jun 15, 2011 8:22 AM

    bobonacus wrote:
    shutdown immediate
    startup nomount
    alter database mount;
    why not just 'startup mount'?? Why the two-step?
    alter database rename file
    'e:\oracle\oradata\orcl\indx01.dbf',
    'e:\oracle\oradata\orcl\rbs01.dbf',
    'e:\oracle\oradata\orcl\system01.dbf',
    'e:\oracle\oradata\orcl\temp01.dbf',
    'e:\oracle\oradata\orcl\tools01.dbf',
    'e:\oracle\oradata\orcl\users01.dbf',
    'e:\oracle\oradata\orcl\file1.dbf',
    'e:\oracle\oradata\orcl\file2.dbf'
    to
    'd:\oracle\oradata\orcl\indx01.dbf',
    'd:\oracle\oradata\orcl\rbs01.dbf',
    'd:\oracle\oradata\orcl\system01.dbf',
    'd:\oracle\oradata\orcl\temp01.dbf',
    'd:\oracle\oradata\orcl\tools01.dbf',
    'd:\oracle\oradata\orcl\users01.dbf',
    'd:\oracle\oradata\orcl\file1.dbf',
    'd:\oracle\oradata\orcl\file2.dbf'
    ;I'm not sure the RENAME clause allows multiple files to be listed like that. In any event, just reduce the chance of error, I'd do it file by file.
    You forgot to mention that you need to actually move the files, at the os level. All the above does is change their entries in the control file. It doesn't do anything at all to the files themselves.
    >
    shutdown immediate
    startup
    No need for the shutdown. You could just ALTER DATBASE OPEN.
    >
    >
    you can get a full listing of files by
    alter database backup controlfile to trace;
    and you can then copy and paste from that ...
    Simpler, just select from dba_data_files.
    eta. of course assuming you mean move your database files rather than your installation
    Edited by: bobonacus on Jun 16, 2011 3:30 PM

  • How to drop users tablespace

    Hey to all
         I want to drop USER tablespace wid data file but as we know many oracle users Scott OE data reside in users. How can I protect their data. One method which I read on net to export and import once again is quite cumbersome I run this query
    SELECT
    owner
    , segment_name
    , segment_type
    FROM
    dba_segments
    WHERE
    tablespace_name='USERS'
    it give me two user OE and SCOTT. How can I protect their data before drop the user tablespace

    Hi..
    As you said direct load takes place, then the rows which are inserted are always inserted above the HWM.So the datafile size size kept on increasing.
    i read about segment advisor i run the advisor it shrink the segment but users tablespace size on OS still 200 GB could anyone tell why??You would have run alter table <table_name> shrink space; -- This statement will procede in two steps:
    - The first step makes the segment compact by moving rows further down to free blocks at the beginning of the segment.
    - The second step adjusts the high watermark. For this Oracle needs an exclusive table lock,but for a very short moment only.
    The HWM goes below, and table are now more well organized.This command doesn't resize the datafile at the OS level.So, the datafile sizes will remain the same.One thing which you can do is resize(decrease) the datafile.
    MINIMUM DATAFILE SIZE
    COLUMN block_size NEW_VALUE v_block_size
    SELECT TO_NUMBER(value) AS block_size
    FROM   v$parameter
    WHERE  name = 'db_block_size';
    COLUMN tablespace_name FORMAT A20
    COLUMN file_name FORMAT A50
    COLUMN current_bytes FORMAT 999999999999999
    COLUMN shrink_by_bytes FORMAT 999999999999999
    COLUMN resize_to_bytes FORMAT 999999999999999
    SET VERIFY OFF
    SET LINESIZE 200
    SELECT a.tablespace_name,
           a.file_name,
           a.bytes/1024/1024 AS current_MB,
           (a.bytes - b.resize_to)/1024/1024 AS shrink_by_MB,
           b.resize_to/1024/1024 AS resize_to_MB
    FROM   dba_data_files a,
           (SELECT file_id, MAX((block_id+blocks-1)*&v_block_size) AS resize_to
            FROM   dba_extents
            GROUP by file_id) b
    WHERE  a.file_id = b.file_id
    ORDER BY a.tablespace_name, a.file_name;Edited by: Anand... on Feb 17, 2009 12:01 PM

  • How to get Request object and LDAP user

    Hi All,
    How to get Request object, coz i want to see the out put of this code
    IUser myUser = request.getUser();
    String uid=myUser.getUid();
    I want to get only LDAP user from the server, for that i am having  code but i think this code is returning me all user from the server.
    com.sap.security.api.IUser user = null;
    try {
          IUserFactory userFactory = UMFactory.getUserFactory();
         IUserSearchFilter searchFilter = userFactory.getUserSearchFilter();
    ISearchResult searchResult = userFactory.searchUsers(searchFilter);
       int count = 0;
        List list = new ArrayList();
         while (searchResult.hasNext()) {
                      count++;
                       String uniqueid = (String) searchResult.next();
                        user = userFactory.getUser(uniqueid);
                        list.add(user.getUniqueName());
    This code is giving me all user from the server LDAP and as well as portal user.
    But i want only LDAP.
    Please help me out. It's urgent.
    Regards,
    Deepak

    Hi
    use the following code
    //Request
    IWDRequest = WDProtocolAdapter.getProtocolAdapter().getRequestObject();
    //User
    IWDClientUser = WDClientUser.getCurrentUser();
    Regards
    Ayyapparaj

  • How to install ipa update without destroying user data

    Hi - hopefully this is an easy one...
    I'm getting near the end of my iPad app development... at this point I can store files locally on the iPad from my AIR app.
    But everytime I make a change to the app and republish the ipa, the only way I know how to get it on my iPad is to delete the app on the iPad, then install the new version through iTunes. This works, but it blows away any locally saved 'user' files.
    So how can i put a new ipa update on the device without losing stored data, similar to downloading an update from the app store?
    Thanks

    That's what I'd like to do, but I'm just fumbling through iTunes - I drop the new ipa into my 'Apps' (under library), then go to my device to Sync, but it never installs the new version. It seems to think I'm already 'synced', even though the ipa is new. I must be missing something basic. Also, the ipa is in 'Quick publishing for device testing mode'... Perhaps it needs to be published for Ad-hoc distribution?
    -rich

  • Audit whole schema objects by multiple users or schemas in oracle 11gR2

    OS: LInux
    DB: Oracle 11gR2
    schema as many tables and DML access given to many user/schemas in oracle db.
    AUDIT ALL BY test BY ACCESS; appears to be audit records created only when changes are done using actual owner connection but not grantee..
    I need to audit all the test tables DML and DDL performed not just owner but all the grantees (grantees action should be audited only grantee do dml or ddl on test owner tables not his own tables).
    Need to audit test owner tables accessed by multiple users DML and DDL actions..
    is there any simplest way to do this and can someone please help me out?
    thanks.

    http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_4007.htm#i2059073
    Please read the passage labeled 'Auditing by clause'. It answers your question.
    Kindly consult documentation before asking any question.
    Sybrand Bakker
    Senior Oracle DBA

  • How to retrieve Calender object without Time Zone.

    I need to Generate the xml file with JAXB. JAXB requires the Calendar class for the Calendar class. So i am converting the Date Object into the claendar Object as follows.
    Calendar calendar = Calendar.getInstance();
    calendar.setTime(date) // date is the parameter
    return date;
    It was taking the default Time zone and creating the XML element as
    <Resource employmentType="Employee" externalId="104718"
    hireDate="2000-02-29+05:30" includeInDatamart="true"
    isActive="true">
    But i need hireDate="2000-02-29" without the time zone.
    In server side it accepts the "yyyy-mm-dd" formate only.

    I need to Generate the xml file with JAXB. JAXB
    requires the Calendar class for the Calendar class.
    So i am converting the Date Object into the claendar
    Object as follows.
    Calendar calendar = Calendar.getInstance();
    calendar.setTime(date) // date is the parameter
    return date;use this
    //return date;
    return calendar.getTime();
    s taking the default Time zone and creating the XML
    element as
    <Resource employmentType="Employee"
    externalId="104718"
    hireDate="2000-02-29+05:30"
    includeInDatamart="true"
    isActive="true">
    d hireDate="2000-02-29" without the time zone.
    In server side it accepts the "yyyy-mm-dd" formate
    only.

Maybe you are looking for

  • Printing from Acrobat Adobe 8 Pro

    I have a pdf document that has grey shaded boxes on most of the pages.  It is a pdf that uses highlight fields so end users cann enter information and save it to the pdf without having to print the document out and fill it out by hand.  The problem I

  • How 2 select FA virtual Cam in Skype

    how 2 select a FA virtual Cam in Skype

  • Mail Address Panel

    I have just installed OS X Yosemite and when in Mail, I can't find the Address Panel which I used to use with OS X Mavericks to select multiple addressees for an e-mail. As it stands now, I can only add addressees one at a time from contacts or Previ

  • Create Credit Memo Request through txn. FB65

    Hi Experts, I want to create Credit Memo Request through txn. FB65.I am using Bapi 'BAPI_ACC_DOCUMENT_POST' to create it. Can anyone please tell the the minimum parameters which I will pass in this BAPI to create CreditMemo Request? Helpul answers wi

  • BAPI to get password policies in ABAP environement

    Hi all, I  am new to the SAP ABAP environement. (worked to some extent on  JAVA stack). I am working on the RFCSDK using  C language. I wanted to know how to see the password policies in ABAP environment. I went through the link http://help.sap.com/s