Dropping schema and associated objects

I have just had a request to drop a particular schema with the associated objects...how do i go about it

Hi,
Its simple, use the follow sintaxe:
DROP USER <schema> CASCADE;
I hope help you!
Jonathan Ferreira - Brazil
http://www.ebs11i.com.br

Similar Messages

  • Dropping users and their objects

    Is it possible to drop users and their objects (default tablespaces, stored procedures, etc.) ?

    ... because it drops what they own, and they don't own the default_tablespace, it might be used by lots of people.

  • Help with exp schema and related objects

    I need to export a schema from one database to another. I must also be able to export the tablespaces, roles, constraints, etc that are associated with it that aren't necessarily part of the schema. Is there an easy way to do this? I had already tried simply doing a schema exp/imp and it threw up a bunch of errors mostly grants which isn't that big of a deal but some of the tables were not created due to tablespaces being missing.

    exp system/manager file=exp.dmp log=exp.log full=y at the source database.
    imp system/manager file=exp.dmp log=imp_show.log full=y show=y - create the log file without importing the data
    edit the imp_show.log and extract the statements that are needed to re-create users,roles,alter user and grants.
    Pre-create the tablespaces using SQL*Plus in the target database.
    execute the modified imp_show.log(All DDl's)
    imp system/manager file=exp.dmp log=imp.log fromuser=A touser=B
    Re-compile all the Invalid Objects.
    HTH
    -Anantha

  • Oracle and business object!

    hi!
    we have oracle 10g on rhel4.
    we do have business object XI
    even if i have restricted the permissions for the users, why do i see all the schemas and there objects like CTXSYSM, DBSNMP, SYS when i connect throught the universe of BUSINESS OBJECT XI.
    may be it is because by default all users have the privileges which the pseudo role PUBLIC has and when we install oracle, there are so many privileges like insert, update,delete, select on many objects in the schemas which are given to public by default.
    can i seperate a user from the public privileges?
    kind of ... revoking public (role) from the user???
    thanks

    since public pseudo role has a lot of privileges (select, insert, execute, delete) on many of the objects in CTXSYS, SYS, DBSNMP schemas. Also a user can run a select on ALL_ and USER_ tables and views from the dictionary.
    can i restrict a user to view the ALL_ and the USER_ views from the dictionary and should see only the objects which i give explicit priviliges.
    also can i revoke the privileges which are defaultly given to PUBLIC from a user???
    (all users have the privileges which are there with PUBLIC, and defaultly PUBLIC has a lot of privileges at database creation time)
    please help me to resolve the security threat!
    thanks

  • How to identify and delete objects after failure of registering XML schema

    Hi,
    I have tried to register a XML schema with many global elements but failed.
    I have checked the view DBA_XML_SCHEMA and found that there is an entry for this failed XML schema and the disk spaces would not be freed after the failure of registration as well.
    I have tried DBMS_XMLSCHEMA.deleteSchema() with DELETE_CASCADE_FORCE but failed with ORA-31000: Resource is not XDB document.
    How can I identify and delete the objects for this failed XML schema and free up the disk space ?
    I would not prefer to use 'DROP USER ... CASCADE' since there are other objects owned by this user.
    Thanks in advance.

    you can get them from user_objects.
    but you have to identify them manuallly if your schema has other objects other then created by the xml schema creation process.
    Note these objects will be cases senistitive. so you should enclose them with double quotes during deletion.

  • Error: Cannot drop schema because it is being referenced by object

    My database has a schema with the same name as a user (let's call it 'username'). This schema was not explicitly created. I want to drop the User 'username' but I have to drop the schema 'username' first; However, when I tried to do that I got the message...
    "Cannot drop schema 'username' because it is being referenced by object 'vw_Inventory'
    There is a view named 'vw_Inventory' but I don't see where it's referencing this schema, or any schema for that matter. Why would I get this error and how do I resolve it so I can drop the Schema and User?
    Darrell H Burns

    If a Schema has some objects in it, then you cannot drop that Schema until you remove all the objects out of it. You can change the schema owner
    to another database principal and drop the user like,
    Alter Authorization ON Schema::username TO DBO; Drop User username;
    other option would be
    Transfer the username schema objects to a different schema and drop username schema and user like.
    Alter Schema DBO Transfer Username.[OBEJECTNAME] ;
    --need to repeat this until you transfer all objects under this schema
    Drop Schema username;
    Drop User username;
    Regards,
    Praveen D'sa
    MCITP - Database Administrator - 2008
    sqlerrors

  • Schema And Schema Objects

    MySQL is a database server that can have several 'databases' each with it's own connection params, privileges, users and objects (tables, views etc). Oracle however has the structure of a 'single database' with 'categorized' objects (if I am correct), that is a database with one or more schemas (usually mapping to users) each containing objects (tables, views etc). If I want to build an application on oracle (I am using Oracle XE) that has several subsystems or modules (HR, Finance, Operations etc) and I want the subsystems to have their own boundaries (like their own database in MySQL, or their own schema in Oracle) containing only relevant objects but interconnected by the usage of the application (the application creates value or functionality across these subsystems), how do I go about structuring my database to handle this, since schemas map to users.
    Putt another way, since I'll be working with a user account (a schema) can I have schemas within this account / schema to contain objects for the modules. Wherever the 'module schemas' are, how do I interact with them collectively with my login account which I will use as the database connection within the application.
    I don't know if this is the best way to go about it, but my project requirement has changed to one that should have clearly defined modules having similar structures in the database that can be scaled up to their own database in a database server or each in it's own database server.

    I did not mention this, but I also already tried that without success. Whether 'DEPARTMENT_VIEW' or 'DEPARTMENTVIEW', I still get 'no data found'. I did not expect to succedd with 'DEPARTMENT_VIEW' just like that, because it is the name of the view in the other schema (HR) hence I made the synomyn 'DEPARTMENTVIEW' pointing to it, which hasn't worked either.
    I tried this query :
    "SELECT table_name FROM user_tab_columns"
    I could see only the tables defined in my schema. This makes me wonder how I can run a query against 'USER_TAB_COLUMNS' for a SYNONYM as the table_name, when 'USER_TAB_COLUMNS' has no entry for any of my SYNONYMS in the first place ??
    Based on what Ignacio Ruiz said :
    'you need to query ALL_SYNONYMS if you want to resolve DEPARTMENTVIEW'I tried this query :
    "SELECT table_owner, table_name FROM ALL_SYNONYMS WHERE synonym_name = 'DEPARTMENTVIEW'"
    and got the record, but I don't know how to merge this result to a query on 'USER_TAB_COLUMNS' to get the
    column_name, data_type, data_length, data_precision, data_scale, nullable etc for the said 'DEPARTMENTVIEW'.
    Please what else can I try. Thanks alot.

  • How to drop a schema and load another one?

    I have an interruption during installing the central instance of a SAP Netweaver 04s System. After I restarted the installation I found this message in the Log file.
    <b>ERROR 2006-08-16 16:17:04</b>
    CJS-30109 The Java load in database PDV/liesc1ddbw01 has already been configured. <p> SOLUTION: Drop the schema and load it with a new load before running this installation.
    <b>ERROR 2006-08-16 16:17:04</b>
    CJS-30109  The Java load in database PDV/liesc1ddbw01 has already been configured. <p> SOLUTION: Drop the schema and load it with a new load before running this installation.
    <b>ERROR 2006-08-16 16:17:04</b>
    FCO-00011  The step getJavaLoadType with step key |NW_Java_CI|ind|ind|ind|ind|0|0|NW_CI_Instance|ind|ind|ind|ind|10|0|getJavaLoadType was executed with status ERROR.
    QUESTION: How to drop a schema and load another one?

    Hello,
    I got the similar error....but i did reinstall from o.s. and done the installation again...it was worked successfully..
    if you find out alternate solution for that ...please let us know..
    Regards,

  • How can I export schema with all objects and few tables without data

    Hi all
    Verion 10g EE.
    I have to export schema with all objects but i need to ingnore some of the table data.
    There are 4 table those have huge data, we need not to export those tables data but structure should export.
    Thanks,
    Nr

    You can do this with a single command.  Run your export as normal and add query parameters for the 4 tables that you don't want any rows:
    expdp ...  query=schema1.table1:"where rownum = 0" query=schema2.table2:"where rownum = 0" ...
    It is best to put the query parameters in a parameter file so you don't have to worry about escaping any OS special characters.
    Dean

  • How do i drag and drop onto a smart object layer in Photoshop CS 5.5

    I recently bought a 3d mock up Photoshop file as I want to mock up my designs such as business cards and other 3d items. The file notes said With a simple drag and drop on the smart object layer your design will be presented in a realistic and striking way.
    Can you tell me how I do what they are telling me to do as I have played around with the file till the cows come home and can't work out how to do it. Do I need to do the old fashioned mock up way by skewing the image to fit or is there an easier way such as the drag and drop...?
    Any help will be gratefully received,
    Thanks

    Hi here is the template PSD and then I want to put my business card design over and it says you can drag and drop as per my previous message ...

  • 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

  • Are the Kuler color schemes and individual colors associated with pantone codes?

    Are the Kuler color schemes and individual colors associated with pantone codes?
    How do you find the pantone reference for a color in a color scheme?

    Hi Monika,
    What is the reason that it is possible to search for (explore) color themes from within the Color Themes panel in InDesign and Photoshop, but not in Illustrator? Seems a bit odd…
    Cheers,
    Marinka

  • ERRORS IN PORTAL WHEN DROPPING SCHEMA OWNER

    I ran a PDK demo script and added 2 db packages to a schema in the portal repository. After running theses porlets, I decided to attempt to create my own. Prior to adding to the schema I wanted to clean out the old db packages. I thought the easy way would be to drop the user schema and recreate it clean. I attempted to drop the user schema by entering portal as orcladmin, clicking on navigator, then db objects, selected the schema I wanted to drop and it sat there for a few minutes and returned errors. I then opened SQLplus and dropped the user cascade. I noticed that the provider is still in the providers tab list, but can't delete it. I then attempted to re-create the schema using same name and I get additional errors in portal (see upload file: createrror2.jpg. I need to 1) drop the old provider and 2) recreate a new schema and provider that I will use for my portal/portlets.
    Any suggestions.

    I ran a PDK demo script and added 2 db packages to a schema in the portal repository. After running theses porlets, I decided to attempt to create my own. Prior to adding to the schema I wanted to clean out the old db packages. I thought the easy way would be to drop the user schema and recreate it clean. I attempted to drop the user schema by entering portal as orcladmin, clicking on navigator, then db objects, selected the schema I wanted to drop and it sat there for a few minutes and returned errors. I then opened SQLplus and dropped the user cascade. I noticed that the provider is still in the providers tab list, but can't delete it. I then attempted to re-create the schema using same name and I get additional errors in portal (see upload file: createrror2.jpg. I need to 1) drop the old provider and 2) recreate a new schema and provider that I will use for my portal/portlets.
    Any suggestions.

  • Compare 2 schemas and get the difference with .sql file.

    Hi,
    I am using ORACLE DATABASE 11g R2 and ORACLE Linux 5.
    I want to perform a very lengthy process and want to make it automated.
    I am having a software named as SVN. In which all the developers keep their updated scripts.
    We have 2 schema's one is used for developement and when all the development seems good we implement the scripts on the final schema which is used by testing people also.
    Now every day we need to check the modifications in the development schema, that we do by observing the updated scripts in the SVN software. Now we get the scripts which are modified.
    We will fire this scripts to a sample schema then we will compare the objects in this schema and the same objects in our final schema. If the objects in sample schema is different than the final schema it should give me the
    script to create the same type object in the final schema.
    Below is a proper example to explain :-
    Developement Schema :- 'DEV'
    SVN Script Schema :- 'SVNscript'
    Main Schema :- 'MAIN'
    1) On Monday developers modified/added 4 tables in the development schema names 'DEV' after working for a day they found that the changes are necessary and so checked-in in the SVN software.
    2) On tuesday morning we found 4 scripts which has been modified/added in the SVN.
    The Scripts were as follows :-
    1St table :- An extra column was added.
    2nd table :- An index was created on it.
    3rd table :- 2 Columns were dropped from it.
    4th table :- A new table is added in the schema.
    Now taking these 4 scripts i am going to execute it in a sample schema named :- SVNscript
    SVNscript schema will have now 4 tables with proper properties(columns,indexes,...). Now this is the final table structure as we want in our 'MAIN' schema .
    Coming to MAIN schema which is our most important schema and all the development work is finally posted here.Considering MAIN schema is having around 1000 tables,500 function/procedure/package and many more DB objects.
    I want to compare(one way compare) from SVNscript schema --> MAIN schema :- That the objects present in the SVNscripts schema is same or not in the MAIN schema. If its not same then this code should generate a .sql script for me which i should be able to fire on the MAIN schema.
    The output .sql scripts should be something like this :-
    1st Table :- Alter table add...
    2nd Table :- Create index on table...
    3rd Table :- Alter table drop...
    4th table :- Create table tablename...
    I found a link while trying this but it is not the perfect fit to my requirement
    http://www.dbspecialists.com/files/scripts/compare_schemas.sql
    Please let me know the best code to compare 2 schemas and get a .sql file as output of the difference.
    Thanks in advance.

    Yes I followed the tutorial properly this time. Still i have a few queries :-
    1) This is returning me the 'ALTER TABLE...' statement but how to make it more efficient to return all the DDL dependent on the table, Like index,trigger,view...
    2) I want to compare objects in a different schema on a different db. I have created an DBLINK but how to use it ... can i use it like
    DBMS_METADATA.OPEN('TABLE'," Network_link_name " );Can you please give me some clear about it.
    3) I created a table 'TAB1' with which i want to compare a 'TAB1' in other schema.I was not getting how to compare on remote dblink so,I created the same table with the following code in the same schema
    CREATE TABLE TAB1_OLD as select * from TAB1@DBLINK where 1=2;Now when i fire the below query to get the alter difference I get the following error :-
    SQL> SELECT get_table_alterddl('TAB1','TAB1_old') FROM dual;
    SELECT get_table_alterddl('TAB1','TAB1_old') FROM dual
    ORA-31603: object "TAB1_old" of type TABLE not found in schema "SVNCHECK"
    ORA-06512: at "SYS.DBMS_METADATA", line 5225
    ORA-06512: at "SYS.DBMS_METADATA", line 5189
    ORA-06512: at "SVNCHECK.GET_TABLE_SXML", line 17
    ORA-06512: at "SVNCHECK.COMPARE_TABLE_SXML", line 12
    ORA-06512: at "SVNCHECK.GET_TABLE_ALTERXML", line 11
    ORA-06512: at "SVNCHECK.GET_TABLE_ALTERDDL", line 11
    Can you please guide me why i am getting this error?
    I have made sure that TAB1_OLD table has been created and the entries are also present in the data dictionary tables.
    SQL> select * from tab1_old;
    EMPNO ENAME                  MGR DEPTNO
    ----- -------------------- ----- ------The only difference is that this table was created with CREATE TABLE AS SELECT statement ....
    Thanks.

  • Dropping schema in production...

    Hi
    We are implementing a block point in our production database.Can I drop and recreate the schema (owner) instead of dropping the schema objects incase there is a backout and the database/schema has to be restored. I will be taking a full DB export before the activity starts.I want to be 100% sure since this is production...Thanks!

    Hi
    Again , i will remind you don't depends on Oracle exp/imp or datapump because this is not the physical backup . I suggest you to take backup using Rman full backup . Since you are performing it on production and in case something wrong happen then you can recover to your previous state .
    Once you have rman backup then extract the ddl (say roles,privileges, user ) ,and then you can drop the schemas and re-create it after running the ddl's . Check the link to extract the DDL's
    http://neeraj-dba.blogspot.in/2011/12/dbmsmetadata-package-to-extract-all-ddl.html
    Hope this may help you
    Good Luck
    --neeraj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for