Dropping Schema

Hi,
I am using oracle 9i release 2 and i have a schema in database.
If i drop that schema my harddisk space is effect.
I want to remove space of my hard disk through droping some schema.
How it is possible.

Try
The query shows the total and available free space in each datafile.
SELECT DFS.FILE_ID, DDF.FILE_NAME, DDF.BYTES/1024 AS "TOTAL(KB)", DFS.FREE AS "FREE(KB)"
FROM DBA_DATA_FILES DDF, (
SELECT FILE_ID, SUM(BYTES)/1024 as "FREE"
FROM DBA_FREE_SPACE
GROUP BY FILE_ID) DFS
WHERE DFS.FILE_ID = DDF.FILE_ID
ORDER BY 2;
Used = Total - Free
You can resize the datafile to a size >= actual used size.
But, if you resize to a limit equal or near used size, probably you will need to resize again to increase the value. I suggest to you think about (re)allocate the
files in another (new) disk.
Miguel

Similar Messages

  • If I drop schemas will stats still be availible in the database

    Hi,
    I'm creating a duplicate of a database and was thinking of doing the following:
    1. exp data to file and move it over the network (there is a lot of long data in different schemas)
    2. imp data new dublicated database
    3. gather stats
    4. drop schemas
    5. recreate schemas
    6. load fresh data from a new export
    My question:
    Do we need to gather statistics again or will statistics stay in the dictionary allthough I drop the schemas?
    Regards
    933746

    sybrand_b wrote:
    If you use impdp network_link=
    you can import in the target database directly instead of this cumbersome procedure.
    And, of course the statistics are gone when you drop a schema.
    Sybrand Bakker
    Senior Oracle DBAHi,
    We use networklink as much as possible but it dosn't support long data.
    So this time we export to files and move it.
    Thanks for your reply

  • Should i drop schema or truncate tables before importing?

    I have exported a dump of the whole schema form oracle database. I need to import this to another database with a different schema name but same tables. The only thing i am doing is this to bring data consistent with the other database.
    Now Do i need to drop schema or do anything like that to avoid and redundancy or i can just go ahead and do the import? Please let me know how to do it. I would prefer not deleted any tables but truncate all the data if needed from about all 200 tables.
    Thanks

    For the places in your application where a Sequence is used to insert or set values in some tables, note that the sequence's current value may have been incremented if it has been used since the last import. If your truncate and re-import the tables, the tables may have the older (lower) values but the current sequence may be higher.
    You would then have to "reset" the sequence best by dropping and recreating it.

  • 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

  • Any DBA views storing history of Dropped schemas?

    DB Version: 10gR2 and higher
    username, created columns in DBA_USERS view display info about the schemaS which currently exist in the DB.
    Is there a Dictionary view which stores the history of Dropped schemas?

    user872043 wrote:
    DB Version: 10gR2 and higher
    username, created columns in DBA_USERS view display info about the schemaS which currently exist in the DB.
    Is there a Dictionary view which stores the history of Dropped schemas?No

  • Problem with Queue Table while dropping schema

    Hi,
    I want to DROP a schema, but it gives the following error while trying to drop it:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-24005: must use DBMS_AQADM.DROP_QUEUE_TABLE to drop queue tables
    From TOAD, I found that no queue or queue_table exists in the database presently.
    I'm using 10.2.0.2 RAC database.
    Can anyone help me to drop the schema?
    Thanks in advance..
    Regards,
    Anjan

    I have followed the doc 203225.1..
    Now getting the following error:
    ORA-00081: address range [0x60000000000A89A0, 0x60000000000A89A4) is not readable
    ORA-00600: internal error code, arguments: [kzdukl3], [24], [], [], [], [], [], []

  • 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.

  • 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

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Drop-schema

    I am new to oracle.could some one help me how to drop an oracle schema?
    This is what i have done
    Connected to the oracle instance.Then from googling i have DROP DATABASE command.
    I done this got error
    ORA-01586: database must be mounted EXCLUSIVE and not open for this operation
    while doing shutdown says insufficient privileges.
    i done grant all privileges to user
    then also i could not drop the schema
    Give me Suggestions please
    Thanks

    Mario Alcaide wrote:
    drop tablespace xxx INCLUDING CONTENTS AND DATAFILES;
    DROP USER XXX CASCADE;my previous post I was mentioned ," That particular schema also dropped", No the schema doesnot droped, the schema object will drop.
    C:\Users\mazar>set oracle_sid=azar
    C:\Users\mazar>sqlplus
    SQL*Plus: Release 11.2.0.1.0 Production on Tue May 11 12:34:23 2010
    Copyright (c) 1982, 2010, Oracle. All rights reserved.
    Enter user-name: sys/sys@azar as sysdba
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> create tablespace testdb datafile 'd:\azar\testdb01.dbf' size 10m;
    Tablespace created.
    SQL> create user testdrive identified by testdrive default tablespace testdb;
    User created.
    SQL> grant connect, resource to testdrive;
    Grant succeeded.
    SQL> create user testexample identified by testexample default tablespace testdb
    User created.
    SQL> grant connect, resource to testexample;
    Grant succeeded.
    SQL> commit;
    Commit complete.
    SQL> drop tablespace testdb including contents and datafiles;
    Tablespace dropped.
    SQL> select username,default_tablespace from dba_users where username='TESTDRIVE';
    USERNAME DEFAULT_TABLESPACE
    TESTDRIVE TESTDB
    SQL> SELECT TABLESPACE_NAME FROM DBA_DATA_FILES WHERE TABLESPACE_NAME='TESTDB';
    no rows selected
    SQL> COMMIT;
    Commit complete.
    SQL> conn testdrive/testdrive;
    Connected.
    SQL> select * from tab;
    no rows selected
    SQL> create table xxx(empno number);
    create table xxx(empno number)
    ERROR at line 1:
    ORA-00959: tablespace 'TESTDB' does not exist
    SQL> conn / as sysdba
    Connected.
    SQL> alter user testdrive default tablespace users;
    User altered.
    SQL> conn testdrive/testdrive@azar;
    Connected.
    SQL> create table xxx(empno number);
    Table created.
    SQL> conn / as sysdba
    Connected.
    SQL> create tablespace testdb datafile 'd:\azar\testdb01.dbf' size 10m;
    Tablespace created.
    SQL> alter user testexample default tablespace testdb;
    User altered.
    SQL> conn testexample/testexample;
    Connected.
    SQL> create table test(empno number);
    Table created.
    SQL> insert into test values('001');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> conn / as sysdba
    Connected.
    SQL> drop tablespace testdb including contents and datafiles;
    Tablespace dropped.
    SQL> commit;
    Commit complete.
    SQL> conn testexample/testexample;
    Connected.
    SQL> select * from test;
    select * from test
    ERROR at line 1:
    ORA-00942: table or view does not exist
    So you will have lose data...

  • Dropping Schema Question

    Hi,
    DROP USER X CASCADE;
    Does this also purge all teh foreign key constraints that were createdin "X" schema?
    Thank you for your time and help.

    ssk1974 wrote:
    Does this also purge all teh foreign key constraints that were createdin "X" schema?All schema objects are dropped and space occupied by schema physical objects is released back to free space pool. Nothing goes to recycle bin.
    SY.

  • Export user permissions  - dropping schema

    Hey, i created a new database from an export of the old database.
    So, for the import I need the user on the new db to import the users schema.
    How can I export the user ( with all his roles and permissions) on the old database and import this on the new database before I start the import.
    Reason:
    I need to drop the users schema from time to time. so the user is dropped with dropping the schema.
    Any ideas ?
    Chris

    If you don't know datapump you will find that a bit difficult but it's definitely a thing to consider.
    expdb user/pw consistent=Y
    correct syntax ?
    No Oracle changed the syntax (they reintroduce the syntax in 11.2 to help people but in 10.2 there is only the datapump syntax)
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/dp_export.htm#SUTIL200
    You have to use flashback_time and flashback_scn to replace consistent=y
    Will this export the user the the import will create the user on the new database ?
    Yes it can create the user.
    Whats the syntax for the import ?
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/dp_import.htm
    Notice you can do directly the import without the need of an export, directly with a database link !
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/dp_import.htm#i1007380
    There are restrictions (LONG columns etc.) but it can be interesting.
    The schema already exists, is there a need to delete the schema ?
    Not necessarily but it can make things easier.
    Best regards
    Phil

  • System refresh - drop schema

    I'v an existing QA system which I wish to refresh from PRD. The method will be using R3load export/import. My question is must I drop the database schema manually first before I start the import in QA, does sapinst prompt for us to delete the db schema or it does this overwriting automatically.
    My dba is suggesting that i drop the db using Oracle database assistance (dbca) manually before the import.
    I'm on SAP R/3 4.7, SAPinst 6.40.

    On large systems (> 1tb) the creation of datafiles can take quite some time. To reduce the downtime during a migration i was using this procedure:
    Do a test migration first:
    - run sapinst, select the import (i was using "start migmon manually")
    - at the start migmon step, stop sapinst, and backup the /tmp/sapinst_instdir
    - finish the test migration
    Then the real migration:
    - drop the SAP schema (can also take a lot of time on a ERP system)
    - recreated the SAP schema user
    - put the backup of sapinst_instdir back in place
    - done the export/import with migmon
    - restart sapinst and finish the migration
    So basically, this is possible but i can also confirm Markus's statement. If there already is a SAP schema sapinst asks if you want to drop it, i think you could even create a new one in that case.
    Cheers Michael
    Edited by: mho on Jan 26, 2011 12:50 PM
    Ah, just had a review in the documentation, i recreated the user myself (but obviously this is only a tribute the my special sapinst-procedure):
    create user SAPSR3 identified by sap default tablespace PSAPSR3USR temporary tablespace psaptemp;
    grant sapconn, unlimited tablespace to SAPSR3;

  • Unable to drop schema-user with AQTables

    Hello,
    Due to dirty manipulation on a schema (Oracle 9ir2), somes queues tables had been deleted, and others aq$_ tables exist.
    I'm not able to drop the user ;-(
    Impossible to drop the user, ORA-00604 error occured at recursive SQL level 1 - ORA-24005 must use DBMS_AQADM.DROP_QUEUE_TABLE to drop queues tables.
    and using DROP_QUEUE_TABLE return queue_tables does not exist.
    Any idea to drop the schema ?
    Thanks
    Rafael.

    Hy
    I had a similar problem with 8i and drop user cascade.
    Try this:
    1) create the same queues in another schema
    2) search the 'missing' tables in the new schema
    3) rebuild this tables in the corrupted schema (you may use dbastudio to get the DDL)
    4) use stop_queue, drop_queue and drop_queue_table to drop
    Lars Tetzlaff

  • OBIEE 11g RCU utility wont drop schema

    Just wanted to let people know something I ran across..
    if you create the BI schemas with rcu 11.1.1.3.0
    rcu 11.1.1.5.0 will not fully drop those schemas..
    I had to re-run rcu 11.1.1.3.0 in order to completely drop them before rcu 11.1.1.5.0 would let me recreate them..

    Thanks for the information Merlin. Was planning on installing 11.1.1.5.0 this weekend on a machine that already had 11.1.1.3.0.
    Amith.

Maybe you are looking for

  • Error on sender FCC: InterfaceDetermination did not yield any actual intfc

    Hi Experts, I am developing a File to Proxy scenario. Sender File adapter with FCC has been configured as required with the Fixedfiled lenghths and filed names. On trying to execute the i/f by placing the source file at the desired location; Sender C

  • Any standard transaction code to check Batch Creation Date of a batch?

    Please let me know if you know any transaction to check batch creation date of a batch , preferably with valuation information.

  • CC membership & email account hosting

    Hello from rainy Finland! I suppose there is no email hosting within the Creative Cloud? I was excited to transfer my pages to the BC but in order to get the two email accounts that I need, I´d have to upgrade to the webBasics + and pay 12 USD per mo

  • I frame ONLY MPEG2 video?

    Adobe Media Encoder documention states that: M Frames Number of B frames (bi‑directional frames) between consecutive I frames (intra‑frames) and P frames (predicted frames). N Frames Number of frames between I frames (intra‑frames). This value must b

  • DB12 not showing the last two completed Database Backup

    Hi Gurus, I have scheduled my production system to take a daily complete db backup , but when I see the Db12 Database History it shows the last complete backup was happened two days before(ex: 18/01/10 considering today is 21/01/10) and its not showi