Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to do script Analysis of impdp&expdp, a Database commonly used in Oracle

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

How to carry out Oracle common database impdp&expdp script analysis, many novices are not very clear about this, in order to help you solve this problem, the following small series will explain in detail for everyone, there are people who need this can learn, I hope you can gain something.

[Description]

Example script that performs the following functions:

1) Create table space EAS_D_HFY121009_STANDARD and temporary table space EAS_T_HFY121009_STANDARD, user hfy120910;

2) Create a directory zdir for backup restore;

3) Complete the backup from the source database hfy and restore to the new database hfy120910;

[Script]

------ begin Create user and tablespaces--------CREATE TABLESPACE "EAS_D_HFY121009_STANDARD" DATAFILE '/oracle/oradata/dbeas/EAS_D_HFY121009_STANDARD.ORA' SIZE 2000M;ALTER DATABASE DATAFILE '/oracle/oradata/dbeas/EAS_D_HFY121009_STANDARD.ORA' AUTOEXTEND ON; CREATE TEMPORARY TABLESPACE "EAS_T_HFY121009_STANDARD" TEMPFILE '/oracle/oradata/dbeas/EAS_T_HFY121009_STANDARD.DBF' SIZE 500M;ALTER DATABASE TEMPFILE '/oracle/oradata/dbeas/EAS_T_HFY121009_STANDARD.DBF' AUTOEXTEND ON; CREATE USER hfy121009 IDENTIFIED BY hfy121009 DEFAULT TABLESPACE EAS_D_HFY121009_STANDARD TEMPORARY TABLESPACE EAS_T_HFY121009_STANDARD;grant dba to hfy121009;------ end Create users and tablespaces-------------- begin Create directory ---------Copyright (c) 1982, 2009, Oracle. All rights reserved.SQL> conn /as sysdbaConnected.SQL> create directory zdir as '/oradata';Directory created.SQL> grant read,write on directory zdir to hfy; Grant succeeded.SQL> quitDisconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options$------ end Create directory -------------------- begin Backup Restore-------------$ expdp hfy/** * directory=zdir schemas=hfy dumpfile=hfy121009.dmp logfile=hfy121009exp.log$ impdp hfy121009/** * directory=zdir schemas=hfy remap_schema=hfy:hfy121009 remap_tablespace=EAS_D_HFY_STANDARD:EAS_D_HFY121009_STANDARD dumpfile=hfy121009.dmp logfile=hfy121009imp.log------------

Note: When restoring the database, if the target database does not have the table space EAS_D_HFY_STANDARD, you must add the parameter: remap_table space =EAS_D_HFY_STANDARD: EAS_D_HFY121009_STANDARD, otherwise an error will be reported: table space not found.

Did reading the above help you? If you still want to have further understanding of related knowledge or read more related articles, please pay attention to the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 242

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report