oracle 数据泵导出演示步骤
1、使用 oracle 用户创建目录
mkdir software_bak
[[email protected] ~]$ cd software_bak/
[[email protected] software_bak]$ pwd
/home/oracle/software_bak
2、建立目录并授权
sql> show user;
USER is "SYSTEM"
sql> create directory software_bak as '/home/oracle/software_bak' ;
sql> grant read, write on directory software_bak to SOFTWARE;
Grant succeeded.
3、
@H_403_50@二、查看管理员目录(同时查看操作系统是否存在,因为oracle并不关心该目录是否存在,假如不存在,则出错)
sql>select * from dba_directories;
4 、导出数据
查看导出的数据
导出某张表
expdp software/oracle directory=software_bak dumpfile=software.dmp tables= users
查看表:
sql> select * from users;
ID
----------
1
2
3
删除表:
drop table users;
再次查看
sql> select * from users;
select * from users
*
ERROR at line 1:
ORA-00942: table or view does not exist
导入表:
impdp software/oracle directory=software_bak dumpfile=software.dmp tables= users
查看表是否存在:
sqlplus software/oracle
sql> show user;
USER is "SOFTWARE"
sql> select * from users;
ID
----------
1
2
3
数据已恢复