2015年4月10日
摘要: --查询临时表空间select f.tablespace_name,d.file_name "tempfile name",round((f.bytes_free + f.bytes_used) / 1024 /1024, 2) "total mb",round(((f.bytes_free + f... 阅读全文
posted @ 2015-04-10 11:04 相约future 阅读(329) 评论(0) 推荐(0) 编辑
摘要: expdp system/system@orcl schemas=wxcqhtba directory=DATA_PUMP_DIR dumpfile=wxcqhtba_%DATE%.dmp logfile=wxcqhtba_%DATE%.logexpdp system/system@orcl sc... 阅读全文
posted @ 2015-04-10 10:50 相约future 阅读(460) 评论(0) 推荐(0) 编辑
  2015年3月25日
摘要: explain plan for select * from scott.emp; select * from table(dbms_xplan.display) --要配合 explain 使用--查询最近执行过的sql 的执行计划,在sqlplus 在执行 前提是目标sql 还有shared ... 阅读全文
posted @ 2015-03-25 16:25 相约future 阅读(267) 评论(0) 推荐(0) 编辑
摘要: --Oracle trunc()函数的用法/**************日期********************/select trunc(sysdate) from dual --2015-03-23 今天的日期为2015-03-23select trunc(sysdate, 'mm')... 阅读全文
posted @ 2015-03-25 16:20 相约future 阅读(908) 评论(0) 推荐(0) 编辑
摘要: --取随机的数据select empno,ename from ( select a.*,rownum rn from emp a order by dbms_random.value ) where rn=3000 then 1 else 2 end as rn from emp order by... 阅读全文
posted @ 2015-03-25 16:19 相约future 阅读(121) 评论(0) 推荐(0) 编辑
  2015年1月29日
摘要: declare cursor mycursor is SELECT ROWID FROM tpr_zjjx1 WHERE jxrq=to_date('2013-06-30','yyyy-mm-dd') order by rowid; type rowid_table_type i... 阅读全文
posted @ 2015-01-29 18:40 相约future 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 1、Oracle11g默认对空表不分配segment,故使用exp导出Oracle11g数据库时,空表不会导出。 2、设置deferred_segment_creation 参数为FALSE后,无论是空表还是非空表,都分配segment。 在sqlplus中,执行如下命令: SQL>al... 阅读全文
posted @ 2015-01-29 13:42 相约future 阅读(144) 评论(0) 推荐(0) 编辑
摘要: CREATE OR REPLACE FUNCTION money_to_chinese (money IN VARCHAR2) RETURN VARCHAR2IS c_money VARCHAR2 (12); m_string VARCHAR2 (60) := '分角圆拾佰仟万... 阅读全文
posted @ 2015-01-29 13:24 相约future 阅读(168) 评论(0) 推荐(0) 编辑
  2014年12月31日
摘要: --取随机数据select dbms_random.value from dual;select * from temp_tpg_qyxx sample(1); --百分比 阅读全文
posted @ 2014-12-31 16:40 相约future 阅读(141) 评论(0) 推荐(0) 编辑
摘要: --declare cursor cur_t is select rowid rid from tpr_zwjyw3 where dwid=10113222; type tab_t is table of urowid index by binary_integer; l_rid tab... 阅读全文
posted @ 2014-12-31 15:02 相约future 阅读(363) 评论(0) 推荐(0) 编辑