独孤狼群
===========================================================
ORACLE中如何拒绝某台机器上发过来的访问请求
===========================================================
ORACLE中如何拒绝某台机器上发过来的访问请求 查看全文
liuxh6 发表于:2005.04.26 22:00 ::分类: ( oracle数据库 ) ::阅读:(362次) :: 评论 (0)
===========================================================
AWK使用手册(zt)
===========================================================
你可能对UNIX比较熟悉,但你可能对awk很陌生,这一点也不奇怪,的确,与其优秀的功能相比,awk还远没达到它应有的知名度。 查看全文
liuxh6 发表于:2005.04.20 20:25 ::分类: ( unix&win ) ::阅读:(343次) :: 评论 (0)
===========================================================
物化视图
===========================================================
实现物化视图的方法 查看全文
liuxh6 发表于:2005.04.19 14:29 ::分类: ( oracle数据库 ) ::阅读:(329次) :: 评论 (0)
===========================================================
ftp自动传送文件的方法的批处理方法
===========================================================
unix与win平台ftp自动脚本的实现  查看全文
liuxh6 发表于:2005.04.12 20:44 ::分类: ( unix&win ) ::阅读:(422次) :: 评论 (0)
===========================================================
(zt)多域控制器环境下Active Directory灾难恢复
===========================================================
摘要
本文讲述了在多域控制器环境下,主域控制器由于硬件故障突然损坏,而又事先又没有做好备份,如何使额外域控制器接替它的工作,使Active Directory正常运行,并在硬件修理好之后,如何使损坏的主域控制器恢复。
 查看全文
liuxh6 发表于:2005.04.10 19:25 ::分类: ( 微软技术文章 ) ::阅读:(281次) :: 评论 (0)
===========================================================
Active Directory 域控制器降级
===========================================================

使用 DCPROMO/FORCEREMOVAL 命令强制将 Active Directory 域控制器降级

 查看全文
liuxh6 发表于:2005.04.10 19:20 ::分类: ( 微软技术文章 ) ::阅读:(478次) :: 评论 (0)
===========================================================
如何将对应的数字转换成对应的大写字母
===========================================================
function        getBigMoneyStr(money In number) return varchar2 is
    tmp_str varchar2(20);
    money_str varchar2(20);
    val_j        varchar2(20);
    len_j        number;
    k                number;
    i                number;
    j                number;
  m       number;
    result    varchar2(40);
    type         my_type     is varray(20) of varchar2(4);
    num         constant     my_type := my_type('1','2','3','4','5','6','7','8','9','0');
    num_str constant     my_type := my_type('壹','贰','叁','肆','伍','陆','柒','捌','玖','零');
begin
    tmp_str := to_char(money * 100);
    len_j    := length(tmp_str);
    k := 11 - len_j;
    result := substr(tmp_str,1,1);
  m := 2;
    for i in 1..len_j  loop
    begin
        if k = 1 then money_str := '仟';
        elsif k = 2 then money_str :='佰';
        elsif k = 3 then money_str :='拾';
        elsif k = 4 then money_str :='万';
        elsif k = 5 then money_str :='仟';
        elsif k = 6 then money_str :='佰';
        elsif k = 7 then money_str :='拾';
        elsif k = 8 then money_str :='元';
        elsif k = 9 then money_str :='角';
        elsif k = 10 then money_str :='分';
    end if;

        k := k + 1;
    m := i + 1;
        val_j := nvl(substr(tmp_str,m,1),'');
        if len_j = m + 5 and substr(result,length(result),1) = '0' then
            result := substr(result,0,length(result)-1) ||'万0';
        end if;

        if len_j = m + 1 and substr(result,length(result) ,1) = '0' then
            result := substr(result,0,length(result)-1) ||'元0';
        end if;

        if val_j = '0' and substr(result,length(result),1) = '0' then
            goto TheEnd;
        end if;

        if substr(result,length(result) ,1) != '0' then
            result := result || money_str;
        end if;

        result := result || val_j ;

    <<TheEnd>>
    null;
  end;
    end loop;
--除去最后的0
    for j in 1..3 loop
        begin
      if substr(result,length(result),1) = '0' then
              result := substr(result,0,length(result) -1);
      end if;
        end;
    end loop;
    for i in 1..10 loop
        result := replace(result,num(i),num_str(i));
    end loop;

    return result||'整';
end;
/

例子


SQL> select getBigMoneyStr(2124324.34) from dual;

GETBIGMONEYSTR(2124324.34)
--------------------------------------------------------------------

贰佰壹拾贰万肆仟叁佰贰拾肆元叁角肆分整

SQL> select getBigMoneyStr(2129874.34) from dual;

GETBIGMONEYSTR(2129874.34)
--------------------------------------------------------------------

贰佰壹拾贰万玖仟捌佰柒拾肆元叁角肆分整


liuxh6 发表于:2005.04.07 21:45 ::分类: ( pl/sql ) ::阅读:(414次) :: Permanent link
===========================================================
db2数据库(ibm公司)调试
===========================================================

现有状况

根据数据库日志文件db2diag.log,我们发现以下问题:

1.  Memory Heap Error;

2.  cdbold有锁升级现象;

观察当前环境后,我们发现系统内存平均使用率很高,2G内存平时使用量达到1.96G,可再分配的内存不到40M,非常有限。

参数调节

因此,我们采用加速脏业回写的方式来尝试改变性能,语法为:

db2 connnect to stmaold;

db2 update db cfg for stmaold using CHNGPGS_THRESH 30;

用同样的方式,我们也改变了其他三个数据库的参数。参数改变后,必须进行数据库重激活或者数据库实例重起。例如:

db2stop

db2start

然后该参数能够开始起作用。

此外,我还将cdbold的锁列表改大:

db2 connect to cdbold;

db2 update db cfg for cdbold using locklist 200;

该参数直接生效。并多占用了0.4M内存。

其他环节

如果要将参数修改回原样,可采用以下设置:

db2 connnect to <数据库名>;

db2 update db cfg for <数据库名> using CHNGPGS_THRESH 60;

db2 connect to cdbold;

db2 update db cfg for cdbold using locklist 200;

此外,建议定期检测db2diag.log文件,如果出现Memory Heap Error,建议选择适当的时间对数据库进行重起。而且,观察出现该错误的时间应用的什么功能在运行,收集errpt信息和DB2support信息,以供进一步分析处理。

 

 

 

 

 

 

 


liuxh6 发表于:2005.04.07 13:52 ::分类: ( db2数据库 ) ::阅读:(325次) :: 评论 (0)
切换风格
新闻聚合
博客日历
文章归档...
最新发表...
博客统计...
Blog信息
网站链接...