Drop a tablespace and datafile when database is mounted

I tried to import data in my oracle 11g. It failed midway. I presumed that i did not size the redolog properly. Now my database cannot go beyound the mounted mode.
ORA-01157: cannot identify/lock data file 7 – see DBWR trace file
ORA-01110: data file 7: ‘ /data1/owprojects/xxxxx.dbf ‘
Its a new oracle installation and i do not need the corrupt datafile.
I cant take the tablespace offline neither can i drop the tablespace including its contents.
Do i drop from the Linux OS. If yes which other file to i edit to remove the pointer to this tablespace.
Thanks and Best Regards
J

Try:
alter database datafile 7 offline for drop;Example:
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1071333376 bytes
Fixed Size                  1388352 bytes
Variable Size             658505920 bytes
Database Buffers          406847488 bytes
Redo Buffers                4591616 bytes
Database mounted.
SQL>
SQL> alter database open;
alter database open
ERROR at line 1:
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: 'C:\TEMP\TEST01.DBF'
SQL> alter database datafile 5 offline for drop;
Database altered.
SQL> alter database open;
Database altered.
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     396
Next log sequence to archive   397
Current log sequence           397
SQL> alter tablespace test drop datafile 5;
alter tablespace test drop datafile 5
ERROR at line 1:
ORA-03261: the tablespace TEST has only one file
SQL> drop tablespace test;
Tablespace dropped.
SQL>Please read http://docs.oracle.com/cd/E11882_01/server.112/e25494/dfiles004.htm#ADMIN11428.
Edited by: P. Forstmann on 19 mars 2012 18:53

