Oracle匯入匯出

2021-10-01 12:22:41 字數 2080 閱讀 9480

dcmd進入:

sqlplus 使用者名稱/密碼(管理員)

plsql操作:

建立表空間:

–建立表空間(擴容)

create tablespace $

datafile 『e:\tablespace\mytablespace.dbf』

size 1024m

extent management local;

或者create tablespace $ datafile 『e:\tablespace\mytablespace.dbf』 size 500m

建立使用者:

create user +使用者名稱+ identified by +密碼+ default tablespace +表空間名;

例如:create user $ identified by $ default tablespace $ temporary tablespace temp;

給使用者賦許可權

grant connect,resource,dba to $;

黑視窗匯入:

匯入dmp 檔案

//imp platform/platform@orcl file=『g:\orcaledmpfile\23_platform.dmp』;

//匯入本地

imp pla

tfor

m//pl

atfo

rm/@orcl file=g:\export\platform.dmp fromuser=pla

tfor

mtou

ser=

touser=

platfo

rmto

user

= commit=y ignore=y rows=y indexes=y;

//導進伺服器

imp gtjapoc/[email protected]/orcl file=g:\export\gtjapoc.dmp fromuser=bonddev touser=gtjapoc commit=y ignore=y rows=y indexes=y;

匯出dmp檔案

1.用以下這句查詢空表並生成執行命令

select 『alter table 『||table_name||』 allocate extent;』 from user_tables where num_rows=0;

2.將查詢結果的內容匯出,執行匯出的語句。

3.然後再用exp的方式去匯出資料庫,就可以完整的匯出包括空表的資料庫

exp bon

ddev

//

bondde

v/@192.168.70.23/orcl file=g:export\bond_hs.dmp owner=($)

或者exp bon

ddev

//

bondde

v/@192.168.70.23/orcl file=g:\export\bonddev.dmp log=f:\export\bonddev.log full=y

刪除使用者

drop user $ cascade;

刪除表空間

drop tablespace $ including contents and datafiles;

檢視表空間

select tablespace_name,file_name,autoextensible from dba_data_files;

擴充套件表空間:

1.cmd進入黑視窗;

2.輸入 sqlplus /nolog

3.輸入 conn /sysdba

4.alter database datafile 『c:\tablespace\mytablespace.dbf』 autoextend on next 200m

1.用以下這句查詢空表並生成執行命令

select 『alter table 『||table_name||』 allocate extent;』 from user_tables where num_rows=0;

2.將查詢結果的內容匯出,執行匯出的語句。

3.然後再用exp的方式去匯出資料庫,就可以完整的匯出包括空表的資料庫

oracle匯出,匯入

匯出,在dos下執行 1.exp username userpassword databasename 可以是資料庫也可是遠端的,如username userpassword caac135 2.enter array fetch buffer size 4096 回車 3.export file ...

oracle匯入匯出

sqlplus system system egov create directory dump dir as d dbback exit expdp system system egov directory dump dir dumpfile urbanyw.dmp schemas urbanyw...

Oracle匯入匯出

最簡單 exp duser duser remote localinstancename owner duser file file path dmp imp duser duser remote localinstancename file file path dmp 詳細出處參考 win10下o...