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

Back up the oracle database

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

Share

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

Database backup can be divided into two types.

I am used to import and export on the database server. Of course, you can also use sqlplus for database import and export, import must be in the directory of the dmp file. I have tried to import using the full path of the file, but it is not successful. I guess it is to escape the directory character.

1. Export the database from the current database for backup, and then import it to the current database.

Export

Expdp username / password @ ORACLE_SID dumpfile=XXX.dmp logfile= impmespd`date + "% Y%m%d%H%M%S" `. Log

Import

Impdp username / password @ ORACLE_SID dumpfile=XXX.dmp logfile= impmespd`date + "% Y%m%d%H%M%S" `. Log table_exists_action=replace

2. Export the backup file from the current database An and import it into another database B.

Export Database A

Expdp username A / password A@ORACLE_SIDA dumpfile=AXXX.dmp logfile= impmespd`date + "% Y%m%d%H%M%S" `. Log

Import to database B

Impdp username B / password B@ORACLE_SIDB dumpfile=AXXX.dmp logfile= impmespd`date + "% Y%m%d%H%M%S" `.log table_exists_action=replace remap_schema= username A: username B remap_tablespace=tablespaceA:tablespaceB

Enter the user name B and password B of database B

The import is complete and the view needs to be re-executed.

Query the tablespace of the current database

Select tablespace_name, sum (bytes) / 1024 / 1024 as MB from dba_data_files

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