Oracle 導入本地dmp文件 詳細操作步驟


 

以下操作均在命令行窗口中進行

/*連接數據庫*/

C:\Users\hqbhonker>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Fri Dec 20 11:23:42 2013

Copyright (c) 1982, 2010, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

/*創建表空間*/
SQL> create tablespace zhaohang datafile 'd:\1_workspace\zhaohang.dbf' size 500m autoextend on next 100m extent management local;

/*創建用戶*/
SQL> create user zhaohang identified by "1" default tablespace zhaohang;

/*賦予用戶權限*/
SQL> grant resource,connect,dba to zhaohang;

/*測試用戶是否創建成功*/
SQL> connect zhaohang/1

/*改變用戶默認表空間,

導入本地dmp文件前,必須搞清楚原有的表空間,如果與上面新創建的表空間不一致,導入時,會報錯,

這時,就需要重新創建一個同名表空間,然后,再改變上面新創建用戶的默認表空間,如下*/
SQL> ALTER user zhaohang default tablespace YSSQDII;

/*斷開連接*/
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

/*導入本地dmp文件*/

C:\Users\hqbhonker>imp zhaohang/1 file='C:\Users\hqbhonker\Desktop\CMBCHINA20130606.dmp' full=y

以用戶身份導入數據

imp 用戶名/密碼@數據庫實例名  file=需要導入的dmp文件的路徑及文件名  log=指定導入日志路徑及文件名  full=y 

以DBA身份導入數據

imp '用戶名/密碼@數據庫實例名 as sysdba'  file=需要導入的dmp文件的路徑及文件名  log=指定導入日志路徑及文件名  full=y )

 事例:imp 'sys/p2p@p2p_dev as sysdba' file='d:\P2PData.dmp' log='d:\P2PData.log' full=y

注意:此語句不是SQL語句,結尾沒有分號。

下面是完整片段,可直接復制

 

Microsoft Windows [版本 6.1.7601]
版權所有 (c) 2009 Microsoft Corporation。保留所有權利。

C:\Users\hqbhonker>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Fri Dec 20 12:28:25 2013

Copyright (c) 1982, 2010, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> create tablespace QDII datafile 'd:\1_workspace\QDHuaiTai.dbf' size 2000m autoextend on next 100m extent management local;

Tablespace created.

SQL> create user huaitai identified by "1" default tablespace QDII;

User created.

SQL> grant resource,connect,dba to huaitai;

Grant succeeded.

SQL> connect huaitai/1
Connected.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

C:\Users\hqbhonker>imp huaitai/1 file='C:\Users\hqbhonker\Desktop\qdiifull20130909.dmp' full=y

 

  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM