DBMS_DATAPUMP.metadata_remap - a matter of REMAP_TABLE.

I want to export SCOTT. DEPT table and imports than HR. DEPT_HR with constraint. I'm using DBMS_METADATA. METADATA_REMAP with REMAP_SCHEMA (to change the schema anme) and REMAP_TABLE (to change the name of the table). I don't know where I am getting the error. It seems that REMAP_SCHEMA is changing all the names of schema successfully, but REMAP_TABLE does not change the name of the table on the constraint. So constraint is not be created. Is there another workaround solution? Here is a small proof of concept:

SQL> --My database version.
SQL> ----------------------
SQL> SELECT * FROM v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

SQL> SET SERVEROUT ON
SQL> ed
Wrote file afiedt.buf

  1  DECLARE
  2  l_data_pump_handle    NUMBER;
  3  l_logfilename    VARCHAR2(30) := 'DWABI_'||to_char(sysdate, 'DDMMRRRRhh24miss') || '.log';
  4  l_expfilename    VARCHAR2(30) := 'DWABI_'||to_char(sysdate, 'DDMMRRRRhh24miss') || '.dmp';
  5  BEGIN
  6  l_data_pump_handle:= DBMS_DATAPUMP.OPEN(operation   => 'EXPORT',
  7                        job_mode    => 'TABLE',
  8                        remote_link => NULL,
  9                        job_name    => 'TEST_REMAP_DP',
10                        version     => 'LATEST');
11   DBMS_DATAPUMP.ADD_FILE(handle    => l_data_pump_handle,
12                     filename    => l_expfilename,
13                     directory => 'SAUBHIK',
14                     filetype    => DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE);
15  DBMS_DATAPUMP.ADD_FILE(handle    => l_data_pump_handle,
16                     filename    => l_logfilename,
17                     directory => 'SAUBHIK',
18                     filetype    => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
19   DBMS_DATAPUMP.metadata_filter(handle => l_data_pump_handle,
20                        name   => 'SCHEMA_EXPR',
21                        value  =>'= '||''''||'SCOTT'||'''');
22   DBMS_DATAPUMP.metadata_filter(handle => l_data_pump_handle,
23                        name   => 'NAME_EXPR',
24                        value  =>'= '||''''||'DEPT'||'''');
25  --We don't need index
26    DBMS_DATAPUMP.metadata_filter(handle => l_data_pump_handle,
27                        name   => 'EXCLUDE_PATH_EXPR',
28                        value  =>'=''INDEX''');
29  -- We don't copy table statistics!!
30    DBMS_DATAPUMP.metadata_filter(handle => l_data_pump_handle,
31                        name   => 'EXCLUDE_PATH_EXPR',
32                        value  =>'=''STATISTICS''');
33   -- We don't copy index statistics either!!
34    DBMS_DATAPUMP.metadata_filter(handle => l_data_pump_handle,
35                        name   => 'EXCLUDE_PATH_EXPR',
36                        value  =>'=''INDEX_STATISTICS''');
37    -- We do not need the data!!
38    DBMS_DATAPUMP.DATA_FILTER(
39     handle => l_data_pump_handle,
40     name => 'INCLUDE_ROWS',
41     value =>0
42     );
43  -- Start the export now.
44       DBMS_DATAPUMP.start_job(l_data_pump_handle);
45       dbms_output.put_line('Export started....');
46   -- Detach, it's finish!
47      DBMS_DATAPUMP.detach(l_data_pump_handle);
48      dbms_output.put_line('Export ended....');
49  EXCEPTION
50       WHEN OTHERS THEN
51        dbms_datapump.stop_job(l_data_pump_handle);
52        RAISE;
53*  END;
54  /
Export started....
Export ended....

PL/SQL procedure successfully completed.

SQL> SELECT * FROM user_datapump_jobs;

no rows selected



Now, I'm importing that:

SQL> ed
Wrote file afiedt.buf

  1  --DWABI_28052015143133.dmp
  2  DECLARE
  3  l_data_pump_imp_handle NUMBER;
  4  l_logfilename  VARCHAR2(30) := 'DWABI_'||to_char(sysdate, 'DDMMRRRRhh24miss') || '.log';
  5  ind       NUMBER;        -- loop index
  6   pct_done  NUMBER;        -- percentage complete
  7   job_state VARCHAR2(30);  -- track job state
  8   le        ku$_LogEntry;  -- WIP and error messages
  9   js        ku$_JobStatus; -- job status from get_status
10   jd        ku$_JobDesc;   -- job description from get_status
11   sts       ku$_Status;    -- status object returned by get_status
12  BEGIN
13  l_data_pump_imp_handle:= DBMS_DATAPUMP.OPEN(operation   => 'IMPORT',
14                        job_mode    => 'FULL',
15                        remote_link => NULL,
16                        job_name    => 'TEST',
17                        version     => 'LATEST');
18   DBMS_DATAPUMP.ADD_FILE(handle    => l_data_pump_imp_handle,
19                     filename    => 'DWABI_28052015143133.dmp',
20                     directory => 'SAUBHIK',
21                     filetype    => DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE);
22  DBMS_DATAPUMP.ADD_FILE(handle    => l_data_pump_imp_handle,
23                     filename    => l_logfilename,
24                     directory => 'SAUBHIK',
25                     filetype    => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
26   --If table is already there then do not import.
27   dbms_datapump.set_parameter(handle => l_data_pump_imp_handle,
28                              name => 'TABLE_EXISTS_ACTION',
29                              value =>'SKIP');
30    -- We need to remap the schema!!.
31    dbms_output.put_line('Changing Schema...');
32    DBMS_DATAPUMP.METADATA_REMAP (
33     handle => l_data_pump_imp_handle,
34     name => 'REMAP_SCHEMA',
35     old_value => 'SCOTT',
36     value=>'HR'
37     );
38    -- We need to remap the table!!. This is not working properly.
39    dbms_output.put_line('Changing Table...');
40    DBMS_DATAPUMP.METADATA_REMAP (
41     handle => l_data_pump_imp_handle,
42     name => 'REMAP_TABLE',
43     old_value => 'DEPT',
44     value=>'DEPT_HR',
45     object_type => NULL
46     );
47   -- Start the import now.
48       DBMS_DATAPUMP.start_job(l_data_pump_imp_handle);
49    -- monitor job
50    pct_done := 0;
51    job_state := 'UNDEFINED';
52    WHILE (job_state != 'COMPLETED') AND (job_state != 'STOPPED') LOOP
53      dbms_datapump.get_status(l_data_pump_imp_handle, dbms_datapump.ku$_status_job_error +
54      dbms_datapump.ku$_status_job_status +
55      dbms_datapump.ku$_status_wip, -1, job_state, sts);
56      js := sts.job_status;
57      -- If the percentage done changed, display the new value
58      IF js.percent_done != pct_done THEN
59        dbms_output.put_line('*** Job percent done = ' ||
60        to_char(js.percent_done));
61        pct_done := js.percent_done;
62      END IF;
63      -- If any work-in-progress (WIP) or error messages
64      -- were received for the job, display them.
65      IF (BITAND(sts.mask,dbms_datapump.ku$_status_wip) != 0) THEN
66        le := sts.wip;
67      ELSE
68        IF (BITAND(sts.mask,dbms_datapump.ku$_status_job_error) != 0) THEN
69          le := sts.error;
70        ELSE
71          le := NULL;
72        END IF;
73      END IF;
74      IF le IS NOT NULL THEN
75        ind := le.FIRST;
76        WHILE ind IS NOT NULL LOOP
77          dbms_output.put_line(le(ind).LogText);
78          ind := le.NEXT(ind);
79        END LOOP;
80      END IF;
81      --DBMS_LOCK.sleep (10);
82    END LOOP;
83    -- Indicate that the job finished and detach from it.
84    dbms_output.put_line('Job has completed');
85   -- Detach, it's finish!
86       DBMS_DATAPUMP.detach(l_data_pump_imp_handle);
87  EXCEPTION
88       WHEN OTHERS THEN
89        dbms_datapump.stop_job(l_data_pump_imp_handle);
90        RAISE;
91* END;
SQL> /
Changing Schema...
Changing Table...
Master table "SYS"."TEST" successfully loaded/unloaded
Starting "SYS"."TEST":
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
ORA-39083: Object type CONSTRAINT failed to create with error:
ORA-00942: table
or view does not exist
Failing sql is:
ALTER TABLE "HR"."DEPT" ADD CONSTRAINT
"PK_DEPT" PRIMARY KEY ("DEPTNO") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE
DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS"  ENABLE

Job "SYS"."TEST" completed with 1 error(s) at 15:04:02
Job has completed

PL/SQL procedure successfully completed.

SQL>



If you look at the failing sql code, it is clear that the name of the table in the constraint definition has not changed, but the DEPT_HR table is created in the HR schema without constraint. What's not here?

Post edited by: Massimiliano edited the subject line, because he said as DBMS_METADATA. Changed to DBMS_DATAPUMP.

Hello

This is a bug in 11.2.0.1 I think - please this Ref

Oracle Support Document 1609238.1 (REMAP_TABLE on IMPDP FAILS WITH ORA-942) can be found at: https://support.oracle.com/epmos/faces/DocumentDisplay?id=1609238.1

See you soon,.

Rich

Tags: Database

Similar Questions

  • Specified Import Tables in conjunction with schema remap

    I have a problem that I had to face for a while now.  I export some tables using DBMS_DATAPUMP of a schema (say, a test environment) and I would like to just a SINGLE import of this dump file table in another schema (say, a dev environment).  At the same time, I'm remapping the source table to a temporary table with the same structure.

    Let me start by saying, I used this script to run the export and import in the SAME pattern and it worked fine.  This problem only when I went to import the data into another schema, using METADATA_REMAP.  Here's the import code.

    BEGIN
          SELECT TO_CHAR (SYSDATE, 'YYYYMMDDHH24MISS') INTO L_JOB_NUM FROM DUAL;
          SELECT TO_CHAR (SYSDATE, 'YYYYMMDD') INTO L_SHORT_DT FROM DUAL;
          V_JOB_NUM :=
             DBMS_DATAPUMP.OPEN (OPERATION   => 'IMPORT',
                                 JOB_MODE    => 'TABLE',
                                 JOB_NAME    => 'BMF_CASE_IMP_' || L_JOB_NUM,
                                 VERSION     => 'COMPATIBLE');
                                 
          DBMS_DATAPUMP.SET_PARALLEL (HANDLE => V_JOB_NUM, DEGREE => 1);
          DBMS_DATAPUMP.ADD_FILE (
             HANDLE      => V_JOB_NUM,
             FILENAME    => 'BMF_CASE_IMP_BATCH_' || L_SHORT_DT || '.LOG',
             DIRECTORY   => G_DUMP_DIRECTORY,
             FILETYPE    => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE); 
          
                                         
          DBMS_DATAPUMP.METADATA_FILTER (HANDLE   => V_JOB_NUM,
                                         NAME     => 'NAME_EXPR',
                                         VALUE    => q'|in ('BATCH')|',
                                         OBJECT_PATH => 'TABLE');
                                         
          DBMS_DATAPUMP.METADATA_REMAP (HANDLE      => V_JOB_NUM,
                                        NAME        => 'REMAP_TABLE',
                                        OLD_VALUE   => 'BATCH',
                                        VALUE       => 'BATCH_TMP');
                                        
                                         
          d('Remapping from schema '|| G_FROM_SCHEMA || ' to ' || G_TO_SCHEMA );
          DBMS_DATAPUMP.METADATA_REMAP (HANDLE      => V_JOB_NUM,
                                        NAME        => 'REMAP_SCHEMA',
                                        OLD_VALUE   => G_FROM_SCHEMA,
                                        VALUE       => G_TO_SCHEMA);
          DBMS_DATAPUMP.ADD_FILE (
             HANDLE      => V_JOB_NUM,
             FILENAME    => 'BMF_CASE_EXP_' || i_case_control_id || '.DMP',
             DIRECTORY   => G_DUMP_DIRECTORY,
             FILETYPE    => DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE);          
          DBMS_DATAPUMP.SET_PARAMETER (HANDLE   => V_JOB_NUM,
                                       NAME     => 'INCLUDE_METADATA',
                                       VALUE    => 0);
          DBMS_DATAPUMP.START_JOB (HANDLE         => V_JOB_NUM,
                                   SKIP_CURRENT   => 0,
                                   ABORT_STEP     => 0);
    

    If I remove the filter from the BATCH table metadata and run this, it ends and I get the following output in the LOG file:

    ...

    . . imported "CMR2_DEV." "' NTC_ACTION ': 'SYS_P1932' 13.84 KB 0 rows

    . . imported "CMR2_DEV." "' BATCH_TMP ': 'SYS_P343' 16.70 KB 1 lines

    (.. .and documents for all tables in the dump file)

    However, as soon as I activate the filter NAME_EXPR or NAME_LIST, I get nothing imported.  Just the following errors:

    -ORA-31627: API call succeeded, but more information

    -ORA-31655: no data or metadata of objects selected for employment

    It worked when I was not moving between the schemas so is there another way, I need to write my table filter expression, which will identify the BATCH table when a remapping of schema is used?

    Thanks in advance.

    Adam

    I think that my advice was not correct. The name_list filter only takes a table name.  If you do not have a list of schema filter, then the owner of the default table for the schema to run the task.  I think you need to add a filter of schema specifying the table owner.

    If you can't understand it, I can try to see if I can find the right calls, but it may take me a while.

    Dean

  • DBMS_DATAPUMP. METADATA_REMAP

    What I'm missing here? I have reference Mr. [Christopher Poole | http://www.chrispoole.co.uk/tips/dbatip4.htm] while trying to use the function METADATA_REMAP of DATAPUMP... but I can't make it work. Here is my code... my proc succeeds however it attempts to import the schema of origin instead of remapping it. So, I get a ton of errors saying "this schema already exists...". ».

    What Miss me?




    DECLARE
    / * IMPORT/EXPORT VARIABLES * /.
    v_dp_job_handle NUMBER;          -The handful of job data pump
    v_count NUMBER;          -Index of the loop
    v_percent_done NUMBER;          -Percentage of job complete
    v_job_state VARCHAR2 (30);     -To keep track of job status
    v_message KU$ _LOGENTRY;     -For error messages and work in PROGRESS
    v_job_status KU$ _JOBSTATUS;     -The State of the work of get_status
    v_status KU$ _STATUS;     -The status returned by get_status object
    T_DATE VARCHAR2 (13).
    v_schema VARCHAR2 (25);
    v_new_schema VARCHAR2 (25);
    v_source_database_name VARCHAR2 (50);

    BEGIN
    v_schema: = 'TEST ';
    T_DATE: = TO_CHAR (SYSDATE, 'MMDDYYYY_HHMI');
    v_source_database_name: = 'TEST_DB ';
    v_new_schema: = 'TEST_NEW ';

    / * OPEN THE DATA PUMP PROCEDURE * /.
    v_dp_job_handle: = DBMS_DATAPUMP. OPEN)
    OPERATION = > "IMPORT."
    JOB_MODE = > "SCHEMA."
    REMOTE_LINK = > v_source_database_name,
    JOB_NAME = > v_schema | ' _REMAP_' | T_DATE,
    VERSION = > 'LAST');

    / * ADD THE NAME OF THE EXPORT LOG FILE TO THE DATA PUMP PROCEDURE * /.
    DBMS_DATAPUMP. ADD_FILE)
    MANAGE = > v_dp_job_handle,
    FILENAME = > v_schema | ' _REMAP_' | T_DATE |'. JOURNAL '.
    DIRECTORY = > 'DATAPUMP. "
    FILETYPE = > DBMS_DATAPUMP. KU$ _FILE_TYPE_LOG_FILE);

    / * ADD THE NAME OF THE SCHEMA TO THE PROCEDURE OF DATA PUMP EXPORT * /.
    DBMS_DATAPUMP. () METADATA_FILTER
    MANAGE = > v_dp_job_handle,
    NAME = > 'SCHEMA_EXPR ',.
    VALUE = > ' = "' | v_schema | " ' ') ;

    / * REMAP THE ORIGINAL THE NEW SCHEMA SCHEMA * /.
    DBMS_DATAPUMP. () METADATA_REMAP
    MANAGE = > v_dp_job_handle,
    NAME = > 'REMAP_SCHEMA ',.
    OLD_VALUE = > ' = "' | v_schema | " ' ',
    VALUE = > ' = "' | v_new_schema | " ' ') ;

    / * START THE EXPORT * /.
    DBMS_DATAPUMP. START_JOB (v_dp_job_handle);



    / * EXPORT ERROR HANDLING * /.
    v_percent_done: = 0;
    v_job_state: = "UNDEFINED";

    WHILE (v_job_state! = "COMPLETED") AND (v_job_state! = "STOPPED")
    LOOP
    DBMS_DATAPUMP. GET_STATUS)
    v_dp_job_handle,
    DBMS_DATAPUMP. KU$ _STATUS_JOB_ERROR + DBMS_DATAPUMP. KU$ _STATUS_JOB_STATUS + DBMS_DATAPUMP. KU$ _STATUS_WIP.
    -1,
    v_job_state,
    v_status);

    v_job_status: = v_status. JOB_STATUS;

    / * IF THE PERCENTAGE CHANGED, DISPLAYS THE NEW VALUE * /.
    IF v_job_status. PERCENT_DONE! = v_percent_done THEN
    DBMS_OUTPUT. Put_line ('* percent of the job done = ' |) To_char (v_job_status. PERCENT_DONE));
    v_percent_done: = v_job_status. PERCENT_DONE;
    END IF;

    / * IF THE WORK IN PROGRESS (WIP) OR ERROR MESSAGES HAVE BEEN RECEIVED FOR THE POST, POST THEM * /.
    IF BITAND (v_status. MASK, DBMS_DATAPUMP. KU$ _STATUS_WIP)! = 0 THEN
    v_message: = v_status. WORK IN PROGRESS;
    ELSIF BITAND (v_status.mask, DBMS_DATAPUMP. KU$ _STATUS_JOB_ERROR)! = 0 THEN
    v_message: = v_status. ERROR;
    ON THE OTHER
    v_message: = NULL;
    END IF;

    IF v_message IS NOT NULL THEN
    v_count: = v_message. FIRST;
    While v_count IS NOT NULL
    LOOP
    DBMS_OUTPUT. Put_line (v_message (v_count). LOGTEXT);
    v_count: = v_message. Next (v_count);
    END LOOP;
    END IF;
    END LOOP;

    -Indicate that the finished work and detach.
    DBMS_OUTPUT. Put_line ("' job has completed");
    DBMS_OUTPUT. Put_line (' State of the Final work = ' | v_job_state);

    / * END OF THE DATA PUMP PROCEDURE * /.
    DBMS_DATAPUMP. Detach (v_dp_job_handle);
    END;

    A simple display... not tested... Why not change it...

    DBMS_DATAPUMP.METADATA_REMAP (
    HANDLE => v_dp_job_handle,
    NAME => 'REMAP_SCHEMA',
    OLD_VALUE => v_schema,
    VALUE => v_new_schema) ;
    
  • dbms_datapump import dblink ORA-39165

    Hi all

    I try to import a table on a from dblink to a diagram a diagram b but I get ORA-39165 scheme ('A') has not been found. and ORA-39166 object ('ACCOUNT') has not been found. When you try to import b to b it works but oddly always saves an ORA-39166. User B has imp_full_database and permission on two databases:

    declare
    Number of JobHandle;
    JS varchar2 (9); -COMPLETED or STOPPED
    q varchar2 (1): = chr (39);


    BEGIN / * open a new level of schema import job using a link to default DB * /.
    JobHandle: = dbms_datapump.open (operation = > 'IMPORT',)
    job_mode = > 'TABLE',
    remote_link = > "MRT");

    dbms_datapump.add_file (JobHandle,
    filename = > "mylog";
    Directory = > 'DATA_PUMP_DIR. "
    filetype = > dbms_datapump.ku$ _file_type_log_file);

    dbms_datapump.metadata_remap (manage = > JobHandle,)
    name = > 'REMAP_SCHEMA ',.
    old_value = > "A"
    value = > 'B');

    dbms_datapump.metadata_filter (manage = > JobHandle,)
    name = > 'SCHEMA_EXPR ',.
    value = > "IN"A","
    object_type = > 'TABLE');

    dbms_datapump.metadata_filter (manage = > JobHandle,)
    name = > 'NAME_LIST;
    ' value = > '('' COMPTE ''), '
    object_type = > 'TABLE');

    dbms_datapump.set_parameter (JobHandle,
    "TABLE_EXISTS_ACTION."
    'REPLACE');

    dbms_datapump. START_JOB (JobHandle);

    dbms_datapump.wait_for_job (JobHandle, js);

    end;

    For the life of me I don't understand how can I tell him that the source table is in A diagram. Any help would be greatly appreciated.

    Thank you very much

    Ok. Then you export in job_mode SCHEME and patterns of filter and tables, using metadata filter with SCHEMA_EXPR and INCLUDE_PATH_EXPR.

    Using the code you provided, here it is changed:

    declare
      JobHandle number;
      js varchar2(9); -- COMPLETED or STOPPED
      q varchar2(1) := chr(39); 
    
    BEGIN /* open a new schema level import job using a default DB link */
      JobHandle := dbms_datapump.open (operation=>'IMPORT', job_mode=>'SCHEMA', remote_link=>'RMT'); 
    
      dbms_datapump.add_file (JobHandle, filename => 'mylog', directory => 'DATA_PUMP_DIR', filetype => dbms_datapump.ku$_file_type_log_file);
      ---
      DBMS_DATAPUMP.metadata_filter (handle=> JobHandle, name=> 'SCHEMA_EXPR',VALUE=> 'IN(''A'')');
      dbms_datapump.metadata_filter (handle => JobHandle,name => 'INCLUDE_PATH_EXPR',value => 'IN (''TABLE'')');
      --
      dbms_datapump.metadata_remap ( handle=>JobHandle,name=> 'REMAP_SCHEMA',old_value=> 'A',value=> 'B');
      dbms_datapump.metadata_filter (handle =>JobHandle, name =>'NAME_LIST', value =>'(''ACCOUNT'')',object_type => 'TABLE');
      dbms_datapump.set_parameter ( JobHandle,'TABLE_EXISTS_ACTION','REPLACE' );
    
      dbms_datapump.start_job( JobHandle);
      dbms_datapump.wait_for_job( JobHandle, js);
    end;
    /
    

    I tested it with 10.2.0.3 on both sites, and it worked:

    -- mylog.log content:
    
    Starting "B"."SYS_IMPORT_SCHEMA_03":
    Estimate in progress using BLOCKS method...
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 64 KB
    Processing object type SCHEMA_EXPORT/TABLE/TABLE
    . . imported "B"."ACCOUNT"                                    1 rows
    Processing object type SCHEMA_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
    ORA-39083: Object type OBJECT_GRANT failed to create with error:
    ORA-01749: you may not GRANT/REVOKE privileges to/from yourself
    Failing sql is:
    GRANT SELECT ON "B"."ACCOUNT" TO "B"
    ORA-39166: Object ('ACCOUNT') was not found.
    Job "B"."SYS_IMPORT_SCHEMA_03" completed with 2 error(s) at 17:35:40
    

    And the table was created to the destination site:

    B@local> select * from account;
             N
    ----------
             1
    

    If you do not have a direct subsidy that B A.ACCOUNT on the remote site, then you will see this output, but the table is imported anyway:

    Processing object type SCHEMA_EXPORT/TABLE/TABLE
    . . imported "B"."ACCOUNT"                                    1 rows
    ORA-39166: Object ('ACCOUNT') was not found.
    

    Kind regards.
    Nelson

  • Works Datapump inside the SQL worksheet...

    Hi all

    "running the following code inside the spreadsheet and he just spits ' anonymous block completed.

    *****************************

    Set scan off

    Set serveroutput on

    escape game off

    whenever sqlerror exit

    DECLARE

    number of H1;

    errorvarchar varchar2 (100): = "ERROR";

    tryGetStatus number: = 0;

    Start

    H1: = dbms_datapump.open (operation = > 'IMPORT', job_mode = > job_name 'FULL' = > 'IMPORT_JOB_SQLDEV_73', version = > 'COMPATIBLE');

    tryGetStatus: = 1;

    dbms_datapump.set_parallel (handle = > h1, degree = > 1);

    dbms_datapump.add_file (handle = > h1, filename = > 'IMPORTtest2.LOG', directory = > 'DATA_PUMP_DIR', filetype = > 3);

    dbms_datapump.set_parameter (handle = > h1, name = > 'KEEP_MASTER', value = > 0);

    dbms_datapump.add_file (handle = > h1, filename = > ' ORAEU_COPIED.) (DMP", directory = >"DATA_PUMP_DIR", filetype = > 1);

    dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\APT_SYS_DATA01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/APT_SYS_DATA01.) DBF'));

    dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\APT_SYS_IDX01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/APT_SYS_IDX01.) DBF'));

    dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\DATA_MART_DATA01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/DATA_MART_DATA01.) DBF'));

    dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\DATA_MART_IDX01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/DATA_MART_IDX01.) DBF'));

    dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > UPPER ('C:\ORACLE\ORADATA\ORCL/DATA_STORE_DATA01.) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/DATA_STORE_DATA01.) DBF'));

    dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\DATA_STORE_IDX01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/DATA_STORE_IDX01.) DBF'));

    dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\RNET2_DATA01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/RNET2_DATA01.) DBF'));

    dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\RNET2_IDX01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/RNET2_IDX01.) DBF'));

    dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\DATA_AMA_DATA01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/DATA_AMA_DATA01.) DBF'));

    dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\DATA_AMA_IDX01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/DATA_AMA_IDX01.) DBF'));

    dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\DATASERVICES_DATA01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/DATASERVICES_DATA01.) DBF'));

    dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\DATASERVICES_IDX01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/DATASERVICES_IDX01.) DBF'));

    dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\ARC_DATA01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/ARC_DATA01.) DBF'));

    dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\MCSS_DATA01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/MCSS_DATA01.) DBF'));

    dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\MCSS_IDX01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/MCSS_IDX01.) DBF'));

    dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\IPAS_DATA01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/IPAS_DATA01.) DBF'));

    dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\IPAS_IDX01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/IPAS_IDX01.) DBF'));

    dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\PFIZERCMS_DATA01.)) DBF "), value = >"

    dbms_datapump.set_parameter (handle = > h1, name = > 'INCLUDE_METADATA', value = > 1);

    dbms_datapump.set_parameter (handle = > h1, name = > 'DATA_ACCESS_METHOD', value = > "AUTOMATIC").

    dbms_datapump.set_parameter (handle = > h1, name = > 'REUSE_DATAFILES', value = > 0);

    dbms_datapump.set_parameter (handle = > h1, name = > 'TABLE_EXISTS_ACTION', value = > 'REPLACE');

    dbms_datapump.set_parameter (handle = > h1, name = > 'SKIP_UNUSABLE_INDEXES', value = > 0);

    dbms_datapump. START_JOB (handle = > h1, skip_current = > 0, abort_step = > 0);

    dbms_datapump. Detach (handle = > h1);

    errorvarchar: = "NO_ERROR"

    EXCEPTION

    WHILE OTHERS THEN

    BEGIN

    IF ((errorvarchar = ' ERROR') AND (tryGetStatus = 1)) THEN

    DBMS_DATAPUMP. Detach (H1);

    END IF;

    EXCEPTION

    WHILE OTHERS THEN

    NULL;

    END;

    LIFT;

    END;

    /

    *****************

    all entries are appreciated

    Thank you

    Please let me know if you see a code problem

    What is your question has to do with Sql Developer?

    Unless you can connect you must mark ANSWERED thread and repost it in Sql and Pl/Sql forum

    the Japan Government says:

    Hi Jeff

    I expect that it runs the import at least.

    Get this error now on line 66:

    EXCEPTION

    WHILE OTHERS THEN

    BEGIN

    IF ((errorvarchar = ' ERROR') AND (tryGetStatus = 1)) THEN

    DBMS_DATAPUMP. Detach (H1);

    END IF;

    EXCEPTION---> line 66

    WHILE OTHERS THEN

    NULL;

    END;

    When you repost you should post the EXACT code you use. The code you posted is NOT valid: you must also REMOVE the WHEN of OTHER or you can expect everyone to book you to INTENTIONALLY HIDE any exceptions that occur. Why do you NOT want to know if Oracle finds problems in your code? That makes NO sense at all.

    IF ((errorvarchar = ' ERROR') AND (tryGetStatus = 1)) THEN

    There is NO SPACE after the "and" what is garbage just as far as Oracle are concerned.

    Either you have posted an incorrect code or your code has syntax errors and will not compile or run anyway.

    I suggest that correct you your syntax errors before reposting in the Sql forum. If you have pain to find their delete ALL unnecessary code to reduce the problem to the example as SIMPLE as possible, until you find the code causing errors.

  • How to copy all the tables, triggers, etc, from a schema from one user to another

    Hello everyone!

    I'm looking for a QUERY or a stored procedure to copy the tables of a schema of the user to a different schema.

    Should resemble the kind of: copy (select * from object where owner = 'UserIwantToCopyFrom') user = "UserIwantToCopyTO".

    I'm sure that my example is rubbish, but I tried to explain what I want to do.

    Then there is a chance to do in sql code? I have to build a model of a schema of the user with hundreds of tables, triggers, etc. and copy it into several other user patterns.

    Thanks for your advice!

    Jan

    There are many examples available.
    What you generally want to do is:

    For the export, use the job_mode-online option "SCHEMA".
    Example of export

    http://www.oracle-base.com/articles/10g/OracleDataPump10g.php
    
    DECLARE
      l_dp_handle       NUMBER;
      l_last_job_state  VARCHAR2(30) := 'UNDEFINED';
      l_job_state       VARCHAR2(30) := 'UNDEFINED';
      l_sts             KU$_STATUS;
    BEGIN
      l_dp_handle := DBMS_DATAPUMP.open(
        operation   => 'EXPORT',
        job_mode    => 'SCHEMA',
        remote_link => NULL,
        job_name    => 'EMP_EXPORT',
        version     => 'LATEST');
    
      DBMS_DATAPUMP.add_file(
        handle    => l_dp_handle,
        filename  => 'SCOTT.dmp',
        directory => 'TEST_DIR');
    
      DBMS_DATAPUMP.add_file(
        handle    => l_dp_handle,
        filename  => 'SCOTT.log',
        directory => 'TEST_DIR',
        filetype  => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
    
      DBMS_DATAPUMP.metadata_filter(
        handle => l_dp_handle,
        name   => 'SCHEMA_EXPR',
        value  => '= ''SCOTT''');
    
      DBMS_DATAPUMP.start_job(l_dp_handle);
    
      DBMS_DATAPUMP.detach(l_dp_handle);
    END;
    /
    

    for import, you can use the remap_schema option with:

    DBMS_DATAPUMP.METADATA_REMAP (
       handle      IN NUMBER,
       name        IN VARCHAR2,
       old_value   IN VARCHAR2,
       value       IN VARCHAR2,
       object_type IN VARCHAR2 DEFAULT NULL);
    

    There are many more details in the document as provided Thierry.

  • How can I specify a different schema when importing using DBMS_DATAPUMP?

    I use the following procedure to import a schema. Is it possible that I can specify the import to import into another schema?

    Basically, what I want to do is take a pattern and copy it into another schema

    DECLARE
    v_dp_job_handle NUMBER;     -The handful of job data pump
    v_count NUMBER;     -Index of the loop
    v_percent_done NUMBER;     -Percentage of job complete
    v_job_state VARCHAR2 (30);     -To keep track of job status
    v_message KU$ _LOGENTRY;     -For error messages and work in PROGRESS
    v_job_status KU$ _JOBSTATUS;     -The State of the work of get_status
    v_status KU$ _STATUS;     -The status returned by get_status object
    v_logfile NUMBER;
    T_DATE VARCHAR2 (13).
    BEGIN
    v_project: = 'TEST ';
    T_DATE: = '03272009_1048 ';

    / * IMPORT * /.
    / * OPEN THE DATAPUMP PROCEDURE * /.
    v_dp_job_handle: = DBMS_DATAPUMP. OPEN)
    OPERATION = > "IMPORT."
    JOB_MODE = > "SCHEMA."
    -REMOTE_LINK = > v_desitination_server_name,
    JOB_NAME = > v_project | ' _IMP_' | T_DATE,
    VERSION = > 'LAST');

    / * ADD THE NAME OF THE DUMP FILE TO THE DATAPUMP PROCEDURE * /.
    DBMS_DATAPUMP. ADD_FILE)
    MANAGE = > v_dp_job_handle,
    FILENAME = > v_project | ' _EXP_' | T_DATE |'. DMP',.
    DIRECTORY = > "DATAPUMP");

    / * ADD THE NAME OF THE LOG IMPORT FILE TO THE DATAPUMP PROCEDURE * /.
    DBMS_DATAPUMP. ADD_FILE)
    MANAGE = > v_dp_job_handle,
    FILENAME = > v_project | ' _IMP_' | T_DATE |'. JOURNAL '.
    DIRECTORY = > 'DATAPUMP. "
    FILETYPE = > DBMS_DATAPUMP. KU$ _FILE_TYPE_LOG_FILE);

    / * START THE IMPORT * /.
    DBMS_DATAPUMP. START_JOB (v_dp_job_handle);

    / * END OF THE DATAPUMP PROCEDURE * /.
    DBMS_DATAPUMP. Detach (v_dp_job_handle);
    END;

    Use metadata_remap with the REMAP_SCHEMA option proc:

    DBMS_DATAPUMP. METADATA_RAMAP (id, 'REMAP_SCHEMA', 'SOURCE_SCHEMA', 'DESTINATION_SCHEMA');

  • My iPhone 7 won't let me push down on the icons to move them. No matter how hard or how long I push the icon itself just happens.

    MY iPhone 7 won't let me push down on the icons to move them. When I push it down and that you hold, no matter how many seconds the icon itself appears just. Help!

    Push slightly, not difficult.

  • Oerating system matter?

    Hi, but I have a used Ipod, I think the operating system for a mac, but I have a PC. It appears in Itunes and I put some songs on it. But I should reformat PC or isn't important?

    It does not matter. It is not no matter what access the reader to an iPod touch, and it is not possible to format with the exception of restore in iTunes or on the device itself.

    (144537)

  • Download Nikon D90 photos via a cable of Photos does not work. The picture freezes and does not matter. Any ideas?

    Download photos of Nikon D90 Photos OS El Capitan 10.11.16 cable does not work. The picture freezes and does not matter. Any ideas?

    Try with Capture of Image (in your applications folder)

    LN

  • research and new tabs take up yahoo no matter what I do in the options

    No matter what I do, the search engines in the toolbar by default return Yahoo! Remove all but Google does not help. When you restart Firefox Yahoo is the default value. Similarly, new tabs and the home page back to Yahoo after the reopening. This is a new laptop HP with Windows 10 and I just downloaded Firefox. I spent a lot of time trying to solve this problem and about to give up and to switch browsers. I bet that Chrome will allow me to use Google.

    Generally, changes in parameters are retained between reboots. If you change other preferences such as your home page, Firefox manages to retain those between reboots?

    We have an article of general support on issues that may lead to changes to get lost between sessions: How to fix preferences that will not save.

    Two other thoughts:

    (1) some software utility/security/life private changes the folder of Firefox settings between sessions. This includes Advanced SystemCare and various programs 'homepage protection' or "browsing protection" feature. If you have any software with a similar feature, disable it until everything is set as you want and stable.

    (2) you might check all the extensions that could possibly change the settings when you start Firefox. You can do this on the page modules. Either:

    • CTRL + SHIFT + a
    • "3-bar" menu button (or tools) > Add-ons

    In the left column, click Extensions. Then, take a critical look on the list on the right side. On a new installation, it is usually empty, unless Firefox has detected the extensions that already exist on your system. Something unexpected?

  • I used 'Customize Firefox' to change toolbars show, and now the Firefox Customize, tab keeps appearing no matter how many times I close.

    The window customize Firefox and tab guard popping open at seemingly random times. This continues to be no matter how many times I close.

    One possible reason is that if it was added as a second 'Home tab' in which case it will be displayed in each new window (Ctrl + n) and every time that you click the Home button.

    To verify that you can use the page Options, as described in this article: start-up, homepage, tabs and download settings.

    Look for a vertical bar character at the heart of the area that separates the two addresses. A simple example with short URLS:

    https://www.mozilla.org/|about:customizing
    

    The bar certainly can be hard to spot with long URLs, but when you find it, delete everything to the right of the bar, then the bar itself (I suggest to remove the last bar so things don't accidentally get it together).

    Was she?

  • No matter what I do to get my Thunderbird as default email, GMAIL can always be default mail. What should I do now?

    I checked everything should be checked in the Thunderbird preferences, to make it the default mail provider, but no matter what I have gmail always happen to be the default email.
    TI tha.
    Thank you

    This happens when you click on a mailto link in your browser? You should maybe define TB as default, for example, for Firefox, see these instructions:

    https://support.Mozilla.org/en-us/KB/change-program-used-open-email-links

    A similar approach applies to the IE, Chrome etc.

  • All of a sudden, after a update of firefox, I get "this connection is untrusted" for Facebook, no matter if I use http: or https:, WHY?

    All of a sudden, after a update of firefox, I get "this connection is untrusted" for Facebook, no matter if I use http: or https:, WHY? Here are all the details of the error message:

    This connection is Untrusted

    You asked Firefox to connect safely to facebook.com, but we cannot confirm that your connection is secure.

    Normally, when you try to connect safely, sites will present a reliable identification to prove that you're in the right place. However, the identity of this site cannot be verified.
    What should I do?

    If you normally connect to this site without problems, this error can mean that someone is trying to impersonate the identity of the site, and you should not continue.

    This site uses HTTP Strict Transport Security (HST) to specify that Firefox didn't connect safely. As a result, it is not possible to add an exception for this certificate.

    Facebook.com uses an invalid security certificate.

    The certificate is not trusted because the issuer certificate is unknown.

    (Error code: sec_error_unknown_issuer)

    (Also included a screenshot).

    COR - el said

    You can check the date and time and time zone in the clock on your computer: (double) click on the clock icon in the Windows taskbar.

    You can retrieve the certificate and check details such as WHO issued the certificates and the expiration dates of certificates.

    • Click on the link at the bottom of the error page: "I understand the risks".
    • Let Firefox recover the certificate: "Add Exception"-> "get certificate".
    • Click on the button "View" and inspect the certificate and the Coachman, who is the issuer.

    You can see more details like the intermediate certificates that are used in the Details tab.

    If you cannot inspect the certificate by "I understand the risks", then try this:

    Open the chrome URI by pasting or typing this URI in the address bar to open the window "Add the Security Exception" and to check the certificate:

    • chrome://pippki/content/exceptionDialog.XUL

    In the field location type and paste the URL of the Web site

    • retrieve the certificate via the button 'Get certificate '.
    • Click on the "view..." button. "to inspect the certificate in the certificate display

    Check which is the issuer of the certificate.

    You can get more details like the certificate chain in the Details tab of the certificate display.

  • No matter what I do on firefox, I get a message that the action is not reliable. How can I fix it?

    I started this morning, opens Firefox as usual. The normal task bar has been replaced by a taskbar of Bing. I couldn't get rid of him. So, I tried to reset Firefox. The taskbar of Bing was not deleted. I uninstalled firefox and downloaded the latest version and installed. I also uninstalled the taskbar of Bing as found in my list of programs. I opened Firefox and no matter what I select on the menu or on a website a message appears saying that the site is not reliable. It is as far as I can get in Firefox! The message arrives even for internal actions within Firefox. How can I fix it. It's very frustrating!

    Make a check of malware with several malware scanning of programs on the Windows computer.

    Please scan with all programs, because each program detects a different malicious program.

    All of these programs have free versions.

    Make sure that you update each program to get the latest version of their databases before scanning.

    Alternatively, you can write a check for an infection rootkit TDSSKiller.

    See also:

Maybe you are looking for

  • Spotlight doesn't index

    Hello I've been running El Capitan fine since output without any problem, and Spotlight worked very well. In recent weeks, all of a sudden Spotlight is no longer indexes. I have no idea of what has changed - I have not install new software or make ch

  • Problems with Satellite A300-1 b 0 cooling: fan does not stop

    Hello users,. I m new on Linux and Ubuntu, I installed ubuntu 8.10 last week;All things are ok, ok start menu because I have XP, network ethernet connection and wireless, updates ok, ok packages!just one thing that make me "' it's my laptop fan, I ex

  • Why Apple may not send a request to have a camera out of their account, if it was purchased or given legaly but have no way to do it themselves

    MY father had bought an IPad of Gen 4 someone online, but the person had mentioned that they did not have the password there apple ID. My father who have never owned an apple product didn't know the problem and may not be able to implement the IPad t

  • Cannot sync with Sony Bridge for Mac iPhoto albums

    When I connect the Sony Xperia Z3 compact Mac, Sony for Mac. bridge arises. I select the option explore iPhoto. At first nothing shows up (the developers of Sony, it would be nice to show at least a cone of propeller or progress bar), but after a whi

  • VideoDisplay fullscreen

    Hello How to do full screen with VideoDisplay? I use: stage.fullScreenSourceRect = new Rectangle (video.x, video.y, video.width, video.height);stage.scaleMode = StageScaleMode.NO_SCALE;stage.displayState = StageDisplayState.FULL_SCREEN; But this does