Similar Messages

  • Resize datafile when database is mount

    Hello,
    I need resize datafile when database is mount not open(I recover database).
    Is it posible?

    Try making the tablespace offline, opening the database and resizing the datafile. After you resize the datafile, recover the tablespace or just the datafile.
    In Oracle documentation: Backup & Recovery Guide, you can find more details of these options:
    =>RECOVER TABLESPACE Statement
    RECOVER TABLESPACE performs media recovery on all datafiles in the tablespaces listed. For example, enter the following at the SQL prompt to recover tablespace TBS_1:
    RECOVER TABLESPACE tbs_1
    The tablespaces must be offline to perform the recovery. Oracle indicates an error if none of the files require recovery.
    => RECOVER DATAFILE Statement
    RECOVER DATAFILE lists the datafiles to be recovered. For example, enter the following at the SQL prompt to recover datafile /oracle/dbs/tbs_22.f:
    RECOVER DATAFILE '/oracle/dbs/tbs_22.f'
    The database can be open or closed, provided that you can acquire the media recovery locks. If the database is open in any instance, then datafile recovery can only recover offline files.
    Hope it helps.
    Eliane

  • Tablespace and datafiles

    I have 3 test databases with Oracle 11.2.3 on the same box
    data.dbf and index.dbf were deleted from 2 of the databases in SQL and now EP Manager can't get to any of the tablespaces.  when clicking on Server - Tablespace i get the following error:
    java.sql.SQLException: ORA-01116: error in opening database file 2 ORA-01110: data file 2: '/u02/oradata/LAWTEST/dev_data01.dbf' ORA-27041: unable to open file IBM AIX RISC System/6000 Error: 2: No such file or directory Additional information: 3 Additional information: 4 Additional information: 4194304
    I have tried dropping the tablespaces and refreshing the database from a Prod backup but no luck and have been searching the web for any info.
    Any help would be greatly appreciated.

    Hi,
    I would like to ask where is stored in the database
    the information regarding the tablespace and
    datafiles (for example for a tablespace which
    datafiles belong?). Is it in controlfile? I think no.
    Where is it?
    Thank you,
    MihaelaHi,
    You may query DBA_TABLESPACES or V$TABLESPACE to views to gain information on tablespaces. Similarly, DBA_DATA_FILES and V$DATAFILE views will list you the details related to the data files like tablespace name/id, file location ......etc..
    Regards

  • Tablespace and Datafiles... HELP

    Hi, I3m new to Oracle, I3m trying to install Oracle 8.1.5 under
    Tru64 UNIX, I3m having a hard time creating the Tablespace and
    Datafiles to the oracle User... I cannot find documentation
    about it, can somebody here tell me how to do it????, it3s
    urgent, Please HELP mee!!!!
    null

    Hi Ruben,
    I'm an Ora admin working under NT.
    Use oracle server manager to create datafiles & tablespaces.
    You can find the executable file name for oracle server manager
    (svrmgr??.exe for NT) under BIN irectory of ORACLE HOME.
    Hope this will be tip for you.
    Regards
    Sukumar
    Ruben Gomez (guest) wrote:
    : Hi, I3m new to Oracle, I3m trying to install Oracle 8.1.5 under
    : Tru64 UNIX, I3m having a hard time creating the Tablespace and
    : Datafiles to the oracle User... I cannot find documentation
    : about it, can somebody here tell me how to do it????, it3s
    : urgent, Please HELP mee!!!!
    null

  • Database Performance (Tablespaces and Datafiles)

    Hi guys!
    What's the best for performance in database, tablespace with various datafiles distribuited in diferents filesystems or tablespaces with various datafiles in only one filesystem?
    Thanks,
    Augusto

    It depends on contents of the tablespaces, tablespace level LOGGING/NOLOGGING and env such as either OLTP or OLAP and LUN presentation to the server with RAID or without RAID and SAN Read per second and write per second.
    In general, tablespace with various datafiles distribuited in diferents filesystems/LUN's is in practice for non dev/system test databases.
    Moreover using ASM is better then standard filesystems.
    Regards,
    Kamalesh

  • Tablespace and datafile hot backup

    Hi,
    I wanted to if there is a command to copy a datafile using sqlplus command. I making a script that will backup the database while its online.I made a script for the alter tablespace begin backup but I wanted to know how to copy the datafiles without using the OS command,instead I wanted to use a sql commands. Is there any script or procedure to do this one.
    thanks
    Best Regards,
    Antok

    RMAN is the best utility to do the backup and recover activities. It take care copy and paste itself. Bellow given script is also usefull for hot backup
    spool hotbackup_PROD3.sql;
    set feedback off;
    set verify off;
    set pagesize 2500
    set linesize 132
    set serveroutput on size 50000;
    declare
    cursor tablespace is select tablespace_name from dba_tablespaces where tablespace_name
    in('RBS1',
    'STORAGE',
    'SYSADM_IDX2',
    'SYSADM_IDX3',
    'SYSADM_IDX4',
    'SYSTEM');
    cursor datafile(tsname varchar2 ) is select file_name from dba_data_files
    where tablespace_name = tsname;
    begin
    dbms_output.put_line('spool hotbackup_PRODc.log;');
    dbms_output.put_line('alter system switch logfile;');
    dbms_output.put_line('select ''log''||sequence#,sysdate from v$log where status = ''CURRENT'';
    for tsname in tablespace
    loop
    dbms_output.put_line('alter tablespace '||tsname.tablespace_name||' begin backup;');
    dbms_output.put_line('prompt Starting Backup for '||tsname.tablespace_name||' Tablespace')
    for dname in datafile(tsname.tablespace_name)
    loop
    dbms_output.put_line('prompt Copying File '||dname.file_name||'.....');
    dbms_output.put_line('!cp '||dname.file_name||' /backup2/hotbak'||dname.file_name);
    end loop;
    dbms_output.put_line('alter tablespace '||tsname.tablespace_name||' end backup;');
    dbms_output.put_line('prompt Finished backing up '||tsname.tablespace_name||' Tablespace')
    dbms_output.put_line('alter system switch logfile;');
    end loop;
    dbms_output.put_line('spool off;');
    dbms_output.put_line('!mailx -s "KL_PROD521_HOTBACKUP1" [email protected] < /prod1/HOTBKUP/hotbackup_PRODc.log');
    dbms_output.put_line('exit');
    end;
    spool off;
    @hotbackup_PROD3.sql
    exit;

  • Why is my MacBook dropping wifi connection and slow when wired?

    Dropping internet regularly
    Regardless of wireless or wired, my MacBook often loses it's connection to the network. It's most noticeable when wireless, but will sit there churning trying to load a page either way too much lately.
    What do I need to do to troubleshoot please?

    I had about the same problem and fixed it by updating the firmware of my router

  • Hello. My IPad keeps dropping wifi connection and freezes when streaming

    I have been to the store twice already. They replaced my iPad the first time and restored the second time. But still having the same problem

    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    Additional things to try.
    Turn Off your iPad. Then turn Off (disconnect power cord) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    Change the channel on your wireless router. Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    If none of the above suggestions work, look at this link.
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
     Cheers, Tom

  • Drop Normal Tablespace Taking several hours

    Hi,
    In my 1TB database there is one tablespace size (38.5 GB / used 4 GB) which we used for objects backup purpose and i am trying to drop this tablespace using every option like bring tablespace offline and drop with DROP TABLESPACE TBS_NAME INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS
    but Drop Tablespace Taking several hours (24 + hrs)
    I tried with drop objects from the tablespace but that is also taking lot of time to drop and then i tried to drop empty tablespace and again it is taking several hours.
    Database version :- 10.2.0.3 and 10.2.0.4
    Operation System Version :- Solaris 5.10
    ERP 11.5.10
    Please suggest what could be the problem.

    So, till now you have done these steps,
    1) dropped all database objects from that tablespace. Checked if any objects are there in this tablespace and there were none
    2) take tbs offline
    3) drop tablespace
    4) While drop tablespace command is hanging, monitored segments in the tbs from another session. Segments were reducing very slowly
    Out of first 3 steps, which step took longer? drop tablespace ?
    Logically, when you are able to drop objects, then there should be no issue of locks or anything like that.
    Dictionary updates should not take 24 hours!!!
    What else is going on, on the disk/file-system where this tbs is housed?
    Do you have all locally managed tablespaces?

  • Unable to drop USERS tablespace.

    Hi All,
    I am trying to drop USERS tablespace and facing below error.
    PLATFORM:
    OS: Linux Ubuntu 9.04 LTS
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE     10.2.0.1.0     Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    PROBLEM:
    SQL> drop tablespace users including contents and datafiles cascade constraints;
    drop tablespace users including contents and datafiles cascade constraints
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-24005: must use DBMS_AQADM.DROP_QUEUE_TABLE to drop queue tables
    When I see, dba_queue_tables...
    SQL> select owner, queue_table, object_type from dba_queue_tables;
    OWNER               QUEUE_TABLE          OBJECT_TYPE
    SYS               ALERT_QT           SYS.ALERT_TYPE
    SYS               AQ$_MEM_MC
    SYS               AQ_EVENT_TABLE          SYS.AQ$_EVENT_MESSAGE
    SYS               AQ_SRVNTFN_TABLE      SYS.AQ$_SRVNTFN_MESSAGE
    SYS               KUPC$DATAPUMP_QUETAB     SYS.KUPC$_MESSAGE
    SYS               SCHEDULER$_EVENT_QTAB     SYS.SCHEDULER$_EVENT_INFO
    SYS               SCHEDULER$_JOBQTAB     SYS.ANYDATA
    SYS               SYS$SERVICE_METRICS_TAB     SYS.SYS$RLBTYP
    SYSMAN               MGMT_NOTIFY_QTABLE     SYSMAN.MGMT_NOTIFY_NOTIFICATION
    SYSTEM               DEF$_AQCALL
    SYSTEM               DEF$_AQERROR
    11 rows selected.
    Also, there are no tables in USERS tablespace now, as I've moved all to other tablespace.
    SQL> select count(*) from dba_tables where tablespace_name='USERS';
    COUNT(*)
         0
    USERS tablespace is not permanent tablespace as I've changed it to some other, still the problem.
    SQL> select property_name, property_value from database_properties where PROPERTY_NAME = 'DEFAULT_PERMANENT_TABLESPACE'
    PROPERTY_NAME          PROPERTY_VALUE
    DEFAULT_PERMANENT_TABLESPACE DEV
    Can you please help me drop the USERS tablespace.

    Thanks Hemant,
    I queried as below.
    SQL> select count(*) from dba_segments where tablespace_name='USERS';
    COUNT(*)
         7
    SQL> SELECT owner, segment_name, segment_type from dba_segments where tablespace_name='USERS';
    OWNER               SEGMENT_NAME
    SEGMENT_TYPE
    IX               SYS_IOT_TOP_62384
    INDEX
    IX               SYS_IOT_TOP_62386
    INDEX
    IX               SYS_IOT_TOP_62390
    INDEX
    IX               SYS_IOT_TOP_62392
    INDEX
    IX               SYS_IOT_TOP_62395
    INDEX
    IX               SYS_IOT_TOP_62397
    INDEX
    IX               SYS_IOT_TOP_62401
    INDEX
    7 rows selected.
    SQL> drop user ix cascade;
    drop user ix cascade
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-24005: must use DBMS_AQADM.DROP_QUEUE_TABLE to drop queue tables
    Then connected as 'IX' user.
    IX@devdb> exec sys.DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>'SYS_IOT_TOP_62384',force => TRUE);
    BEGIN sys.DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>'SYS_IOT_TOP_62384',force => TRUE); END;
    ERROR at line 1:
    ORA-24002: QUEUE_TABLE IX.SYS_IOT_TOP_62384 does not exist
    ORA-06512: at "SYS.DBMS_AQADM_SYS", line 4084
    ORA-06512: at "SYS.DBMS_AQADM", line 197
    ORA-06512: at line 1
    IX@devdb> alter index SYS_IOT_TOP_62384 rebuild tablespace dev;
    alter index SYS_IOT_TOP_62384 rebuild tablespace dev
    ERROR at line 1:
    ORA-28650: Primary index on an IOT cannot be rebuilt
    IX@devdb> SELECT INDEX_TYPE,TABLE_NAME,TABLESPACE_NAME,STATUS FROM USER_INDEXES;
    INDEX_TYPE          TABLE_NAME               TABLESPACE_NAME          STATUS
    LOB               STREAMS_QUEUE_TABLE      DEV                    VALID
    NORMAL               ORDERS_QUEUETABLE          DEV                    VALID
    NORMAL               STREAMS_QUEUE_TABLE      DEV                    VALID
    NORMAL               AQ$_ORDERS_QUEUETABLE_S     DEV                    VALID
    NORMAL               AQ$_STREAMS_QUEUE_TABLE_C     DEV                    VALID
    NORMAL               AQ$_STREAMS_QUEUE_TABLE_S     DEV                    VALID
    LOB               STREAMS_QUEUE_TABLE      DEV                    VALID
    LOB               ORDERS_QUEUETABLE          DEV                    VALID
    IOT - TOP          AQ$_STREAMS_QUEUE_TABLE_T     USERS               VALID
    IOT - TOP          AQ$_STREAMS_QUEUE_TABLE_I     USERS               VALID
    IOT - TOP          AQ$_STREAMS_QUEUE_TABLE_H     USERS               VALID
    IOT - TOP          AQ$_STREAMS_QUEUE_TABLE_C     USERS               VALID
    IOT - TOP          AQ$_ORDERS_QUEUETABLE_T     USERS               VALID
    IOT - TOP          AQ$_ORDERS_QUEUETABLE_I     USERS               VALID
    IOT - TOP          AQ$_ORDERS_QUEUETABLE_H     USERS               VALID
    15 rows selected.
    IX@devdb> alter table AQ$_STREAMS_QUEUE_TABLE_T move tablespace dev;
    alter table AQ$_STREAMS_QUEUE_TABLE_T move tablespace dev
    ERROR at line 1:
    ORA-08108: may not build or rebuild this type of index online

  • To drop all the tables in a database

    hi,
    I have 25000 tables in a database.I want ot delete all the tables and then i have to import the dump.For deleting all the tables what query has to be given.
    Thanks in advance,
    R.Ratheesh

    The code would be
    BEGIN
       FOR c IN (SELECT owner,
                        table_name
                   FROM all_tables
                  WHERE owner IN ('YOUR_OWNER1', 'YOUR_OWNER2_ETC'))
       LOOP
          EXECUTE IMMEDIATE    'drop table '
                            || c.owner
                            || '.'
                            || c.table_name
                            || ' cascade constraints';
       END LOOP;
    END;
    the user ,tablespaces ,datafiles has to be recreatedbut still dropping the user would be the simplest option
    you don't have to recreate tablespaces and datafiles for that.

  • Tablespace with datafiles on many disks

    Hello,
    I am using Oracle 11g R2 on AIX 7.1
    I am planing to create a tablespace where it is datafiles on 4 disks.
    How can I specify a datafile to be on a disk while creating the tablespace?
    Regards,

    NB wrote:
    thanks for the info.
    No i have no control on the disks.
    I am doing that for better performance so I will put each datafile of a tablespace on a disk, and I/O will decrease.
    How can I achieve that ?
    again if the 4 disks are mounted on a single mount point /u01
    Edited by: NB on Mar 17, 2012 11:08 AMRead this.
    Consider the Performance Impact_
    The number of datafiles contained in a tablespace, and ultimately the database, can have an impact upon performance.
    Oracle Database allows more datafiles in the database than the operating system defined limit. The database DBWn processes can open all online datafiles. Oracle Database is capable of treating open file descriptors as a cache, automatically closing files when the number of open file descriptors reaches the operating system-defined limit. This can have a negative performance impact. When possible, adjust the operating system limit on open file descriptors so that it is larger than the number of online datafiles in the database.
    Place Datafiles Appropriately_
    Tablespace location is determined by the physical location of the datafiles that constitute that tablespace. Use the hardware resources of your computer appropriately.
    For example, if several disk drives are available to store the database, consider placing potentially contending datafiles on separate disks.This way, when users query information, both disk drives can work simultaneously, retrieving data at the same time.
    Source:-
    http://docs.oracle.com/cd/B28359_01/server.111/b28310/dfiles001.htm

  • Drop rollback tablespace after using UNDO

    I have switched to using UNDO instead of using rollback segments. The UNDO works fine, and I have sucessfully dropped all rollback segments. Now I try to drop rollback tablespace. Can I simplely issue drop tablespace command to drop it? the reason I hesitate to simply drop it is that before I do drop, I placed the rollback tablespace offline. And there are errors during transaction since some tables somehow still checking on this tablespace. Can I simplely drop rollback tablespace, and Oracle would clean this internally, and everything would be finr?
    thanks for your input.

    Hi,
    This is the steps to migration from rollback tablespace to undo tablespace (from 8i to 9i migration by manual upgrade) :
    SQL>alter system set undo_management=auto scope=spfile;
    SQL>create UNDO tablespace UNDOTBS  datafile ‘d:\database\mydb\system\undotbs01.dbf’ size 500M;
    SQL>alter system set undo_tablespace= UNDOTBS  scope=spfile;
    SQL>shutdown immediate
    SQL>startup
    SQL>select SEGMENT_NAME,TABLESPACE_NAME,STATUS from dba_rollback_segs; --Verirify creation and usage UNDO tablespace
    SQL>drop tablespace rbs including contents and datafiles;
    SQL>create pfile=’d:\database\mydb\system\pfile\init.ora’ from spfile;No need to drop old rollback segment.
    Nicolas.

  • Use of backing up a single tablespace or datafile

    Hello,
    I am reading the RMAN manual and I'm quite familiar with backup up a tablespace or datafile, but I can find very few uses for that. Backup up a tablespace is useful for TPITR, but since that needs another instance its of very little use in most production environments. I think you cannot restore an old version of tablespace in a normal database, unless the tablespace has long been made read-only, in which case RMAN's optimizations will do the trick.
    Even less use I can find for datafile backup. I have absolutely no idea what you can do with a single datafile.
    Can you please clarify me on the uses of these RMAN features?
    Thank you.

    Dear Albi!
    Think of the following scenario:
    You have a very large (let's say 1 Terabyte) production database that is split into n tablespaces. This database is in archivelog mode and a full backup of the hole database would take more than 10 hours.
    scenario end.
    In such a scenario I think you will not take a full database backup very often. Therfore you can backup portions (tablespaces and datafiles) of your database. This will take less time then a hole DBbackup.
    If you have to restore your DB then RMAN will take all the files it needs from all your backup. RMAN uses always the most actual version of your datafiles. After the restore RMAN will take the archivelogs to recover all datafiles to the most actual point in time. And that's the point why partial backups of your db are not only usefull for TSPITR.
    I hope I could make clear what the operative point is with partial backups.
    Yours sincerely
    Florian W.

  • Where do the segments belong after the drop of tablespace...?????

    Hi ,
    After a tablespace drop solely .... what is happening with its included segments....., i mean where would they belong to.... to SYSTEM tablespace...?????
    NOTE: I use Oracle10g on Windows XP platform......
    Thanks , a lot
    Simon

    Hi ,
    The following portion of document is from an Oracle documentation :
    "To drop a tablespace, use the DROP TABLESPACE statement. The following statement drops the users tablespace, including the segments in the tablespace:
    DROP TABLESPACE users INCLUDING CONTENTS;
    If the tablespace is empty (does not contain any tables, views, or other structures), you do not need to specify the INCLUDING CONTENTS clause. Use the CASCADE CONSTRAINTS clause to drop all referential integrity constraints from tables outside the tablespace that refer to primary and unique keys of tables inside the tablespace.
    To delete the datafiles associated with a tablespace at the same time that the tablespace is dropped, use the INCLUDING CONTENTS AND DATAFILES clause. The following statement drops the users tablespace and its associated datafiles:
    DROP TABLESPACE users INCLUDING CONTENTS AND DATAFILES;
    "So , from the above , i understand that :
    1) if i specify DROP TABLESPACE USERS.... then the tablespace db object is dropped only.... not datafiles , not segments......So , my question is where these segments belong to ....afterwards????
    2) if i specify DROP TABLESPACE users INCLUDING CONTENTS ... then the tablespace db object is dropped as well as the segments included in it.....Not the datafiles....
    3) if i specify DROP TABLESPACE users INCLUDING CONTENTS AND DATAFILES... then the tablespace db object is dropped , the segments and datafiles ,as well ....
    Are the above considerations correct...?????
    Many thanks ,
    Simon
    Message was edited by:
    sgalaxy

