svmon -S中inuse的求和脚本及其结果比svmon -G小的原因

November 2, 2011 system, unix No comments

很多客户可能认为svmon -S中inuse的求和结果和svmon -G中的inuse一样,但是实际是不一样的。下面的脚本可以用来统计svmon -S中的inuse的相加结果:

#!/usr/bin/ksh
svmon -S | cut -c54-62 | awk ‘/^[-sLm]/ {if ($1 ~ /L/)
{COUNT1 =($2*4096+COUNT1)}
else if ($1 ~ /m/)
{COUNT2 =($2*16+COUNT2)}
else {COUNT3 =$2+COUNT3}}
END {printf “The result is as f[……]

Read more

一次cursor: pin S wait on X的解决

November 2, 2011 oracle, RAC 3 comments

环境描述:双节点rac 数据库版本10.2.0.5 通过awr发现down机时间段产生大量的cursor: pin S wait on X等待,同时伴随大量的library latch等待,通过与相关人员沟通得知,此库在每月的月头都会有大量的报表业务,从而负载将会增长几十倍之多。通过下面
的awr可以看出负载确实很高:

DB NameDB IdInstanceInst numReleaseRACHost

PORTALDB597889515portaldb1110.2.0.5.0YESptdb01

Snap IdSnap TimeSes[……]

Read more

测试coolcode插件

November 1, 2011 system 2 comments

测试coolcode插件

select * from v$session where status=’HAPPY’ and owner=’LIU’
and sid not in (1900,2012) order by sid asc

good luck![……]

Read more

手动升级9i-10g全步骤

October 29, 2011 migration, oracle 3 comments

某局威武,升级弄完都到凌晨6点了 居然还要搭DG ,下面记录这次的升级过程(9.2.0.7-10.2.0.4)

迁移步骤:

1 首先安装10g的数据库软件,基于当时的AIX情况,由于系统是通过OS升级重新导入到P6 570上的需要重新开启AIO,数据库版本为9.2.0.7 需要再打一个bos.cifs.**补丁

2 copy 10g ORACLE_HOME/rdbms/admin 下的脚本
ORACLE_HOME/rdbms/admin/utlu102i.sql /tmp/utlu102i.sql
ORACLE_HOME/rdbms/admin/utltzuv2[……]

Read more

处理一个ORA-00600: internal error code, arguments: [keltnfy-ldmInit] 错误

October 29, 2011 maintain, oracle No comments

今天偶尔碰到一个ORA-600错误:

[oracle@honcho ~]$ sqlplus sys/oracle@honcho as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Sat Oct 29 18:25:11 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> conn / as sysdba
Connected to an idle instanc[……]

Read more

基于foreign key 没有index引起的ssx锁等待的测试

October 27, 2011 maintain, oracle 2 comments

创建测试环境:
[oracle@yang ~]$ sqlplus ‘/as sysdba’

SQL*Plus: Release 10.2.0.4.0 – Production on Thu Oct 27 00:03:46 2011

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 – Production
With the Partitioning, O[……]

Read more

data_object_id

October 24, 2011 Internals, oracle 1 comment

xxx_objects.data_object_id differs from object_id after

* truncate table (or alter table truncate partition), unless table/partition is empty
* alter table move (or alter table move partition)
* alter index rebuild (or alter index rebuild partition)
* alter table exchange partition

Alte[……]

Read more

datafile Checkpoint cnt

October 24, 2011 Internals, oracle 2 comments

通过dump datafile header 发现每个Checkpoint cnt不同

大致原因如下:

1.tablespace 建立的时间不同 现在我们新建一个tablespace ->liu datafile->liu01.dbf

DATA FILE #10:
(name #14) /u01/liu01.dbf
creation size=128 block size=8192 status=0xe head=14 tail=14 dup=1
tablespace 8, index=8 krfil=10 prev_file=0
unrecoverable sc[……]

Read more

使用dbms_rowid恢复可用数据

October 22, 2011 maintain, oracle 5 comments

最近看到同事的一个案例,觉得很有趣 现在测试下:
SQL> select * from v$version;

BANNER
—————————————————————-
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 – Prod
PL/SQL Release 10.2.0.4.0 – Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0[……]

Read more

SYSAUX 表空间问题解决

October 19, 2011 maintain, oracle No comments

通过awrinfo.sql 以及 v$sysaux_occupants对SYSAUX空间分析,发现OPTSTAT(历史统计信息)相关的表占用近28G,AWR相关占用空间4G多,经分析OPTSTAT的历史
统计信息系统会自动清理失败有如下原因:因为历史统计信息较多,通过DBMS_STATS.PURGE_STATS清理比较困难,因此与客户沟通后对wri$_optstat_histhead_history
和wri$_optstat_histgrm_history进行TRUNCATE后再通过DBMS_STATS.PURGE_STATS清理其它表的数据,并清理一些无效的ASH数据

一.清理S[……]

Read more