Oracle 逻辑备份(数据迁移)

以逻辑结构为单位进行的备份

  • 跨用户移动数据
  • 跨数据库移动数据库
  • 为测试保存原始的数据状态
  • 对数据库进行版本升级

逻辑导出的注意事项:

  • exp程序在目录中发现同名文件时会直接覆盖,不提示!!
  • exp无法备份无段的空表
  • 执行逻辑导出时一定要注意字符集!最好使用包含中文的小表做测试!!
  • 执行逻辑导出时一定要注意字符集!最好使用包含中文的小表做测试!!
  • 导入时的数据和导出时的数据一模一样,导出之后数据库中表的数据变化全都丢失!!

逻辑导出:所有版本都可用,服务器端和客户端都可用。

mkdir -p /home/oracle/expbk

exp userid=scott/tiger table=t01 file=/home/oralce/expbk/t01.dmp buffer=1048576 feedback=10000 log=/home/oracle/expbk/t01.log

[oracle@oracle-db-19c expbk]$ 
[oracle@oracle-db-19c expbk]$ exp userid=scott/tiger@PDB1 tables=emp file=/home/oracle/expbk/emp.dmp buffer=1048576 log=/home/oracle/expbk/emp.log

Export: Release 19.0.0.0.0 - Production on Mon Dec 5 23:34:37 2022
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses AL32UTF8 character set (possible charset conversion)

About to export specified tables via Conventional Path ...
. . exporting table                            EMP         14 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
Export terminated successfully with warnings.
[oracle@oracle-db-19c expbk]$ 

逻辑导入:

drop table t01 purge;

imp userid=scott/tiger tables=t01 file=/home/oracle/expbk/t01.dmp buffer=1048576 feedback=10000 log=/home/oracle/expbk/t01.log

你可能感兴趣的:(DBA,oracle,数据库)