Maybe you are looking for

  • No Internet signal with 2 Airport express' & Ipod Hifi

    My Airport express connects with a router and gives a wireless signal all over the house. The 2nd airport express (less than 50'ft. away connects to an Ipod Hifi. The 2nd airport blinks yellow and won't allow me to go onto the internet (ie radio stre

  • Convert date/time to HEX command and write to a bin file

    Hello, I have to do the following thing. I have the date/time string, let's say 08:45:23, 12.08.09, where the hour, the minutes, the seconds, the day, the month and the year represent hex number or in other words I have the following command: Byte 0

  • E-Rec: Problem with set attribute 'POS_TITLE' in Requisition mgmt

    Hi All, In Component controller of 'ERC_REQ_MGMT' WD4A application, I just tried to set the posting title using the below code: DATA lo_nd_language        TYPE REF TO if_wd_context_node.     lo_nd_language = wd_context->get_child_node( name = wd_this

  • Floating Fields with .replace()

    Hi All, I'm having a problem with my floating fields. I have a variable declared in my function (floatingFunction), lets call the variable sPara. to sPara I assign a long Paragragh for example; sPara = "I, the undersigned FN in my capacity as a CP...

  • Presets and Profiles

    1.  What is the specific difference between the 2?  Is a profile purely about colour? (as the sliders in the profile pane only relate to colour adjustments). 2.  A preset can be applied on import  (eg, I am now running a  'capture sharpening' preset