exp/imp 9i overwrite
newby question re exp/imp
If we do an exp full=y
and want to import the data into another instance and overwite the data, what do we do?
If I just do a straight import, presumably entries will not be overwritten? - so do existing objects not get re-created either, and just left alone?
and if I do not say ignore=y will it fail?
I basically want to overwrite the existing data in the schema to imp into - can I do that easily?
You should start by looking at the import command.
You can add DESTROY=Y to your parameter list.
You should specify IGNORE=Y
Import: Release 184.108.40.206.0 - Production on Tue Jan 24 16:41:39 2006
Copyright (c) 1982, 2002, 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)
STREAMS_CONFIGURATION import streams general metadata (Y)
STREAMS_INSTANITATION import streams instantiation metadata (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
Import terminated successfully without warnings.
this space intentionally left blank
Drop the schema and do the imp would be the right way to do.
"What is past is PROLOGUE"
and if I only want to import data for one user, and leave the rest alone, but I still want to overwrite the data for that one user, then how do I do it?
Someone told me not to use destroy=y - it is not strictly used to overwrite the data, but will get rid of the actual existing datafiles and can leave you in the lurch (so to speak)?
I am a litle confused as to what destroy=y means - obviosuly in my case I only want to overwrite the one user on the database, not all of them, and presumably the datafile would be in use by many users, therfore if I destroed it, would end up losing the data for the other exisiting users?
or do I have it all wrong?
If you want to overwrite only one user then you need not do full export/import. You can export required schema, drop the schema on the target and then import.
thanks a lot, will remove schema for the user then do an import fromuser touser.
Back to Square 1
Originally Posted by sunil_kandi
"What is past is PROLOGUE"
yep thanks, presumably I use owner=myuser on the export?
then do imp fromuser=myuser on the import
Click Here to Expand Forum to Full Width