Oracle資料庫匯入匯出,oracle匯入匯出

來源:互聯網
上載者:User

Oracle資料庫匯入匯出,oracle匯入匯出
一、準備工作
建立資料表空間:
create temporary tablespace yangwen_temp 
tempfile 'D:\oracle\oradata\orcl\yangwen_temp.dbf' 
size 50m  
autoextend on  
next 50m maxsize 20480m  
extent management local;

create tablespace yangwen_data  
logging  
datafile 'D:\oracle\oradata\orcl\yangwen_data.dbf' 
size 50m  
autoextend on  
next 50m maxsize 20480m  
extent management local;
--建立使用者
create user admin123 identified by 123456  
default tablespace yangwen_data  
temporary tablespace yangwen_temp;
-- 授許可權

grant connect,resource,dba to admin123;


二、匯入匯出方法

方案一:
1.1 資料庫的備份-邏輯備份: 
expdp wzzjxt/wzzjxt@wzzj DIRECTORY=data_dump_dir dumpfile=%backup_file%.dmp 
1.2 資料庫的還原-邏輯還原:
impdp aaa/aaa directory=data_dump_dir dumpfile=px.DMP REMAP_SCHEMA=px:aaa 
樣本:
建立使用者以及授許可權
create directory DATA_PUMP_DIR as'd:\';
create user v106 identified by v106;
grant dba,connect,resource to v106;
grant read,write on directory DATA_PUMP_DIR to v106;


impdp sanyuechu/sanyuechu DIRECTORY=DATA_PUMP_DIR DUMPFILE=TEST.DMP

方案二:
1.1 資料庫的備份-邏輯備份:
exp userName/passWord@IP file=d:/資料庫檔案.dmp

資料庫的還原-邏輯還原:


建立使用者:(在sys系統使用者執行sql)
create user userName identified by passWord;
grant dba,connect,resource to userName;
imp userName/passWord@ORCL file=E:\資料庫檔案.dmp ignore=y full=y  log=e:\app\log\imp.log

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.