您好,登錄后才能下訂單哦!
exp及expdp的主要區別
EXP和IMP是客戶端工具程序,它們既可以在客戶端使用,也可以在服務端使用。
EXPDP和IMPDP是服務端的工具程序,他們只能在ORACLE服務端使用,不能在客戶端使用
常用的導入導出操作:
exp system/manager buffer=緩沖大小(1024-4096)? file=備份文件名(*.dmp) full=y? \\system/manager登錄名和密碼
expdp system/oracle? directory=hzvidmprd? dumpfile=201090314.dmp? ? schemas=MESPRD
imp MESPRD/MESPRD file=e:/backup/20190313.dmp??full=y??ignore=y
impdp hzruser/hzruser2017@mhdb directory=/home dumpfile=20180720.dmp? full=y??ignore=y
impdp hzruser/hzruser2017@hzmestesr directory=/home dumpfile=20180720.dmp? full=y??ignore=y
imp hzruser/hzruser2017@mhdb DIRECTORY=dpdata1 DUMPFILE=/home/20180720.dmp SCHEMAS=syssde? ? ? ??
impdp?system/oracle? directory=BACK_DMP? dumpfile=201090314.dmp? ? schemas=MESPRD??ignore=y
imp olddms/olddms@hzmestest file=D:\app\Administrator\admin\HZMESTEST\dpdump\GAC_OEM.dmp ignore=y full=y
創建表空間
create tablespace httbs_mesprd datafile 'E:\app\Administrator\oradata\hzvidmprd\httbs_mesprd_1.DBF'?
size 2G
autoextend on
next? 100M maxsize? 4G
extent management local;?
給表空間增加數據文件
select file_name,tablespace_name from dba_data_files;
alter tablespace httbs_mesprd add datafile 'E:\app\Administrator\oradata\hzvidmprd\httbs_mesprd_2.DBF'
size 100m
autoextend on
next? 100M maxsize 4G;?
select file_name,tablespace_name from dba_data_files;
alter tablespace httbs_mesprd add datafile 'E:\app\Administrator\oradata\hzvidmprd\httbs_mesprd_3.DBF'
size 100m
autoextend on
next? 100M ;
刪除表空間
drop tablespace httbs_mesprd including contents and datafiles;
指定表空間創建用戶
create user MESPRD identified by MESPRD??
default tablespace?HTTBS_MESPRD?;
授權
grant connect,resource to MESPRD;
查看并創建邏輯目錄
create or replace?directory back_dmp as? '/u01/backup';
select * from dba_directories;
賦予導出用戶的邏輯目錄操作權限
grant read,write on directory?back_dmp?to MESPRD;
導出:
????按用戶導出數據
expdp MESPRD/MESPRD@HZVIDMPRD schemas=MESPRD directory=HZMESVIDM??dumpfile=20190304.dmp
????按表導出數據
expdp sys/gacHZdba2018@plusbpdb tables=sys.aud$ dumpfile=sys.aud$.dmp directory=back_dmp
????按表空間導
expdp system/oracle? directory=hzvidmprd DUMPFILE=mesprd_tablespace.dmp? TABLESPACES=temp,example;
????導整個數據庫
expdp system/oracle? directory=hzvidmprd DUMPFILE=full.dmp FULL=y;
????按查詢條件導
expdp system/oracle? directory=hzvidmprd dumpfile= 201090314.dmp Tables=DS_QM_DEFECTINSPITEM query='WHERE atr_key=22726';
截斷歷史表
????????手動導出(表)
????????exp
????????/u01/backup/sysaud.dmp
????????t
????????yes
????????yes
????????sys.aud$
????????查看表的數據量
????????select owner,table_name,SAMPLE_SIZE from dba_tables where owner='SYS' and table_name='AUD$';
????????查看表大小
????????select?SEGMENT_NAME,TABLESPACE_NAME,sum(BYTES/1024/1024)||'M'??from?USER_extents?where?SEGMENT_TYPE='TABLE'
????????group?by?SEGMENT_NAME,TABLESPACE_NAME
????????截短表
????????TRUNCATE TABLE SYS.AUD$;
導入:
????指定用戶導入數據
impdp MESPRD/MESPRD DIRECTORY=back_dmp? DUMPFILE=20190304.dmp SCHEMAS=MESPRD?
(導入不同用戶impdp MESPRD/MESPRD DIRECTORY=back_dmp? DUMPFILE=20190304.dmp?? logfile=imp2.log REMAP_SCHEMA=vidm:MESPRD? ?ignore=y)
????改變表的owner導入數據
impdp system/oracle? directory=hzvidmprd DUMPFILE=20190304.dmp TABLES=mesprd.DS_QM_DEFECTINSPITEM REMAP_SCHEMA=mesprd:system;
????導入表空間
impdpsystem/oracle? directory=hzvidmprd DUMPFILE=mesprd_tablespace.dmp TABLESPACES=example;
????導入數據庫
impdb system/oracle? directory=hzvidmprd DUMPFILE=full.dmp FULL=y;
????追加數據
impdp system/oracle? directory=hzvidmprd DUMPFILE=20190304.dmp SCHEMAS=system TABLE_EXISTS_ACTION
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。