Page tree
Skip to end of metadata
Go to start of metadata
  • Drop your local dspace user (so that you can check it was created at the end).
  • In the Oracle10XE admin screens, run the following sql:
    create directory STORE_DIR as 'c:\temp\dspace-import';
  • and place into that dir your dump file:
    c:\temp\dspace-import\DSPACE-EXP.DMP
  • then run the following sql:
    declare
    h1   NUMBER;
     begin
      begin 
          h1 := dbms_datapump.open (operation => 'IMPORT', job_mode => 'SCHEMA', job_name => 'IMPORT000124', version => 'COMPATIBLE'); 
      end;
      begin 
         dbms_datapump.set_parallel(handle => h1, degree => 1); 
      end;
      begin 
         dbms_datapump.set_parameter(handle => h1, name => 'KEEP_MASTER', value => 0); 
      end;
      begin 
         dbms_datapump.add_file(handle => h1, filename => 'DSPACE-EXP.DMP', directory => 'STORE_DIR', filetype => 1); 
      end;
      begin 
         dbms_datapump.metadata_remap(handle => h1, name => 'REMAP_SCHEMA', old_value => 'DSPACE', value => 'DSPACE'); 
      end;
      begin 
         dbms_datapump.metadata_filter(handle => h1, name => 'SCHEMA_EXPR', value => 'IN(''DSPACE'')'); 
      end;
      begin 
         dbms_datapump.set_parameter(handle => h1, name => 'DATA_ACCESS_METHOD', value => 'AUTOMATIC'); 
      end;
      begin 
         dbms_datapump.set_parameter(handle => h1, name => 'INCLUDE_METADATA', value => 1); 
      end;
      begin 
         dbms_datapump.set_parameter(handle => h1, name => 'SKIP_UNUSABLE_INDEXES', value => 0); 
      end;
      begin 
         dbms_datapump.start_job(handle => h1, skip_current => 0, abort_step => 0); 
      end;
      begin 
         dbms_datapump.detach(handle => h1); 
      end;
    end;
    /
    
  • This will drop your local user and create a new one but with the pw of whichever database it was dumped from.
  • It will take ages so leave it for a while to finish.
  • No labels