The Export utility can provide a logical backup of:
The Import utility is used to read a valid Export file for moving data into a database. Redo log history cannot be applied to objects that are imported from an export file, therefore data loss may occur, but can be minimized. The DBA can use the Export and Import utilites to complement normal operating system backups by using them to :
运行方法:
另外, 如果你想使用 Export, 你必须具有如下权限:
CREATE SESSION, EXP_FULL_DATABASE
command-line 运行模式:
操作系统提示符: exp hr/hr tables = (employees, departments) rows=y file=exp1.dmp -- 注意, 这里不指定文件路径, 那么就是执行命令的当前目录, 也可以直接指定目录
exp hr/hr tables = ( employees, departments) rows=y file = ‘/u01/exp/exp1.dmp’
导出hr 用户的所有object :
exp system/manager owner=hr directy -- 如果没有指定file, 那么默认的文件名是 expdat.dmp.
导出 tablespace ts_employees 下的所有 objects, 并同时声称日志文件记录在 ts_employees.log 里
exp system/manager transport_tablespace=y tablespaces=(ts_employees) log=ts_employees.log
includes all definitions and data modified in the database since the last cumulative or complete export.
exp system/manager FULL=y INCTYPE=cumulative FILE=expcum1.dmp
parameter file:
exp parfile=exp_param.txt
其中 param.txt 为:
USERID=hr/hr
TABLES=(employees, departments)
FILE=exp_one.dmp
DIRECT=y
command-line 运行方式:
imp hr/hr tables=(employees, departments) rows=y file=exp1.dmp -- 这样会首先创建这两个 table, 然后再进行插入
imp system/manager FROMUSER=hr file=exp2.dmp
imp system/manager transport_tablespace=y TABLESPACES=ts_employees