1、 閃回
批注:delete “T_SPC_ROOM”表,但沒有commit可以用以下命令還原回來。
flashback table MW_APP.T_SPC_ROOM to before drop2、處理特殊字符
批注:插入帶有&等特殊時,Oracle提示為變量。有以下兩種方法:
select 'abc'||chr(38)||'efg' from dual; select 'abc'||'&'||'efg' from dual;
3. 導入或導出
說明:導入或導出一張表
imp system/system@sgtms file=e:\datatable\t_pub_tables.dmp fromuser=(mw_app) touser=(mw_app) exp system/system@sgtms tables=mw_app.T_MAINTAIN_UNIT file=e:\T_MAINTAIN_UNIT121101.dmp log=e:\T_MAINTAIN_UNIT121105.log
4. 刪除當年用戶下某類對象
--delete all tables select 'drop table ' || table_name ||';'||chr(13)||chr(10) from user_tables; --delete all views select 'drop view ' || view_name||';'||chr(13)||chr(10) from user_views; --delete all seqs select 'drop sequence ' || sequence_name||';'||chr(13)||chr(10) from user_sequences; --delete all functions select 'drop function ' || object_name||';'||chr(13)||chr(10) from user_objects where object_type='FUNCTION'; --delete all procedure select 'drop procedure ' || object_name||';'||chr(13)||chr(10) from user_objects where object_type='PROCEDURE'; --delete all package select 'drop package ' || object_name||';'||chr(13)||chr(10) from user_objects where object_type='PACKAGE';