1、 闪回
批注:delete “T_SPC_ROOM”表,但没有commit可以用以下命令还原回来。
<span style="color:#000099;">flashback table MW_APP.T_SPC_ROOM to before drop</span>
2、处理特殊字符
批注:插入带有&等特殊时,Oracle提示为变量。有以下两种方法:
<span style="color:#000099;">select 'abc'||chr(38)||'efg' from dual; select 'abc'||'&'||'efg' from dual;</span>
3. 导入或导出
说明:导入或导出一张表
<span style="color:#000099;">imp system/[email protected] file=e:\datatable\t_pub_tables.dmp fromuser=(mw_app) touser=(mw_app) exp system/[email protected] tables=mw_app.T_MAINTAIN_UNIT file=e:\T_MAINTAIN_UNIT121101.dmp log=e:\T_MAINTAIN_UNIT121105.log</span>
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';
时间: 2024-10-10 00:10:51