oracle 常用指令

2021-09-01 05:00:32 字數 891 閱讀 2267

匯出指令:

1.匯出單張表或多張表 

exp userid=使用者名稱/密碼@伺服器 file=c:\dd.dmp tables=表名1,表名2

2.匯出整個資料庫

exp userid=使用者名稱/密碼@伺服器 file=d:daochu.dmp full=y

3.匯出資料庫中乙個或多個使用者下的表

exp userid=使用者名稱/密碼@伺服器 fle=d:daochu.dmp owner=(system,sys)

匯入指令:

1.把dd.dmp匯入到該使用者下

imp userid=使用者名稱/密碼@伺服器 file=c:\dd.dmp

如果有的表已經存在的話,匯入就會出錯,在後面加上 ignore=y 就可以了

2.把dd.dmp從乙個使用者下匯入到另乙個使用者下

imp  userid=使用者名稱/密碼@伺服器 fromuser=使用者名稱 touser=使用者名稱 file=c:\dd.dmp 

3.將乙個或多個表匯入到該使用者下

2 將d:daochu.dmp中的表table1 匯入

imp userid=使用者名稱/密碼@伺服器   file=d:daochu.dmp   tables=(table1)

建立觸發器

create or replace trigger myblog_music_tri     -->blog_music_tri--觸發器名稱

before insert on myblog_music    -->log_music--表名

for each row

begin

select myblog_music_seq.nextval into:new.id from dual;     -->log_music_seq--序列名稱

end;

oracle 常用指令

關鍵字 oracle 常用指令 授權pkg gps audit 包給使用者simmon grant execute on pkg gps audit to simmon 刪除simmon訪問pkg gps audit 的 許可權 revoke execute on pkg gps audit fro...

mysql常用指令 Mysql常用指令

mysql常用指令2021 01 19 23 40 45 作用 去除select 查詢出來的結果中重複的資料,重複資料只展示一列.關鍵字 distinct 用法 select distinct source from student table source 去重的字段條件 student tabl...

ORACLE 常用表空間操作指令集

為了方便,下面用到的表空間統一名稱myspace,資料檔案存放在 oracle base oradata wilson 下面 1 建立表空間 a 最簡形式 create tablespace myspace datafile u01 oradata wilson myspace01.dbf size...