Home > database >  Oracle using imp and exp export import table, view, materialized view
Oracle using imp and exp export import table, view, materialized view

Time:09-18

1. The table
Export:
Expdp userid=username/password @ server name: DB server port/database name tables=table name directory=export file path to the dump file=export file name logfile=the log file name

If you want to export all the table, the table name % instead,

Import:
Impdp userid=username/password @ server name: DB server port/directory database name=you need to import the file path of the dump file=you need to import the filename logfile=log filename remap_schema="yuan schema change: changes to the schema" tables schema of the table name=change yuan table_exist_action=replace

Table_exist_action: want to delete the data before importing used before import to delete the data using truncate table structure also want to redo the replace,
Content: only the login data, and the content=DATA_ONLY

2. View
Export:
Expdp userid=username/password @ server name: DB server port/directory database name=export file path to the dump file=export file name logfile=the log file name include=view: \ "in (' view table 1 ', 'the view table 2) "

If all the if all the view of export, but into the include=view

Import:
Prior to import the view to remove the view,
Drop the view of view;

Impdp userid=username/password @ server name: DB server port/directory database name=you need to import the file path of the dump file=you need to import the filename logfile=log filename remap_schema="yuan schema change: changes to the schema"

3. The materialized view
Export:
Expdp userid=username/password @ server name: DB server port/directory database name=export file path to the dump file=export file name logfile=the log file name include=materialized_view: \ "in (' mview table 1 ', 'mview table 2) " include=table: \ "in (' mview table 1', 'mview table 2) "

Import:
Before importing the mview, first remove the mview and table,
The drop materialized view mview name;
Drop table mview name;

Impdp userid=username/password @ server name: DB server port/directory database name=you need to import the file path of the dump file=you need to import the filename logfile=log filename remap_schema="yuan schema change: change the schema first"