Oracle Import missing tables
I am using this command to import tables.
imp FILE=D:\swr\SWR_18_08_2019.dmp FROMUSER=SWR TOUSER=SWR
I expect the output of all tables need to import.
Any help would be appreciated.
What happens if you modify the command to
imp swr file=D:\swr\SWR_18_08_2019.dmp log=swr_imp.log ignore=y
In other words:
specify username which will own data you import (swr)
include log file (to see what's going on)
use ignore parameter which will skip CREATE TABLE statements if tables already exist and will load only data
fromuser/touser seems to be unnecessary
Then run it and see what happens. If it still doesn't work, please, post an excerpt from the log file so that we'd see the result.
Related
I tried to import (TABLES, PROCEDURE, FUNCTION etc) from a dump file. I did a mistake by
executing KILL -9 <PROCESS_ID> while import was still going on.
So, I started to import again. Now, I did another mistake by NOT mentioning
TABLE_EXISTS_ACTION=TRUNCATE . So, tables have been imported with duplicate records.
I want to get rid of duplicate data. There are more than 500 tables involved.
I am planning to import again by first truncating the table and then importing data only.
Below is the import command I have come up with. Will this command import ONLY table data(records) by first
truncating the table and then insert only the data?
impdp DIRECTORY=MY_DIRECTORY dumpfile=EXP_MY_DUMP.dmp INCLUDE=TABLE_DATA TABLE_EXISTS_ACTION=TRUNCATE
I could try executing myself and find out if that works. But, I have already tried twice and failed.
Also, I don't want to again import INDEX, SEQUENCES etc. Just table records.
Remove INCLUDE=TABLE_DATA. That will not execute create table.. that should work.
I created a dump of a local oracle database like this:
expdp mydb/passwd -schemas=myschema -dumpfile=mydumpfile.dmp -logfile=oralog.log
I sent the dump to someone who is supposed to import the dump in his oracle server. Now, he tells me, the import fails due to some errors related to tablespaces (like tablespace XYZ is not available, - the database XYZ is in no relation to the respective database). Besides, he asks me to give some information about the dump concerning the tablespaces.
Since I am usually working with MySQL and have limited knowledge about these Oracle-Tablespace things: I would really appreciate to get some advise.
Use REMAP_TABLESPACE parameter.
For example,
REMAP_TABLESPACE=(source1:destination1,source2:destination1,source3:destination1,source4:destination1)
Go through the documentation about Data Pump Import. A small quote -
Multiple REMAP_TABLESPACE parameters can be specified, but no two can
have the same source tablespace. The target schema must have
sufficient quota in the target tablespace.
Note that use of the REMAP_TABLESPACE parameter is the only way to
remap a tablespace in Data Pump Import. This is a simpler and cleaner
method than the one provided in the original Import utility. That
method was subject to many restrictions (including the number of
tablespace subclauses) which sometimes resulted in the failure of some
DDL commands.
By contrast, the Data Pump Import method of using the REMAP_TABLESPACE
parameter works for all objects, including the user, and it works
regardless of how many tablespace subclauses are in the DDL statement.
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
I have encountered a problem in importing the dump file to a new database.
When importing the dump file it requires a new tablespace which does not exist in the database.
To create the tablespace I need to hijack some scripts which is readonly.For this reason it is complicated to export the table structure through imp tool of Oracle so my colleage changed the dump file manually and it is able to be imported.
Is it OK to change the dump file manually in order to import the file if it is the quickest way?
if are comfortable to change the dump file manually then it is fine, keeping that you are aware of the the complete structure of the .dmp file.
i will suggest u to use data pump as it remaps the table space of the existing schema with the new one. and performance wise data pump is much faster then normal dump.
As an alternative, get a dummy database and
create the tablespace/schema.
Do the import there with ROWS=N
ALTER TABLE ... MOVE .... to put the tables into the desired tablespace
Export tables (structures) from there
import corrected structures
Import the data with IGNORE=Y so that the data can be imported over the existing structures.
if you create the user with a default tablespace that is a tablespace that exists, you can import with rows=n and ignore=y and that should bring the objects in for you into that tablespace.
We get *.dmp files from client which has some masked table data including indexes and constraints.
I do have those table structures (including indexes and constraints) at my end.
I want to import just the data without the indexes and constraints (present in the .dmp file) in Oracle10g using 'imp' command.
I am aware of the 'imp' command. Do help me in letting me know the options available in 'imp' command to import only the data.
I have tried using -- rows=yes indexes=no but this does not help.
You should be able to specify indexes=N and constraints=N.
For more info:
%> imp help=y
Here is a link with some good info on the options:
Oracle imp information
I am assuming from your post that you already have the tables and ancillary structures in your database, and you just want to suppress the error messages. If that is indeed the case the option you want is IGNORE=Y.
The Oracle documentaion is available online. You don't say what version you're on, but as you're using IMP I'd say 9i was a good fit. Find out more.. (On later versions you should check out DataPump instead).
Import the dump with show=y option. This will create/extract the scripts from dmp file. Now you can remove the indexes and constraint scripts from the log and execute against the database.
Here you can see lot of exp/data pump related examples.
http://www.acehints.com/p/site-map.html
You need to disable all triggers and then import your data with the CONSTRAINTS=N argument. Consider importing a table G3E_COMPONENT with constraints, foreign keys and triggers:
SQL>alter table G3E_COMPONENT disable all triggers;
import your data:
imp userid=USER/XXXXX#ORCL CONSTRAINTS=N DATA_ONLY=Y STATISTICS=NONE file=export.exp log=imp.log TABLES=G3E_COMPONENT
Should do the trick
IMHO IMP can't prevent constraints being applied and triggers being fired, ignore=y only ignores errors that arise. Maybe datapump allows it, I don't know.
So you have to:
manually disable all triggers and constraints on imported table
do an import with tables=<table names> rows=Y indexes=N constraints=N
enable triggers
enable validate constraints and resolve any errors (find and edit/remove offending values).
Be careful to use imp version that exactly matches your DB version. I had trouble with this...
Do Ignore=Y. It will ignore the create errors since you have already have the schema.