Skip to Main Content

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Michelle.

Asked: March 01, 2002 - 3:21 pm UTC

Last updated: January 05, 2010 - 12:23 pm UTC

Version: 9i

Viewed 1000+ times

You Asked

Does Resumable Space Allocation work with the Import Utility?

and Tom said...

yes.

$ imp help=y

Import: Release 9.0.1.0.0 - Production on Fri Mar 1 15:38:34 2002

(c) Copyright 2001 Oracle Corporation. All rights reserved.



You can let Import prompt you for parameters by entering the IMP
command followed by your username/password:

Example: IMP SCOTT/TIGER

Or, you can control how Import runs by entering the IMP command followed
by various arguments. To specify parameters, you use keywords:

Format: IMP KEYWORD=value or KEYWORD=(value1,value2,...,valueN)
Example: IMP SCOTT/TIGER IGNORE=Y TABLES=(EMP,DEPT) FULL=N
or TABLES=(T1:P1,T1:P2), if T1 is partitioned table

USERID must be the first parameter on the command line.

Keyword Description (Default) Keyword Description (Default)
--------------------------------------------------------------------------
USERID username/password FULL import entire file (N)
BUFFER size of data buffer FROMUSER list of owner usernames
FILE input files (EXPDAT.DMP) TOUSER list of usernames
SHOW just list file contents (N) TABLES list of table names
IGNORE ignore create errors (N) RECORDLENGTH length of IO record
GRANTS import grants (Y) INCTYPE incremental import type
INDEXES import indexes (Y) COMMIT commit array insert (N)
ROWS import data rows (Y) PARFILE parameter filename
LOG log file of screen output CONSTRAINTS import constraints (Y)
DESTROY overwrite tablespace data file (N)
INDEXFILE write table/index info to specified file
SKIP_UNUSABLE_INDEXES skip maintenance of unusable indexes (N)
FEEDBACK display progress every x rows(0)
TOID_NOVALIDATE skip validation of specified type ids
FILESIZE maximum size of each dump file
STATISTICS import precomputed statistics (always)
RESUMABLE suspend when a space related error is encountered(N)
RESUMABLE_NAME text string used to identify resumable statement
RESUMABLE_TIMEOUT wait time for RESUMABLE

COMPILE compile procedures, packages, and functions (Y)
VOLSIZE number of bytes in file on each volume of a file on tape

The following keywords only apply to transportable tablespaces
TRANSPORT_TABLESPACE import transportable tablespace metadata (N)
TABLESPACES tablespaces to be transported into database
DATAFILES datafiles to be transported into database
TTS_OWNERS users that own data in the transportable tablespace set

Import terminated successfully without warnings.


Rating

  (5 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Good to know.

Robert, January 09, 2004 - 12:42 pm UTC


inctype

jasdeep, March 19, 2004 - 11:44 am UTC

hi tom

which are the types of inctype and to utilise it in export backup


Tom Kyte
March 19, 2004 - 2:04 pm UTC

they are documented and not suggested. if you want to read about them -- server utilities guide documents it.

however, export is not a backup tool really.

do not use export as a backup tool.

backups are backups.

undo

reader, April 12, 2004 - 10:46 pm UTC

If the transaction does not have enough undo space in the undo tablespace, can it resume after I add space to undo tablespace assuming that the session is in resumable mode? Thanks.

Tom Kyte
April 13, 2004 - 7:11 am UTC

yes with a caveat:

If rollback segments are located in dictionary managed tablespaces, then space allocation for rollback segments is not resumable.

Undo

A reader, August 02, 2004 - 11:57 pm UTC

1. Can you please show with an example how resumable space allocation would suspend a transaction when the UNDO tablespace (in AUM mode) runs out of space?

2. How would it resume? Can I make it automatically resume after, say, N seconds, sort of like the 'reopen=N max_failure=M' option for log_archive_dest_n? After "max_failure", I want the txn to be really flagged as suspended in dba_resumables and such

3. How can I have all sessions be resumable-enabled by default?

Thanks


Tom Kyte
August 03, 2004 - 8:36 am UTC

1) that should be trivial.  taking a measely 2m undo tablespace (create undo tablespace undo_test datafile size 2m) with no "autoextend", all we need to do is:

ops$tkyte@ORA9IR2> drop table t;
 
Table dropped.
 
ops$tkyte@ORA9IR2> create table t as select * from all_objects;
 
Table created.
 
ops$tkyte@ORA9IR2> update t set object_name = object_name;
update t set object_name = object_name
       *
ERROR at line 1:
ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDO_TEST'


looking at dba_extents, we'd see:

ops$tkyte@ORA9IR2> break on segment_name skip 1
select segment_name, extent_id, blocks
  from dba_extents
 where tablespace_name = 'UNDO_TEST'
 order by segment_name, extent_id
/
ops$tkyte@ORA9IR2>   2    3    4    5
SEGMENT_NAME                    EXTENT_ID     BLOCKS
------------------------------ ---------- ----------
_SYSSMU13$                              0          7
                                        1          8
 
_SYSSMU14$                              0          7
                                        1          8
 
