I have a .dmp file that I would like to import into Oracle 9i. How do I do that?
Presuming you have a .dmp file created by oracle exp then
imp help=y
will be your friend. It will lead you to
imp file=<file>.dmp show=y
to see the contents of the dump and then something like
imp scott/tiger#example file=<file>.dmp fromuser=<source> touser=<dest>
to import from one user to another. Be prepared for a long haul though if it is a complicated schema as you will need to precreate all referenced schema users, and tablespaces to make the imp work correctly
I am Using Oracle Database Express Edition 11g Release 2.
Follow the Steps:
Open run SQl Command Line
Step 1: Login as system user
SQL> connect system/tiger
Step 2 : SQL> CREATE USER UserName IDENTIFIED BY Password;
Step 3 : SQL> grant dba to UserName ;
Step 4 : SQL> GRANT UNLIMITED TABLESPACE TO UserName;
Step 5:
SQL> CREATE BIGFILE TABLESPACE TSD_UserName
DATAFILE 'tbs_perm_03.dat'
SIZE 8G
AUTOEXTEND ON;
Open Command Prompt in Windows or Terminal in Ubuntu. Then Type:
Note : if you Use Ubuntu then replace " \" to " /" in path.
Step 6: C:\> imp UserName/password#localhost file=D:\abc\xyz.dmp log=D:\abc\abc_1.log full=y;
Done....
I hope you Find Right solution here.
Thanks.
i got solution what you are getting as per imp help=y it is mentioned that imp is only valid for TRANSPORT_TABLESPACE as below:
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)
STREAMS_CONFIGURATION import streams general metadata (Y)
STREAMS_INSTANTIATION import streams instantiation metadata (N)
DATA_ONLY import only data (N)
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
So, Please create table space for your user:
CREATE TABLESPACE <tablespace name> DATAFILE <path to save, example: 'C:\ORACLEXE\APP\ORACLE\ORADATA\XE\ABC.dbf'> SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE 10G EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;
imp system/system-password#SID file=directory-you-selected\FILE.dmp log=log-dir\oracle_load.log fromuser=infodba touser=infodba commit=Y
.dmp files are dumps of oracle databases created with the "exp" command. You can import them using the "imp" command.
If you have an oracle client intalled on your machine, you can executed the command
imp help=y
to find out how it works. What will definitely help is knowing from wich schema the data was exported and what the oracle version was.
Related
I exported a database and it created a sql file for me with create and insert but I get an error saying ORA-02199: missing DATAFILE/TEMPFILE clause
in sql plus I run the sql script and get a bunch of ORA-00942: table or view does not exist Then i noticed when it creates a table it has TABLESPACE "LOCALDEV" ; So I enter CREATE tablespace LOCALDEV
Prior to all that I enter create user localdev identified by localdev;
and
grant ALTER SESSION, CREATE SESSION, CREATE DATABASE LINK, CREATE MATERIALIZED VIEW, CREATE PROCEDURE, CREATE PUBLIC SYNONYM, CREATE ROLE,CREATE SEQUENCE, CREATE SYNONYM, CREATE TABLE, CREATE TRIGGER, CREATE TYPE, CREATE VIEW, UNLIMITED TABLESPACE to localdev;
SQL> create tablespace localdev datafile '/u01/app/localdev.dbf'
size 100m;
ERROR at line 1:
ORA-01119: error in creating database file '/u01/app/localdev.dbf'
ORA-27040: file create error, unable to create file
Linux-x86_64 Error: 13: Permission denied
Additional information
: 1
I get no error until I run the sql script. If I had a BDA to ask I would but do not. Any advice will be greatly appreciated.
I exported a database and it created a sql file for me with create and
insert but I get an error saying ORA-02199: missing DATAFILE/TEMPFILE
clause (bla bla bla)
In my opinion, the very first step you did was wrong. If you wanted to export the "database" (I presume it is, actually, a "schema" (i.e. "user")), then you should have done that. Oracle offers Data Pump utility, export and import.
If you performed export, you'd take the DMP file with you and import it into another database using import data pump with the REMAP_TABLLESPACE parameter which accepts two values: the old, "source" tablespace and the new, "target" tablespace, separated by colon. For example:
impdp scott/tiger#new_database REMAP_TABLESPACE=localdev:users DIRECTORY=dump_dir DUMPFILE=scott.dmp
Alternatively, as you currently have a textual file that contains CREATE & INSERT statements, why didn't you open it in any text editor and replaced the old tablespace name (localdev) with a tablespace name used in your new database (that would be "users" in my IMPDP example)?
It takes a few seconds, you run it, everything gets created and you don't have to reinvent the wheel by doing everything you did after the first sentence (that would be bla bla part).
I have an oracle dump file which I assume has been created using the exp command and not the expdp
The dump file is about 4 GB and I would like to import it into my Oracle 11.2 database.
The dump file which was created has the tablespace as "spaceA" but my tablespace is "spaceB"
So I would need to remap the tablespace as well.
I did use impdp commands before and it used to work perfectly fine but guess as I understand
impdp could only be used on dump file if it was exported using expdp..
Since I am not very familiar with the process of exporting/importing, I would like to get help with this
If the tablespace is not hardcoded in the dmp file create table statements then you should be able to import without a problem. So my suggestion would be to first try something like the following (for more details: http://docs.oracle.com/cd/E11882_01/server.112/e10701/original_import.htm)
imp user/password#instance file=FILE.dmp log=LOG.log fromuser=DMPSCHEMA touser=NEWSCHEMA
If you get IMP-00017 errors. Then you have to take the longer route. You need to first create the tables and then import with ignore=y.
To first create the tables you need the DDL statements, which you can obtain by running:
imp user/password#instance file=FILE.dmp log=LOG.log full=y indexfile=INDEXFILE.log
The INDEXFILE.log will contain all the create table statements. Find and replace "spaceA" with "spaceB", create the tables, and then run the import with the ignore=y parameter which will ignore table creation errors (since tables already exist) and load data:
imp user/password#instance file=FILE.dmp log=LOG.log fromuser=DMPSCHEMA touser=NEWSCHEMA ignore=y
The Oracle new tablespace name must fit with the old tablespace name?
For example:
The dump file tablespace name is A,and i create a new tablespace B,and it could import table, but has many error?
ORA-00959:tablespace 'ECASYS'(old) not exits.
This is my import statement:
imp userid='ZHPE/zhpe#ORCL' file='E:\xxxx\xxxx2013-08-15Bak\130815.dmp' log='D:\app\Administrator\oradata\orcl\ZHPE.log' full=y ignore=y;
Is the new tablespace must must must fit the old one???
help!
If you're forced to use the legacy exp and imp tools then the tablespace cannot be changed during the import itself using command-line options. If you can, switch to using the datapump versions, expdp and impdp, and then follow #schurik's advice.
If you can't do that then you'll need a workaround, which is to create the schema objects manually first.
If you run imp with the indexfile option then it will create a file containing the DDL for the tables and indexes:
imp user/password indexfile=schema.sql file=...
The table creation DDL is commented out with REM markers, which you need to remove. You can then edit it to change the tablespace and any other storage options that are no longer appropriate. Then run that schema creation SQL to create all the tables as empty.
Then run the normal import again, but with the ignore=y flag so it doesn't complain (much) that the tables now already exist. The data will still be inserted into those existing tables.
This will be a bit slower if you create the indexes as well as the tables beforehand; normally it would create the tables, insert the data, and then build the indexes, which is more efficient. If the slowdown is significant then you can split your schema.sql into separate table and index creation files and do the same thing manually - create the tables, run the import with ignore=y and indexes=n (to stop it trying and failing to create them), and then create the indexes yourself afterwards.
Clearly this is a bit of a pain, and one of many reasons that switching to datapump is a good idea.
take a look at the REMAP_TABLESPACE import parameter e.g
REMAP_TABLESPACE=A:B
I'm facing a new problem about importing data on Oracle.
I've got a dump file of around 40GB, and I'm trying to import this to my Oracle Database 10g Release 10.2.0.4.0.
On our system we have 3 tablespaces (Datalob/Data and Index), one of our Customer is using only one tablespace (MIG).
if I try to import the data (from customer), I get the error ORA-01652 unable to extend segment by ... because i don't have enough space.
too bad, I can't make the tablespace bigger/ or is not allowed.
is there a way to import the tablespace for Datalob(all lob fields) to the tablespace DATALOB, all index to INDEX and normal data to DATA?
like Remap_Tablespace=MIG(LOB):DATALOB remap_tablespcae=MIG(IDX):INDEX
I'd use a sequential approach - not very elegant, but it should work:
import only the metadata (into your "table" tablespace)
move the LOB segments to the LOB tablespace
move the indices to the index tablespace
import the contents
Pre-create the table using the tablespaces you want and use TABLE_EXISTS_ACTION=APPEND.
I have a table in Oracle for users. I am going to install new schema and want to backup all users with passwords and other fields.
I tried exp and int utilities, but imp doesn't recover anything.
I created temporary user in USERS table. Then I did backup with command:
exp user_owner/password file=file.dmp table=USERS rows=yes indexes=no
After that I deleted the temporary username and I tried to restore with:
imp user_owner/password file=file.dmp table=users fromuser=user_owner
Export file created by EXPORT:V10.02.01 via conventional path
import done in UTF8 character set and AL16UTF16 NCHAR character set
. importing USER_OWNER's objects into USER_OWNER
. importing USER_OWNER's objects into USER_OWNER
IMP-00015: following statement failed because the object already exists:
bla
bla
bla
Import terminated successfully with warnings.
In the USERS table temporary user didn't appear.
Please advice how can I perform such task like backup and restore rows (with values) of the table in Oracle.
Use IGRNORE=Y as a parameter to your import. This will ignore creation errors.
Type imp help=y at the command line for more information.
The specific error you got on import is because by default it will try to create the table, not just the data in it. You can use the IGNORE=Y flag to avoid that problem. But it will try to insert all the users that existed, not just the one you deleted, which might cause you other problems. Or, it could fail for those rows if there's a unique index.