Oracle时间类型数据为0的bug
应用数据库中记录中date列莫名其妙的出现了几个值为0000-00-00的数据。
更可怕的是如果将这样的记录进行读取成为varchar2后再to_date转换回去就会报错。
问题无从查起,只说一下最终同事搜索到的连接结果:http://www.hellodba.com/Doc/oracle_date_zero_bug.htm
看来的确是oracle的一个bug。
另外需要注意的是,在使用java.sql.Date的valueOf()方法的时候,也是不会进行任何检验的。直接将相应的值转换为Date,因此
如果执行了java.sql.Date.valueOf("0000-01-03");这样的方法,在插入到oracle中后就会变成0000-00-00的数据
哇哈哈,不错不错,继itpub之后又发现一个dba的网站。
相关文档:
经验:
alter system set log_archive_dest=’D:\oracle\archivelog’ scope=spfile;
alter system set log_archive_start=true scope=spfile;
之后,
create pfile from spfile
可验证加上没
一、查看数据库运行模式
可以用超级用户(INTERNAL)在SQLPLUS中使用命令ARCHIVE LOG LIST查看
......
1.创建过程
与其它的数据库系统一样,Oracle的存储过程是用PL/SQL语言编写的能完成一定处理功能的存储在数据库字典中的程序。
语法:
create [or replace] procedure procedure_name
[ (argment [ { in| in out }] type,
argment [ { in | out | in out } ] type
{ is | as }
<类型 ......
SELECT sde.st_area(zone) from sde.test1 ORDER BY name;//
SELECT shape from schools ORDER BY name;
SELECT objectid, sde.st_astext(SDE.ST_POINTfromSHAPE(shape,0)) AS points from schools;
SELECT name, sde.st_x (zone) "The X coordinate" from test ; //正确执行
SELECT name, sde.st_x (shape) "The ......
select dbtimezone from dual ; --查看数据库时区
select sessiontimezone from dual ; --查看会话时区
1.select u.name || '.' || o.name || '.' || c.name TSLTZcolumn
from sys.obj$ o, sys.col$ c, sys.user$ u
&nbs ......