Forum Stats

  • 3,758,196 Users
  • 2,251,352 Discussions
  • 7,870,106 Comments

Discussions

restore data of one table.

ANNEC
ANNEC Member Posts: 294 Bronze Badge

A developer has a table data messed up. If we have a backup of full expdp dump file, can we just truncate the table and import just that one table data from the dump file instead of restore all?


Thanks,

Tagged:

Best Answer

Answers

  • saratpvv
    saratpvv Member Posts: 905 Gold Badge

    Never truncate the original table - Instead rename it and then restore the table from the .dmp file. Once you compare the old and restore table and if thinks are good , go and drop the old table.

    ANNEC
  • EdStevens
    EdStevens Member Posts: 28,462 Gold Crown
    edited Sep 23, 2021 3:10PM Accepted Answer

    Good caution from saratpvv. But back to your original question of "can I", of course you can, if you use the proper options of impdp, which are spelled out in the very fine documentation. https://docs.oracle.com/en/database/oracle/oracle-database/18/sutil/datapump-import-utility.html#GUID-D11E340E-14C6-43B8-AB09-6335F0C1F71B

    Hint: look up the INCLUDE parameter.

    ANNEC
  • ANNEC
    ANNEC Member Posts: 294 Bronze Badge

    Thanks both. Good recommendation and article link.

    One more question, if I want to learn how to use the tool in a learning environment. What should I set up?

    I would like two separate oracle instances environment, like dev and test, can I install two on my workstations for learning purpose, or is there a virtual lab on some resources that I can use to practice?

  • EdStevens
    EdStevens Member Posts: 28,462 Gold Crown

    Good recommendation and article link.

    It wasn't an "article". It was the official oracle documentation. Something you should be getting very familiar with, and should be your very first resource. In fact, you should go to the documentation site, click the droplist, select your version of oracle, then bookmark that location.

    To your latest question: Of course you can install two databases, as long as you have the resources (memory and disk space) to handle it. Actually, you'd only install oracle once, then create two databases running under the same ORACLE_HOME. When you install the software, you will have an option to also create a database. Do not make that selection during installation. After installation is complete, come back and use the 'dbca' (DataBase Creation Utility) to create your databases.

    ANNEC