oracle 數據泵導出演示步驟 sql
一、使用 oracle 用戶建立目錄 數據庫
mkdir software_bakoracle
[oracle@master ~]$ cd software_bak/ide
[oracle@master software_bak]$ pwdspa
/home/oracle/software_bak操作系統
二、創建目錄並受權 3d
SQL> show user;blog
USER is "SYSTEM"it
SQL> create directory software_bak as '/home/oracle/software_bak' ;table
SQL> grant read, write on directory software_bak to SOFTWARE;
Grant succeeded.
三、
2、查看管理員目錄(同時查看操做系統是否存在,由於oracle並不關心該目錄是否存在,假如不存在,則出錯)
SQL>select * from dba_directories;
4 、導出數據
查看導出的數據
導出某張表
expdp software/oracle directory=software_bak dumpfile=software.dmp tables= users
使用 software 登陸數據庫:
查看錶:
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
使用 software 登陸數據庫:
查看錶是否存在:
sqlplus software/oracle
SQL> show user;
USER is "SOFTWARE"
SQL> select * from users;
ID
----------
1
2
3
數據已恢復