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

Expdp migration test

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

Share

Shulou(Shulou.com)06/01 Report--

The following actions require operations on the database server. For remote operations, please refer to http://blog.itpub.net/24486203/viewspace-2132814/

1. The source library creates a directory directory

Sqlplus / as sysdba

Create directory dumpdir as'/ u01 u01/dumpdir is the directory already created by the system.

two。 Query related data of source database

Query the tablespace of the source database

Select tablespace_name from dba_segments where owner='TEST' group by tablespace_name;---TEST is the user who needs to migrate.

Query the amount of user object data in the source database

Select count (*), object_type from dba_objects where owner='TEST' group by object_type;-Statistics on the amount of user object data migrated

3. Source library export

Expdp directory=dumpdir dumpfile=test20170905.dmp logfile=test20170905.log schemas=TEST

Enter / as sysdba

Description of relevant parameters

Dumpdir creates a directory directory for the previous

Dumpfile is the export file name, and the file path after export is under / u01/dumpdir, that is, the directory directory was created before.

Logfile export log name to see if the export is successful

Schemas export schema name can be understood as user name

The following common parameters are also available

Tables can specify export table names, such as the aa table under export test, where the parameter is tables=test.aa separated by commas

Content can specify that you only need to export data (content=data_only) or only export table structures (content=metadata_only)

Exclude can filter without the need to export data

Exclude=index does not export indexes

Exclude=statistics does not export statistics

Parallel=4 specifies a parallelism of 4 that the database is too large to speed up the export. Use with filesize if the exported data is 10G parallel=4, then the filesize=2G filename dumpfile=test%U.dmp% U has an incrementally generated filename.

Version specifies the export version. If the higher version is imported to the lower version, the version corresponding to the lower version is generally added. If 12c is imported to 11g, specify version=11.2.0.

You can also write these parameters to the parfile file

Cat test.par

Directory=dumpdir1

Dumpfile=product_20170821.dmp

Logfile=product_20170821.log

Tables= (pwb.CATEGORY_CORPORATION_RELATION,pwb.test,pwb.order_detail)

Expdp parfile=test.par

Database operation on the import side

Creating a tablespace can be inconsistent with the source tablespace

Create tablespace tbs_test datafile'/ u01 size size autoextend on next 20m oradata 8G

Create a directory

Create directory dumpdir' / u01swap dump dirt directory-this directory is arbitrary. But users of oralce system must have write permission.

Import data

Copy the source server / u01/dumpdir/test20170905.dmp to the new server / u01/dumpdir (just created the directory directory)

Impdp directory=dumpdir dumpfile=test20170902.dmp logfile=test20170902.log

/ as sysdba

If the new tablespace name is not the same as the original

Impdp directory=dumpdir dumpfile=test20170902.dmp logfile=test20170902.log remap_tablespace=tbs_old:tbs_new

Tbs_old is the name of the table space checked from the source database. If there are more than one, write it, separated by commas.

Tbs_new is the new tablespace name

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: 0

*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

Database

Wechat

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

12
Report