Oracle資料庫匯入匯出簡單備份

2022-02-02 04:40:03 字數 2178 閱讀 9229

oracle資料庫簡單備份

方法一:

1、匯出

exp c##xmq/pwda@orcl owner=c##xmq file=c:/expdb.dmp buffer=8000

2、匯入

2.1.刪除原來使用者

sqlplus system/123456sql>drop user c##xmq cascade;

////

如果出現 ora-00604: 遞迴 sql 級別 1 出現錯誤

////

或出現ora-01940:無法刪除當前連線的使用者

////

就重啟資料庫再drop

////

sql> shutdown immediate

////

sql> startup

2.2.建立表空間和使用者

create tablespace xmq_tablespace datafile 'c:/dboracle/xmq.dbf'size 15m autoextend on next 5m;

create user c##xmq identified by pwda;

grant connect,resource,dba to c##xmq;

alter user c##xmq

default

tablespace xmq_tablespace;

////

若是建立表空間提示表空間已存在,則:

////

drop tablespace xmq_tablespace including contents and datafiles;

////

再建立表空間

建立成功後

sql>exit

2.3.匯入

imp c##xmq/pwda@orcl fromuser=c##xmq touser=c##xmq file=c:/dboracle/expdb.dmp buffer=8000方法二:

1、匯出

1.建立目錄

create directory dbdir as 'c:\test\dump';

2.授權

grant read,write on directory dbdir to c##xmq;

3.根據使用者匯出

expdp c##xmq/pwda@orcl schemas=c##xmq dumpfile=expdp.dmp logfile=expdp.log directory=dbdir version=10.2.0;

2、匯入

2.1.刪除原來使用者

sqlplus system/123456sql>drop user c##xmq cascade;

////

如果出現 ora-00604: 遞迴 sql 級別 1 出現錯誤

////

或出現ora-01940:無法刪除當前連線的使用者

////

就重啟資料庫再drop

////

sql> shutdown immediate

////

sql> startup

2.2.建立表空間和使用者

create tablespace xmq_tablespace datafile 'c:/dboracle/xmq.dbf'size 15m autoextend on next 5m;

create user c##xmq identified by pwda;

grant connect,resource,dba to c##xmq;

alter user c##xmq

default

tablespace xmq_tablespace;

////

若是建立表空間提示表空間已存在,則:

////

drop tablespace xmq_tablespace including contents and datafiles;

////

再建立表空間

建立成功後

sql>exit

2.3.匯入

2.3.1.建立目錄

create directory dbdir as 'c:\test\dump';

2.3.2.授權

grant read,write on directory dbdir to c##xmq;

2.3.3.匯入

Oracle 資料庫 匯入匯出

匯入匯出時要,通過 執行 進行到oracle的安裝目錄的 bin 目錄下導 例如 d oracle product 10.1.0 db 1 bin 匯出分三種 匯出 表 方案 資料庫 1.1.1 匯出自己的表 說明 使用者 密碼 資料庫例項 表名 可多個 檔案路徑 exp userid scott ...

oracle資料庫匯入匯出

用工具匯入 匯出 資料 工具 t 匯出表 x 工具 t 匯出表 x 所選執行檔案位置 e oracle product 10.2.0 db 1 bin imp.exe exp.exe 命令匯入匯出 oracle匯入dmp檔案命令 1 dmp檔案中的資料匯入資料庫 1.首先進入cmd命令視窗 2.執行...

Oracle資料庫匯入匯出

我們經常會在資料備份或環境移至的時候用到oracle的匯入匯出 下面我們來詳細看一下匯入匯出的步驟 1.命令列下匯出dmp檔案 資料匯出,可以帶版本 expdp bp oracle bp oracle orcl directory dump dir dumpfile bp oracle.dmp ve...