Showing posts with label Data pump. Show all posts
Showing posts with label Data pump. Show all posts

Friday, November 04, 2011

ORA-30094: failed to find the time zone data file for version 11 in $ORACLE_HOME/oracore/zoneinfo

Always check out the original article at http://www.oraclequirks.com for latest comments, fixes and updates.

My first close encounter with the brand new Oracle XE11 returned the following error upon importing a dump that a customer sent me for preparing a demo.

ORA-39097: Data Pump job encountered unexpected error -30094
ORA-39065: unexpected master process exception in DISPATCH
ORA-30094: failed to find the time zone data file for version 11
in $ORACLE_HOME/oracore/zoneinfo

The full story is in this thread in the OTN XE forum.
The bottom line is summarized as follows: if you hit this problem when attempting to import a dump taken with a different version of Oracle, for instance 11.2.0.1.0, as it was in my case, the cause is in the missing timezone files in the folder $ORACLE_HOME/oracore/zoneinfo, because XE11 ships only with the following pair of files:
timezlrg_14.dat
timezone_14.dat


The not-so-quick but certainly very dirty solution is to download a full-blown version of the database, install it, copy over the missing files to the aforementioned folder ensuring that the pair of files ending with the number contained in the line I highlighted in red above are present. Or tell the other party to send you a nicely compressed archive containing the files taken from his/her server.

Thereafter retry the import and voilá, XE11 is served.

Why didn't supply the missing files with XE11?
Don't ask me.

If you can't or don't want to install the full database temporarily, chances are that you can at least import the "naked" objects taken from the dump file using the parameter CONTENT=METADATA_ONLY, this avoids the failure upon importing table data and probably is better than nothing.You may also manage to import some of the table data by excluding the table(s) containing the column(s) of type TIMESTAMP WITH [LOCAL] TIMEZONE, supposing you know in advance their names and you disabled any foreign keys beforehand, but clearly this is very far from being an optimal solution.

Thanks to mr. Carter for putting me on the right track.

See message translations for ORA-30094 and search additional resources.

Friday, September 17, 2010

ORA-31694: master table "SYS"."SYS_IMPORT_FULL_01" failed to load/unload

Always check out the original article at http://www.oraclequirks.com for latest comments, fixes and updates.

