Import/export from one oracle db to anothe roracle db

Hi All,
I would like to import and export data from one oracle database to another oracle database. Can any one please suggest me/provide me any script if available.
I am following Datapump IMPDP and EXPDP. I would like to do this data pump process every time. So I wolud like to do this task as automate. So please provide me any script for automating this job
or let me know if there is any easy method to do this process.. I would like to have a script and am uising Oracle 11.2.0.3.
Thanks

Hi,
Below Anonymous block Exports the 'HR' schema:
DMPDIR -- Directory object where you want to create the dmp files
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 => 'SCHEMA_EXPORT', version => 'LATEST');
  DBMS_DATAPUMP.add_file( handle        => l_dp_handle, filename => 'SCHEMA_EXPORT.dmp', directory => 'DMPDIR');
  DBMS_DATAPUMP.add_file( handle        => l_dp_handle, filename => 'SCHEMA_EXPORT.log', directory => 'DMPDIR', filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
  DBMS_DATAPUMP.metadata_filter( handle => l_dp_handle, name => 'SCHEMA_EXPR', value => '= ''HR''');
  DBMS_DATAPUMP.start_job(l_dp_handle);
  DBMS_DATAPUMP.detach(l_dp_handle);
END;
Now you can use this dmp file to import the 'HR' schema in the required database.
Below Anonymous block imports the 'HR' schema:
DECLARE
dph NUMBER;
BEGIN
  dph := dbms_datapump.open(operation => 'IMPORT', job_mode =>
  'SCHEMA',job_name => 'SCHEMA_IMPORT');
  dbms_datapump.add_file(handle => dph,filename =>
  'SCHEMA_EXPORT.dmp', directory => 'DMPDIR',filetype=>1);
  dbms_datapump.add_file(handle => dph,filename =>
  'SCHEMA_IMPORT.log',directory => 'DMPDIR',filetype=>3);
  dbms_datapump.start_job(dph);
  dbms_datapump.detach(dph);
END;

Similar Messages

  • Migration from one oracle DB to another Oracle DB

    Hi ,
    We are migration data from one oracle DB to another Oracle DB. Lets take it as DB1 and DB2.
    Both are having many tables and many columns. So some tables contains common columns with different data types and same datatype with different datasize.
    I am trying to map the columns in both the DB's. Then I will retrieve what are the equal columns and what are columns have difference in data types and datatype lengths.
    for Eg : Please find the below tables and the structures.
    DB1                                                              DB2
    EMP                                                             EMPLOYEE
    ENO   VARCHAR2(10)                                  EMP_NO  Number(8)
    ENAME  Varchar2(25)                                   EMP_NAME  Varchar2(20)
    SAL   NUMBER(8)                                        JOb    VARCHAR2(20)
    Description  BLOB/CLOB                              Department   Varcgar2(20)
                                                                       SAL  number(8,3)
                                                                       JOB_DESC  varchar2(30)
    I would like to migrate DB1 to DB2
    Here I found the differences as follows.
    1. There is relation between EMP and EMPLOYEE tables.
    2. Datatype is different for EMPNO(DB2) compare to DB1. ( Here in DB1 datatype is Varchar and in DB2 it is Number )
    3. in DB1 Ename datatype length is 25 and in DB2 it is 20...
    So can any one suggest me any pl/sql automation code how can we map the columns,datatypes,datalengths and other required information.
    Can you please suggest me and give your suggestions to write automation code if possible or how can we resolve these type of issues.
    Thanks,
    Vas 

    So can any one suggest me any pl/sql automation code how can we map the columns,datatypes,datalengths and other required information.
    No such 'automation code' exists. You need to write your own mapping functions and exception handling processes.
    Can you please suggest me and give your suggestions to write automation code if possible or how can we resolve these type of issues.
    Finish what you started. The most important step you can take is to create a Functional Requirements document that includes, at a minimum:
    1. Mapping of each source table to each target table
    2. Lists of possible errors, or dirty data issues, that might be encountered
    3. The business rules that should be applied to each of those possible errors
    You already made a good start on the mapping for the one table above. And you made a good start of identifying the possible errors:
    2. Datatype is different for EMPNO(DB2) compare to DB1. ( Here in DB1 datatype is Varchar and in DB2 it is Number )
    Good - it should be easy for everyone in your org to agree that you can't put 'TEXT' data into a NUMBER column so now you need to document that issue:
    1. Identify data in DB1.ENO that is not numeric
    2. Remove, ignore, fix that data?
    What do the business users want to do with text data in that DB1.ENO column that is not numeric? They need to tell you. They may want a report or excel file that contains that 'dirty' data so they can review and/or fix it. They may want to query that data for themselves. They may want to know where that data came from - especially if the data is all supposed to be numeric.
    3. in DB1 Ename datatype length is 25 and in DB2 it is 20...
    Good - use the same process as above
    1. Identify data in DB1.ENAME that is longer than 20.
    2. Remove, ignore, fix that data? Truncate it?
    Again - it is usually the business users that need to actually determine what should be done. Your job is to identify that 'dirty' data and/or make it available to the business users so they can research it
    You don't need to wait for the business users to actually provide all of those answers. You can begin writing pseudo-code that contains steps to deal with those issues - you just can't write the actual code until you have the answers.
    You can certainly begin writing queries or procedures that look for 'dirty' data. Just based on the two problems you posted you can write queries to find data that has those two issues.

  • Is it possible to import slides from one Keynote presentation into another. If so how do I do it on iPad 2?

    Is it possible to import slides from one Keynote presentation into another. If so how do I do it on iPad 2?

    You do it sort of like the way you arrange your apps on the iPad and how you drag apps into groups. You do the same technic with your Keynote slides.
    Look here......http://support.apple.com/kb/PH1360

  • Database link from one Oracle database to another

    Hi everyone!
    I have 2 databases. I need to create a database link to copy a table from one of the database to another.
    Both of them are Oracle 10g v2
    Please advice me on how can I go about it.
    I am trying to avoid import and export.
    What are the options left to me?
    Thanks

    user5160274 wrote:
    Hi Kanchana,
    I am using Oracle 10g/Windows Server 2008. I have created a dabaselink. The link works perfectly fine. I want to copy the table (Oracle 11g) from remote server in to my database. It is ongoing process ie, it has to be scheduled and I want the updated rows to be copied in to my database on a daily basis. Please help me out.
    Eagerly awaiting for your response.
    Regards
    Narayanan NAnd once again a new member of the forum, on their very first post, goes on an archeological dig and tries to raise the dead. This thread is well over a year old. You should have started your own thread for your own issue. You say you have created a link and it works, so whatever your problem is, it is NOT even related to the question the OP raised.
    At exactly what point are you unsure about the process? Scheduling a processes? The command to use? Exactly what have you tried? What results do you have so far?.
    Please, start a new thread explaining your issue.
    Moderator --- please lock this thread.

  • Importing keywords from one iPhoto library to another iPhoto library

    I start a new iPhoto library at the beginning of every year. I've made a collection of keywords in the previous years library that I would like to import into the new iPhoto library. I've tried assigning all of the keywords to one picture, exporting it from the old library and importing it to the new library, but it didn't take the keywords with it. Is there anyway to import this keyword list so that I don't have to recreate it?
    Thanks,
    Claire

    Claire
    You're on the right track, but you'll need iPhoto Library Manager to do it. It's the only way to move files from one library to another while maintaining metadata. So, assign all the keywords to one pic, then transfer it to the new library using iPLM. It's a $20 shareware, and all round good app. You can read about it here:
    http://homepage.mac.com/bwebster/iphotolibrarymanager.html
    Regards
    TD

  • Improving performance on migrating data from one Oracle database to another

    We are using hibernate to migrate complete tables from one database to the other. This takes hours to days to transfer a couple of tables, all having relationships between each other. The only difference is that the new tables have an extra column which stores the primary key of the source table as an alias key in the destination table and the destination table has only one extra column which is its own primary key. Another small difference is that the name of the columns is a little different.
    Isn't there a simple way to use Oracle database's in built tools to migrate data if provided the source and destination tables and column names for mapping purposes? Please provide some suggestions for this Oracle newbie. Any other suggestions on improving the migration performance will be greatly appreciated.
    Suggestions please!!!

    Hello Justin,
    Thanks for your prompt reply. Ours is a small company so we take up all kinda roles. In this particular scenario, I was asked to migrate all the tables from one database to another. Both of the databases are present on two different machines but on the same network. There are about 100,000 records in some of the tables and there are about 50 tables to migrate. As I said, both the tables have different columns to be mapped and then transferred and the new table has only one extra column which is a primary key in the new table. Under these constraints, Hibernate is taking way too much time.
    I always felt that there must be a simpler and efficient way to do this. I would appreciate if you could you explain me the procedures in detail please.
    Thanks in advance.

  • How to export a table from one oracle server to another oracle server?

    Hi experts,
    Scenario : Copying table T1 from Server1 to Server2.
    Can I follow any of the following two options. Please advise if these options would be feasible under the current scenario.
    1) Create the same table T1 in Server2. Export the values of T1 in Server1 to an Excel sheet. Make the Excel sheet as source and import the values of the excel sheet to table T1 in Server2.
    2) Use an ETL tool like Oracle Warehouse builder to extract and load the values in T1 in Server1 to T1 in Server2.
    Can we schedule both option1 & 2 as a job in Oracle Warehouse Builder? The job will have 2 steps :-
    a) Delete all rows in T1 (Server2).
    b) Insert the values from T1(Server1) to T1(Server2).
    Please advise.
    Thanks,
    Debashish

    Can you exactly explain a little bit more what is the actual requirement.
    Just to kick off the things..
    In case:
    1) you just need to create a table based on another table in same schema. Its as simple as : create table table2 as (select * from table1)
    2) table1 is on remote db then
    create table table2 as (select * from table1@yourdblink)
    3) Need to export and import table1 refer this link :
    http://wiki.oracle.com/page/Oracle+export+and+import+?t=anon
    4) Need to refresh table periodically either schedule a job or create materialized view refer to this link :
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96567/repmview.htm
    Choose an approach. Then try it and see what errors you get, In case you get errors search on internet for that error code and how to resolve that and in case need any help post it here. But key is understanding first what exactly your requirement is and which approach you need/want to follow.

  • Export from one oracle datasbase server to another  for version: 9.2.0.1.0

    Hi All,
    I know this is an elementory thread , however i would like to know the process of import and export of database in detail.
    I need to copy the entire database from a existing prodcution server having oracle 9.2 as its version to another server with same oracle version .
    Kindly mention the process to be carried out .
    Thanx in advance

    I need to copy the entire database from a existing prodcution server having oracle 9.2 as its version to another server with same oracle version .Its better to take a hotbackup/coldbackup or RMAN backup depending on the environment. Exp/Imp will be time consuming.
    For exp/imp;
    http://www.orafaq.com/wiki/Import_Export_FAQ
    For full export-import, you need to do is take an exp backup from source DB. Create same tablespace that of source DB and import from the dump file.
    exp system/manager full=y buffer=100000 feedback=10000 recordlength=64000
    imp system/manager full=y buffer=100000 feedback=10000 recordlength=64000

  • Imports Photos from one user name to another

    We have two user profiles on my IMac (myself and my wife).  Each has a separate IPhoto.  My wife has imported some of our photos into her IPhoto, while I have imported others into mine.  How can I import/share the photos between the user names so that we can have ALL the photos in the same IPhoto folder?

    For iPhoto 09 (version 8.0.2) and later:
    What you mean by 'share'.
    If you want the other user to be able to see the pics, but not add to, change or alter your library, then enable Sharing in your iPhoto (Preferences -> Sharing), leave iPhoto running and use Fast User Switching to open the other account. In that account, enable 'Look For Shared Libraries'. Your Library will appear in the other source pane. And vice versa
    Any user can drag a pic from the Shared Library to their own in the iPhoto Window.
    Remember iPhoto must be running in both accounts for this to work.
    If you want the other user to have the same access to the library as you: to be able to add, edit, organise, keyword etc.
    First you'll need to merge the two Libraries. The only way to do this is with the paid ($20) version of
    iPhoto Library Manager
    Quit iPhoto in both accounts. Move the Library to the Users / Shared Folder
    (You can also use an external HD set to ignore permissions, a Disk Image or even partition your Hard Disk.)
    In each account in turn: Double click on the Library to open it. (You may be asked to repair the Library Permissions.) From that point on, this will be the default library location. Both accounts will have full access to the library, in fact, both accounts will 'own' it.
    However, there is a catch with this system and it is a significant one. iPhoto is not a multi-user app., it does not have the code to negotiate two users simultaneously writing to the database, and trying will cause db corruption. So only one user at a time, and back up, back up back up.
    Regards
    TD

  • Importing music from one iTunes account to another

    I have recently bought a mac and am trying to import my music from my ITunes account on my PC to my ITunes account on my mac through home sharing. however I can only see my Mac library on my PC whereas I need to see my PC library on my Mac to import/share music already purchased.
    can you help?

    more often than not, it's to do with firewall settings on the winsloth side. check out this support article for possible remedies.

  • How do i import contacts from one mail program to another

    We just purchased a laptop and are trying to get the contacts from the desktop to the new laptop. We were able to transfer all the emails but are having trouble with the contacts. We are using Mail as our program

    MacBook Pro Apple Support
    MacBook Pro
    iCloud Troubleshooting iCloud Contacts
    Migration Assistant tips and tricks
    use Migration Assistant

  • How Do I "Export" from one Aperture project into another?

    I've imported shots into project "A" with both the jpg and the raw file being considered masters. I would like to make a slideshow using just the jpegs but don't want to have to go and flag each individual file. I tried turning the view option off in the filmstrip viewer but no dice there.

    simply use the Filter/Search function in the browser of the project and do a text search for .jpg that should show all the jpg images. then select them and choose File -> New -> Slideshow and Check "Add selected items to new slideshow".

  • Import some data from one oracle to another...

    Hi Guys,
    we have 2 oracle database servers on 2 different machines with schema.
    I want to import some data from a specific table from one oracle into another oracle.
    what is the way to do that.
    Please help in details
    Imran Baig

    Hi,
    Thanks for the reply.
    Tables are already created in both of the oralce databases only the data varies. I just have to import only few records from one oracle to another with the same user name and table already existing.
    I have tried using database link. I can view records from the other oracle database but as soon as i write an insert command oracle gets held. I cant do anything.
    Is there any other way?
    Imran

  • How to export a user and their schema from one 10g database to another?

    Hi,
    I would like to export a user and their entire schema from one 10g database to another one. How do I do this?
    thx
    adam

    If you want to export a user and the schema owned to the user, and import to the same user in a different database, or a different user in the same database, you can use the exp and imp commands as described in the Utilities manual.
    These commands are very versatile and have a lot of options - well worth learning properly. To give you a simplistic shortcut, see below - I create a user 'test_move', create some objects in the schema, export, create a new user in the database 'new_move' and import.
    oracle@fuzzy:~> sqlplus system/?????
    SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 11 21:46:54 2006
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    SQL> create user test_move identified by test_move;
    User created.
    SQL> grant create session, resource to test_move;
    Grant succeeded.
    SQL> connect test_move/test_move
    Connected.
    SQL> create table test (x number);
    Table created.
    SQL> insert into test values (1);
    1 row created.
    SQL> exit
    Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    oracle@fuzzy:~> exp system/????? file=exp.dmp owner=test_move
    Export: Release 10.2.0.1.0 - Production on Sat Mar 11 21:48:34 2006
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set
    About to export specified users ...
    . exporting pre-schema procedural objects and actions
    . exporting foreign function library names for user TEST_MOVE
    . exporting PUBLIC type synonyms
    . exporting private type synonyms
    . exporting object type definitions for user TEST_MOVE
    About to export TEST_MOVE's objects ...
    . exporting database links
    . exporting sequence numbers
    . exporting cluster definitions
    . about to export TEST_MOVE's tables via Conventional Path ...
    . . exporting table                           TEST          1 rows exported
    . exporting synonyms
    . exporting views
    . exporting stored procedures
    . exporting operators
    . exporting referential integrity constraints
    . exporting triggers
    . exporting indextypes
    . exporting bitmap, functional and extensible indexes
    . exporting posttables actions
    . exporting materialized views
    . exporting snapshot logs
    . exporting job queues
    . exporting refresh groups and children
    . exporting dimensions
    . exporting post-schema procedural objects and actions
    . exporting statistics
    Export terminated successfully without warnings.
    oracle@fuzzy:~> sqlplus system/?????
    SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 11 21:49:23 2006
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    SQL> create user new_move identified by new_move;
    User created.
    SQL> grant create session, resource to new_move;
    Grant succeeded.
    SQL> exit
    Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    oracle@fuzzy:~> imp system/????? file=exp.dmp fromuser=test_move touser=new_move
    Import: Release 10.2.0.1.0 - Production on Sat Mar 11 21:50:12 2006
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    Export file created by EXPORT:V10.02.01 via conventional path
    import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
    . importing TEST_MOVE's objects into NEW_MOVE
    . . importing table                         "TEST"          1 rows imported
    Import terminated successfully without warnings.
    oracle@fuzzy:~>                                                       If moving between databases, remember to set the SID properly before the import. If keeping the same userid, skip the from/to stuff in the import.
    There are many variations on the theme ...
    You can simplify this. You can select tables individually. You can use a parameter file. You can transport all the constraints and data. You can skip the data and only move the definitions. You can get some help (imp/exp help=yes).
    And, if it's all 10g, there is a new and improved facility called expdp/impdp (dp = data pump) which has a lot more capability as well, including direct transfer (no intermediate file) together with suspend/restart. Also documented in the Utilities manual.

  • How do I export photo's from one user acct. to another user acct

    Trying to export photo's from one user acct. to another user acct. on same computer into second users Iphoto app.

    File -> Export to the destop. Drag to Users/Shared Folder and then import from other account.
    Or use iPhoto Sharing:
    For iPhoto 09 (version 8.0.2) and later:
    If you want the other user to be able to see the pics, but not add to, change or alter your library, then enable Sharing in your iPhoto (Preferences -> Sharing), leave iPhoto running and use Fast User Switching to open the other account. In that account, enable 'Look For Shared Libraries'. Your Library will appear in the other source pane.
    Any user can drag a pic from the Shared Library to their own in the iPhoto Window.
    Remember iPhoto must be running in both accounts for this to work.
    If you want the other user to have the same access to the library as you: to be able to add, edit, organise, keyword etc.
    Quit iPhoto in both accounts. Move the Library to the Users / Shared Folder
    (You can also use an external HD set to ignore permissions, a Disk Image or even partition your Hard Disk.)
    In each account in turn: Double click on the Library to open it. (You may be asked to repair the Library Permissions.) From that point on, this will be the default library location. Both accounts will have full access to the library, in fact, both accounts will 'own' it.
    However, there is a catch with this system and it is a significant one. iPhoto is not a multi-user app., it does not have the code to negotiate two users simultaneously writing to the database, and trying will cause db corruption. So only one user at a time, and back up, back up back up.
    Regards
    TD

Maybe you are looking for