我正在使用转储导出数据库。问题是转储不包括空表。导出完整的数据库,结构和数据的最佳方法是什么?
答案 0 :(得分:0)
使用数据泵。查找oracle工具expdp。
答案 1 :(得分:0)
我使用这种方法备份自己的开发环境
oracle@befb83f389c6:~$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Wed Oct 17 05:39:49 2018
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
oracle@befb83f389c6:~$ tar czvf spxe-20181017.tar.gz admin/ fast_recovery_area/ oradata/
要还原备份-您只需解压缩文件并替换现有文件夹
oracle@befb83f389c6:~$ rm -rdf admin/
oracle@befb83f389c6:~$ rm -rdf fast_recovery_area/
oracle@befb83f389c6:~$ rm -rdf oradata/
oracle@befb83f389c6:~$ tar xzvf spxe-20181017.tar.gz
oracle@befb83f389c6:~$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Wed Oct 17 06:13:22 2018
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 601272320 bytes
Fixed Size 2228848 bytes
Variable Size 364907920 bytes
Database Buffers 230686720 bytes
Redo Buffers 3448832 bytes
Database mounted.
Database opened.
SQL>