It's amazing how much time one can waste because of certain bugs.
Yesterday evening i got the following stack of errors upon importing (IMPDP) a dump made on Oracle 11.1.0.7.0 to 11.1.0.6.0.
ORA-39002: invalid operation
ORA-31694: master table "SYS"."SYS_IMPORT_FULL_01" failed to load/unload
ORA-02354: error in exporting/importing data
ORA-02373: Error parsing insert statement for table "SYS"."SYS_IMPORT_FULL_01".
ORA-00904: "ORIGINAL_OBJECT_NAME": invalid identifier
My first reaction was to tamper with the IMPDP parameters, on the false assumption that i was doing something wrong (who knows why i always assume I'm wrong...).
After various attempts, i started looking around and found several references that unfortunately were misleading. Someone claimed a VERSION=11.1.0.6.0 parameter was missing, another suggested a wrong character set or a corrupt dump and so on. Every round implied a new dump to be made available by the customer, downloaded and imported.
Finally, this morning, i found a rather recent OTN thread were it was made clear that the above errors are a consequence of bug 7590679 in 11.1.0.7.

The quick solution is to perform the export (EXPDP) adding parameter VERSION=10.2 (with some caveats as per cited metalink note) or alternatively install the patch for upgrading from 11.1.0.6 to 11.1.0.7.

As an experiment i also tried importing the downgraded dump to XE and it worked like a charm.

See message translations for ORA-31694 and search additional resources.

Thursday, August 20, 2009

ORA-31609: error loading file "kuauddef.xsl" from file system directory

Always check out the original article at http://www.oraclequirks.com for latest comments, fixes and updates.

Sometimes i wish certain things were a little bit easier.
I was attempting to import a datapump export obtained with the DBMS_METADATA "demo" export program i mentioned a while ago, but unfortunately it blows up while processing trigger information.
After investigating the problem, it seemed that, for some reason, there were missing stylesheets that needed to be loaded using a script called initmeta.sql, under the $ORACLE_HOME/rdbms/admin folder according to a user who reported that after doing that, the problem was fixed, but to my surprise i could not find such script in my Oracle XE linux installation.
So i began another iteration, in pursue of a solution for this new "problem" and i found an OTN forum discussion where someone else could not spot the fatal script, but a DBA published the content of initmeta.sql for Oracle version 10gR1, which is a single line:
EXECUTE SYS.DBMS_METADATA_UTIL.LOAD_STYLESHEETS('/Users/oracle/.../rdbms/xml/xsl');
(whole path omitted)

Apparently i only needed to modify the file path, but first i wanted to have a look at the package specification of DBMS_METADATA_UTIL.
Interestingly enough, in version 10gR2 (XE) something must have been changed, because procedure LOAD_STYLESHEETS doesn't take any parameters.
Oh good, i thought, it means that they are retrieving the path themselves, so i removed the parameter and ran the procedure as SYS:
EXECUTE SYS.DBMS_METADATA_UTIL.LOAD_STYLESHEETS;

ORA-31609: error loading file "kuauddef.xsl" from file system directory
"/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/xml/xsl"

ORA-06512: at "SYS.DBMS_METADATA_UTIL", line 1793
ORA-06512: at line 1
31609. 00000 - "error loading file \"%s\" from file system directory \"%s\""
*Cause: The installation script initmeta.sql failed to load
the named file from the file system directory into the database.
*Action: Examine the directory and see if the file is present
and can be read.
And there you go, with ORA-31609.
It's curious that SQL Developer explains the error message mentioning the initmeta.sql script that didn't run at all, it means that procedure LOAD_STYLESHEETS is expected to be run only in that occasion.

So, here is where i am stuck now, the missing $ORACLE_HOME/rdbms/xml directory.
May be i'll update this entry if i manage to work around this problem.

Fortunately there are still the good-ole EXP/IMP utilities to keep the ball rolling.

See message translations for ORA-31609 and search additional resources.

Friday, July 31, 2009

ORA-39094: Parallel execution not supported in this database edition

Always check out the original article at http://www.oraclequirks.com for latest comments, fixes and updates.

This morning i was trying out a demo of DBMS_DATAPUMP found at psoug.org and initially i wasn't getting the expected file dump, so i slightly modified the procedure in order to understand where it was stopping. The problem with this nice demo is in that it must have been written for Oracle 10g Enterprise Edition (i was testing this on a 10gR2 SE) because, after a couple of misses, i eventually isolated the failing statement:

DBMS_DATAPUMP.SET_PARALLEL(dph, 2);

After surrounding this statement with an error trapping block:
 ...
-- set parallelism
begin
dbms_datapump.set_parallel(dph, 2);
exception
when xcp_39002 then null;
end;
...
i could successfully complete the demo and here is what i found at beginning of the DBMS_OUTPUT message trail:
ORA-39002: invalid operation
ORA-39094: Parallel execution not supported in this database edition.
This is expected behavior as per the official documentation.

See message translations for ORA-39094 and search additional resources.

Tuesday, April 21, 2009

ORA-27040: file create error, unable to create file

Always check out the original article at http://www.oraclequirks.com for latest comments, fixes and updates.

It's not the first time i write about the stack of errors returned by data pump operations and ORA-31641 in particular, however the error messages may vary slightly with the operating system. For instance the following error stack is returned on XE running on top of Ubuntu, whereas the previously linked page refers to an error condition occurring on XE for Windows.
expdp user/pwd directory=EXPDIR dumpfile=dump.dp tables=emp,dept nologfile=Y

ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31641: unable to create dump file "/home/flavio/documents/dump.dp"
ORA-27040: file create error, unable to create file
Linux Error: 13: Permission denied
The problem is caused by the missing privileges of user oracle on the directory pointed to by EXPDIR.
EXPDIR is pointing to /home/flavio/documents.
ls -ld /home/flavio/documents

drwxr-xr-x 4 flavio flavio 4096 2009-04-10 19:00 /home/flavio/documents/
As you see the directory belongs to user flavio, group flavio, moreover no write privileges are granted other than to the directory owner. Now, as Oracle processes are running under the user oracle, in order to be able to dump a file in this directory we have two possibilities:
  1. to change the other group permissions on the directory i.e. by executing chmod o+w documents.
  2. to add user oracle to group flavio and grant write permissions on documents to group flavio by executing sudo usermod -a -G flavio oracle; chmod g+w documents.
Note that option #1 will work instantly while option #2 requires a db restart. If you do not restart the db, you will still get the permission denied error. In either case, the db user must have READ and WRITE permissions on EXPDIR or hold CREATE ANY DIRECTORY privilege.

Whether the optimal solution is either of the two options above it really depends on the application security requirements.
In the end may be it's better to create a public directory where everybody can dump files freely or create a shared directory EXPDIR where only oracle can create files and users belonging to a datapump group can read them. This approach avoids tampering with the existing permissions on user's private folders and it doesn't require a db restart.

Final notes: while looking for the Optimal Flexible Architecture document, i realized that dpdump is nowhere to be found in the installation documents through version 11gR1. This directory is created at time of installation and it is an OFA directory, no matter what the books say or don't. Directory object DATA_PUMP_DIR, which is the default directory for data pump operations, indeed maps to dpdump.
If i remember correctly in 10gR2 the directory object is automatically created at installation time whilst in 10gR1 you need to create it manually.

See message translations for ORA-27040 and search additional resources.

Friday, March 07, 2008

ORA-39070: Unable to open the log file.

Always check out the original article at http://www.oraclequirks.com for latest comments, fixes and updates.

You may see this error when you have not properly initialized certain directory objects required to perform the data pump import or you have not specified the proper parameters in the command line or the OS user under which you are performing the operation does not hold the necessary privileges on the file system objects (the dump file or the directory containing it).
For instance, invoking IMPDP without specifying NOLOGFILE=Y, may result in the error being discussed in this topic if the parameter LOGFILE has not been specified or contains an invalid value.

IMPDP user/pwd schemas=YOCOYA

ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-39145: directory object parameter must be specified and non-null
On the other hand, setting NOLOGFILE=Y may solve or not the problem, depending on other factors like the privileges held by the db user (see ORA-39000 for a scenario where a user lacks some specific privileges) or the OS permissions required to access the file or directories involved in the data pump operation.

Db users like SYS have automatically access to the default directory pointed to by DATA_PUMP_DIR that is also used as a default destination for the LOG file in case you don't specify a different one.
To be more precise, all users who have been granted either IMP_FULL_DATABASE or EXP_FULL_DATABASE role (see dictionary view ROLE_TAB_PRIVS), have access to DATA_PUMP_DIR. Please note that according to my understanding this holds for oracle version 10R2 (including XE) or above.

On version 10R1, the DBA had first to create the directory DATA_PUMP_DIR thereafter users holding the DBA role could automatically read from and write to DATA_PUMP_DIR. Apparently it is not necessary to explicitly grant READ and WRITE on DATA_PUMP_DIR to the DBA role, it just works once the directory object has been created.
This behavior seems to be different from 10R2 in that you can actually find READ and WRITE privileges granted to EXP_FULL_DATABASE and IMP_FULL_DATABASE roles that, in turn, are granted to the DBA role. In other words the situation on 10R2 is easier to understand from a dictionary point of view.

Standard db users don't even see this directory in the view ALL_DIRECTORIES until they are granted READ and WRITE privileges or they are granted the CREATE ANY DIRECTORY system privilege by the DBA.
Therefore a normal user should always specify the parameter DIRECTORY in the command line along with the parameter LOGFILE or specify the file as (dir:file) directly in the LOGFILE parameter:
IMPDP user/pwd DIRECTORY=logdir LOGFILE=dump.log
or
IMPDP user/pwd LOGFILE=logdir:dump.log
As already noted in a previous posting, note that if you hold only the READ privilege on the target directory, you may see it in view ALL_DIRECTORIES, but when you try perform the dump, you'll get ORA-31631.

Unix users may encounter further problems depending on the permissions associated with the underlying directories.
For instance, suppose i am logged on as user "flavio" on a xubuntu server and i am the owner of the dump file, located in the directory impdir (pointing to "/home/flavio/dumps"), if i execute:
IMPDP yocoya/yocoya NOLOGFILE=Y SCHEMAS=yocoya DIRECTORY=impdir DUMPFILE=yocoya.dmp
i am able to import the dump file successfully (supposing there are no other blocking errors...)

However, as soon as i try to specify the same directory as a destination for the log file:
IMPDP yocoya/yocoya LOGFILE=dump.log SCHEMAS=yocoya DIRECTORY=impdir DUMPFILE=yocoya.dmp
the command may fail:
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 475
ORA-29283: invalid file operation
I guess this happens because IMPDP is trying to perform write operations through the UTL_FILE package, which is probably invoking some low level program running as the OS user "oracle" (the user under which the database server has been installed) but the "oracle" user has no WRITE permissions on the OS folder /home/flavio/dumps. Indeed if i grant the write permission to that folder to the "Others" group, the operation succeeds.

So, let's summarize what to do when you get this type of error:

while logged in as the db user, check out if you have been granted READ and WRITE privileges on the directory object:
select * from all_directories where directory_name = 'DIRECTORY_NAME';

select * from user_tab_privs
where table_name = 'DIRECTORY_NAME';
alternatively, have you been granted CREATE ANY DIRECTORY system privilege?

select * from user_sys_privs
where privilege = 'CREATE ANY DIRECTORY';
if you hold CREATE ANY DIRECTORY privilege but you don't see the directory object in view ALL_DIRECTORIES, most likely the directory object has not been created (yet).

if you do not hold this system privilege and you don't see the directory in ALL_DIRECTORIES, you must ask the DBA to check for the object (assuming you are not the DBA...).

check out the permissions on the dump file: is the user who installed the db allowed to read the file?

check out the permission on the OS directory containing the file: is the user who installed the db allowed to read from it?

As you see there are many variables involved and finding where is the catch can be a trial-and-error process.
The data pump in this respect is more complex to manage compared to the old-fashioned IMP/EXP utilities, especially because everything happens at the server side, not at the client side.

I hope i didn't miss anything important, if not, please let me know.

See message translations for ORA-39070 and search additional resources

Thursday, March 06, 2008

ORA-31641: unable to create dump file

Always check out the original article at http://www.oraclequirks.com for latest comments, fixes and updates.

You are getting this error while performing a data pump export (EXPDP) using a dump filename that is already present at the destination.

EXPDP 'user/pwd' SCHEMAS=user DUMPFILE=dumpfile.dmp NOLOGFILE=Y DIRECTORY=expdir
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31641: unable to create dump file "C:\oracle\product\10.1.0\admin\orcl10\dpdump\dumpfile.dmp"
ORA-27038: created file already exists
OSD-04010: option specified, file already exists
Dump files are never overwritten (in contrast with LOG files and SQL files generated by the data pump), so you must either change the dump filename in the command line or rename or move or delete the existing file prior to attempting the operation again.

See a previous posting for other common error situations that you can encounter when performing a data pump export.

See message translations for ORA-31641 and search additional resources

Tuesday, November 27, 2007

ORA-39145: directory object parameter must be specified and non-null

If you, like me, tend to forget the varied syntax of the myriad of oracle commands that have been introduced over the years, you won't be surprised to get errors like that i am going to describe.

EXPDP is the data pump export introduced with Oracle version 10 and it comes with a somewhat funny syntax for what concerns the specification of the export folder, because, unless you are doing the export as a privileged user, a user presumably holding EXP_FULL_DATABASE role like the DBA, it expects that you specify the oracle directory object name along with the name of the file dump. See the linked document for additional possibilities.

This is why when i submitted the following command:
expdp schemas=yocoya dumpfile=testdp.dmp nologfile=Y
i got this verbose error message in return:
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-39145: directory object parameter must be specified and non-null
Supposing you have defined a directory object called EXP_DIR, then the correct form of the command is the following:
expdp schemas=yocoya dumpfile=exp_dir:testdp.dmp nologfile=Y
or
expdp schemas=yocoya directory=exp_dir dumpfile=testdp.dmp nologfile=Y
As usual, the object name is case insensitive unless you have explicitly created it enclosed in double quotes. See also the related article about errors caused by the lack of read and write privileges on the destination folder or when an existing file is found.

See error translations for ORA-39145 and search additional resources.

---------------------------------------
ORA-39145: il parametro oggetto directory deve essere specificato e diverso da null
ORA-39145: se debe especificar el parámetro de objeto de directorio y no ser nulo
ORA-39145: el paràmetre d''objecte de directori s''ha d''especificar i no pot ser nul
ORA-39145: le paramètre d'objet de répertoire doit être indiqué et il ne doit pas avoir la valeur Null
ORA-39145: Verzeichnisobjektparameter muss angegeben werden und darf nicht Null sein.
ORA-39145: η παράμετρος αντικειμένου καταλόγου πρέπει να προσδιοριστεί με τιμή διαφορετική της τιμής null
ORA-39145: katalogobjektparameter skal være angivet og ikke-NULL
ORA-39145: katalogobjektparametern måste anges och får inte vara null
ORA-39145: katalogobjektparameteren må være angitt og ikke være null
ORA-39145: hakemisto-objektiparametri on määritettävä, ja se ei saa olla tyhjä
ORA-39145: a könyvtárobjektum paramétert meg kell adni, nem lehet üres
ORA-39145: parametrul pentru obiectul director trebuie să fie specificat şi nenul
ORA-39145: een directoryobjectparameter moet worden opgegeven die niet NULL mag zijn
ORA-39145: o parâmetro de objeto de diretório deve ser especificado e não-nulo
ORA-39145: é necessário que o parâmetro do objecto do directório seja especificado e não seja nulo
ORA-39145: требуется задать параметр 'объект каталога' с определенным значением
ORA-39145: parametr objektu adresáře musí být zadán a nesmí být null
ORA-39145: parameter objektu adresára musí byť zadaný a nesmie mať hodnotu null
ORA-39145: parametr obiektu-katalogu musi być podany i nie może mieć wartości Null
ORA-39145: dizin nesnesi parametresi belirtilmeli ve null olmamalıdır
ORA-39145: directory object parameter must be specified and non-null

See message translations for ORA-39145 and search additional resources

Thursday, May 31, 2007

ORA-39001, ORA-39000, ORA-39087, ORA-31631 and the missing directory privileges

As i explained in my previous posting, after fixing the quota problem, you can still hit a few problems:
>expdp yocoya/yocoya@xe tables=(items,images) dumpfile=exp_dir:testdp.dmp nologfile=Y

Export: Release 10.2.0.1.0 - Production on Thursday, 31 May, 2007 10:06:24

Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-39087: directory name EXP_DIR is invalid
Oracle is complaining about EXP_DIR, but if we check ALL_DIRECTORIES:

select * from all_directories;

OWNER DIRECTORY_NAME DIRECTORY_PATH
----- -------------- --------------
SYS EXP_DIR C:\Temp
We see that the directory is existing and (i guess) points to a valid path.

This means that most likely we forgot to grant the WRITE privilege on that directory to the user doing the export. Before granting (or asking for) the privilege, you can find out if you have been granted the privilege in this fashion:

select * from user_tab_privs
where table_name = 'EXP_DIR';

no rows selected

So let's try and see what we get:

grant write on directory exp_dir to yocoya;

>expdp yocoya/yocoya@xe tables=(items,images) dumpfile=exp_dir:testdp.dmp nologfile=Y

Export: Release 10.2.0.1.0 - Production on Thursday, 31 May, 2007 11:10:53

Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31631: privileges are required

With some surprise we see that Oracle this time is complaining about missing privileges just after that we granted the write permission!
Interestingly enough, it means that the READ privilege is necessary too, not just WRITE.
Let's do it:

grant read on directory exp_dir to yocoya;

Now, unless you forgot to delete a previous dump with the same name, you should get the export dump, finally!


PS: if you specified an existing name for the dump file, you will see the following error:

ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31641: unable to create dump file "H:\Documents\Apex\oracletext\testdp.dmp"
ORA-27038: created file already exists
OSD-04010: opci┐CREATE> especificada; el archivo ya existe
This is another difference between EXP and EXPDP, because EXP overwrites the export file without warnings.

Funnily enough i got the last message in spanish, the primary installation language i guess, even if i had...
set NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1

There must be some quirk in some DLL, but don't count on me to find out which one it is!

¡Que viva Mexico!

See message translations for ORA-39001, ORA-39000, ORA-39087, ORA-31631 and search additional resources.

ORA-31626,ORA-31633,ORA-01950 and the missing quota

If while using the Oracle Data Pump Export utility EXPDP you get something like:

Export: Release 10.2.0.1.0 - Production on Thursday, 31 May, 2007 10:14:20

Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
ORA-31626: job does not exist
ORA-31633: unable to create master table "YOCOYA.SYS_EXPORT_TABLE_05"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPV$FT", line 863
ORA-01950: no privileges on tablespace 'USERS'
It means that you forgot to grant a quota on the default tablespace of the user, in this case named YOCOYA.
alter user YOCOYA quota n M on USERS
will fix the problem unless the total allowance of n megabytes is insufficient to carry out the export, in which case you will get:

ORA-31626: job does not exist
ORA-31633: unable to create master table "YOCOYA.SYS_EXPORT_TABLE_05"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPV$FT", line 863
ORA-01536: space quota exceeded for tablespace 'USERS'


See message translations for ORA-31626, ORA-31633, ORA-01950, ORA-01536 and search additional resources.

Tuesday, May 29, 2007

IMP-00017, ORA-01536, ORA-00959: IMPDP vs IMP

What happened to me yesterday is a good example of a too-long-deferred transition from the traditional EXP/IMP process to the newest EXPDP/IMPDP (aka Oracle Data Pump technology).

Scenario:
CREATE TABLE "IMAGES" (
"ID" NUMBER(9, 0),
"IMAGE" BLOB)
TABLESPACE "YOCOYA"
LOB ("IMAGE") STORE AS (TABLESPACE "YOCOYA")
/
CREATE TABLE "ITEMS" (
"ID" NUMBER(9, 0),
"NAME" VARCHAR2(50))
TABLESPACE "YOCOYA"
/

Two simple tables that i want to copy from one user to another, with each user having his/her objects in a separate tablespace, a typical situation for an hosted environment for instance.

> exp yocoya/yocoya@xe file=test.dmp tables=(items, images)

> imp yocoyatx/yocoyatx@xe file=test.dmp tables=(items, images)

Import: Release 10.2.0.1.0 - Production on Wed May 30 12:20:51 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

Export file created by EXPORT:V10.02.01 via conventional path

Warning: the objects were exported by YOCOYA, not by you

import done in WE8ISO8859P1 character set and AL16UTF16 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
export client uses WE8MSWIN1252 character set (possible charset conversion)
. importing YOCOYA's objects into YOCOYATX
. importing YOCOYA's objects into YOCOYATX
. . importing table "ITEMS" 0 rows imported
IMP-00017: following statement failed with ORACLE error 1536:
"CREATE TABLE "IMAGES" ("ID" NUMBER(9, 0), "IMAGE" BLOB) PCTFREE 10 PCTUSED"
" 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROU"
"PS 1 BUFFER_POOL DEFAULT) TABLESPACE "YOCOYA" LOGGING NOCOMPRESS LOB ("IMAG"
"E") STORE AS (TABLESPACE "YOCOYA" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERS"
"ION 10 NOCACHE LOGGING STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1"
" BUFFER_POOL DEFAULT))"
IMP-00003: ORACLE error 1536 encountered
ORA-01536: space quota exceeded for tablespace 'YOCOYA'
Import terminated successfully with warnings.

Now, let's review the IMP log:

in green you see that table ITEMS has been successfully imported even if the specified tablespace in the export dump was YOCOYA and this is an expected behavior because IMP takes the owner's default tablespace if the original one cannot be used because it doesn't exist or the user does not have the necessary quota, as in this case.

What can be surprising indeed is the second failing statement, where Oracle complains about the lack of quota on tablespace YOCOYA and one may wonder why it didn't complain before then.

Well, the reason is in that Oracle is not complaining about the main table storage clause, but about the LOB storage clause (above, in red). According to the documentation this restriction applies also for IOT tables, nested tables and user defined object tables.

Note also that if i had imported these objects into a database where no YOCOYA tablespace was existing, i would get instead:

IMP-00017: following statement failed with ORACLE error 959:
...
ORA-00959: tablespace 'YOCOYA' does not exist
So Oracle makes a useful distinction here between a nonexistent tablespace and an existing tablespace with no quota.

And now for the workaround.

Forget to manually create the table and re-execute IMP, there is a much simpler solution for this, avalaible since Oracle version 10, kindly suggested by my friend John Scott, who adopted EXPDP/IMPDP (Oracle Data Pump) much earlier than me:

> expdp yocoya/yocoya@xe tables=(items,images) dumpfile=exp_dir:testdp.dmp nologfile=Y

> impdp yocoyatx/yocoyatx@xe remap_schema=YOCOYA:YOCOYATX REMAP_TABLESPACE=YOCOYA:YOCOYATX
DIRECTORY=exp_dir dumpfile=testdp.dmp logfile=test.log

Import: Release 10.2.0.1.0 - Production on Wednesday, 30 May, 2007 15:29:34

Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Master table "YOCOYATX"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "YOCOYATX"."SYS_IMPORT_FULL_01": yocoyatx/********@xe
remap_schema=YOCOYA:YOCOYATX REMAP_TABLESPACE=YOCOYA:YOCOYATX
DIRECTORY=exp_dir dumpfile=testdp.dmp logfile=test.log
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported "YOCOYATX"."IMAGES" 0 KB 0 rows
. . imported "YOCOYATX"."ITEMS" 0 KB 0 rows
Job "YOCOYATX"."SYS_IMPORT_FULL_01" successfully completed at 15:29:59

One important difference between EXP/IMP and EXPDP/IMPDP is the fact that the latter is a tool that works entirely at the server side. In other words, don't expect to receive the file on your client machine if you are connected remotely, the data pump will export the file in a local folder specified in various ways and depending on the configuration and privileges granted to the user doing the operation. You can find the relevant information about these parameters in the Overview of Oracle Data Pump. In the example above i had to create a DIRECTORY object exp_dir beforehand, as well as granting read and write privileges to both users, otherwise the export operation would fail (which will the topic of my next posting i guess...).

So, what if you need to export a file over a network?

You'll need to have access to the directory where the file has been exported and get the file via FTP, via a network share or whatever other method is available.

Updated July 27, 2007:
John Scott points out that if the user performing the import holds unlimited tablespace privilege, then error ORA-01536 may not be returned at all. Note also that such privilege can be held indirectly if the user has been granted a role like resource (this role has been deprecated since Oracle 9iR2 by the way).

See message translations for IMP-00017, ORA-01536, ORA-00959 and search additional resources.
---------------------------------------
ORA-01536: quota di spazio superata per tablespace ''
ORA-01536: cuota de espacio excedida para tablespace ''
ORA-01536: s'ha excedit la quota d'espai del tablespace ''
ORA-01536: dépassement du quota d'espace affecté au tablespace ''
ORA-01536: Speicherplatz-Zuteilung für Tablespace '' überschritten
ORA-01536: το quota χώρου ξεπεράσθηκε για το χώρο πινάκων (tablespace) ""
ORA-01536: pladskvota er overskredet for tabelområdet ''
ORA-01536: utrymmeskvot överskriden för tabellutrymme ''
ORA-01536: plasskvoten er overskredet for tabellområdet
ORA-01536: tilakiintiö ylitetty taulualueelle ''
ORA-01536: terület kvóta túllépés a(z) '' táblaterületre
ORA-01536: cota de spaţiu depăşită pentru spaţiul tabelă ''
ORA-01536: Geheugenquota is overschreden voor tabelruimte ''.
ORA-01536: cota de espaço excedida para o tablespace ''
ORA-01536: quota de espaço excedida para o tablespace ''
ORA-01536: превышена квота памяти для раздела ''
ORA-01536: kvóta pro prostor tabulek '' překročena
ORA-01536: kvóta prekročená pre tabuľkový priestor ''
ORA-01536: przekroczenie limitu w przestrzeni tabel ''
ORA-01536: tablo '' için alan kotası aşıldı

ORA-00959: tablespace '' inesistente
ORA-00959: el tablespace '' no existe
ORA-00959: el tablespace '' no existeix
ORA-00959: le tablespace '' n'existe pas
ORA-00959: Tablespace '' nicht vorhanden
ORA-00959: ο χώρος πινάκων (tablespace) "" δεν υπάρχει
ORA-00959: tabelområdet '' findes ikke
ORA-00959: tabellutrymmet '' finns inte
ORA-00959: tabellområdet finnes ikke
ORA-00959: taulutilaa '' ei ole olemassa
ORA-00959: a(z) '' táblaterület nem létezik
ORA-00959: spaţiul tabel '' nu există
ORA-00959: Tabelruimte '' bestaat niet.
ORA-00959: tablespace '' não existe
ORA-00959: tablespace '' não existe
ORA-00959: раздел '' не существует
ORA-00959: tabulkový prostor '' neexistuje
ORA-00959: tabuľkový priestor '' neexistuje
ORA-00959: przestrzeń tabel '' nie istnieje
ORA-00959: '' tablo alanı mevcut değil

yes you can!

Two great ways to help us out with a minimal effort. Click on the Google Plus +1 button above or...
We appreciate your support!

latest articles