Solved

oracle import script -how to build

Posted on 2006-11-03
4
4,553 Views
Last Modified: 2007-11-27
folks

below is a database export script

@echo off

 

exp 'sys/Sr20072006@MAXDEMO as sysdba' full=Y file=D:\Backup\MAXDEMO\exp_maxdemo.dmp log=D:\Backup\MAXDEMO\exp_maxdemo.log grants=y indexes=y compress=y direct=n rows=y

how can i convert this so i get a database import script?
0
Comment
Question by:rutgermons
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 48

Expert Comment

by:schwertner
ID: 17865185
imp 'sys/Sr20072006@MAXDEMO as sysdba' full=Y file=D:\Backup\MAXDEMO\exp_maxdemo.dmp log=D:\Backup\MAXDEMO\exp_maxdemo.log grants=y indexes=y compress=y direct=n rows=y


Another example:

c:>imp parfile =imp.par

where the file is:

USERID="sys/reks@test as sysdba"
FILE=d:\ora10g\m\main\imp\07_15_2005_m.dmp
SHOW=n
IGNORE=y
GRANTS=y
ROWS=y
FULL=y
LOG=d:\ora10g\m\main\imp\imp.log
0
 

Expert Comment

by:cgilbert78fr
ID: 17865292
FYI, compress and direct are not imp options...

Prior to the import, you should clear the data you need to reimport, that is dropping the tables/indexes or truncating them to avoid ORA-0001 (unique contraint violated) and things like that.

If your aim is to rebuild your DB frol scratch using dump file, you should include in your script the create database statement.

The only parameters that are usefull to you are :
full=y
file=...
log=.../imp.log


If tables already exist when importing, you should set the ignore=Y parameter.
ignore=y will also allow you to reuse the existing DB files...

More information here (on tahiti) :
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14215/exp_imp.htm#i1023560

Regards

0
 
LVL 48

Expert Comment

by:schwertner
ID: 17865597
Another trap:

You have to set NLS_LANG environment (registry) parameter to a good value if you use letters that aren't english. On bot sites - export and import.
Because the defaulut is US7ASCII and the dump will loose all not english letters ...
0
 
LVL 35

Accepted Solution

by:
Mark Geerlings earned 500 total points
ID: 17869988
If you plan to use export and import to copy data from one Oracle database to another, this can work (and I use that technique each weekend in an automated job that reloads our test database with current, production data) but you need to do some work in the import database first!  Before running import, you need to:
1. disable (or drop) all constraints on tables that will be loaded by the import
2. truncate every table that will be loaded by the import
3. disable any/all triggers on tables that will be loaded by the import

Then you run the import (with "ignore=Y") and that will recreate/re-enable the constraints and triggers after it loads the data.

It looks to me like you a Maximo system that uses an Oracle database.  We also have a small Maximo system here, but Maximo is certainly not optimized for Oracle, and the folks at MRO don't know Oracle all that well.

0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question