_SYSSMU15$                              0          7
                                        1          8
 
_SYSSMU16$                              0          7
                                        1          8
 
_SYSSMU17$                              0          7
                                        1          8
 
_SYSSMU18$                              0          7
                                        1          8
 
_SYSSMU19$                              0          7
                                        1          8
 
_SYSSMU20$                              0          7
                                        1          8
                                        2          8
                                        3          8
                                        4          8
                                        5          8
                                        6          8
                                        7          8
                                        8          8
                                        9          8
                                       10          8
                                       11          8
                                       12          8
 
_SYSSMU21$                              0          7
                                        1          8
 
_SYSSMU22$                              0          7
                                        1          8
 
 
31 rows selected.

<b>on segment will steal as many extents as it can, but when there are no more, there are no more.

So</b>
 
ops$tkyte@ORA9IR2> rollback;
 
Rollback complete.
 
ops$tkyte@ORA9IR2> alter session enable resumable;
 
Session altered.
 
ops$tkyte@ORA9IR2> update t set object_name = object_name;
 
<b>and we tail our alert log - shortly we see:</b>
Tue Aug  3 08:22:59 2004
Failure to extend rollback segment because of 30036 condition
statement in resumable session 'User OPS$TKYTE(200), Session 15, Instance 1' was  suspended due to
    ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDO_TEST'
Failure to extend rollback segment because of 30036 condition
Failure to extend rollback segment because of 30036 condition
...........


<b>so, that shows how to "get there"</b>


2) it will resume when the condition that caused it to pause is corrected or it timesout (you control the timeout).  

It really is flagged in dba_resumable as well:

sys@ORA9IR2> select * from dba_resumable;
 
   USER_ID SESSION_ID INSTANCE_ID COORD_INSTANCE_ID COORD_SESSION_ID STATUS
---------- ---------- ----------- ----------------- ---------------- ----------
   TIMEOUT START_TIME           SUSPEND_TIME         RESUME_TIME
---------- -------------------- -------------------- --------------------
NAME
------------------------------
SQL_TEXT
-------------------------------------------------------------------------------
ERROR_NUMBER
------------
ERROR_PARAMETER1
-------------------------------------------------------------------------------
ERROR_PARAMETER2
-------------------------------------------------------------------------------
ERROR_PARAMETER3
-------------------------------------------------------------------------------
ERROR_PARAMETER4
-------------------------------------------------------------------------------
ERROR_PARAMETER5
-------------------------------------------------------------------------------
ERROR_MSG
-------------------------------------------------------------------------------
       200         15           1                                    SUSPENDED
      7200 08/03/04 08:22:55    08/03/04 08:22:58
User OPS$TKYTE(200), Session 1
5, Instance 1
update t set object_name = object_name
       30036
8
UNDO_TEST
 
 
 
ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDO_TEST'
 

<b>
In that session I queried -- I then:</b>

sys@ORA9IR2> select file_name from dba_data_files where tablespace_name = 'UNDO_TEST';
 
FILE_NAME
-------------------------------------------------------------------------------
/home/ora9ir2/oradata/ora9ir2/o1_mf_undo_tes_0jx3c23k_.dbf
 
sys@ORA9IR2> alter database datafile '/home/ora9ir2/oradata/ora9ir2/o1_mf_undo_tes_0jx3c23k_.dbf'
  2  autoextend on next 1m maxsize 2000m;
 
Database altered.

<b>
and pretty much immediately the alert showed:
</b>

Failure to extend rollback segment because of 30036 condition
Failure to extend rollback segment because of 30036 condition
Tue Aug  3 08:27:51 2004
alter database datafile '/home/ora9ir2/oradata/ora9ir2/o1_mf_undo_tes_0jx3c23k_.dbf'
autoextend on next 1m maxsize 2000m
Tue Aug  3 08:27:51 2004
Completed: alter database datafile '/home/ora9ir2/oradata/ora
Tue Aug  3 08:27:52 2004
statement in resumable session 'User OPS$TKYTE(200), Session 15, Instance 1' was resumed

<b>and the statement finished</b>


3) that would be in the category of "a truly bad idea".  end users calling saying "hey, my query has been running for days (out of temp and just hanging there).  "my update has gone off the deep end" and so on.

this is a tool a DBA can use to perform long, large operations -- whilst they are monitoring for the out of space condition.

 

resumable space

aliyar, January 05, 2010 - 11:40 am UTC

Dear Tom ,

Thanks for your wonderful service to DBA world.

to avoid out of space error
===========================

1 ) monitor Tablespace usage periodically. so that we can add space before hitting the issue

2 ) also enable resumable space management at Instance level. so that in case if we fail to detect Tablespace running out of space , we can add space and resume the transaction from where it was stopped.

i know about about step. is the second step useful ?.. will it cause any addition issue to database.

could you please clarify the above.

Thanks
Aliyar
Tom Kyte
January 05, 2010 - 12:23 pm UTC

#2) caveat - you had better be monitoring constantly for that to be practical! Otherwise, people that hit "insufficient space" will just sit there and wait and wait and wait.


#3) use autoextend and monitor the single file system for reserve capacity.

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library