oracle
資料庫備份與還原命令
資料匯出:
1 將資料庫test完全匯出,使用者名稱system 密碼manager 匯出到d:\daochu.dmp中
exp system/manager@test file=d:\daochu.dmp full=y
2 將資料庫中system使用者與sys使用者的表匯出
exp system/manager@test file=d:\daochu.dmp owner=(system,sys)
3 將資料庫中的表table1 、table2匯出
exp system/manager@test file=d:\daochu.dmp tables=(table1,table2)
4 將資料庫中的表table1中的字段filed1以"00"打頭的資料匯出
exp system/manager@test file=d:\daochu.dmp tables=(table1)query=\" where filed1 like '00%'\"
上面是常用的匯出,對於壓縮我不太在意,用
winzip把dmp檔案可以很好的壓縮。
不過在上面命令後面 加上 compress=y 就可以了
資料的匯入
1 將d:\daochu.dmp 中的資料匯入 test資料庫中。
imp system/manager@test file=d:\daochu.dmp
上面可能有點問題,因為有的表已經存在,然後它就報錯,對該錶就不進行匯入。
在後面加上 ignore=y 就可以了。
2 將d:\daochu.dmp中的表table1 匯入
imp system/manager@test file=d:\daochu.dmp tables=(table1)
基本上上面的匯入匯出夠用了。不少情況我是將表徹底刪除,然後匯入。
注意:你要有足夠的許可權,許可權不夠它會提示你。
資料庫時可以連上的。可以用tnsping test 來獲得資料庫test能否連上
附錄一:
給使用者增加匯入資料許可權的操作
第一,啟動sql*puls
第二,以system/manager登陸
第三,create user 使用者名稱 identified by 密碼 (如果已經建立過使用者,這步可以省略)
第四,grant create user,drop user,alter user ,create any view ,
drop any view,exp_full_database,imp_full_database,
dba,connect,resource,create session to 使用者名字
第五, 執行-cmd-進入dmp檔案所在的目錄,
imp userid=system/manager full=y file=*.dmp
或者 imp userid=system/manager full=y file=filename.dmp
安裝oracle9i
szportdb\szportdb\szportdb
用sysdba 登入建立使用者:szportdb 表空間可以自己設定,也可以users
倒入資料庫。
imp szportdb/szportdb@szportdb full=y c:\szportdb.dmp ignore=
Oracle匯入 匯出exp imp
export 匯出資料,dmp檔案,其實就是select。import 匯入資料,其實就是insert 缺陷 匯出的時候需要全表匯出,速度慢,不是實時,而且是邏輯備份 1 exp exp匯出分為一下幾種模式 表模式 匯出某個使用者下指定的表 使用者模式 匯出某個使用者下所有的物件 資料庫模式 匯出除...
imp 只匯入索引 EXP IMP 匯入匯出
1,匯入匯出使用者下所有物件及資料 exp fanmeng fanmeng 192.168.12.212 orcl file c fanmeng.dmp imp fanmeng fanmeng 192.168.12.212 orcl file c fanmeng.dmp 2,注意事項 手工建庫需要執...
orcl資料庫的匯入 匯出
個人整理 orcl資料庫匯入整理 臨時表空間 create temporary tablespace cqq tempfile d caoqiuqin orcl cqq.dbf size 50m autoextend on next 50m maxsize 20480m extent managem...