Home » RDBMS Server » Server Utilities » How to overwrite Functions/ Procedures using expdp (Oracle 10.2.0.4.0 on RHEL 4)
How to overwrite Functions/ Procedures using expdp [message #333411] Fri, 11 July 2008 10:32 Go to next message
OraKaran
Messages: 183
Registered: March 2008
Location: United Kingdom
Senior Member
Hi,

I have 2 schemas Prod_ax and Dev_ax

I want to overwite a functions in Dev_ax with those in Prod_ax

However everytime I import in from Prod_ax schema it does not allow me to overwrite and produces folowing error.

expdp Prod_ax/Prod_ax schemas=Prod_ax directory=TSTDIR include=FUNCTION:"IN('FX')" dumpfile=tstfun1.dmp logfile=tstfun1.log

impdp Dev_ax/Dev_ax schemas=Prod_ax directory=TSTDIR include=FUNCTION:"IN('FX')" dumpfile=tstfun1.dmp logfile=tstfun2.log REMAP_SCHEMA=Prod_ax:Dev_ax

[oracle@db005]$ impdp Dev_ax/Dev_ax schemas=tst directory=TSTDIR include=FUNCTION:"IN('FX')" dumpfile=tstfun1.dmp logfile=tstfun2.log REMAP_SCHEMA=Prod_ax:Dev_ax

Import: Release 10.2.0.4.0 - 64bit Production on Friday, 11 July, 2008 16:21:08

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

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "Dev_ax"."SYS_IMPORT_SCHEMA_01" successfully loaded/unloaded
Starting "Dev_ax"."SYS_IMPORT_SCHEMA_01":  Dev_ax/******** schemas=Prod_ax directory=TSTDIR include=FUNCTION:IN('FX') dumpfile=tstfun1.dmp logfile=tstfun2.log REMAP_SCHEMA=Prod_ax:Dev_ax
Processing object type SCHEMA_EXPORT/FUNCTION/FUNCTION
ORA-31684: Object type FUNCTION:"Dev_ax"."FX" already exists
Processing object type SCHEMA_EXPORT/FUNCTION/ALTER_FUNCTION
Job "Dev_ax"."SYS_IMPORT_SCHEMA_01" completed with 1 error(s) at 16:22:20



Please advice how to overwrite the functions while import

Thanks and Regards,
OraKaran
Re: How to overwrite Functions/ Procedures using expdp [message #333414 is a reply to message #333411] Fri, 11 July 2008 10:36 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
]$ impdp -help

Import: Release 10.2.0.3.0 - 64bit Production on Friday, 11 July, 2008 8:33:45

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


The Data Pump Import utility provides a mechanism for transferring data objects
between Oracle databases. The utility is invoked with the following command:

     Example: impdp scott/tiger DIRECTORY=dmpdir DUMPFILE=scott.dmp

You can control how Import runs by entering the 'impdp' command followed
by various parameters. To specify parameters, you use keywords:

     Format:  impdp KEYWORD=value or KEYWORD=(value1,value2,...,valueN)
     Example: impdp scott/tiger DIRECTORY=dmpdir DUMPFILE=scott.dmp

USERID must be the first parameter on the command line.

Keyword               Description (Default)
------------------------------------------------------------------------------
ATTACH                Attach to existing job, e.g. ATTACH [=job name].
CONTENT               Specifies data to load where the valid keywords are:
                      (ALL), DATA_ONLY, and METADATA_ONLY.
DIRECTORY             Directory object to be used for dump, log, and sql files.
DUMPFILE              List of dumpfiles to import from (expdat.dmp),
                      e.g. DUMPFILE=scott1.dmp, scott2.dmp, dmpdir:scott3.dmp.
ENCRYPTION_PASSWORD   Password key for accessing encrypted column data.
                      This parameter is not valid for network import jobs.
ESTIMATE              Calculate job estimates where the valid keywords are:
                      (BLOCKS) and STATISTICS.
EXCLUDE               Exclude specific object types, e.g. EXCLUDE=TABLE:EMP.
FLASHBACK_SCN         SCN used to set session snapshot back to.
FLASHBACK_TIME        Time used to get the SCN closest to the specified time.
FULL                  Import everything from source (Y).
HELP                  Display help messages (N).
INCLUDE               Include specific object types, e.g. INCLUDE=TABLE_DATA.
JOB_NAME              Name of import job to create.
LOGFILE               Log file name (import.log).
NETWORK_LINK          Name of remote database link to the source system.
NOLOGFILE             Do not write logfile.
PARALLEL              Change the number of active workers for current job.
PARFILE               Specify parameter file.
QUERY                 Predicate clause used to import a subset of a table.
REMAP_DATAFILE        Redefine datafile references in all DDL statements.
REMAP_SCHEMA          Objects from one schema are loaded into another schema.
REMAP_TABLESPACE      Tablespace object are remapped to another tablespace.
REUSE_DATAFILES       Tablespace will be initialized if it already exists (N).
SCHEMAS               List of schemas to import.
SKIP_UNUSABLE_INDEXES Skip indexes that were set to the Index Unusable state.
SQLFILE               Write all the SQL DDL to a specified file.
STATUS                Frequency (secs) job status is to be monitored where
                      the default (0) will show new status when available.
STREAMS_CONFIGURATION Enable the loading of Streams metadata
TABLE_EXISTS_ACTION   Action to take if imported object already exists.
                      Valid keywords: (SKIP), APPEND, REPLACE and TRUNCATE.
TABLES                Identifies a list of tables to import.
TABLESPACES           Identifies a list of tablespaces to import.
TRANSFORM             Metadata transform to apply to applicable objects.
                      Valid transform keywords: SEGMENT_ATTRIBUTES, STORAGE
                      OID, and PCTSPACE.
TRANSPORT_DATAFILES   List of datafiles to be imported by transportable mode.
TRANSPORT_FULL_CHECK  Verify storage segments of all tables (N).
TRANSPORT_TABLESPACES List of tablespaces from which metadata will be loaded.
                      Only valid in NETWORK_LINK mode import operations.
VERSION               Version of objects to export where valid keywords are:
                      (COMPATIBLE), LATEST, or any valid database version.
                      Only valid for NETWORK_LINK and SQLFILE.

The following commands are valid while in interactive mode.
Note: abbreviations are allowed

Command               Description (Default)
------------------------------------------------------------------------------
CONTINUE_CLIENT       Return to logging mode. Job will be re-started if idle.
EXIT_CLIENT           Quit client session and leave job running.
HELP                  Summarize interactive commands.
KILL_JOB              Detach and delete job.
PARALLEL              Change the number of active workers for current job.
                      PARALLEL=<number of workers>.
START_JOB             Start/resume current job.
                      START_JOB=SKIP_CURRENT will start the job after skipping
                      any action which was in progress when job was stopped. 
STATUS                Frequency (secs) job status is to be monitored where
                      the default (0) will show new status when available.
                      STATUS[=interval]
STOP_JOB              Orderly shutdown of job execution and exits the client.
                      STOP_JOB=IMMEDIATE performs an immediate shutdown of the
                      Data Pump job.



the answer is contain the HELP info above
Re: How to overwrite Functions/ Procedures using expdp [message #333417 is a reply to message #333414] Fri, 11 July 2008 10:45 Go to previous messageGo to next message
OraKaran
Messages: 183
Registered: March 2008
Location: United Kingdom
Senior Member
Hi,

Thanks for too quick Reply.

It's seems I have puzzle time Smile

Are yoiu referring to "TABLE_EXISTS_ACTION=REPLACE"?

It is not working though in my case.

I am missing something.

Thansk and Regards,
Pratap

Re: How to overwrite Functions/ Procedures using expdp [message #333420 is a reply to message #333411] Fri, 11 July 2008 10:53 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Are yoiu referring to "TABLE_EXISTS_ACTION=REPLACE"?
Yes

>It is not working though in my case.
Sorry to hear that.

My reality is that my application uses UTF-8 characterset.
V10 Data Pump contains known bug which corrupts UTF-8 data;
which I have posted Metalink Note to this forum previously.
You may have found yet another flaw in it.
Re: How to overwrite Functions/ Procedures using expdp [message #333426 is a reply to message #333411] Fri, 11 July 2008 11:28 Go to previous message
OraKaran
Messages: 183
Registered: March 2008
Location: United Kingdom
Senior Member
Thanks For your quick reply again!!

I will serach the related link on Metalink and will post the results

Thanks and Regards,
OraKaran
Previous Topic: Functions in SQL LOADER
Next Topic: SQLLDR Insert problem
Goto Forum:
  


Current Time: Sun May 12 05:51:44 CDT 2024