今天头找到我,说:今天的净增用户数怎么回事啊,居然是0,今天总用户数是增加了的,领导问我我也不知道,小林你赶快查查数据库到底是怎么回事。我找到相关过程统计语句,做了以下工作排查,最终定位问题。一、统计到目前为止的用户数SELECT COUNT(DISTINCT a.username) FROM recharge_rec...【阅读全文】
undo实验(update的一致性读):--使用非sys用户进行会话I:create table t (x int,y int);insert into t values(1,1);commit;创建触发器:create or replace trigger t_bufferbefore update on t for each rowbegindbms_output.put_line ( 'old.x = '|| :old.x||' ,old.y = '||:old.y);dbms_outp...【阅读全文】
数据类型不准确的一个隐患,下面来构造一张表存日期字段,一个存varchar2,一个存date,做一个测试。之前也写过两篇blog: 1.字段类型设计与实际业务不符引发的问题1 2.字段类型设计与实际业务不符引发的问题2 SQL> drop table test purge;SQL> create table test as select &nbs...【阅读全文】
If creating a table with the same name, then the old table it renamed to XXX$n where "XXX" is the original name and "n" is a version number. You can then access it using this name XXX$n and copy data to the new table with the requested transformation (if the schemas are not the same).&n...【阅读全文】