Oracle根据两点经纬度计算距离(转载)
摘要:CREATE OR REPLACE FUNCTION rad ( d NUMBER ) return NUMBER IS pi NUMBER := 3.141592625; BEGIN return d * pi / 180.0; END; CREATE OR REPLACE FUNCTION ge
阅读全文
oracle查询使用order by变慢的问题
摘要:oracle版本10.1.0 一条简单的sql,在pl/sql里执行,表里共有20多w条记录: select * from table (1s) select * from table order by date_report desc (18s) 加上order by date_report de
阅读全文
Thread 1 cannot allocate new log引起的宕机事故(转载)
摘要:发生oracle宕机事故,alert文件中报告如下错误: Fri Jan 12 04:07:49 2007Thread 1 cannot allocate new log, sequence 187398Checkpoint not complete 产生此问题的原因分析: CKPT这个后台进程的就
阅读全文
oracle sql查询转义下划线
摘要:1,看以下结果 select * from test where login like '%CF_%'; LOGIN CF_wwwwwww4CF_wwwwwww5CF_wwwwwww6CF1CF2CF3 因为_是转义字符 把CF1,CF2,CF3的结果也查出来了 而我们的目的 是不需要转义符 的,只
阅读全文
oracle根据分隔符将字符串分割成数组函数
摘要:--创建表类型 create or replace type mytype as table of number;--如果定义成varchar--CREATE OR REPLACE type mytype as table of varchar2(4000); -- 将字符串分割成数组 functi
阅读全文
shell 调用 sqlplus
摘要:一、最简单的shell里调用sqlplus.$ vi test1.sh#!/bin/bashsqlplus -S /nolog > result.log result.log u_test.txt$ chmod g-rwx,o-rwx u_test.txt$ vi test6.sh#!/bin/bashPASSWD=`cat u_test.txt`sqlplus -S /nolog <<EOFconn u_test/$PASSWDselect * from tab;exitEOF$ chmod +x test6.sh$ ./test6.sh--End--
阅读全文