<?xml version="1.0" encoding="GB2312"?>
<rss version="2.0">
<channel>
<title>Friends Life and Oracle</title>
<link>http://www.eygle.com/blog/</link>
<description>eygle的Oracle Blog，提供Oracle技术研究及深入探讨，同时记录个人爱好及生活历程。</description>
<copyright>Copyright 2006</copyright>
<lastBuildDate>Wed, 08 Nov 2006 11:48:58 +0800</lastBuildDate>
<generator>http://www.movabletype.org/?v=3.33</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs> 

<item>
<title>DB link与检查点(checkpoint)和SCN</title>
<description><![CDATA[<p>昨天在<a href="http://www.eygle.com/archives/2006/11/db_link_remote_function.html">测试</a>的时候发现了一个有趣的现象，就是通过DB查询的2个数据库间，SCN会被同步。</p>

<p>测试的过程如下.<br />
1.首先获得本地的SCN<br />
<blockquote>[oracle@jumper oracle]$ sqlplus "/ as sysdba"</p>

<p>SQL*Plus: Release 9.2.0.4.0 - Production on Tue Nov 7 21:07:56 2006</p>

<p>Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.</p>

<p><br />
Connected to:<br />
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production<br />
With the Partitioning option<br />
JServer Release 9.2.0.4.0 - Production</p>

<p>SQL> select dbms_flashback.GET_SYSTEM_CHANGE_NUMBER scn from dual;</p>

<p>       SCN<br />
----------<br />
   5287824</blockquote></p>

<p>2.通过db link进行SCN查询</p>

<blockquote><pre>SQL> set serveroutput on
SQL> set feedback off
SQL> declare
  2  r_gname    varchar2(40);
  3  l_gname    varchar2(40);
  4  begin
  5     execute immediate
  6     'select GLOBAL_NAME from global_name@hsbill' into r_gname;
  7     dbms_output.put_line('gname of remote:'||r_gname);
  8     select GLOBAL_NAME into l_gname from global_name;
  9     dbms_output.put_line('gname of locald:'||l_gname);
 10  end;
 11  /
gname of remote:HSBILL.HURRAY.COM.CN
gname of locald:EYGLE

<p>SQL&gt; declare<BR>&nbsp; 2&nbsp; r_scn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; number;<BR>&nbsp; 3&nbsp; l_scn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; number;<BR>&nbsp; 4&nbsp; begin<BR>&nbsp; 5&nbsp;&nbsp;&nbsp;&nbsp; execute immediate<BR>&nbsp; 6&nbsp;&nbsp;&nbsp;&nbsp; 'select dbms_flashback.GET_SYSTEM_CHANGE_NUMBER@hsbill from dual' into r_scn;<BR>&nbsp; 7&nbsp;&nbsp;&nbsp;&nbsp; dbms_output.put_line('scn of remote:'||r_scn);<BR>&nbsp; 8&nbsp;&nbsp;&nbsp;&nbsp; select dbms_flashback.GET_SYSTEM_CHANGE_NUMBER into l_scn from dual;<BR>&nbsp; 9&nbsp;&nbsp;&nbsp;&nbsp; dbms_output.put_line('scn of locald:'||l_scn);<BR>&nbsp;10&nbsp; end;<BR>&nbsp;11&nbsp; /<BR>scn of remote:18992092078<BR>scn of locald:18992092078</pre></blockquote></p>

<p>我们可以看到，通过DB Link查询后，两个数据库的SCN被同步。<br />
手工执行checkpoint，此时可以发现数据库的checkpoint scn被增进:<br />
<blockquote><P>SQL&gt; col scn for 999999999<BR>SQL&gt; select file#,CHECKPOINT_CHANGE# scn from v$datafile;</P><br />
<P>&nbsp;&nbsp;&nbsp;&nbsp; FILE#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SCN<BR>---------- -----------------<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5287605<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5287605<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5287605<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5287605</P><br />
<P>SQL&gt; alter system checkpoint;</P><br />
<P>System altered.</P><br />
<P>SQL&gt; select file#,CHECKPOINT_CHANGE# scn from v$datafile;</P><br />
<P>&nbsp;&nbsp;&nbsp;&nbsp; FILE#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SCN<BR>---------- -----------------<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 18992092162<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 18992092162<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 18992092162<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 18992092162<BR></P></blockquote></p>

<p>这种机制其实是为了满足分布式事务(Distributed Transaction)的需要，只不过这里通过db link被触发。</p>

<p>-The End-<br />
</p>]]></description>
<link>http://www.eygle.com/archives/2006/11/db_link_checkpoint_scn.html</link>
<guid>http://www.eygle.com/archives/2006/11/db_link_checkpoint_scn.html</guid>
<category>Internal</category>
<pubDate>Wed, 08 Nov 2006 11:48:58 +0800</pubDate>
</item>
<item>
<title>UTL_INADDR包获取ip地址的内部原理</title>
<description><![CDATA[<p>今天有朋友在MSN上问我如何获得已经连接用户的IP地址。</p>

<p>我们知道，通过SYS_CONTEXT函数可以获得这部分信息，当前用户的ip等信息可以通过如下命令轻易获取：</p>

<blockquote>SQL> select sys_context('userenv','host') from dual;

<p>SYS_CONTEXT('USERENV','HOST')<br />
--------------------------------------------------------------------------------<br />
WORKGROUP\GQGAI</p>

<p>SQL> select sys_context('userenv','ip_address') from dual;</p>

<p>SYS_CONTEXT('USERENV','IP_ADDR<br />
--------------------------------------------------------------------------------<br />
172.16.34.20</blockquote></p>

<p>可是如果我们希望获取其它session的地址信息等，通过SYS_CONTEXT函数就只能通过LOGON触发器来完成。</p>

<p>而如果没有触发器记录，则我们可以通过UTL_INADDR Package来实现。<br />
我们看一下UTL_INADDR包获取ip等信息的实现原理。</p>

<p>我们在数据库中进行如下查询：<br />
<blockquote>[oracle@jumper oracle]$ sqlplus "/ as sysdba"</p>

<p>SQL*Plus: Release 9.2.0.4.0 - Production on Wed Oct 25 11:24:22 2006</p>

<p>Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.</p>

<p><br />
Connected to:<br />
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production<br />
With the Partitioning option<br />
JServer Release 9.2.0.4.0 - Production</p>

<p>SQL> !<br />
[oracle@jumper oracle]$ ps -ef|grep sql<br />
oracle   14700 14663  1 11:24 pts/0    00:00:00 sqlplus            <br />
oracle   14732 14702  0 11:24 pts/0    00:00:00 grep sql<br />
[oracle@jumper oracle]$ ps -ef|grep LO<br />
oracle   14701 14700  0 11:24 ?        00:00:00 oracleeygle (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))<br />
oracle   14734 14702  0 11:24 pts/0    00:00:00 grep LO<br />
[oracle@jumper oracle]$ exit<br />
exit</p>

<p>SQL> SELECT UTL_INADDR.get_host_address('www.anysql.net') from dual;</p>

<p>UTL_INADDR.GET_HOST_ADDRESS('WWW.ANYSQL.NET')<br />
---------------------------------------------------------------------<br />
208.113.151.109</blockquote></p>

<p>在Linux中我们通过strace跟踪这个进程，可以得到以下堆栈信息:<br />
<blockquote>[oracle@jumper oracle]$ strace -p 14701<br />
Process 14701 attached - interrupt to quit<br />
read(7, "\0\313\0\0\6\0\0\0\0\0\3^\10a\200\0\0\0\0\0\0@\342\22\10"..., 2064) = 203<br />
gettimeofday({1161746697, 269895}, NULL) = 0<br />
getrusage(RUSAGE_SELF, {ru_utime={0, 30000}, ru_stime={0, 10000}, ...}) = 0<br />
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 10000}, ...}) = 0<br />
gettimeofday({1161746697, 270542}, NULL) = 0<br />
gettimeofday({1161746697, 270670}, NULL) = 0<br />
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 10000}, ...}) = 0<br />
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 10000}, ...}) = 0<br />
gettimeofday({1161746697, 271614}, NULL) = 0<br />
gettimeofday({1161746697, 271748}, NULL) = 0<br />
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 10000}, ...}) = 0<br />
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 10000}, ...}) = 0<br />
gettimeofday({1161746697, 272347}, NULL) = 0<br />
gettimeofday({1161746697, 272699}, NULL) = 0<br />
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 10000}, ...}) = 0<br />
gettimeofday({1161746697, 272989}, NULL) = 0<br />
gettimeofday({1161746697, 273140}, NULL) = 0<br />
gettimeofday({1161746697, 273273}, NULL) = 0<br />
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 10000}, ...}) = 0<br />
gettimeofday({1161746697, 273771}, NULL) = 0<br />
gettimeofday({1161746697, 275526}, NULL) = 0<br />
getpid()                                = 14701<br />
open("/etc/resolv.conf", O_RDONLY)      = 12<br />
fstat64(12, {st_mode=S_IFREG|0644, st_size=46, ...}) = 0<br />
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fba000<br />
read(12, "search hurray.com.cn\nnameserver "..., 4096) = 46<br />
read(12, "", 4096)                      = 0<br />
close(12)                               = 0<br />
munmap(0xb6fba000, 4096)                = 0<br />
socket(PF_UNIX, SOCK_STREAM, 0)         = 12<br />
connect(12, {sa_family=AF_UNIX, path="/var/run/.nscd_socket"}, 110) = -1 ENOENT (No such file or directory)<br />
close(12)                               = 0<br />
open("/etc/host.conf", O_RDONLY)        = 12<br />
fstat64(12, {st_mode=S_IFREG|0644, st_size=17, ...}) = 0<br />
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fba000<br />
read(12, "order hosts,bind\n", 4096)    = 17<br />
read(12, "", 4096)                      = 0<br />
close(12)                               = 0<br />
munmap(0xb6fba000, 4096)                = 0<br />
futex(0xb71a1a20, FUTEX_WAKE, 2147483647) = 0<br />
open("/etc/hosts", O_RDONLY)            = 12<br />
fcntl64(12, F_GETFD)                    = 0<br />
fcntl64(12, F_SETFD, FD_CLOEXEC)        = 0<br />
fstat64(12, {st_mode=S_IFREG|0644, st_size=175, ...}) = 0<br />
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fba000<br />
read(12, "# Do not remove the following li"..., 4096) = 175<br />
read(12, "", 4096)                      = 0<br />
close(12)                               = 0<br />
munmap(0xb6fba000, 4096)                = 0<br />
open("/opt/oracle/product/9.2.0/lib/libnss_dns.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)<br />
open("/lib/tls/libnss_dns.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)<br />
open("/lib/i686/libnss_dns.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)<br />
open("/lib/libnss_dns.so.2", O_RDONLY)  = 12<br />
read(12, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240\16"..., 512) = 512<br />
fstat64(12, {st_mode=S_IFREG|0755, st_size=18632, ...}) = 0<br />
old_mmap(NULL, 17100, PROT_READ|PROT_EXEC, MAP_PRIVATE, 12, 0) = 0xb6fb6000<br />
old_mmap(0xb6fba000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 12, 0x3000) = 0xb6fba000<br />
close(12)                               = 0<br />
open("/opt/oracle/product/9.2.0/lib/libresolv.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)<br />
open("/lib/tls/libresolv.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)<br />
open("/lib/i686/libresolv.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)<br />
open("/lib/libresolv.so.2", O_RDONLY)   = 12<br />
read(12, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320(\0"..., 512) = 512<br />
fstat64(12, {st_mode=S_IFREG|0755, st_size=76508, ...}) = 0<br />
old_mmap(NULL, 73604, PROT_READ|PROT_EXEC, MAP_PRIVATE, 12, 0) = 0xb6fa4000<br />
old_mmap(0xb6fb3000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 12, 0xf000) = 0xb6fb3000<br />
old_mmap(0xb6fb4000, 8068, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6fb4000<br />
close(12)                               = 0<br />
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 12<br />
connect(12, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("208.113.151.109")}, 28) = 0<br />
send(12, "\324#\1\0\0\1\0\0\0\0\0\0\3www\5anysql\3com\0\0\1\0\1", 31, 0) = 31<br />
gettimeofday({1161746697, 286025}, NULL) = 0<br />
poll([{fd=12, events=POLLIN, revents=POLLIN}], 1, 5000) = 1<br />
ioctl(12, FIONREAD, [74])               = 0<br />
recvfrom(12, "\324#\201\200\0\1\0\1\0\1\0\0\3www\5anysql\3com\0\0\1\0"..., 1024, 0, <br />
{sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("208.113.151.109")}, [16]) = 74<br />
close(12)                               = 0<br />
gettimeofday({1161746697, 290245}, NULL) = 0<br />
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 20000}, ...}) = 0<br />
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 20000}, ...}) = 0<br />
gettimeofday({1161746697, 291553}, NULL) = 0<br />
write(10, "\2\275\0\0\6\0\0\0\0\0\20\31\266\344\217\3700\320\341S"..., 701) = 701<br />
read(7, "\0\215\0\0\6\0\0\0\0\0\3^\t@\0\0\0\1\0\0\0\0\0\0\0\0\0"..., 2064) = 141<br />
gettimeofday({1161746697, 294898}, NULL) = 0<br />
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 20000}, ...}) = 0<br />
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 20000}, ...}) = 0<br />
gettimeofday({1161746697, 295496}, NULL) = 0<br />
getrusage(RUSAGE_SELF, {ru_utime={0, 40000}, ru_stime={0, 20000}, ...}) = 0<br />
gettimeofday({1161746697, 295847}, NULL) = 0<br />
gettimeofday({1161746697, 295981}, NULL) = 0<br />
lseek(9, 1024, SEEK_SET)                = 1024<br />
read(9, "\30\0$\0007\0@\0J\0V\0`\0i\0t\0~\0\232\0\245\0\320\0\330"..., 512) = 512<br />
lseek(9, 47104, SEEK_SET)               = 47104<br />
read(9, "\f\0^\5\0\0P\0x\5\0\0\214\0y\5\0\0\250\0z\5\0\0\313\0{"..., 512) = 512<br />
gettimeofday({1161746697, 297024}, NULL) = 0<br />
write(10, "\0\202\0\0\6\0\0\0\0\0\4\1\0\0\0\1\1\0\0\0{\5\0\0\0\0\1"..., 130) = 130<br />
read(7,  <unfinished ...><br />
Process 14701 detached</blockquote></p>

<p>在这个信息中，我们注意到Oracle顺序访问了如下文件来完成地址定位：<br />
<blockquote>open("/etc/resolv.conf", O_RDONLY)      = 12<br />
open("/etc/host.conf", O_RDONLY)        = 12<br />
open("/etc/hosts", O_RDONLY)            = 12</blockquote></p>

<p>首先获取域名解析服务器，在根据host.conf文件确定解析顺序，因为缺省hosts文件优先，又继续读取/etc/hosts文件。</p>

<p>如果hosts文件存在解析关系，则返回信息；如果不存在，则继续问询DNS服务器，获得解析地址，如果不能解析，则会出错：<br />
<blockquote>SQL> select UTL_INADDR.get_host_address('www.a.com') from dual;<br />
select UTL_INADDR.get_host_address('www.a.com') from dual<br />
       *<br />
ERROR at line 1:<br />
ORA-29257: host www.a.com unknown<br />
ORA-06512: at "SYS.UTL_INADDR", line 35<br />
ORA-06512: at "SYS.UTL_INADDR", line 40<br />
ORA-06512: at line 1</blockquote><br />
也就是说，UTL_INADDR的数据获取已经不依赖于数据库信息了，而SYS_CONTEXT的信息获取仍然来自数据库内部。</p>

<p>这就是UTL_INADDR包的工作原理。</p>

<p>-The End-</p>]]></description>
<link>http://www.eygle.com/archives/2006/10/how_to_getip_address.html</link>
<guid>http://www.eygle.com/archives/2006/10/how_to_getip_address.html</guid>
<category>HowTo</category>
<pubDate>Thu, 26 Oct 2006 11:30:06 +0800</pubDate>
</item>
<item>
<title>获得Redo Block Size的非典型方法</title>
<description><![CDATA[<p>我以前介绍过<a href="http://www.eygle.com/archives/2005/02/log_block_size.html">获得redo block size的方法</a>，当然也可以通过<a href="http://www.eygle.com/archives/2006/03/oracle_tools_dbfsize.html">dbfsize工具</a>获得。</p>

<p>现在在这里我想介绍的是另外一种非典型方法，有多非典型呢?</p>

<p>问题来自于N年前我在一个客户的机器上部署的监控脚本，现在那些脚本看来还在运行着，我最近收到了大量类似如下内容的邮件:<br />
<blockquote>ORA-16038: log 2 sequence# 17151 cannot be archived<br />
ORA-19504: failed to create file ""<br />
ORA-00312: online log 2 thread 1: '/export/home/oracle/oradata/cuwap/redo02.log'<br />
ORA-19504: failed to create file "/data1/oraarc/PTL017151.arc"<br />
ORA-19504: failed to create file "/data1/oraarc/PTL017151.arc"<br />
ORA-27044: unable to write the header block of file<br />
ORA-16038: log 2 sequence# 17151 cannot be archived<br />
ORA-19504: failed to create file ""<br />
ORA-00312: online log 2 thread 1: '/export/home/oracle/oradata/cuwap/redo02.log'<br />
ORA-19504: failed to create file "/data1/oraarc/PTL017151.arc"<br />
ORA-19504: failed to create file "/data1/oraarc/PTL017151.arc"<br />
ORA-27044: unable to write the header block of file<br />
ORA-16038: log 2 sequence# 17151 cannot be archived<br />
ORA-19504: failed to create file ""<br />
ORA-00312: online log 2 thread 1: '/export/home/oracle/oradata/cuwap/redo02.log'<br />
ORA-19502: write error on file "/data1/oraarc/PTL017151.arc", blockno 169985 (blocksize=512)<br />
ORA-27072: skgfdisp: I/O error<br />
ORA-19502: write error on file "/data1/oraarc/PTL017151.arc", blockno 169985 (blocksize=512)<br />
ORA-19502: write error on file "/data1/oraarc/PTL017152.arc", blockno 57345 (blocksize=512)<br />
ORA-27072: skgfdisp: I/O error<br />
ORA-19502: write error on file "/data1/oraarc/PTL017152.arc", blockno 57345 (blocksize=512)<br />
ORA-16038: log 2 sequence# 17151 cannot be archived<br />
ORA-19502: write error on file "", blockno  (blocksize=)<br />
ORA-00312: online log 2 thread 1: '/export/home/oracle/oradata/cuwap/redo02.log'<br />
ORA-16038: log 2 sequence# 17151 cannot be archived<br />
ORA-19502: write error on file "", blockno  (blocksize=)<br />
ORA-00312: online log 2 thread 1: '/export/home/oracle/oradata/cuwap/redo02.log'<br />
ORA-16038: log 2 sequence# 17151 cannot be archived<br />
ORA-19502: write error on file "", blockno  (blocksize=)<br />
ORA-00312: online log 2 thread 1: '/export/home/oracle/oradata/cuwap/redo02.log'<br />
ORA-16038: log 3 sequence# 17152 cannot be archived<br />
ORA-19502: write error on file "", blockno  (blocksize=)<br />
ORA-00312: online log 3 thread 1: '/export/home/oracle/oradata/cuwap/redo03.log'</blockquote></p>

<p>我们注意到，在这些错误信息中，这样的提示至关重要:<br />
<blockquote>ORA-19502: write error on file "/data1/oraarc/PTL017151.arc", blockno 169985 (blocksize=512)<br />
ORA-27072: skgfdisp: I/O error<br />
ORA-19502: write error on file "/data1/oraarc/PTL017151.arc", blockno 169985 (blocksize=512)<br />
ORA-19502: write error on file "/data1/oraarc/PTL017152.arc", blockno 57345 (blocksize=512)</blockquote></p>

<p>这里的Blocksize就告诉我们，在该系统上（Solaris），Redo Block Size是512 bytes。</p>

<p>这里的BlockNo让我想到了另外一个内容。</p>

<p>参考<a href="http://www.ixora.com.au/">Steve Adams</a>网站上的关于<a href="http://www.ixora.com.au/notes/log_buffer_usage.htm">Log Buffer Usage</a>的说明我们能找到另外一个有意思的内容，引用一下Steve的图：<br />
<a href="http://www.flickr.com/photos/eygle/272096259/" title="Photo Sharing"><img src="http://static.flickr.com/80/272096259_9164abb14f_o.gif" width="429" height="175" alt="log_buffer_mapping" /></a></p>

<p>我们知道，Redo Log Buffer和Redo Log File是通过Block映射（map）来完成空间分配和使用的，于是也就有了两个变量：<br />
1.用以标示SGA中Redo Log Buffer基准位置的变量b<br />
2.用以标示Redo Log File基准位置的变量i</p>

<p>如果这里存在问题的是redo log file,那么无法写入的blockno实际上就应该和variable (i)有关；当然对于归档日志文件，这里的blockno自然也是由最初的变量推进和定界的。</p>

<p>由以上输出的错误信息我们可以知道:<br />
<blockquote>169985 * 512 /1024 /1024 = 83M</blockquote></p>

<p>所以我们还可以判断Redo Log File的大小肯定是大于83M的，在Oracle9i中，缺省的Redo Log File大小是100M。</p>

<p>-The End-<br />
</p>]]></description>
<link>http://www.eygle.com/archives/2006/10/redo_block_size_and_sga_variable.html</link>
<guid>http://www.eygle.com/archives/2006/10/redo_block_size_and_sga_variable.html</guid>
<category>Internal</category>
<pubDate>Tue, 17 Oct 2006 16:57:22 +0800</pubDate>
</item>
<item>
<title>sql.bsq与数据库的创建</title>
<description><![CDATA[<p>如果我们使用脚本创建数据库，那么最先运行的是一个叫做CreateDB.sql的脚本。<br />这个脚本发出CREATE DATABASE的命令,具体类似如下的例子:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">CREATE DATABASE eygle<br />MAXINSTANCES 1<br />MAXLOGHISTORY 1<br />MAXLOGFILES 5<br />MAXLOGMEMBERS 3<br />MAXDATAFILES 100<br />DATAFILE '/opt/oracle/oradata/eygle/system01.dbf' <br />SIZE 250M REUSE AUTOEXTEND ON NEXT&nbsp; 10240K MAXSIZE UNLIMITED<br />EXTENT MANAGEMENT LOCAL<br />DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/opt/oracle/oradata/eygle/temp01.dbf' <br />SIZE 40M REUSE AUTOEXTEND ON NEXT&nbsp; 640K MAXSIZE UNLIMITED<br />UNDO TABLESPACE &quot;UNDOTBS1&quot; DATAFILE '/opt/oracle/oradata/eygle/undotbs01.dbf' <br />SIZE 200M REUSE AUTOEXTEND ON NEXT&nbsp; 5120K MAXSIZE UNLIMITED<br />CHARACTER SET ZHS16GBK<br />NATIONAL CHARACTER SET AL16UTF16<br />LOGFILE GROUP 1 ('/opt/oracle/oradata/eygle/redo01.log') SIZE 10240K,<br />GROUP 2 ('/opt/oracle/oradata/eygle/redo02.log') SIZE 10240K,<br />GROUP 3 ('/opt/oracle/oradata/eygle/redo03.log') SIZE 10240K;<br />exit;</td>
        </tr>
    </tbody>
</table>
<p>&nbsp;在这个过程中，Oracle会调用$ORACLE_HOME/rdbms/admin/sql.bsq脚本，用于创建数据字典。</p>
<p>这个文件的位置受到一个隐含的初始化参数 （_init_sql_file ）的控制:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; @GetParDescrb.sql <br />Enter value for par: init_sql<br />old&nbsp;&nbsp; 6:&nbsp;&nbsp;&nbsp; AND x.ksppinm LIKE '%&amp;par%'<br />new&nbsp;&nbsp; 6:&nbsp;&nbsp;&nbsp; AND x.ksppinm LIKE '%init_sql%'</p>
            <p>NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VALUE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DESCRIB<br />--------------- --------------------- ------------------------------------------------------------<br />_init_sql_file&nbsp; ?/rdbms/admin/sql.bsq File containing SQL statements to execute upon database creation</p>
            </td>
        </tr>
    </tbody>
</table>
<p>&nbsp;如果在创建过程中，Oracle无法找到sql.bsq文件，则数据库创建将会出错.<br />如果我们移除sql.bsq文件，再看这样一个数据库创建过程:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>[oracle@jumper scripts]$ sqlplus &quot;/ as sysdba&quot;</p>
            <p>SQL*Plus: Release 9.2.0.4.0 - Production on Fri Aug 18 15:45:26 2006</p>
            <p>Copyright (c) 1982, 2002, Oracle Corporation.&nbsp; All rights reserved.</p>
            <p>Connected to an idle instance.</p>
            <p>SQL&gt; startup nomount;<br />ORACLE instance started.</p>
            <p>Total System Global Area&nbsp; 252777592 bytes<br />Fixed Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 451704 bytes<br />Variable Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 134217728 bytes<br />Database Buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 117440512 bytes<br />Redo Buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 667648 bytes<br />SQL&gt; @CreateDB.sql<br />CREATE DATABASE eygle<br />*<br />ERROR at line 1:<br />ORA-01092: ORACLE instance terminated. Disconnection forced</p>
            <p><br />Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production<br />With the Partitioning option<br />JServer Release 9.2.0.4.0 - Production</p>
            </td>
        </tr>
    </tbody>
</table>
<p>&nbsp;此时日志中会记录:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">Fri Aug 18 15:45:49 2006<br />Errors in file /opt/oracle/admin/eygle/udump/eygle_ora_3632.trc:<br />ORA-01501: CREATE DATABASE failed<br /><font color="#ff0000">ORA-01526: error in opening file '?/rdbms/admin/sql.bsq'</font><br />ORA-07391: sftopn: fopen error, unable to open text file.<br />Error 1526 happened during db open, shutting down database<br />USER: terminating instance due to error 1526<br />Fri Aug 18 15:45:49 2006<br />Errors in file /opt/oracle/admin/eygle/bdump/eygle_ckpt_3623.trc:<br />ORA-01526: error in opening file ''<br />Instance terminated by USER, pid = 3632<br />ORA-1092 signalled during: CREATE DATABASE eygle<br />MAXINSTANCES 1<br />MAXLOGHISTORY...</td>
        </tr>
    </tbody>
</table>
<p>&nbsp;这就是sql.bsq文件在数据库创建过程中的作用。知道了这个内容之后，我们可以通过手工修改sql.bsq文件来更改数据库字典对象参数，从而实现特殊要求数据库的创建或测试自定义库。</p>
<p>我们也可以通过修改_init_sql_file参数来重定位sql.bsq文件的位置。</p>
<p>ixora网站上有一篇文章可以参考:<br /><a href="http://www.ixora.com.au/tips/creation/bsq.htm">http://www.ixora.com.au/tips/creation/bsq.htm</a><br />Itpub上的相关文章:<br /><a href="http://www.itpub.net/199099.html">http://www.itpub.net/199099.html</a><br /></p>
<p>-The End-</p>
<p>&nbsp;</p>]]></description>
<link>http://www.eygle.com/archives/2006/08/createdb_sql_bsq.html</link>
<guid>http://www.eygle.com/archives/2006/08/createdb_sql_bsq.html</guid>
<category>Internal</category>
<pubDate>Wed, 23 Aug 2006 16:55:28 +0800</pubDate>
</item>
<item>
<title>备份的控制文件和新的数据文件</title>
<description><![CDATA[<p>继续<a href="http://www.eygle.com/archives/2006/08/event_controlfile_datafile.html">上一节</a>的介绍：</p>
<p>我们可以想象，如果控制文件是从备份中恢复的，那么数据库在open过程中又将如何呢?</p>
<p>首先备份控制文件，打开数据库，增进检查点:&nbsp;</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>[oracle@jumper eygle]$ cp control01.ctl control01.ctl.bak<br />[oracle@jumper eygle]$ sqlplus &quot;/ as sysdba&quot;</p>
            <p>SQL*Plus: Release 9.2.0.4.0 - Production on Fri Aug 11 10:46:05 2006</p>
            <p>Copyright (c) 1982, 2002, Oracle Corporation.&nbsp; All rights reserved.</p>
            <p>Connected to an idle instance.</p>
            <p>SQL&gt; startup<br />ORACLE instance started.</p>
            <p>Total System Global Area&nbsp; 139531744 bytes<br />Fixed Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 452064 bytes<br />Variable Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 121634816 bytes<br />Database Buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 16777216 bytes<br />Redo Buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 667648 bytes<br />Database mounted.<br />Database opened.<br />SQL&gt; alter system checkpoint;</p>
            <p>System altered.</p>
            <p>SQL&gt; shutdown immediate;<br />Database closed.<br />Database dismounted.<br />ORACLE instance shut down.<br />SQL&gt; exit<br />Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production<br />With the Partitioning option<br />JServer Release 9.2.0.4.0 - Production</p>
            </td>
        </tr>
    </tbody>
</table>
<p>然后恢复旧的控制文件，mount数据库，转储数据文件头:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>[oracle@jumper eygle]$ mv control01.ctl control01.ctl.n<br />[oracle@jumper eygle]$ mv control01.ctl.bak control01.ctl <br />[oracle@jumper eygle]$ sqlplus &quot;/ as sysdba&quot;</p>
            <p>SQL*Plus: Release 9.2.0.4.0 - Production on Fri Aug 11 10:46:50 2006</p>
            <p>Copyright (c) 1982, 2002, Oracle Corporation.&nbsp; All rights reserved.</p>
            <p>Connected to an idle instance.</p>
            <p>SQL&gt; startup mount;<br />ORACLE instance started.</p>
            <p>Total System Global Area&nbsp; 139531744 bytes<br />Fixed Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 452064 bytes<br />Variable Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 121634816 bytes<br />Database Buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 16777216 bytes<br />Redo Buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 667648 bytes<br />Database mounted.<br />SQL&gt; alter session set events 'immediate trace name file_hdrs level 10';</p>
            <p>Session altered.</p>
            <p>SQL&gt; !</p>
            </td>
        </tr>
    </tbody>
</table>
<p>我们看控制文件的信息（选择一个文件）:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">DATA FILE #4: <br />&nbsp; (name #4) /opt/oracle/oradata/eygle/eygle01.dbf<br />creation size=0 block size=8192 status=0xe head=4 tail=4 dup=1<br />&nbsp;tablespace 4, index=4 krfil=4 prev_file=0<br />&nbsp;unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00<br />&nbsp;<font color="#ff0000">Checkpoint cnt:61</font> scn: 0x0000.002acb1e 08/11/2006 10:44:38<br />&nbsp;Stop scn: 0x0000.002acb1e 08/11/2006 10:44:38<br />&nbsp;Creation Checkpointed at scn:&nbsp; 0x0000.0015078d 06/06/2006 09:41:54</td>
        </tr>
    </tbody>
</table>
<p>再看数据文件头信息:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">&nbsp;FILE HEADER:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Software vsn=153092096=0x9200000, Compatibility Vsn=134217728=0x8000000<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Db ID=1407686520=0x53e79778, Db Name='EYGLE'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Activation ID=0=0x0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Control Seq=989=0x3dd, File size=1280=0x500<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File Number=4, Blksiz=8192, File Type=3 DATA<br />Tablespace #4 - EYGLE&nbsp; rel_fn:4 <br />Creation&nbsp;&nbsp; at&nbsp;&nbsp; scn: 0x0000.0015078d 06/06/2006 09:41:54<br />Backup taken at scn: 0x0000.00000000 01/01/1988 00:00:00 thread:0<br />&nbsp;reset logs count:0x232bee1f scn: 0x0000.0007c781 recovered at 08/11/2006 10:11:26<br />&nbsp;status:0x0 root dba:0x00000000 <font color="#ff0000">chkpt cnt: 64</font> ctl cnt:63<br />begin-hot-backup file size: 0<br />Checkpointed at scn:&nbsp; 0x0000.002acb98 08/11/2006 10:46:24</td>
        </tr>
    </tbody>
</table>
<p>我们注意到数据文件的chkpt cnt: 64 要大约控制文件的Checkpoint cnt:61，也就是说控制文件是旧的。</p>
<p>此时尝试打开数据库就会出现如下错误:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>[oracle@jumper udump]$ sqlplus &quot;/ as sysdba&quot;</p>
            <p>SQL*Plus: Release 9.2.0.4.0 - Production on Fri Aug 11 10:51:20 2006</p>
            <p>Copyright (c) 1982, 2002, Oracle Corporation.&nbsp; All rights reserved.</p>
            <p><br />Connected to:<br />Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production<br />With the Partitioning option<br />JServer Release 9.2.0.4.0 - Production</p>
            <p>SQL&gt; alter database open;<br />alter database open<br />*<br />ERROR at line 1:<br />ORA-01122: database file 1 failed verification check<br />ORA-01110: data file 1: '/opt/oracle/oradata/eygle/system01.dbf'<br />ORA-01207: file is more recent than controlfile - old controlfile</p>
            </td>
        </tr>
    </tbody>
</table>
<p>Oracle告诉我们，控制文件是旧的。此时我们可以通过重建控制文件或者从旧的数据备份开始恢复。</p>
<p>未完待续...</p>
<p>&nbsp;</p>]]></description>
<link>http://www.eygle.com/archives/2006/08/old_controlfile_and_new_datafile.html</link>
<guid>http://www.eygle.com/archives/2006/08/old_controlfile_and_new_datafile.html</guid>
<category>Internal</category>
<pubDate>Fri, 11 Aug 2006 11:05:54 +0800</pubDate>
</item>
<item>
<title>关于控制文件与数据文件头信息的说明</title>
<description><![CDATA[<p>为了回答关于《深入浅出Oracle》中的一些疑问，引出本系列文章，讨论链接参考:</p>
<blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
<p><a href="http://www.itpub.net/609499.html">http://www.itpub.net/609499.html</a></p>
</blockquote>
<p>在<a href="http://www.eygle.com/archives/2006/08/event_file_hdrs.html">上一讲</a>中，我们说过：当我们使用file_hdrs事件来转储数据文件头信息时，Oracle会转储两部分信息，一部分来自控制文件，一部分来自数据文件，在数据库启动过程中，这两部分信息要用来进行启动验证。</p>
<p>在数据库open的过程中,Oracle要进行检查中包含以下<a href="http://www.eygle.com/internal/Checkpoint_CNT&amp;SCN.htm">两个过程</a>:</p>
<p>第一次检查数据文件头中的Checkpoint cnt是否与对应控制文件中的Checkpoint cnt一致.<br />如果相等,进行第二次检查.</p>
<p>第二次检查数据文件头的开始SCN和对应控制文件中的结束SCN是否一致如果结束SCN等于开始SCN,则不需要对那个文件进行恢复.</p>
<p>对每个数据文件都完成检查后,打开数据库.同时将每个数据文件的结束SCN设置为无穷大.</p>
<p>通过以下过程我们来进一步说明一下这个内容。</p>
<p>我们来看以下来自控制文件部分(选取一个文件测试):&nbsp;</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">DATA FILE #4: <br />&nbsp; (name #4) /opt/oracle/oradata/eygle/eygle01.dbf<br />creation size=0 block size=8192 status=0xe head=4 tail=4 dup=1<br />&nbsp;tablespace 4, index=4 krfil=4 prev_file=0<br />&nbsp;unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00<br />&nbsp;Checkpoint cnt:58 scn: 0x0000.002ac8ee 08/11/2006 09:48:29<br />&nbsp;Stop scn: 0x0000.002ac8ee 08/11/2006 09:48:29<br />&nbsp;Creation Checkpointed at scn:&nbsp; 0x0000.0015078d 06/06/2006 09:41:54<br />&nbsp;thread:0 rba:(0x0.0.0)<br />................<br />&nbsp;aux_file is NOT DEFINED </td>
        </tr>
    </tbody>
</table>
<p>&nbsp;这部分中包含的重要信息有:<br />检查点计数: Checkpoint cnt:58<br />检查点SCN: scn: 0x0000.002ac8ee 08/11/2006 09:48:29<br />数据文件Stop SCN:Stop scn: 0x0000.002ac8ee 08/11/2006 09:48:29</p>
<p>我们再看来自数据文件头的信息:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">&nbsp;FILE HEADER:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Software vsn=153092096=0x9200000, Compatibility Vsn=134217728=0x8000000<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Db ID=1407686520=0x53e79778, Db Name='EYGLE'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Activation ID=0=0x0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Control Seq=979=0x3d3, File size=1280=0x500<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File Number=4, Blksiz=8192, File Type=3 DATA<br />Tablespace #4 - EYGLE&nbsp; rel_fn:4 <br />Creation&nbsp;&nbsp; at&nbsp;&nbsp; scn: 0x0000.0015078d 06/06/2006 09:41:54<br />Backup taken at scn: 0x0000.00000000 01/01/1988 00:00:00 thread:0<br />&nbsp;reset logs count:0x232bee1f scn: 0x0000.0007c781 recovered at 08/10/2006 20:57:53<br />&nbsp;status:0x0 root dba:0x00000000 chkpt cnt: 58 ctl cnt:57<br />begin-hot-backup file size: 0<br />Checkpointed at scn:&nbsp; 0x0000.002ac8ee 08/11/2006 09:48:29<br />.......................</td>
        </tr>
    </tbody>
</table>
<p>这部分中包含的重要信息有:<br />检查点SCN: Checkpointed at scn:&nbsp; 0x0000.002ac8ee 08/11/2006 09:48:29<br />检查点计数: chkpt cnt: 58 ctl cnt:57</p>
<p>这两者都和控制文件中所记录的一致。如果这两者一致，数据库启动时就能通过验证，启动数据库。</p>
<p>那么如果不一致呢？<br />Oracle则请求进行恢复。<br />我们看，从备份中恢复eygle01.dbf文件.<br />首先第一部分从控制文件中获得的信息是相同的:&nbsp;</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">DATA FILE #4: <br />&nbsp; (name #4) /opt/oracle/oradata/eygle/eygle01.dbf<br />creation size=0 block size=8192 status=0xe head=4 tail=4 dup=1<br />&nbsp;tablespace 4, index=4 krfil=4 prev_file=0<br />&nbsp;unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00<br />&nbsp;Checkpoint cnt:58 scn: 0x0000.002ac8ee 08/11/2006 09:48:29<br />&nbsp;Stop scn: 0x0000.002ac8ee 08/11/2006 09:48:29<br />&nbsp;Creation Checkpointed at scn:&nbsp; 0x0000.0015078d 06/06/2006 09:41:54<br />...................<br />&nbsp;aux_file is NOT DEFINED </td>
        </tr>
    </tbody>
</table>
<p>检查点计数: Checkpoint cnt:58<br />检查点SCN: scn: 0x0000.002ac8ee 08/11/2006 09:48:29<br />数据文件Stop SCN:Stop scn: 0x0000.002ac8ee 08/11/2006 09:48:29</p>
<p>而从文件头中获得的备份文件信息则是：&nbsp;</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">&nbsp;FILE HEADER:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Software vsn=153092096=0x9200000, Compatibility Vsn=134217728=0x8000000<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Db ID=1407686520=0x53e79778, Db Name='EYGLE'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Activation ID=0=0x0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Control Seq=973=0x3cd, File size=1280=0x500<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File Number=4, Blksiz=8192, File Type=3 DATA<br />Tablespace #4 - EYGLE&nbsp; rel_fn:4 <br />Creation&nbsp;&nbsp; at&nbsp;&nbsp; scn: 0x0000.0015078d 06/06/2006 09:41:54<br />Backup taken at scn: 0x0000.00000000 01/01/1988 00:00:00 thread:0<br />&nbsp;reset logs count:0x232bee1f scn: 0x0000.0007c781 recovered at 08/10/2006 20:57:53<br />&nbsp;status:0x0 root dba:0x00000000 chkpt cnt: 53 ctl cnt:52<br />begin-hot-backup file size: 0<br />Checkpointed at scn:&nbsp; 0x0000.002ac5f9 08/10/2006 20:58:21<br />...................................</td>
        </tr>
    </tbody>
</table>
<p>我们看到此时备份文件的信息：<br />检查点是：Checkpointed at scn:&nbsp; 0x0000.002ac5f9 08/10/2006 20:58:21<br />检查点计数为:chkpt cnt: 53 ctl cnt:52</p>
<p>这两者不再一致，首先是检查点技术不一致，当前文件的chkpt cnt为53，小于控制文件中记录的58，Oracle可以判断文件是从备份中恢复的，或者文件故障，需要进行介质恢复。</p>
<p>我们看如果此时我们试图打开数据库，则Oracle提示文件需要介质恢复:&nbsp;</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">SQL&gt; alter database open;<br />alter database open<br />*<br />ERROR at line 1:<br />ORA-01113: file 4 needs media recovery<br />ORA-01110: data file 4: '/opt/oracle/oradata/eygle/eygle01.dbf'</td>
        </tr>
    </tbody>
</table>
<p>执行恢复:&nbsp;</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">SQL&gt; recover datafile 4;<br />Media recovery complete.</td>
        </tr>
    </tbody>
</table>
<p>我们看看恢复完成之后，控制文件和数据文件的变化.<br />首先看控制文件的变化:&nbsp;</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">DATA FILE #4: <br />&nbsp; (name #4) /opt/oracle/oradata/eygle/eygle01.dbf<br />creation size=0 block size=8192 status=0xe head=4 tail=4 dup=1<br />&nbsp;tablespace 4, index=4 krfil=4 prev_file=0<br />&nbsp;unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00<br />&nbsp;Checkpoint cnt:59 scn: 0x0000.002ac8ee 08/11/2006 09:48:29<br />&nbsp;Stop scn: 0x0000.002ac8ed 08/11/2006 09:48:29<br />&nbsp;Creation Checkpointed at scn:&nbsp; 0x0000.0015078d 06/06/2006 09:41:54<br />......................</td>
        </tr>
    </tbody>
</table>
<p>检查点计数: Checkpoint cnt:59<br />执行了恢复之后，检查点计数较前增加了1</p>
<p>检查点SCN: scn: 0x0000.002ac8ee 08/11/2006 09:48:29<br />数据文件Stop scn: 0x0000.002ac8ed 08/11/2006 09:48:29<br />数据文件Stop scn和数据文件进行了同步。</p>
<p>数据文件头信息:&nbsp;</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">&nbsp;FILE HEADER:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Software vsn=153092096=0x9200000, Compatibility Vsn=134217728=0x8000000<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Db ID=1407686520=0x53e79778, Db Name='EYGLE'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Activation ID=0=0x0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Control Seq=983=0x3d7, File size=1280=0x500<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File Number=4, Blksiz=8192, File Type=3 DATA<br />Tablespace #4 - EYGLE&nbsp; rel_fn:4 <br />Creation&nbsp;&nbsp; at&nbsp;&nbsp; scn: 0x0000.0015078d 06/06/2006 09:41:54<br />Backup taken at scn: 0x0000.00000000 01/01/1988 00:00:00 thread:0<br />&nbsp;reset logs count:0x232bee1f scn: 0x0000.0007c781 recovered at 08/11/2006 10:11:26<br />&nbsp;status:0x0 root dba:0x00000000 chkpt cnt: 59 ctl cnt:58<br />begin-hot-backup file size: 0<br />Checkpointed at scn:&nbsp; 0x0000.002ac8ed 08/11/2006 09:48:29<br />..........................</td>
        </tr>
    </tbody>
</table>
<p>我们看到此时数据文件的信息：<br />检查点是：Checkpointed at scn:&nbsp; 0x0000.002ac8ed 08/11/2006 09:48:29<br />这个检查点和控制文件中记录的stop scn一致，数据库启动可以顺利进行。</p>
<p>检查点计数为:chkpt cnt: 59 ctl cnt:58</p>
<p>我们打开数据库:&nbsp;</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; alter database open;</p>
            <p>Database altered.</p>
            <p>SQL&gt; alter session set events 'immediate trace name file_hdrs level 10';</p>
            <p>Session altered.</p>
            </td>
        </tr>
    </tbody>
</table>
<p>此时数据库恢复正常运行。<br />控制文件信息如下：&nbsp;</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">DATA FILE #4: <br />&nbsp; (name #4) /opt/oracle/oradata/eygle/eygle01.dbf<br />creation size=0 block size=8192 status=0xe head=4 tail=4 dup=1<br />&nbsp;tablespace 4, index=4 krfil=4 prev_file=0<br />&nbsp;unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00<br />&nbsp;Checkpoint cnt:60 scn: 0x0000.002ac8ef 08/11/2006 10:19:30<br />&nbsp;Stop scn: 0xffff.ffffffff 08/11/2006 09:48:29<br />&nbsp;Creation Checkpointed at scn:&nbsp; 0x0000.0015078d 06/06/2006 09:41:54</td>
        </tr>
    </tbody>
</table>
<p>&nbsp;此时stop scn被置为无穷大。<br />数据文件头信息如下:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">&nbsp;FILE HEADER:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Software vsn=153092096=0x9200000, Compatibility Vsn=134217728=0x8000000<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Db ID=1407686520=0x53e79778, Db Name='EYGLE'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Activation ID=0=0x0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Control Seq=984=0x3d8, File size=1280=0x500<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File Number=4, Blksiz=8192, File Type=3 DATA<br />Tablespace #4 - EYGLE&nbsp; rel_fn:4 <br />Creation&nbsp;&nbsp; at&nbsp;&nbsp; scn: 0x0000.0015078d 06/06/2006 09:41:54<br />Backup taken at scn: 0x0000.00000000 01/01/1988 00:00:00 thread:0<br />&nbsp;reset logs count:0x232bee1f scn: 0x0000.0007c781 recovered at 08/11/2006 10:11:26<br />&nbsp;status:0x4 root dba:0x00000000 chkpt cnt: 60 ctl cnt:59<br />begin-hot-backup file size: 0<br />Checkpointed at scn:&nbsp; 0x0000.002ac8ef 08/11/2006 10:19:30</td>
        </tr>
    </tbody>
</table>
<p>未完待续...</p>
<p>&nbsp;</p>]]></description>
<link>http://www.eygle.com/archives/2006/08/event_controlfile_datafile.html</link>
<guid>http://www.eygle.com/archives/2006/08/event_controlfile_datafile.html</guid>
<category>Internal</category>
<pubDate>Fri, 11 Aug 2006 10:01:16 +0800</pubDate>
</item>
<item>
<title>EVENT: FILE_HDRS 的信息来源</title>
<description><![CDATA[<p>准备用几篇稿子来记录一下ITPUB上关于数据库Open的一个<a href="http://www.itpub.net/609499.html">问题</a>。<br />具体问题参考ITPUB链接:<br /><a href="http://www.itpub.net/609499.html">http://www.itpub.net/609499.html</a></p>
<p dir="ltr" style="MARGIN-RIGHT: 0px">我们知道，可以通过一个内部事件来转储数据文件头信息，这个常用的命令是：</p>
<blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
<p dir="ltr" style="MARGIN-RIGHT: 0px"><strong>alter session set events 'immediate trace name file_hdrs level 10';</strong></p>
</blockquote>
<p>那么我们来看一下这个命令得到的trace文件及内容。<br />immediate关闭数据库，在mount状态下执行该命令:&nbsp;</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; startup mount;<br />ORACLE instance started.</p>
            <p>Total System Global Area&nbsp; 139531744 bytes<br />Fixed Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 452064 bytes<br />Variable Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 121634816 bytes<br />Database Buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 16777216 bytes<br />Redo Buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 667648 bytes<br />Database mounted.<br />SQL&gt; alter session set events 'immediate trace name file_hdrs level 10';</p>
            <p>Session altered.</p>
            </td>
        </tr>
    </tbody>
</table>
<p>选取一个文件的信息,这里选择eygle01.dbf文件，我们注意，以下就是trace文件摘录的信息:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">DATA FILE #4: <br />&nbsp; (name #4) /opt/oracle/oradata/eygle/eygle01.dbf<br />creation size=0 block size=8192 status=0xe head=4 tail=4 dup=1<br />&nbsp;tablespace 4, index=4 krfil=4 prev_file=0<br />&nbsp;unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00<br />&nbsp;Checkpoint cnt:53 scn: 0x0000.002ac5f9 08/10/2006 20:58:21<br />&nbsp;Stop scn: 0x0000.002ac5f9 08/10/2006 20:58:21<br />&nbsp;Creation Checkpointed at scn:&nbsp; 0x0000.0015078d 06/06/2006 09:41:54<br />&nbsp;thread:0 rba:(0x0.0.0)<br />&nbsp;enabled&nbsp; threads:&nbsp; 00000000 00000000 00000000 00000000 00000000 00000000<br />&nbsp; 00000000 00000000<br />&nbsp;Offline scn: 0x0000.00000000 prev_range: 0<br />&nbsp;Online Checkpointed at scn:&nbsp; 0x0000.00000000 <br />&nbsp;thread:0 rba:(0x0.0.0)<br />&nbsp;enabled&nbsp; threads:&nbsp; 00000000 00000000 00000000 00000000 00000000 00000000<br />&nbsp; 00000000 00000000<br />&nbsp;Hot Backup end marker scn: 0x0000.00000000<br />&nbsp;aux_file is NOT DEFINED <br />&nbsp;FILE HEADER:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Software vsn=153092096=0x9200000, Compatibility Vsn=134217728=0x8000000<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Db ID=1407686520=0x53e79778, Db Name='EYGLE'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Activation ID=0=0x0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Control Seq=973=0x3cd, File size=1280=0x500<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File Number=4, Blksiz=8192, File Type=3 DATA<br />Tablespace #4 - EYGLE&nbsp; rel_fn:4 <br />Creation&nbsp;&nbsp; at&nbsp;&nbsp; scn: 0x0000.0015078d 06/06/2006 09:41:54<br />Backup taken at scn: 0x0000.00000000 01/01/1988 00:00:00 thread:0<br />&nbsp;reset logs count:0x232bee1f scn: 0x0000.0007c781 recovered at 08/10/2006 20:57:53<br />&nbsp;status:0x0 root dba:0x00000000 chkpt cnt: 53 ctl cnt:52<br />begin-hot-backup file size: 0<br />Checkpointed at scn:&nbsp; 0x0000.002ac5f9 08/10/2006 20:58:21<br />&nbsp;thread:1 rba:(0x35.1275.10)<br />&nbsp;enabled&nbsp; threads:&nbsp; 01000000 00000000 00000000 00000000 00000000 00000000<br />&nbsp; 00000000 00000000<br />Backup Checkpointed at scn:&nbsp; 0x0000.00000000 <br />&nbsp;thread:0 rba:(0x0.0.0)<br />&nbsp;enabled&nbsp; threads:&nbsp; 00000000 00000000 00000000 00000000 00000000 00000000<br />&nbsp; 00000000 00000000<br />External cache id: 0x0 0x0 0x0 0x0<br />Absolute fuzzy scn: 0x0000.00000000<br />Recovery fuzzy scn: 0x0000.00000000 08/10/2006 10:46:03<br />Terminal Recovery Stamp scn: 0x0000.00000000 01/01/1988 00:00:00</td>
        </tr>
    </tbody>
</table>
<p>注意，这其中&quot;FILE HEADER&quot;开始的信息就是来自数据文件头，之前的相关内容来自控制文件。</p>
<p>我们可以在mount状态下将eygle01.dbf文件移除:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>[oracle@jumper eygle]$ mv eygle01.dbf eygle01.dbf.n<br />[oracle@jumper eygle]$ sqlplus &quot;/ as sysdba&quot;</p>
            <p>SQL*Plus: Release 9.2.0.4.0 - Production on Thu Aug 10 21:44:10 2006</p>
            <p>Copyright (c) 1982, 2002, Oracle Corporation.&nbsp; All rights reserved.</p>
            <p><br />Connected to:<br />Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production<br />With the Partitioning option<br />JServer Release 9.2.0.4.0 - Production</p>
            <p>SQL&gt; alter session set events 'immediate trace name file_hdrs level 10';</p>
            <p>Session altered.</p>
            <p>SQL&gt; !</p>
            </td>
        </tr>
    </tbody>
</table>
<p>则&quot;FILE HEADER&quot;部分信息将无法获得。</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">DATA FILE #4: <br />&nbsp; (name #4) /opt/oracle/oradata/eygle/eygle01.dbf<br />creation size=0 block size=8192 status=0xe head=4 tail=4 dup=1<br />&nbsp;tablespace 4, index=4 krfil=4 prev_file=0<br />&nbsp;unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00<br />&nbsp;Checkpoint cnt:53 scn: 0x0000.002ac5f9 08/10/2006 20:58:21<br />&nbsp;Stop scn: 0x0000.002ac5f9 08/10/2006 20:58:21<br />&nbsp;Creation Checkpointed at scn:&nbsp; 0x0000.0015078d 06/06/2006 09:41:54<br />&nbsp;thread:0 rba:(0x0.0.0)<br />&nbsp;enabled&nbsp; threads:&nbsp; 00000000 00000000 00000000 00000000 00000000 00000000<br />&nbsp; 00000000 00000000<br />&nbsp;Offline scn: 0x0000.00000000 prev_range: 0<br />&nbsp;Online Checkpointed at scn:&nbsp; 0x0000.00000000 <br />&nbsp;thread:0 rba:(0x0.0.0)<br />&nbsp;enabled&nbsp; threads:&nbsp; 00000000 00000000 00000000 00000000 00000000 00000000<br />&nbsp; 00000000 00000000<br />&nbsp;Hot Backup end marker scn: 0x0000.00000000<br />&nbsp;aux_file is NOT DEFINED <br />ORA-01157: cannot identify/lock data file 4 - see DBWR trace file<br />ORA-01110: data file 4: '/opt/oracle/oradata/eygle/eygle01.dbf'<br />*** Error 1157 in open/read file # 4 ***<br />DUMP OF TEMP FILES: 0 files in database</td>
        </tr>
    </tbody>
</table>
<p>此时报出的错误是，文件无法找到，也就是说当我们执行trace file_hdrs时需要读取数据文件头，获得相关信息。<br /></p>]]></description>
<link>http://www.eygle.com/archives/2006/08/event_file_hdrs.html</link>
<guid>http://www.eygle.com/archives/2006/08/event_file_hdrs.html</guid>
<category>Internal</category>
<pubDate>Thu, 10 Aug 2006 21:59:07 +0800</pubDate>
</item>
<item>
<title>Oracle9iR2 NF:压缩表技术</title>
<description><![CDATA[<p>上周了解了一下<a href="http://www.eygle.com/archives/2006/06/ibm_db2_9_viper.html">IBM的压缩技术</a>,打算对比一下Oracle的表压缩技术做点研究,先讨论一下Oracle的表压缩技术.</p>
<p>从<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">Oracle9iR2</strong>开始，Oracle推出了压缩表技术（table compression），用于压缩数据表中的重复数据，以节省存储空间，压缩技术倾向于在数据仓库中使用。</p>
<p>压缩在数据块级生效，当数据表定义为压缩时，数据库在每个数据块上保留空间存储重复数据的单个拷贝，保留空间被称为符号表（symbol table）。此后在具体行上不必再存储这些重复数据，只需要存放指向符号表相应数据的指针，存储空间因此得以节省。</p>
<p>关于压缩表的基本介绍，参考OTN上的文档:<br /><a href="http://www.oracle.com/technology/oramag/oracle/04-mar/o24tech_data.html">http://www.oracle.com/technology/oramag/oracle/04-mar/o24tech_data.html</a></p>
<p>我们看一下简单的测试:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>[oracle@jumper oracle]$ sqlplus eygle/eygle</p>
            <p>SQL*Plus: Release 9.2.0.4.0 - Production on Mon Jun 26 16:07:24 2006</p>
            <p>Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.</p>
            <p><br />Connected to:<br />Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production<br />With the Partitioning option<br />JServer Release 9.2.0.4.0 - Production</p>
            <p>SQL&gt; create table test (c1 varchar2(20),c2 varchar2(20));</p>
            <p>Table created.</p>
            <p>SQL&gt; begin<br />2 for i in 1 .. 10000 loop<br />3 insert into test values('eygle','test');<br />4 end loop;<br />5 end;<br />6 /</p>
            <p>PL/SQL procedure successfully completed.</p>
            <p>SQL&gt; create table test_compress compress as select * from test;</p>
            <p>Table created.</p>
            <p>SQL&gt; select table_name,COMPRESSION from user_tables where table_name like 'TEST%';</p>
            <p>TABLE_NAME COMPRESS<br />------------------------------ --------<br />TEST DISABLED<br />TEST_COMPRESS ENABLED</p>
            <p>SQL&gt; analyze table test compute statistics;</p>
            <p>Table analyzed.</p>
            <p>SQL&gt; analyze table test_compress compute statistics;</p>
            <p>Table analyzed.</p>
            </td>
        </tr>
    </tbody>
</table>
<p>我们看一下两个表的空间使用情况:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; select table_name,blocks,EMPTY_BLOCKS from user_tables<br />2 where table_name like 'TEST%';</p>
            <p>TABLE_NAME BLOCKS EMPTY_BLOCKS<br />------------------------------ ---------- ------------<br />TEST 28 4<br />TEST_COMPRESS 18 6</p>
            <p>SQL&gt; select (28-4)/(18-6) from dual;</p>
            <p>(28-4)/(18-6)<br />-------------<br />2</p>
            </td>
        </tr>
    </tbody>
</table>
<p>我们看到，压缩表只使用了常规表一半的空间。</p>
<p>我们转储一下数据块，看一下压缩表的存储结构：</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; select segment_name,file_id,block_id,blocks from dba_extents<br />2 where segment_name='TEST_COMPRESS';</p>
            <p>SEGMENT_NAME FILE_ID BLOCK_ID BLOCKS<br />-------------------- ---------- ---------- ----------<br />TEST_COMPRESS 3 17 8<br />TEST_COMPRESS 3 25 8<br />TEST_COMPRESS 3 33 8</p>
            <p>SQL&gt; alter system dump datafile 3 block 20;</p>
            <p>System altered.</p>
            </td>
        </tr>
    </tbody>
</table>
<p>找到跟踪文件：</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; @gettrcname.sql</p>
            <p>TRACE_FILE_NAME<br />-------------------------------------------------------------------<br />/opt/oracle/admin/eygle/udump/eygle_ora_20984.trc</p>
            </td>
        </tr>
    </tbody>
</table>
<p>查看内容，首先看一下块头信息:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">data_block_dump,data header at 0xaa84e7c<br />===============<br />tsiz: 0x1f80<br />hsiz: 0x5d2<br />pbl: 0x0aa84e7c<br />bdba: 0x00c00014<br />76543210<br />flag=-0------<br />ntab=2<br />nrow=727<br />frre=-1<br />fsbo=0x5d2<br />fseo=0x1144<br />avsp=0x1a<br />tosp=0x1a<br />r0_9ir2=0x0<br />mec_kdbh9ir2=0x1<br />r1_9ir2=0x0<br />76543210<br />flag_9ir2=-------C<br />fcls_9ir2[3]={ 0 32768 32768 }<br />0x1c:pti[0] nrow=1 offs=0<br />0x20:pti[1] nrow=726 offs=1<br />0x24:pri[0] offs=0x1f72<br />0x26:pri[1] offs=0x1f6d</td>
        </tr>
    </tbody>
</table>
我们看到这个Block中的ntab =2 也就是存在2张表，从下面可以找到table 0的信息:
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">tab 0, row 0, @0x1f72<br />tl: 14 fb: --H-FL-- lb: 0x0 cc: 2<br />col 0: [ 5] 65 79 67 6c 65<br />col 1: [ 4] 74 65 73 74<br />bindmp: 02 d6 02 cd 65 79 67 6c 65 cc 74 65 73 74</td>
        </tr>
    </tbody>
</table>
<p>这个table 0只有一条记录，就是我们之前所说的符号表。</p>
<p>此后的记录才是真实数据，每条数据记录包含一个指针，指向符号表：</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">tab 1, row 0, @0x1f6d<br />tl: 5 fb: --H-FL-- lb: 0x0 cc: 2<br />col 0: [ 5] 65 79 67 6c 65<br />col 1: [ 4] 74 65 73 74<br />bindmp: 2c 00 01 02 00<br />tab 1, row 1, @0x1f68<br />tl: 5 fb: --H-FL-- lb: 0x0 cc: 2<br />col 0: [ 5] 65 79 67 6c 65<br />col 1: [ 4] 74 65 73 74<br />bindmp: 2c 00 01 02 00</td>
        </tr>
    </tbody>
</table>
<p>这里的bindmp就是指针。</p>
<p>关于压缩表存储结构的进一步探讨可以参考:</p>
<p>biti_rainy 的 关于 9iR2 的 compress table 的研究 <br /><a href="http://www.itpub.net/showthread.php?threadid=197403">http://www.itpub.net/showthread.php?threadid=197403</a></p>
<p>fuyuncat 的 数据段压缩（Data Segment Compression）浅析<br /><a href="http://fuyuncat.itpub.net/post/5203/45991">http://fuyuncat.itpub.net/post/5203/45991</a></p>
<p>压缩表显然是通过CPU换取存储，存储的缩减必然导致存储和查询时压缩和解压缩的CPU消耗。<br />但是，I/O操作得以节约，我们看一下对以上2个表执行全表扫描的比较：</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; set autotrace on<br />SQL&gt; select count(*) from test;</p>
            <p>COUNT(*)<br />----------<br />10000</p>
            <p>Execution Plan<br />----------------------------------------------------------<br />0 SELECT STATEMENT Optimizer=CHOOSE (Cost=4 Card=1)<br />1 0 SORT (AGGREGATE)<br />2 1 TABLE ACCESS (FULL) OF 'TEST' (Cost=4 Card=10000)</p>
            <p>Statistics<br />----------------------------------------------------------<br />0 recursive calls<br />0 db block gets<br />31 consistent gets<br />0 physical reads<br />0 redo size<br />379 bytes sent via SQL*Net to client<br />503 bytes received via SQL*Net from client<br />2 SQL*Net roundtrips to/from client<br />0 sorts (memory)<br />0 sorts (disk)<br />1 rows processed</p>
            <p>SQL&gt; select count(*) from test_compress;<br />COUNT(*)<br />----------<br />10000</p>
            <p><br />Execution Plan<br />----------------------------------------------------------<br />0 SELECT STATEMENT Optimizer=CHOOSE (Cost=3 Card=1)<br />1 0 SORT (AGGREGATE)<br />2 1 TABLE ACCESS (FULL) OF 'TEST_COMPRESS' (Cost=3 Card=10000)</p>
            <p>Statistics<br />----------------------------------------------------------<br />0 recursive calls<br />0 db block gets<br />17 consistent gets<br />0 physical reads<br />0 redo size<br />379 bytes sent via SQL*Net to client<br />503 bytes received via SQL*Net from client<br />2 SQL*Net roundtrips to/from client<br />0 sorts (memory)<br />0 sorts (disk)<br />1 rows processed</p>
            </td>
        </tr>
    </tbody>
</table>
<p>压缩表的一致性读只有17，较常规表的31大大减少。</p>
<p>压缩表是为数据仓库设计的特性，所以并不适合OLTP系统，在发生更新时，压缩表会因行链接而迅速扩展空间使用。<br />请看简单测试:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; update test_compress set c1='oracle' where rownum &lt;10;</p>
            <p>9 rows updated.</p>
            <p>SQL&gt; commit;</p>
            <p>Commit complete.</p>
            <p>SQL&gt; analyze table test_compress compute statistics;</p>
            <p>Table analyzed.</p>
            <p>SQL&gt; select table_name,blocks,EMPTY_BLOCKS from user_tables<br />2 where table_name like 'TEST%';</p>
            <p>TABLE_NAME BLOCKS EMPTY_BLOCKS<br />------------------------------ ---------- ------------<br />TEST 28 4<br />TEST_COMPRESS 24 0</p>
            </td>
        </tr>
    </tbody>
</table>
<p>具体可以参考wanghai 的文章: compress table<br /><a href="http://wzwanghai.spaces.msn.com/blog/cns!56626E237AFBD116!206.entry">http://wzwanghai.spaces.msn.com/blog/cns!56626E237AFBD116!206.entry</a></p>
<p>&nbsp;</p>]]></description>
<link>http://www.eygle.com/archives/2006/06/oracle9ir2_nf_table_compress.html</link>
<guid>http://www.eygle.com/archives/2006/06/oracle9ir2_nf_table_compress.html</guid>
<category>Internal</category>
<pubDate>Mon, 26 Jun 2006 15:27:46 +0800</pubDate>
</item>
<item>
<title>隐含参数_disable_logging的几点说明</title>
<description><![CDATA[<p>在很久以前,曾经介绍过Oracle的一个内部隐含参数<a href="http://www.eygle.com/archives/2005/10/oracle_hidden_disable_logging.html">_disable_logging</a>,看到有朋友论述这个参数,今天忍不住做一点补充说明.</p>
<p>1.当然,隐含有风险,设置请谨慎.</p>
<p>2.最初在9.2.0.6 Solaris版本上,设置该参数会触发Bug:3868748 使得数据库无法启动.</p>
<p>从警告日志中,通常可以获得的错误提示是:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">ORA-07445: exception encountered: <br />core dump [kcrfwcint()+1625] [SIGFPE] [Integer divide by zero] [0x828739D] [] []</td>
        </tr>
    </tbody>
</table>
<p>但是好在这个参数是动态的,在存在Bug版本中,我们可以修改数据库当前值来进行测试:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; alter system set &quot;_disable_logging&quot;=true scope=memory; </p>
            <p>System altered. </p>
            </td>
        </tr>
    </tbody>
</table>
<p>3.这个Bug的影响范围并非全部,9.2.0.6之下,Oracle9.2.0.5,Oracle9.2.0.4等,都不受这个Bug影响.Oracle声称的修正该Bug的版本是Oracle10gR2(我未验正).</p>
<p>4.这个参数在Oracle9.2.0.4版本的Linux/Solaris上是不存在这个Bug的.在我的环境中经过验证,过程请参考(附注1).</p>
<p>5.在归档模式下,设置该参数会导致日志文件损坏.因为在设置该参数与归档原则违背，归档进程无法识别该日志文件格式，会将该日志文件标记为损坏.所以需要谨慎测试,具体请参考(附注2).</p>
<div id="a000827more">
<div id="more">
<p>附注1:Solaris Oracle9.2.0.4设置测试过程:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>$ sqlplus &quot;/ as sysdba&quot;</p>
            <p>SQL*Plus: Release 9.2.0.4.0 - Production on Thu Apr 13 22:51:24 2006</p>
            <p>Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.</p>
            <p><br />Connected to:<br />Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production<br />With the Partitioning option<br />JServer Release 9.2.0.4.0 - Production</p>
            <p>SQL&gt; show parameter disa</p>
            <p>NAME TYPE VALUE<br />------------------------------------ ----------- ------------------------------<br /><strong>_disable_logging boolean FALSE</strong><br />SQL&gt; alter system set &quot;_disable_logging&quot;=true scope=both;</p>
            <p>System altered.</p>
            <p>SQL&gt; shutdown immediate;<br />Database closed.<br />Database dismounted.<br />ORACLE instance shut down.<br />SQL&gt; startup<br />ORACLE instance started.</p>
            <p>Total System Global Area 286755168 bytes<br />Fixed Size 731488 bytes<br />Variable Size 167772160 bytes<br />Database Buffers 117440512 bytes<br />Redo Buffers 811008 bytes<br />Database mounted.<br />Database opened.<br />SQL&gt; show parameter disable</p>
            <p>NAME TYPE VALUE<br />------------------------------------ ----------- ------------------------------<br /><strong>_disable_logging boolean TRUE<br /></strong>SQL&gt; select * from v$version;</p>
            <p>BANNER<br />----------------------------------------------------------------<br />Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production<br />PL/SQL Release 9.2.0.4.0 - Production<br />CORE 9.2.0.3.0 Production<br />TNS for Solaris: Version 9.2.0.4.0 - Production<br />NLSRTL Version 9.2.0.4.0 - Production<br /></p>
            </td>
        </tr>
    </tbody>
</table>
<p>附注2:归档模式下,该参数会导致日志文件损坏.</p>
<p>设置该参数后,切换日志:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; archive log list;<br />Database log mode Archive Mode<br />Automatic archival Enabled<br />Archive destination /opt/oracle/oradata/conner/archive<br />Oldest online log sequence 20<br />Next log sequence to archive 23<br />Current log sequence 23<br />SQL&gt; alter system switch logfile;</p>
            <p>System altered.</p>
            <p>SQL&gt; select group#,status from v$Log;</p>
            <p>GROUP# STATUS<br />---------- ----------------<br />1 INACTIVE<br />2 ACTIVE<br />3 INACTIVE<br />4 CURRENT</p>
            <p>SQL&gt; show parameter disable</p>
            <p>NAME TYPE VALUE<br />------------------------------------ ----------- ------------------------------<br />_disable_logging boolean TRUE</p>
            </td>
        </tr>
    </tbody>
</table>
<p>此时可以在警告日志中看到日志损坏的错误信息:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">Thu Apr 13 23:33:25 2006<br /><strong>ARC0: Evaluating archive log 2 thread 1 sequence 23<br />ARC0: Beginning to archive log 2 thread 1 sequence 23<br />Creating archive destination LOG_ARCHIVE_DEST_1: '/opt/oracle/oradata/conner/archive/1_23.dbf'<br />ARC0: Log corruption near block 3849 change 0 time ?<br />ARC0: All Archive destinations made inactive due to error 354</strong><br />Thu Apr 13 23:33:25 2006<br />Errors in file /opt/oracle/admin/conner/bdump/conner_arc0_21506.trc:<br />ORA-00354: corrupt redo log block header<br />ORA-00353: log corruption near block 3849 change 0 time 04/13/2006 21:13:03<br />ORA-00312: online log 2 thread 1: '/opt/oracle/oradata/conner/redo02.log'<br />ARC0: Archiving not possible: error count exceeded<br />ARC0: Failed to archive log 2 thread 1 sequence 23<br />ARCH: Archival stopped, error occurred. Will continue retrying<br />Thu Apr 13 23:33:26 2006<br />ORACLE Instance conner - Archival Error<br />ARCH: Connecting to console port...<br />Thu Apr 13 23:33:26 2006<br />ORA-16038: log 2 sequence# 23 cannot be archived<br />ORA-00354: corrupt redo log block header<br />ORA-00312: online log 2 thread 1: '/opt/oracle/oradata/conner/redo02.log'<br />ARCH: Connecting to console port...<br />ARCH:<br />Thu Apr 13 23:33:26 2006<br />ORA-16038: log 2 sequence# 23 cannot be archived<br />ORA-00354: corrupt redo log block header<br />ORA-00312: online log 2 thread 1: '/opt/oracle/oradata/conner/redo02.log'<br /></td>
        </tr>
    </tbody>
</table>
</div>
</div>]]></description>
<link>http://www.eygle.com/archives/2006/06/more_about_disable_logging.html</link>
<guid>http://www.eygle.com/archives/2006/06/more_about_disable_logging.html</guid>
<category>Internal</category>
<pubDate>Tue, 20 Jun 2006 11:27:41 +0800</pubDate>
</item>
<item>
<title>时间再次停止运行</title>
<description><![CDATA[<p>今天下班时,同事说,一个数据库上的Job进程不能启动,我登陆上去查看,果然,时间<a href="http://www.eygle.com/case/Job.Can.Not.Execute.Auto.htm">再次</a>停止运行:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; select * from v$timer;</p>
            <p>HSECS<br />----------<br />4294967295</p>
            <p>SQL&gt; /</p>
            <p>HSECS<br />----------<br />4294967295</p>
            </td>
        </tr>
    </tbody>
</table>
<p>此前曾经遭遇这个<a href="http://www.eygle.com/case/Job.Can.Not.Execute.Auto.htm">Bug</a>,当主机持续运行497 days 2 hrs 28 mins 时,数据库系统时间将会停止.</p>
<p>Bug出现:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">$ uptime<br />6:27pm up 497 day(s), 14:35, 6 users, load average: 0.43, 1.21, 2.19</td>
        </tr>
    </tbody>
</table>
<p>这个Bug真是恼人,除了重起主机之外,别无办法.看来虽然9.2.0.4这个版本比较稳定,但是仍然需要考虑升级了.</p>
<p>此Bug在Oracle9.2.0.6中被修正.</p>
<p>在我的Oracle10g环境中,可以看到这个问题已经不再存在.</p>
<p>v$timer计时在溢出后会重新计算:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL*Plus: Release 10.1.0.3.0 - Production on Tue Jun 20 10:21:35 2006</p>
            <p>Copyright (c) 1982, 2004, Oracle. All rights reserved.</p>
            <p><br />Connected to:<br />Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit Production<br />With the Partitioning and Data Mining options</p>
            <p>SQL&gt; select * from v$timer;</p>
            <p>HSECS<br />----------<br />68297932</p>
            <p>SQL&gt; ! uptime<br />10:23am up 504 day(s), 23:31, 1 user, load average: 3.43, 3.37, 2.95</p>
            </td>
        </tr>
    </tbody>
</table>
<p>我们看到,Solaris系统的稳定性还是值得信赖的:)</p>
<p>&nbsp;</p>]]></description>
<link>http://www.eygle.com/archives/2006/06/time_stop_again.html</link>
<guid>http://www.eygle.com/archives/2006/06/time_stop_again.html</guid>
<category>Internal</category>
<pubDate>Fri, 16 Jun 2006 09:38:20 +0800</pubDate>
</item>
<item>
<title>Oracle热备期间的过量Redo生成控制</title>
<description><![CDATA[<p>我们都知道为了防止热备期间的分裂块问题,Oracle在热备过程中会对修改块进行全块的Redo记录.</p>
<p>偶然发现居然还存在一个隐含参数可以控制这个行为:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; SELECT x.ksppinm NAME, y.ksppstvl VALUE, x.ksppdesc describ<br />2 FROM SYS.x$ksppi x, SYS.x$ksppcv y<br />3 WHERE x.inst_id = USERENV ('Instance')<br />4 AND y.inst_id = USERENV ('Instance')<br />5 AND x.indx = y.indx<br />6 AND x.ksppinm LIKE '%&amp;par%'<br />7 /<br />Enter value for par: blocks<br />old 6: AND x.ksppinm LIKE '%&amp;par%'<br />new 6: AND x.ksppinm LIKE '%blocks%'</p>
            <p>NAME VALUE DESCRIB<br />------------------------------ -------------------- -------------------------------------------<br />_log_blocks_during_backup TRUE log block images when changed during backup</p>
            </td>
        </tr>
    </tbody>
</table>
<p>这个参数缺省值为TRUE，设置在热备份期间允许在redo中记录数据块信息，如果数据库块大小等于操作系统块大小，则可以设置该参数为False，减少热备期间数据库的负担（这种情况极为少见）。</p>
<p><font style="BACKGROUND-COLOR: #ffff66"></font></p>]]></description>
<link>http://www.eygle.com/archives/2006/05/oracle_hotbackup_redo.html</link>
<guid>http://www.eygle.com/archives/2006/05/oracle_hotbackup_redo.html</guid>
<category>Internal</category>
<pubDate>Wed, 31 May 2006 08:54:51 +0800</pubDate>
</item>
<item>
<title>使用10203事件跟踪Oracle块清除</title>
<description><![CDATA[<p><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">Oracle</strong>的10203事件可以用来跟踪数据库的块清除（cleanout）操作,从<a href="http://www.eygle.com/internal/Oracle.Diagnostics.Events.list.htm">事件列表</a>中，我们可以知道该时间的含义为：block cleanout 。</p>
<p>该事件需要在系统级设置，重启数据库后生效：</p>
<p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; alter system set event=&quot;10203 trace name context forever&quot; scope=spfile;</p>
            <p>System altered.</p>
            <p>SQL&gt; shutdown immediate;<br />Database closed.<br />Database dismounted.<br /><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">ORACLE</strong> instance shut down.<br />SQL&gt; startup<br /><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">ORACLE</strong> instance started.</p>
            <p>Total System Global Area&nbsp; 126948772 bytes<br />Fixed Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 452004 bytes<br />Variable Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 92274688 bytes<br />Database Buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 33554432 bytes<br />Redo Buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 667648 bytes<br />Database mounted.<br />Database opened.</p>
            <p>SQL&gt; show parameter event</p>
            <p>NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VALUE<br />------------------------------------ ----------- --------------------------------<br />event&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 10203 trace name context forever</p>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>在跟踪文件中，我们可以发现类似如下的block cleanout 信息：</p>
<p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">Begin cleaning out block ...<br />Found all committed transactions<br />Block cleanout record, scn:&nbsp; 0xffff.ffffffff ver: 0x01 opt: 0x02, entries follow...<br />&nbsp; itli: 1&nbsp; flg: 2&nbsp; scn: 0x0819.0045cd54<br />Block cleanout under the cache...<br />Block cleanout record, scn:&nbsp; 0x0819.0045cea1 ver: 0x01 opt: 0x02, entries follow...<br />&nbsp; itli: 1&nbsp; flg: 2&nbsp; scn: 0x0819.0045cd54<br />... clean out dump complete.</td>
        </tr>
    </tbody>
</table>
</p>
<p>&nbsp;</p>]]></description>
<link>http://www.eygle.com/archives/2006/04/event_10203_cleanout.html</link>
<guid>http://www.eygle.com/archives/2006/04/event_10203_cleanout.html</guid>
<category>Internal</category>
<pubDate>Thu, 20 Apr 2006 17:04:22 +0800</pubDate>
</item>
<item>
<title>_disable_logging如何禁用日志</title>
<description><![CDATA[<p>在非归档模式下(<a href="http://www.eygle.com/archives/2006/04/more_about_disable_logging.html">归档模式会导致日志损坏</a>),使用_disable_logging可以禁止日志的生成,从而可以提高某些特殊操作(如批量加载或Benchmark测试等)的性能.</p>
<p>我们可以来看一下这个禁止是如何完成的.</p>
<p>启动2个Session,一个用于管理,一个用于测试.</p>
<p>1.Session 1 ,使用SYS用户连接数据库,当前_disable_logging未设置,数据库处于正常状态</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>$ sqlplus &quot;/ as sysdba&quot;</p>
            <p>SQL*Plus: Release 9.2.0.4.0 - Production on Fri Apr 14 09:30:42 2006</p>
            <p>Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.</p>
            <p><br />Connected to:<br />Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production<br />With the Partitioning option<br />JServer Release 9.2.0.4.0 - Production</p>
            <p>SQL&gt; col member for a40<br />SQL&gt; select * from v$logfile;</p>
            <p>GROUP# STATUS TYPE MEMBER<br />---------- ------- ------- ----------------------------------------<br />1 ONLINE /opt/oracle9/oradata/testora9/redo01.log<br />2 ONLINE /opt/oracle9/oradata/testora9/redo02.log<br />3 ONLINE /opt/oracle9/oradata/testora9/redo03.log</p>
            <p>SQL&gt; alter system switch logfile;</p>
            <p>System altered.</p>
            <p>SQL&gt; select * from v$log;</p>
            <p>GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM<br />---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------<br />1 1 148 104857600 1 NO CURRENT 262708457 14-APR-06<br />2 1 146 104857600 1 NO INACTIVE 262662667 14-APR-06<br />3 1 147 104857600 1 NO ACTIVE 262675537 14-APR-06</p>
            </td>
        </tr>
    </tbody>
</table>
<p>2.Session2通过SCOTT用户连接,执行如下更新:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; connect scott/tiger<br />Connected.</p>
            <p>SQL&gt; update emp set sal=3000 where empno=7788;</p>
            <p>1 row updated.</p>
            <p>SQL&gt; commit;</p>
            <p>Commit complete.</p>
            </td>
        </tr>
    </tbody>
</table>
<div id="a000828more">
<div id="more">
<p>3.在Session转储REDO日志</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; ALTER SYSTEM DUMP LOGFILE '/opt/oracle9/oradata/testora9/redo01.log';</p>
            <p>System altered.</p>
            </td>
        </tr>
    </tbody>
</table>
<p>4.观察跟踪文件,记录正常状态下的REDO信息</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>$ ls<br />testora9_ora_16037.trc<br />$ cat *<br />/opt/oracle9/admin/testora9/udump/testora9_ora_16037.trc<br />Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production<br />With the Partitioning option<br />JServer Release 9.2.0.4.0 - Production<br />ORACLE_HOME = /opt/oracle9/product/9.2.0<br />System name: SunOS<br />Node name: testdbserver.hurray.com.cn<br />Release: 5.8<br />Version: Generic_108528-25<br />Machine: sun4u<br />Instance name: testora9<br />Redo thread mounted by this instance: 1<br />Oracle process number: 15<br />Unix process pid: 16037, image: oracle@testdbserver.hurray.com.cn (TNS V1-V3)</p>
            <p>*** 2006-04-14 09:32:01.356<br />*** SESSION ID:(17.3524) 2006-04-14 09:32:01.340<br /><br />DUMP OF REDO FROM FILE '/opt/oracle9/oradata/testora9/redo01.log'<br />Opcodes *.*<br />DBA's: (file # 0, block # 0) thru (file # 65534, block # 4194303)<br />RBA's: 0x000000.00000000.0000 thru 0xffffffff.ffffffff.ffff<br />SCN's scn: 0x0000.00000000 thru scn: 0xffff.ffffffff<br />Times: creation thru eternity<br />FILE HEADER:<br />Software vsn=153092096=0x9200000, Compatibility Vsn=153092096=0x9200000<br />Db ID=1628068176=0x610a5950, Db Name='TESTORA9'<br />Activation ID=1628067152=0x610a5550<br />Control Seq=1161=0x489, File size=204800=0x32000<br />File Number=1, Blksiz=512, File Type=2 LOG<br />descrip:&quot;Thread 0001, Seq# 0000000148, SCN 0x00000fa89ce9-0xffffffffffff&quot;<br />thread: 1 nab: 0xffffffff seq: 0x00000094 hws: 0x1 eot: 1 dis: 0<br />reset logs count: 0x1f435110 scn: 0x0000.00000001<br />Low scn: 0x0000.0fa89ce9 04/14/2006 09:31:06<br />Next scn: 0xffff.ffffffff 01/01/1988 00:00:00<br />Enabled scn: 0x0000.00000001 04/26/2004 15:56:10<br />Thread closed scn: 0x0000.0fa89ce9 04/14/2006 09:31:06<br />Log format vsn: 0x8000000 Disk cksum: 0x9930 Calc cksum: 0x9930<br />Terminal Recovery Stamp scn: 0x0000.00000000 01/01/1988 00:00:00<br />Most recent redo scn: 0x0000.00000000<br />Largest LWN: 0 blocks<br />End-of-redo stream : No<br />Unprotected mode<br />Miscellaneous flags: 0x0<br /><br />REDO RECORD - Thread:1 RBA: 0x000094.00000002.0010 LEN: 0x01b0 VLD: 0x01<br />SCN: 0x0000.0fa89cf0 SUBSCN: 1 04/14/2006 09:31:30<br />CHANGE #1 TYP:0 CLS:33 AFN:2 DBA:0x00800089 SCN:0x0000.0fa89cca SEQ: 1 OP:5.2<br />ktudh redo: slt: 0x000f sqn: 0x00009c89 flg: 0x000a siz: 132 fbi: 0<br />uba: 0x00800559.0352.01 pxid: 0x0000.000.00000000<br />CHANGE #2 TYP:1 CLS:34 AFN:2 DBA:0x00800559 SCN:0x0000.0fa89cf0 SEQ: 1 OP:5.1<br />ktudb redo: siz: 132 spc: 0 flg: 0x000a seq: 0x0352 rec: 0x01<br />xid: 0x0009.00f.00009c89 <br />ktubl redo: slt: 15 rci: 0 opc: 11.1 objn: 30359 objd: 30359 tsn: 0<br />Undo type: Regular undo Begin trans Last buffer split: No <br />Temp Object: No <br />Tablespace Undo: No <br />0x00000000 prev ctl uba: 0x00800558.0352.57 <br />prev ctl max cmt scn: 0x0000.0fa89887 prev tx cmt scn: 0x0000.0fa8988b <br />KDO undo record:<br />KTB Redo <br />op: 0x04 ver: 0x01 <br />op: L itl: xid: 0x0005.01e.00009810 uba: 0x00800615.032f.26<br />flg: C--- lkc: 0 scn: 0x0000.0f92af59<br />KDO Op code: URP row dependencies Disabled<br />xtype: XA bdba: 0x0040a482 hdba: 0x0040a481<br />itli: 1 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 7(0x7) flag: 0x2c lock: 0 ckix: 0<br />ncol: 8 nnew: 1 size: 0<br />col 5: [ 2] c2 29<br />CHANGE #3 TYP:2 CLS: 1 AFN:1 DBA:0x0040a482 SCN:0x0000.0f92ced1 SEQ: 1 OP:11.5<br />KTB Redo <br />op: 0x11 ver: 0x01 <br />op: F xid: 0x0009.00f.00009c89 uba: 0x00800559.0352.01<br />Block cleanout record, scn: 0x0000.0fa89cf0 ver: 0x01 opt: 0x02, entries follow...<br />itli: 2 flg: 2 scn: 0x0000.0f92ced1<br />KDO Op code: URP row dependencies Disabled<br />xtype: XA bdba: 0x0040a482 hdba: 0x0040a481<br />itli: 1 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 7(0x7) flag: 0x2c lock: 1 ckix: 0<br />ncol: 8 nnew: 1 size: 0<br />col 5: [ 2] c2 1f<br />CHANGE #4 MEDIA RECOVERY MARKER SCN:0x0000.00000000 SEQ: 0 OP:5.20<br />session number = 16<br />serial number = 651<br />transaction name = <br /><br />REDO RECORD - Thread:1 RBA: 0x000094.00000002.01c0 LEN: 0x0054 VLD: 0x01<br />SCN: 0x0000.0fa89cf1 SUBSCN: 1 04/14/2006 09:31:30<br />CHANGE #1 TYP:0 CLS:33 AFN:2 DBA:0x00800089 SCN:0x0000.0fa89cf0 SEQ: 1 OP:5.4<br />ktucm redo: slt: 0x000f sqn: 0x00009c89 srt: 0 sta: 9 flg: 0x2 <br />ktucf redo: uba: 0x00800559.0352.01 ext: 2 spc: 8016 fbi: 0 <br /><br />REDO RECORD - Thread:1 RBA: 0x000094.00000004.0010 LEN: 0x01f4 VLD: 0x01<br />SCN: 0x0000.0fa89cf2 SUBSCN: 1 04/14/2006 09:31:31<br />CHANGE #1 TYP:0 CLS:21 AFN:2 DBA:0x00800029 SCN:0x0000.0fa89ccc SEQ: 1 OP:5.2<br />ktudh redo: slt: 0x001b sqn: 0x00009c9b flg: 0x0012 siz: 108 fbi: 0<br />uba: 0x0080046b.0345.40 pxid: 0x0000.000.00000000<br />CHANGE #2 TYP:0 CLS:22 AFN:2 DBA:0x0080046b SCN:0x0000.0fa89ccb SEQ: 1 OP:5.1<br />ktudb redo: siz: 108 spc: 2908 flg: 0x0012 seq: 0x0345 rec: 0x40<br />xid: 0x0003.01b.00009c9b <br />ktubl redo: slt: 27 rci: 0 opc: 11.1 objn: 3643 objd: 3643 tsn: 0<br />Undo type: Regular undo Begin trans Last buffer split: No <br />Temp Object: No <br />Tablespace Undo: No <br />0x00000000 prev ctl uba: 0x0080046b.0345.3f <br />prev ctl max cmt scn: 0x0000.0fa89888 prev tx cmt scn: 0x0000.0fa8988d <br />KDO undo record:<br />KTB Redo <br />op: 0x04 ver: 0x01 <br />op: L itl: xid: 0x0002.021.0000a088 uba: 0x0080091e.0714.47<br />flg: C--- lkc: 0 scn: 0x0000.0fa89ce0<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f7a hdba: 0x00401f79<br />itli: 1 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 0 to: 0<br />CHANGE #3 TYP:2 CLS: 1 AFN:1 DBA:0x00401f7a SCN:0x0000.0fa89ce3 SEQ: 1 OP:11.4<br />KTB Redo <br />op: 0x11 ver: 0x01 <br />op: F xid: 0x0003.01b.00009c9b uba: 0x0080046b.0345.40<br />Block cleanout record, scn: 0x0000.0fa89cf2 ver: 0x01 opt: 0x02, entries follow...<br />itli: 1 flg: 2 scn: 0x0000.0fa89ce0<br />itli: 2 flg: 2 scn: 0x0000.0fa89ce3<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f7a hdba: 0x00401f79<br />itli: 1 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 0 to: 1<br />CHANGE #4 MEDIA RECOVERY MARKER SCN:0x0000.00000000 SEQ: 0 OP:5.19<br />session number = 8<br />serial number = 1<br />current username = SYS<br />login username = <br />client info = <br />OS username = oracle9<br />Machine name = testdbserver.hurray.com.cn<br />OS terminal = UNKNOWN<br />OS process id = 2053<br />OS program name = oracle@testdbserver.hurray.com.cn (QMN0)<br />transaction name = <br /><br />REDO RECORD - Thread:1 RBA: 0x000094.00000005.0014 LEN: 0x00dc VLD: 0x01<br />SCN: 0x0000.0fa89cf2 SUBSCN: 1 04/14/2006 09:31:31<br />CHANGE #1 TYP:0 CLS:22 AFN:2 DBA:0x0080046b SCN:0x0000.0fa89cf2 SEQ: 1 OP:5.1<br />ktudb redo: siz: 84 spc: 2798 flg: 0x0022 seq: 0x0345 rec: 0x41<br />xid: 0x0003.01b.00009c9b <br />ktubu redo: slt: 27 rci: 64 opc: 11.1 objn: 3635 objd: 3635 tsn: 0<br />Undo type: Regular undo Undo type: Last buffer split: No <br />Tablespace Undo: No <br />0x00000000<br />KDO undo record:<br />KTB Redo <br />op: 0x04 ver: 0x01 <br />op: L itl: xid: 0x0008.01b.00009c85 uba: 0x008007a3.037e.0b<br />flg: C--- lkc: 0 scn: 0x0000.0fa89ce3<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f3a hdba: 0x00401f39<br />itli: 1 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 0 to: 0<br />CHANGE #2 TYP:2 CLS: 1 AFN:1 DBA:0x00401f3a SCN:0x0000.0fa89ce5 SEQ: 1 OP:11.4<br />KTB Redo <br />op: 0x01 ver: 0x01 <br />op: F xid: 0x0003.01b.00009c9b uba: 0x0080046b.0345.41<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f3a hdba: 0x00401f39<br />itli: 1 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 0 to: 1<br /><br />REDO RECORD - Thread:1 RBA: 0x000094.00000005.00f0 LEN: 0x0054 VLD: 0x01<br />SCN: 0x0000.0fa89cf3 SUBSCN: 1 04/14/2006 09:31:31<br />CHANGE #1 TYP:0 CLS:21 AFN:2 DBA:0x00800029 SCN:0x0000.0fa89cf2 SEQ: 1 OP:5.4<br />ktucm redo: slt: 0x001b sqn: 0x00009c9b srt: 0 sta: 9 flg: 0x2 <br />ktucf redo: uba: 0x0080046b.0345.41 ext: 2 spc: 2712 fbi: 0 <br /><br />REDO RECORD - Thread:1 RBA: 0x000094.00000006.0010 LEN: 0x0188 VLD: 0x01<br />SCN: 0x0000.0fa89cf5 SUBSCN: 1 04/14/2006 09:31:31<br />CHANGE #1 TYP:0 CLS:27 AFN:2 DBA:0x00800059 SCN:0x0000.0fa89ccd SEQ: 1 OP:5.2<br />ktudh redo: slt: 0x0020 sqn: 0x00009c72 flg: 0x0012 siz: 108 fbi: 0<br />uba: 0x0080027b.0352.1d pxid: 0x0000.000.00000000<br />CHANGE #2 TYP:0 CLS:28 AFN:2 DBA:0x0080027b SCN:0x0000.0fa89ccc SEQ: 1 OP:5.1<br />ktudb redo: siz: 108 spc: 5718 flg: 0x0012 seq: 0x0352 rec: 0x1d<br />xid: 0x0006.020.00009c72 <br />ktubl redo: slt: 32 rci: 0 opc: 11.1 objn: 3635 objd: 3635 tsn: 0<br />Undo type: Regular undo Begin trans Last buffer split: No <br />Temp Object: No <br />Tablespace Undo: No <br />0x00000000 prev ctl uba: 0x0080027b.0352.1c <br />prev ctl max cmt scn: 0x0000.0fa8988a prev tx cmt scn: 0x0000.0fa8988e <br />KDO undo record:<br />KTB Redo <br />op: 0x04 ver: 0x01 <br />op: L itl: xid: 0x0002.01a.0000a089 uba: 0x0080091e.0714.49<br />flg: C--- lkc: 0 scn: 0x0000.0fa89ce5<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f3a hdba: 0x00401f39<br />itli: 2 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 0 to: 0<br />CHANGE #3 TYP:2 CLS: 1 AFN:1 DBA:0x00401f3a SCN:0x0000.0fa89cf3 SEQ: 1 OP:11.4<br />KTB Redo <br />op: 0x11 ver: 0x01 <br />op: F xid: 0x0006.020.00009c72 uba: 0x0080027b.0352.1d<br />Block cleanout record, scn: 0x0000.0fa89cf5 ver: 0x01 opt: 0x02, entries follow...<br />itli: 1 flg: 2 scn: 0x0000.0fa89cf3<br />itli: 2 flg: 2 scn: 0x0000.0fa89ce5<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f3a hdba: 0x00401f39<br />itli: 2 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 0 to: 2<br />CHANGE #4 MEDIA RECOVERY MARKER SCN:0x0000.00000000 SEQ: 0 OP:5.20<br />session number = 8<br />serial number = 1<br />transaction name = <br /><br />REDO RECORD - Thread:1 RBA: 0x000094.00000006.0198 LEN: 0x0054 VLD: 0x01<br />SCN: 0x0000.0fa89cf6 SUBSCN: 1 04/14/2006 09:31:31<br />CHANGE #1 TYP:0 CLS:27 AFN:2 DBA:0x00800059 SCN:0x0000.0fa89cf5 SEQ: 1 OP:5.4<br />ktucm redo: slt: 0x0020 sqn: 0x00009c72 srt: 0 sta: 9 flg: 0x2 <br />ktucf redo: uba: 0x0080027b.0352.1d ext: 2 spc: 5608 fbi: 0 <br /><br />REDO RECORD - Thread:1 RBA: 0x000094.00000007.0010 LEN: 0x00d4 VLD: 0x01<br />SCN: 0x0000.0fa89cf7 SUBSCN: 1 04/14/2006 09:31:31<br />CHANGE #1 TYP:0 CLS:33 AFN:2 DBA:0x00800089 SCN:0x0000.0fa89cf1 SEQ: 1 OP:5.2<br />ktudh redo: slt: 0x0027 sqn: 0x00009c88 flg: 0x0011 siz: 52 fbi: 0<br />uba: 0x00800559.0352.02 pxid: 0x0000.000.00000000<br />CHANGE #2 TYP:0 CLS:34 AFN:2 DBA:0x00800559 SCN:0x0000.0fa89cf0 SEQ: 2 OP:5.1<br />ktudb redo: siz: 52 spc: 8016 flg: 0x0012 seq: 0x0352 rec: 0x02<br />xid: 0x0009.027.00009c88 <br />ktubl redo: slt: 39 rci: 0 opc: 5.7 objn: 0 objd: 0 tsn: 0<br />Undo type: Regular undo Begin trans Last buffer split: No <br />Temp Object: No <br />Tablespace Undo: No <br />0x00000000 prev ctl uba: 0x00800559.0352.01 <br />prev ctl max cmt scn: 0x0000.0fa8988b prev tx cmt scn: 0x0000.0fa89894 <br />CHANGE #3 MEDIA RECOVERY MARKER SCN:0x0000.00000000 SEQ: 0 OP:5.20<br />session number = 8<br />serial number = 1<br />transaction name = <br /><br />REDO RECORD - Thread:1 RBA: 0x000094.00000007.00e4 LEN: 0x0118 VLD: 0x01<br />SCN: 0x0000.0fa89cf8 SUBSCN: 1 04/14/2006 09:31:31<br />CHANGE #1 TYP:0 CLS:33 AFN:2 DBA:0x00800089 SCN:0x0000.0fa89cf7 SEQ: 1 OP:5.2<br />ktudh redo: slt: 0x0027 sqn: 0x00000000 flg: 0x0002 siz: 84 fbi: 0<br />uba: 0x00800559.0352.03 pxid: 0x0000.000.00000000<br />CHANGE #2 TYP:0 CLS:34 AFN:2 DBA:0x00800559 SCN:0x0000.0fa89cf7 SEQ: 1 OP:5.1<br />ktudb redo: siz: 84 spc: 7962 flg: 0x0022 seq: 0x0352 rec: 0x03<br />xid: 0x0009.027.00009c88 <br />ktubu redo: slt: 39 rci: 0 opc: 11.1 objn: 3643 objd: 3643 tsn: 0<br />Undo type: Regular undo Undo type: Last buffer split: No <br />Tablespace Undo: No <br />0x00000000<br />KDO undo record:<br />KTB Redo <br />op: 0x04 ver: 0x01 <br />op: L itl: xid: 0x0008.01b.00009c85 uba: 0x008007a3.037e.0a<br />flg: C--- lkc: 0 scn: 0x0000.0fa89ce3<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f7a hdba: 0x00401f79<br />itli: 2 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 1 to: 0<br />CHANGE #3 TYP:2 CLS: 1 AFN:1 DBA:0x00401f7a SCN:0x0000.0fa89cf3 SEQ: 1 OP:11.4<br />KTB Redo <br />op: 0x01 ver: 0x01 <br />op: F xid: 0x0009.027.00009c88 uba: 0x00800559.0352.03<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f7a hdba: 0x00401f79<br />itli: 2 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 1 to: 2<br /><br />REDO RECORD - Thread:1 RBA: 0x000094.00000008.0010 LEN: 0x00dc VLD: 0x01<br />SCN: 0x0000.0fa89cf8 SUBSCN: 1 04/14/2006 09:31:31<br />CHANGE #1 TYP:0 CLS:34 AFN:2 DBA:0x00800559 SCN:0x0000.0fa89cf8 SEQ: 1 OP:5.1<br />ktudb redo: siz: 84 spc: 7876 flg: 0x0022 seq: 0x0352 rec: 0x04<br />xid: 0x0009.027.00009c88 <br />ktubu redo: slt: 39 rci: 3 opc: 11.1 objn: 3635 objd: 3635 tsn: 0<br />Undo type: Regular undo Undo type: Last buffer split: No <br />Tablespace Undo: No <br />0x00000000<br />KDO undo record:<br />KTB Redo <br />op: 0x04 ver: 0x01 <br />op: L itl: xid: 0x0003.01b.00009c9b uba: 0x0080046b.0345.41<br />flg: C--- lkc: 0 scn: 0x0000.0fa89cf3<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f3a hdba: 0x00401f39<br />itli: 1 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 1 to: 0<br />CHANGE #2 TYP:2 CLS: 1 AFN:1 DBA:0x00401f3a SCN:0x0000.0fa89cf6 SEQ: 1 OP:11.4<br />KTB Redo <br />op: 0x01 ver: 0x01 <br />op: F xid: 0x0009.027.00009c88 uba: 0x00800559.0352.04<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f3a hdba: 0x00401f39<br />itli: 1 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 1 to: 1<br /><br />REDO RECORD - Thread:1 RBA: 0x000094.00000008.00ec LEN: 0x0054 VLD: 0x01<br />SCN: 0x0000.0fa89cf9 SUBSCN: 1 04/14/2006 09:31:31<br />CHANGE #1 TYP:0 CLS:33 AFN:2 DBA:0x00800089 SCN:0x0000.0fa89cf8 SEQ: 1 OP:5.4<br />ktucm redo: slt: 0x0027 sqn: 0x00009c88 srt: 0 sta: 9 flg: 0x2 <br />ktucf redo: uba: 0x00800559.0352.04 ext: 2 spc: 7790 fbi: 0 <br /><br />REDO RECORD - Thread:1 RBA: 0x000094.00000008.0140 LEN: 0x0188 VLD: 0x01<br />SCN: 0x0000.0fa89cfa SUBSCN: 1 04/14/2006 09:31:31<br />CHANGE #1 TYP:0 CLS:21 AFN:2 DBA:0x00800029 SCN:0x0000.0fa89cf3 SEQ: 1 OP:5.2<br />ktudh redo: slt: 0x001a sqn: 0x00009c9b flg: 0x0012 siz: 108 fbi: 0<br />uba: 0x0080046b.0345.42 pxid: 0x0000.000.00000000<br />CHANGE #2 TYP:0 CLS:22 AFN:2 DBA:0x0080046b SCN:0x0000.0fa89cf2 SEQ: 2 OP:5.1<br />ktudb redo: siz: 108 spc: 2712 flg: 0x0012 seq: 0x0345 rec: 0x42<br />xid: 0x0003.01a.00009c9b <br />ktubl redo: slt: 26 rci: 0 opc: 11.1 objn: 3635 objd: 3635 tsn: 0<br />Undo type: Regular undo Begin trans Last buffer split: No <br />Temp Object: No <br />Tablespace Undo: No <br />0x00000000 prev ctl uba: 0x0080046b.0345.40 <br />prev ctl max cmt scn: 0x0000.0fa8988d prev tx cmt scn: 0x0000.0fa898e6 <br />KDO undo record:<br />KTB Redo <br />op: 0x04 ver: 0x01 <br />op: L itl: xid: 0x0006.020.00009c72 uba: 0x0080027b.0352.1d<br />flg: C--- lkc: 0 scn: 0x0000.0fa89cf6<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f3a hdba: 0x00401f39<br />itli: 2 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 1 to: 0<br />CHANGE #3 TYP:2 CLS: 1 AFN:1 DBA:0x00401f3a SCN:0x0000.0fa89cf9 SEQ: 1 OP:11.4<br />KTB Redo <br />op: 0x11 ver: 0x01 <br />op: F xid: 0x0003.01a.00009c9b uba: 0x0080046b.0345.42<br />Block cleanout record, scn: 0x0000.0fa89cfa ver: 0x01 opt: 0x02, entries follow...<br />itli: 1 flg: 2 scn: 0x0000.0fa89cf9<br />itli: 2 flg: 2 scn: 0x0000.0fa89cf6<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f3a hdba: 0x00401f39<br />itli: 2 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 1 to: 2<br />CHANGE #4 MEDIA RECOVERY MARKER SCN:0x0000.00000000 SEQ: 0 OP:5.20<br />session number = 8<br />serial number = 1<br />transaction name = <br /><br />REDO RECORD - Thread:1 RBA: 0x000094.00000009.00d8 LEN: 0x0054 VLD: 0x01<br />SCN: 0x0000.0fa89cfb SUBSCN: 1 04/14/2006 09:31:31<br />CHANGE #1 TYP:0 CLS:21 AFN:2 DBA:0x00800029 SCN:0x0000.0fa89cfa SEQ: 1 OP:5.4<br />ktucm redo: slt: 0x001a sqn: 0x00009c9b srt: 0 sta: 9 flg: 0x2 <br />ktucf redo: uba: 0x0080046b.0345.42 ext: 2 spc: 2602 fbi: 0 <br /><br />REDO RECORD - Thread:1 RBA: 0x000094.00000009.012c LEN: 0x00d4 VLD: 0x01<br />SCN: 0x0000.0fa89cfb SUBSCN: 1 04/14/2006 09:31:31<br />CHANGE #1 TYP:0 CLS:27 AFN:2 DBA:0x00800059 SCN:0x0000.0fa89cf6 SEQ: 1 OP:5.2<br />ktudh redo: slt: 0x000c sqn: 0x00009c72 flg: 0x0011 siz: 52 fbi: 0<br />uba: 0x0080027b.0352.1e pxid: 0x0000.000.00000000<br />CHANGE #2 TYP:0 CLS:28 AFN:2 DBA:0x0080027b SCN:0x0000.0fa89cf5 SEQ: 1 OP:5.1<br />ktudb redo: siz: 52 spc: 5608 flg: 0x0012 seq: 0x0352 rec: 0x1e<br />xid: 0x0006.00c.00009c72 <br />ktubl redo: slt: 12 rci: 0 opc: 5.7 objn: 0 objd: 0 tsn: 0<br />Undo type: Regular undo Begin trans Last buffer split: No <br />Temp Object: No <br />Tablespace Undo: No <br />0x00000000 prev ctl uba: 0x0080027b.0352.1d <br />prev ctl max cmt scn: 0x0000.0fa8988e prev tx cmt scn: 0x0000.0fa89902 <br />CHANGE #3 MEDIA RECOVERY MARKER SCN:0x0000.00000000 SEQ: 0 OP:5.20<br />session number = 8<br />serial number = 1<br />transaction name = <br /><br />REDO RECORD - Thread:1 RBA: 0x000094.0000000a.0010 LEN: 0x0148 VLD: 0x01<br />SCN: 0x0000.0fa89cfb SUBSCN: 1 04/14/2006 09:31:31<br />CHANGE #1 TYP:0 CLS:27 AFN:2 DBA:0x00800059 SCN:0x0000.0fa89cfb SEQ: 1 OP:5.2<br />ktudh redo: slt: 0x000c sqn: 0x00000000 flg: 0x0002 siz: 84 fbi: 0<br />uba: 0x0080027b.0352.1f pxid: 0x0000.000.00000000<br />CHANGE #2 TYP:0 CLS:28 AFN:2 DBA:0x0080027b SCN:0x0000.0fa89cfb SEQ: 1 OP:5.1<br />ktudb redo: siz: 84 spc: 5554 flg: 0x0022 seq: 0x0352 rec: 0x1f<br />xid: 0x0006.00c.00009c72 <br />ktubu redo: slt: 12 rci: 0 opc: 11.1 objn: 3643 objd: 3643 tsn: 0<br />Undo type: Regular undo Undo type: Last buffer split: No <br />Tablespace Undo: No <br />0x00000000<br />KDO undo record:<br />KTB Redo <br />op: 0x04 ver: 0x01 <br />op: L itl: xid: 0x0003.01b.00009c9b uba: 0x0080046b.0345.40<br />flg: C--- lkc: 0 scn: 0x0000.0fa89cf3<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f7a hdba: 0x00401f79<br />itli: 1 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 2 to: 0<br />CHANGE #3 TYP:2 CLS: 1 AFN:1 DBA:0x00401f7a SCN:0x0000.0fa89cf9 SEQ: 1 OP:11.4<br />KTB Redo <br />op: 0x11 ver: 0x01 <br />op: F xid: 0x0006.00c.00009c72 uba: 0x0080027b.0352.1f<br />Block cleanout record, scn: 0x0000.0fa89cfb ver: 0x01 opt: 0x02, entries follow...<br />itli: 1 flg: 2 scn: 0x0000.0fa89cf3<br />itli: 2 flg: 2 scn: 0x0000.0fa89cf9<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f7a hdba: 0x00401f79<br />itli: 1 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 2 to: 1<br /><br />REDO RECORD - Thread:1 RBA: 0x000094.0000000a.0158 LEN: 0x00dc VLD: 0x01<br />SCN: 0x0000.0fa89cfb SUBSCN: 1 04/14/2006 09:31:31<br />CHANGE #1 TYP:0 CLS:28 AFN:2 DBA:0x0080027b SCN:0x0000.0fa89cfb SEQ: 2 OP:5.1<br />ktudb redo: siz: 84 spc: 5468 flg: 0x0022 seq: 0x0352 rec: 0x20<br />xid: 0x0006.00c.00009c72 <br />ktubu redo: slt: 12 rci: 31 opc: 11.1 objn: 3635 objd: 3635 tsn: 0<br />Undo type: Regular undo Undo type: Last buffer split: No <br />Tablespace Undo: No <br />0x00000000<br />KDO undo record:<br />KTB Redo <br />op: 0x04 ver: 0x01 <br />op: L itl: xid: 0x0009.027.00009c88 uba: 0x00800559.0352.04<br />flg: C--- lkc: 0 scn: 0x0000.0fa89cf9<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f3a hdba: 0x00401f39<br />itli: 1 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 2 to: 0<br />CHANGE #2 TYP:2 CLS: 1 AFN:1 DBA:0x00401f3a SCN:0x0000.0fa89cfb SEQ: 1 OP:11.4<br />KTB Redo <br />op: 0x01 ver: 0x01 <br />op: F xid: 0x0006.00c.00009c72 uba: 0x0080027b.0352.20<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f3a hdba: 0x00401f39<br />itli: 1 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 2 to: 1<br /><br />REDO RECORD - Thread:1 RBA: 0x000094.0000000b.0044 LEN: 0x0054 VLD: 0x01<br />SCN: 0x0000.0fa89cfc SUBSCN: 1 04/14/2006 09:31:31<br />CHANGE #1 TYP:0 CLS:27 AFN:2 DBA:0x00800059 SCN:0x0000.0fa89cfb SEQ: 2 OP:5.4<br />ktucm redo: slt: 0x000c sqn: 0x00009c72 srt: 0 sta: 9 flg: 0x2 <br />ktucf redo: uba: 0x0080027b.0352.20 ext: 2 spc: 5382 fbi: 0 <br /><br />REDO RECORD - Thread:1 RBA: 0x000094.0000000b.0098 LEN: 0x0188 VLD: 0x01<br />SCN: 0x0000.0fa89cfd SUBSCN: 1 04/14/2006 09:31:31<br />CHANGE #1 TYP:0 CLS:33 AFN:2 DBA:0x00800089 SCN:0x0000.0fa89cf9 SEQ: 1 OP:5.2<br />ktudh redo: slt: 0x000d sqn: 0x00009c89 flg: 0x0012 siz: 108 fbi: 0<br />uba: 0x00800559.0352.05 pxid: 0x0000.000.00000000<br />CHANGE #2 TYP:0 CLS:34 AFN:2 DBA:0x00800559 SCN:0x0000.0fa89cf8 SEQ: 2 OP:5.1<br />ktudb redo: siz: 108 spc: 7790 flg: 0x0012 seq: 0x0352 rec: 0x05<br />xid: 0x0009.00d.00009c89 <br />ktubl redo: slt: 13 rci: 0 opc: 11.1 objn: 3635 objd: 3635 tsn: 0<br />Undo type: Regular undo Begin trans Last buffer split: No <br />Temp Object: No <br />Tablespace Undo: No <br />0x00000000 prev ctl uba: 0x00800559.0352.02 <br />prev ctl max cmt scn: 0x0000.0fa89894 prev tx cmt scn: 0x0000.0fa89905 <br />KDO undo record:<br />KTB Redo <br />op: 0x04 ver: 0x01 <br />op: L itl: xid: 0x0003.01a.00009c9b uba: 0x0080046b.0345.42<br />flg: C--- lkc: 0 scn: 0x0000.0fa89cfb<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f3a hdba: 0x00401f39<br />itli: 2 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 2 to: 0<br />CHANGE #3 TYP:2 CLS: 1 AFN:1 DBA:0x00401f3a SCN:0x0000.0fa89cfc SEQ: 1 OP:11.4<br />KTB Redo <br />op: 0x11 ver: 0x01 <br />op: F xid: 0x0009.00d.00009c89 uba: 0x00800559.0352.05<br />Block cleanout record, scn: 0x0000.0fa89cfd ver: 0x01 opt: 0x02, entries follow...<br />itli: 1 flg: 2 scn: 0x0000.0fa89cfc<br />itli: 2 flg: 2 scn: 0x0000.0fa89cfb<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f3a hdba: 0x00401f39<br />itli: 2 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 2 to: 2<br />CHANGE #4 MEDIA RECOVERY MARKER SCN:0x0000.00000000 SEQ: 0 OP:5.20<br />session number = 8<br />serial number = 1<br />transaction name = <br /><br />REDO RECORD - Thread:1 RBA: 0x000094.0000000c.0030 LEN: 0x0054 VLD: 0x01<br />SCN: 0x0000.0fa89cfe SUBSCN: 1 04/14/2006 09:31:31<br />CHANGE #1 TYP:0 CLS:33 AFN:2 DBA:0x00800089 SCN:0x0000.0fa89cfd SEQ: 1 OP:5.4<br />ktucm redo: slt: 0x000d sqn: 0x00009c89 srt: 0 sta: 9 flg: 0x2 <br />ktucf redo: uba: 0x00800559.0352.05 ext: 2 spc: 7680 fbi: 0 <br /><br />REDO RECORD - Thread:1 RBA: 0x000094.0000000d.0010 LEN: 0x00d4 VLD: 0x01<br />SCN: 0x0000.0fa89cff SUBSCN: 1 04/14/2006 09:31:37<br />CHANGE #1 TYP:0 CLS:21 AFN:2 DBA:0x00800029 SCN:0x0000.0fa89cfb SEQ: 1 OP:5.2<br />ktudh redo: slt: 0x0017 sqn: 0x00009c9c flg: 0x0011 siz: 52 fbi: 0<br />uba: 0x0080046b.0345.43 pxid: 0x0000.000.00000000<br />CHANGE #2 TYP:0 CLS:22 AFN:2 DBA:0x0080046b SCN:0x0000.0fa89cfa SEQ: 1 OP:5.1<br />ktudb redo: siz: 52 spc: 2602 flg: 0x0012 seq: 0x0345 rec: 0x43<br />xid: 0x0003.017.00009c9c <br />ktubl redo: slt: 23 rci: 0 opc: 5.7 objn: 0 objd: 0 tsn: 0<br />Undo type: Regular undo Begin trans Last buffer split: No <br />Temp Object: No <br />Tablespace Undo: No <br />0x00000000 prev ctl uba: 0x0080046b.0345.42 <br />prev ctl max cmt scn: 0x0000.0fa898e6 prev tx cmt scn: 0x0000.0fa89907 <br />CHANGE #3 MEDIA RECOVERY MARKER SCN:0x0000.00000000 SEQ: 0 OP:5.20<br />session number = 8<br />serial number = 1<br />transaction name = <br /><br />REDO RECORD - Thread:1 RBA: 0x000094.0000000d.00e4 LEN: 0x0118 VLD: 0x01<br />SCN: 0x0000.0fa89cff SUBSCN: 1 04/14/2006 09:31:37<br />CHANGE #1 TYP:0 CLS:21 AFN:2 DBA:0x00800029 SCN:0x0000.0fa89cff SEQ: 1 OP:5.2<br />ktudh redo: slt: 0x0017 sqn: 0x00000000 flg: 0x0002 siz: 84 fbi: 0<br />uba: 0x0080046b.0345.44 pxid: 0x0000.000.00000000<br />CHANGE #2 TYP:0 CLS:22 AFN:2 DBA:0x0080046b SCN:0x0000.0fa89cff SEQ: 1 OP:5.1<br />ktudb redo: siz: 84 spc: 2548 flg: 0x0022 seq: 0x0345 rec: 0x44<br />xid: 0x0003.017.00009c9c <br />ktubu redo: slt: 23 rci: 0 opc: 11.1 objn: 3643 objd: 3643 tsn: 0<br />Undo type: Regular undo Undo type: Last buffer split: No <br />Tablespace Undo: No <br />0x00000000<br />KDO undo record:<br />KTB Redo <br />op: 0x04 ver: 0x01 <br />op: L itl: xid: 0x0009.027.00009c88 uba: 0x00800559.0352.03<br />flg: C--- lkc: 0 scn: 0x0000.0fa89cf9<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f7a hdba: 0x00401f79<br />itli: 2 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 3 to: 0<br />CHANGE #3 TYP:2 CLS: 1 AFN:1 DBA:0x00401f7a SCN:0x0000.0fa89cfc SEQ: 1 OP:11.4<br />KTB Redo <br />op: 0x01 ver: 0x01 <br />op: F xid: 0x0003.017.00009c9c uba: 0x0080046b.0345.44<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f7a hdba: 0x00401f79<br />itli: 2 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 3 to: 2<br /><br />REDO RECORD - Thread:1 RBA: 0x000094.0000000e.0010 LEN: 0x00dc VLD: 0x01<br />SCN: 0x0000.0fa89cff SUBSCN: 1 04/14/2006 09:31:37<br />CHANGE #1 TYP:0 CLS:22 AFN:2 DBA:0x0080046b SCN:0x0000.0fa89cff SEQ: 2 OP:5.1<br />ktudb redo: siz: 84 spc: 2462 flg: 0x0022 seq: 0x0345 rec: 0x45<br />xid: 0x0003.017.00009c9c <br />ktubu redo: slt: 23 rci: 68 opc: 11.1 objn: 3635 objd: 3635 tsn: 0<br />Undo type: Regular undo Undo type: Last buffer split: No <br />Tablespace Undo: No <br />0x00000000<br />KDO undo record:<br />KTB Redo <br />op: 0x04 ver: 0x01 <br />op: L itl: xid: 0x0006.00c.00009c72 uba: 0x0080027b.0352.20<br />flg: C--- lkc: 0 scn: 0x0000.0fa89cfc<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f3a hdba: 0x00401f39<br />itli: 1 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 3 to: 0<br />CHANGE #2 TYP:2 CLS: 1 AFN:1 DBA:0x00401f3a SCN:0x0000.0fa89cfe SEQ: 1 OP:11.4<br />KTB Redo <br />op: 0x01 ver: 0x01 <br />op: F xid: 0x0003.017.00009c9c uba: 0x0080046b.0345.45<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f3a hdba: 0x00401f39<br />itli: 1 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 3 to: 1<br /><br />REDO RECORD - Thread:1 RBA: 0x000094.0000000e.00ec LEN: 0x0054 VLD: 0x01<br />SCN: 0x0000.0fa89d00 SUBSCN: 1 04/14/2006 09:31:37<br />CHANGE #1 TYP:0 CLS:21 AFN:2 DBA:0x00800029 SCN:0x0000.0fa89cff SEQ: 2 OP:5.4<br />ktucm redo: slt: 0x0017 sqn: 0x00009c9c srt: 0 sta: 9 flg: 0x2 <br />ktucf redo: uba: 0x0080046b.0345.45 ext: 2 spc: 2376 fbi: 0 <br /><br />REDO RECORD - Thread:1 RBA: 0x000094.0000000e.0140 LEN: 0x0188 VLD: 0x01<br />SCN: 0x0000.0fa89d01 SUBSCN: 1 04/14/2006 09:31:37<br />CHANGE #1 TYP:0 CLS:27 AFN:2 DBA:0x00800059 SCN:0x0000.0fa89cfc SEQ: 1 OP:5.2<br />ktudh redo: slt: 0x001f sqn: 0x00009c72 flg: 0x0012 siz: 108 fbi: 0<br />uba: 0x0080027b.0352.21 pxid: 0x0000.000.00000000<br />CHANGE #2 TYP:0 CLS:28 AFN:2 DBA:0x0080027b SCN:0x0000.0fa89cfb SEQ: 3 OP:5.1<br />ktudb redo: siz: 108 spc: 5382 flg: 0x0012 seq: 0x0352 rec: 0x21<br />xid: 0x0006.01f.00009c72 <br />ktubl redo: slt: 31 rci: 0 opc: 11.1 objn: 3635 objd: 3635 tsn: 0<br />Undo type: Regular undo Begin trans Last buffer split: No <br />Temp Object: No <br />Tablespace Undo: No <br />0x00000000 prev ctl uba: 0x0080027b.0352.1e <br />prev ctl max cmt scn: 0x0000.0fa89902 prev tx cmt scn: 0x0000.0fa89908 <br />KDO undo record:<br />KTB Redo <br />op: 0x04 ver: 0x01 <br />op: L itl: xid: 0x0009.00d.00009c89 uba: 0x00800559.0352.05<br />flg: C--- lkc: 0 scn: 0x0000.0fa89cfe<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f3a hdba: 0x00401f39<br />itli: 2 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 3 to: 0<br />CHANGE #3 TYP:2 CLS: 1 AFN:1 DBA:0x00401f3a SCN:0x0000.0fa89d00 SEQ: 1 OP:11.4<br />KTB Redo <br />op: 0x11 ver: 0x01 <br />op: F xid: 0x0006.01f.00009c72 uba: 0x0080027b.0352.21<br />Block cleanout record, scn: 0x0000.0fa89d01 ver: 0x01 opt: 0x02, entries follow...<br />itli: 1 flg: 2 scn: 0x0000.0fa89d00<br />itli: 2 flg: 2 scn: 0x0000.0fa89cfe<br />KDO Op code: LKR row dependencies Disabled<br />xtype: XA bdba: 0x00401f3a hdba: 0x00401f39<br />itli: 2 ispac: 0 maxfr: 4863<br />tabn: 0 slot: 3 to: 2<br />CHANGE #4 MEDIA RECOVERY MARKER SCN:0x0000.00000000 SEQ: 0 OP:5.20<br />session number = 8<br />serial number = 1<br />transaction name = <br /><br />REDO RECORD - Thread:1 RBA: 0x000094.0000000f.00d8 LEN: 0x0054 VLD: 0x01<br />SCN: 0x0000.0fa89d02 SUBSCN: 1 04/14/2006 09:31:37<br />CHANGE #1 TYP:0 CLS:27 AFN:2 DBA:0x00800059 SCN:0x0000.0fa89d01 SEQ: 1 OP:5.4<br />ktucm redo: slt: 0x001f sqn: 0x00009c72 srt: 0 sta: 9 flg: 0x2 <br />ktucf redo: uba: 0x0080027b.0352.21 ext: 2 spc: 5272 fbi: 0 <br /><br />REDO RECORD - Thread:1 RBA: 0x000094.0000000f.012c LEN: 0x00d4 VLD: 0x01<br />SCN: 0x0000.0fa89d02 SUBSCN: 1 04/14/2006 09:31:37<br />CHANGE #1 TYP:0 CLS:33 AFN:2 DBA:0x00800089 SCN:0x0000.0fa89cfe SEQ: 1 OP:5.2<br />ktudh redo: slt: 0x0028 sqn: 0x00009c88 flg: 0x0011 siz: 52 fbi: 0<br />uba: 0x00800559.0352.06 pxid: 0x0000.000.00000000<br />CHANGE #2 TYP:0 CLS:34 AFN:2 DBA:0x00800559 SCN:0x0000.0fa89cfd SEQ: 1 OP:5.1<br />ktudb redo: siz: 52 spc: 7680 flg: 0x0012 seq: 0x0352 rec: 0x06<br />xid: 0x0009.028.00009c88 <br />ktubl redo: slt: 40 rci: 0 opc: 5.7 objn: 0 objd: 0 tsn: 0<br />Undo type: Regular undo Begin trans Last buffer split: No <br />Temp Object: No <br />Tablespace Undo: No <br />0x00000000 prev ctl uba: 0x00800559.0352.05 <br />prev ctl max cmt scn: 0x0000.0fa89905 prev tx cmt scn: 0x0000.0fa8990a <br />CHANGE #3 MEDIA RECOVERY MARKER SCN:0x0000.00000000 SEQ: 0 OP:5.20<br />session number = 8<br />serial number = 1<br />transaction name = <br /><br />REDO RECORD - Thread:1 RBA: 0x000094.00000010.0010 LEN: 0x0054 VLD: 0x01<br />SCN: 0x0000.0fa89d03 SUBSCN: 1 04/14/2006 09:31:37<br />CHANGE #1 TYP:0 CLS:33 AFN:2 DBA:0x00800089 SCN:0x0000.0fa89d02 SEQ: 1 OP:5.4<br />ktucm redo: slt: 0x0028 sqn: 0x00009c88 srt: 0 sta: 9 flg: 0x2 <br />ktucf redo: uba: 0x00800559.0352.06 ext: 2 spc: 7626 fbi: 0 <br />END OF REDO DUMP<br />----- Redo read statistics for thread 1 -----<br />Read rate (ASYNC): 7Kb in 0.19s =&gt; 0.00 Mb/sec<br />Longest record: 0Kb, moves: 0/27 (0%)<br />Change moves: 6/63 (9%), moved: 0Mb</p>
            </td>
        </tr>
    </tbody>
</table>
<p>5.禁用日志生成,并切换日志</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; alter system set &quot;_disable_logging&quot;=true; </p>
            <p>System altered.</p>
            <p>SQL&gt; alter system switch logfile;</p>
            <p>System altered.</p>
            <p>SQL&gt; select * from v$log;</p>
            <p>GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM<br />---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------<br />1 1 148 104857600 1 NO ACTIVE 262708457 14-APR-06<br />2 1 149 104857600 1 NO CURRENT 262708606 14-APR-06<br />3 1 147 104857600 1 NO INACTIVE 262675537 14-APR-06<br /></p>
            </td>
        </tr>
    </tbody>
</table>
<p>6.SCOTT用户再更新</p>
<p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; show parameter disable</p>
            <p>NAME TYPE VALUE<br />------------------------------------ ----------- ------------------------------<br />_disable_logging boolean TRUE<br />SQL&gt; update emp set sal=4000 where empno=7788;</p>
            <p>1 row updated.</p>
            <p>SQL&gt; commit;</p>
            <p>Commit complete.</p>
            <p>&nbsp;</p>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>7.转储日志</p>
<p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; ALTER SYSTEM DUMP LOGFILE '/opt/oracle9/oradata/testora9/redo02.log';</p>
            <p>System altered.<br /></p>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>8.记录此时REDO信息</p>
<p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>DUMP OF REDO FROM FILE '/opt/oracle9/oradata/testora9/redo02.log'<br />Opcodes *.*<br />DBA's: (file # 0, block # 0) thru (file # 65534, block # 4194303)<br />RBA's: 0x000000.00000000.0000 thru 0xffffffff.ffffffff.ffff<br />SCN's scn: 0x0000.00000000 thru scn: 0xffff.ffffffff<br />Times: creation thru eternity<br />FILE HEADER:<br />Software vsn=153092096=0x9200000, Compatibility Vsn=153092096=0x9200000<br />Db ID=1628068176=0x610a5950, Db Name='TESTORA9'<br />Activation ID=1628067152=0x610a5550<br />Control Seq=1163=0x48b, File size=204800=0x32000<br />File Number=2, Blksiz=512, File Type=2 LOG<br />descrip:&quot;Thread 0001, Seq# 0000000149, SCN 0x00000fa89d7e-0xffffffffffff&quot;<br />thread: 1 nab: 0xffffffff seq: 0x00000095 hws: 0x1 eot: 1 dis: 0<br />reset logs count: 0x1f435110 scn: 0x0000.00000001<br />Low scn: 0x0000.0fa89d7e 04/14/2006 09:33:43<br />Next scn: 0xffff.ffffffff 01/01/1988 00:00:00<br />Enabled scn: 0x0000.00000001 04/26/2004 15:56:10<br />Thread closed scn: 0x0000.0fa89d7e 04/14/2006 09:33:43<br />Log format vsn: 0x8000000 Disk cksum: 0xcac7 Calc cksum: 0xcac7<br />Terminal Recovery Stamp scn: 0x0000.00000000 01/01/1988 00:00:00<br />Most recent redo scn: 0x0000.00000000<br />Largest LWN: 0 blocks<br />End-of-redo stream : No<br /><strong>Unprotected mode</strong><br />Miscellaneous flags: 0x0<br />END OF REDO DUMP</p>
            <p><br /></p>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>我们看到此时已经没有REDO生成.数据库仅记录少量必要信息而已.</p>
<p>这就是日志禁用的本质所在.</p>
<p>&nbsp;</p>
</div>
</div>]]></description>
<link>http://www.eygle.com/archives/2006/04/how_disable_loggin_work.html</link>
<guid>http://www.eygle.com/archives/2006/04/how_disable_loggin_work.html</guid>
<category>Internal</category>
<pubDate>Fri, 14 Apr 2006 21:04:51 +0800</pubDate>
</item>
<item>
<title>_disable_logging对于性能的影响</title>
<description><![CDATA[<p>设置了_disable_logging参数,可以禁用日志的生成,从而提高某些测试的性能.</p>
<p>以下测试,纯属测试目的,其他内容请参考本站其他文章:</p>
<p><a href="http://www.eygle.com/archives/2006/04/more_about_disable_logging.html">http://www.eygle.com/<strong style="COLOR: white; BACKGROUND-COLOR: #880000">archives</strong>/<strong style="COLOR: black; BACKGROUND-COLOR: #ff66ff">2006</strong>/04/more_about_disable_logging.html</a></p>
<p>禁用日志情况下:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; connect / as sysdba<br />Connected.<br />SQL&gt; shutdown immediate;<br />Database closed.<br />Database dismounted.<br /><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">ORACLE</strong> instance shut down.<br />SQL&gt; startup<br /><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">ORACLE</strong> instance started.</p>
            <p>Total System Global Area&nbsp; 286755168 bytes<br />Fixed Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 731488 bytes<br />Variable Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 167772160 bytes<br />Database Buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 117440512 bytes<br />Redo Buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 811008 bytes<br />Database mounted.<br />Database opened.<br />SQL&gt; connect eygle/eygle<br />Connected.<br />SQL&gt; show parameter disable</p>
            <p>NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VALUE<br />------------------------------------ ----------- ------------------------------<br />_disable_logging&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; boolean&nbsp;&nbsp;&nbsp;&nbsp; TRUE</p>
            </td>
        </tr>
    </tbody>
</table>
<p>测试创建100万数据表:</p>
<p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; create table test as select * from dba_objects where 1=0;</p>
            <p>Table created.</p>
            <p>SQL&gt; set timing on<br />SQL&gt; begin&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp; 2&nbsp; for i in 1 .. 10000 loop<br />&nbsp; 3&nbsp; insert into test select * from dba_objects where rownum &lt; 101;<br />&nbsp; 4&nbsp; commit;<br />&nbsp; 5&nbsp; end loop;<br />&nbsp; 6&nbsp; end;<br />&nbsp; 7&nbsp; /</p>
            <p>PL/SQL procedure successfully completed.</p>
            <p>Elapsed: 00:00:40.46<br />SQL&gt; truncate table test;</p>
            <p>Table truncated.</p>
            <p>Elapsed: 00:00:52.72</p>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>大约时间用了40秒.</p>
<p>再看正常日志生成下:</p>
<p>&nbsp;</p>
<p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; connect / as sysdba<br />Connected.<br />SQL&gt; alter system set &quot;_disable_logging&quot;=false;</p>
            <p>System altered.</p>
            <p>Elapsed: 00:00:00.05<br />SQL&gt; shutdown immediate;<br />Database closed.<br />Database dismounted.<br /><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">ORACLE</strong> instance shut down.<br />SQL&gt; startup<br /><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">ORACLE</strong> instance started.</p>
            <p>Total System Global Area&nbsp; 286755168 bytes<br />Fixed Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 731488 bytes<br />Variable Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 167772160 bytes<br />Database Buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 117440512 bytes<br />Redo Buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 811008 bytes<br />Database mounted.<br />Database opened.<br />SQL&gt; show parameter disable</p>
            <p>NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VALUE<br />------------------------------------ ----------- ------------------------------<br />_disable_logging&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; boolean&nbsp;&nbsp;&nbsp;&nbsp; FALSE<br /><br />SQL&gt; connect eygle/eygle<br />Connected.<br />SQL&gt; set timing on<br />SQL&gt; <br />SQL&gt; begin&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp; 2&nbsp;&nbsp;&nbsp; for i in 1 .. 10000 loop<br />&nbsp; 3&nbsp;&nbsp; insert into test select * from dba_objects where rownum &lt; 101;<br />&nbsp; 4&nbsp; commit;<br />&nbsp; 5&nbsp;&nbsp;&nbsp; end loop;<br />&nbsp; 6&nbsp; end;<br />&nbsp; 7 /&nbsp;&nbsp; </p>
            <p>PL/SQL procedure successfully completed.</p>
            <p>Elapsed: 00:01:54.04<br />SQL&gt; <br />SQL&gt; truncate table test;</p>
            <p>Table truncated.</p>
            <p>Elapsed: 00:01:01.56</p>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>此时大约用时1分54秒. </p>
<p>两者差距为: 114 / 40 = 2.85 倍.</p>
<p>我们可以看出两者的差距是显著的.不作过多测试了,就此打住.大家有兴趣的可以自己测试一下.</p>
<p>&nbsp;以上测试的环境为:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; select * from v$version;</p>
            <p>BANNER<br />----------------------------------------------------------------<br />Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production<br />PL/SQL Release 9.2.0.4.0 - Production<br />CORE&nbsp;&nbsp;&nbsp; 9.2.0.3.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Production<br />TNS for Solaris: Version 9.2.0.4.0 - Production<br />NLSRTL Version 9.2.0.4.0 - Production<br /></p>
            </td>
        </tr>
    </tbody>
</table>
<p>&nbsp;</p>]]></description>
<link>http://www.eygle.com/archives/2006/04/disable_logging_performance.html</link>
<guid>http://www.eygle.com/archives/2006/04/disable_logging_performance.html</guid>
<category>Internal</category>
<pubDate>Fri, 14 Apr 2006 16:57:06 +0800</pubDate>
</item>
<item>
<title>隐含参数_disable_logging的几点说明</title>
<description><![CDATA[<p>在很久以前,曾经介绍过<strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">Oracle</strong>的一个内部隐含参数<a href="http://www.eygle.com/archives/2005/10/oracle_hidden_disable_logging.html">_disable_logging</a>,看到有朋友论述这个参数,今天忍不住做一点补充说明.</p>
<p>1.当然,隐含有风险,设置请谨慎.</p>
<p>2.最初在9.2.0.6 Solaris版本上,设置该参数会触发Bug:3868748 使得数据库无法启动.</p>
<p>从警告日志中,通常可以获得的错误提示是:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">ORA-07445: exception encountered: <br />core dump [kcrfwcint()+1625] [SIGFPE] [Integer divide by zero] [0x828739D] [] []</td>
        </tr>
    </tbody>
</table>
<p>但是好在这个参数是动态的,在存在Bug版本中,我们可以修改数据库当前值来进行测试:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; alter system set &quot;_disable_logging&quot;=true scope=memory; </p>
            <p>System altered. </p>
            </td>
        </tr>
    </tbody>
</table>
<p>3.这个Bug的影响范围并非全部,9.2.0.6之下,Oracle9.2.0.5,Oracle9.2.0.4等,都不受这个Bug影响.<strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">Oracle</strong>声称的修正该Bug的版本是Oracle10gR2(我未验正).</p>
<p>4.这个参数在Oracle9.2.0.4版本的Linux/Solaris上是不存在这个Bug的.在我的环境中经过验证,过程请参考(附注1).</p>
<p>5.在归档模式下,设置该参数会导致日志文件损坏.因为在设置该参数与归档原则违背，归档进程无法识别该日志文件格式，会将该日志文件标记为损坏.所以需要谨慎测试,具体请参考(附注2).</p>
<p>附注1:Solaris Oracle9.2.0.4设置测试过程:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>$ sqlplus &quot;/ as sysdba&quot;</p>
            <p>SQL*Plus: Release 9.2.0.4.0 - Production on Thu Apr 13 22:51:24 <strong style="COLOR: black; BACKGROUND-COLOR: #ff66ff">2006</strong></p>
            <p>Copyright (c) 1982, 2002, <strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">Oracle</strong> Corporation.&nbsp; All rights reserved.</p>
            <p><br />Connected to:<br />Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production<br />With the Partitioning option<br />JServer Release 9.2.0.4.0 - Production</p>
            <p>SQL&gt; show parameter disa</p>
            <p>NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VALUE<br />------------------------------------ ----------- ------------------------------<br /><strong>_disable_logging&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; boolean&nbsp;&nbsp;&nbsp;&nbsp; FALSE</strong><br />SQL&gt; alter system set &quot;_disable_logging&quot;=true scope=both;</p>
            <p>System altered.</p>
            <p>SQL&gt; shutdown immediate;<br />Database closed.<br />Database dismounted.<br /><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">ORACLE</strong> instance shut down.<br />SQL&gt; startup<br /><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">ORACLE</strong> instance started.</p>
            <p>Total System Global Area&nbsp; 286755168 bytes<br />Fixed Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 731488 bytes<br />Variable Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 167772160 bytes<br />Database Buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 117440512 bytes<br />Redo Buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 811008 bytes<br />Database mounted.<br />Database opened.<br />SQL&gt; show parameter disable</p>
            <p>NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VALUE<br />------------------------------------ ----------- ------------------------------<br /><strong>_disable_logging&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; boolean&nbsp;&nbsp;&nbsp;&nbsp; TRUE<br /></strong>SQL&gt; select * from v$version;</p>
            <p>BANNER<br />----------------------------------------------------------------<br />Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production<br />PL/SQL Release 9.2.0.4.0 - Production<br />CORE&nbsp;&nbsp;&nbsp; 9.2.0.3.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Production<br />TNS for Solaris: Version 9.2.0.4.0 - Production<br />NLSRTL Version 9.2.0.4.0 - Production<br /></p>
            </td>
        </tr>
    </tbody>
</table>
<p>附注2:归档模式下,该参数会导致日志文件损坏.</p>
<p>设置该参数后,切换日志:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">
            <p>SQL&gt; archive log list;<br />Database log mode&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Archive Mode<br />Automatic archival&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Enabled<br />Archive destination&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /opt/<strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">oracle</strong>/oradata/conner/archive<br />Oldest online log sequence&nbsp;&nbsp;&nbsp;&nbsp; 20<br />Next log sequence to archive&nbsp;&nbsp; 23<br />Current log sequence&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 23<br />SQL&gt; alter system switch logfile;</p>
            <p>System altered.</p>
            <p>SQL&gt; select group#,status from v$Log;</p>
            <p>&nbsp;&nbsp;&nbsp; GROUP# STATUS<br />---------- ----------------<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 INACTIVE<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2 ACTIVE<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3 INACTIVE<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4 CURRENT</p>
            <p>SQL&gt; show parameter disable</p>
            <p>NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VALUE<br />------------------------------------ ----------- ------------------------------<br />_disable_logging&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; boolean&nbsp;&nbsp;&nbsp;&nbsp; TRUE</p>
            </td>
        </tr>
    </tbody>
</table>
<p>此时可以在警告日志中看到日志损坏的错误信息:</p>
<table>
    <tbody>
        <tr>
            <td width="500" bgcolor="#999999">Thu Apr 13 23:33:25 <strong style="COLOR: black; BACKGROUND-COLOR: #ff66ff">2006</strong><br /><strong>ARC0: Evaluating archive&nbsp;&nbsp; log 2 thread 1 sequence 23<br />ARC0: Beginning to archive log 2 thread 1 sequence 23<br />Creating archive destination LOG_ARCHIVE_DEST_1: '/opt/<strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">oracle</strong>/oradata/conner/archive/1_23.dbf'<br />ARC0: Log corruption near block 3849 change 0 time ?<br />ARC0: All Archive destinations made inactive due to error 354</strong><br />Thu Apr 13 23:33:25 <strong style="COLOR: black; BACKGROUND-COLOR: #ff66ff">2006</strong><br />Errors in file /opt/<strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">oracle</strong>/admin/conner/bdump/conner_arc0_21506.trc:<br />ORA-00354: corrupt redo log block header<br />ORA-00353: log corruption near block 3849 change 0 time 04/13/<strong style="COLOR: black; BACKGROUND-COLOR: #ff66ff">2006</strong> 21:13:03<br />ORA-00312: online log 2 thread 1: '/opt/<strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">oracle</strong>/oradata/conner/redo02.log'<br />ARC0: Archiving not possible: error count exceeded<br />ARC0: Failed to archive log 2 thread 1 sequence 23<br />ARCH: Archival stopped, error occurred. Will continue retrying<br />Thu Apr 13 23:33:26 <strong style="COLOR: black; BACKGROUND-COLOR: #ff66ff">2006</strong><br /><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">ORACLE</strong> Instance conner - Archival Error<br />ARCH: Connecting to console port...<br />Thu Apr 13 23:33:26 <strong style="COLOR: black; BACKGROUND-COLOR: #ff66ff">2006</strong><br />ORA-16038: log 2 sequence# 23 cannot be archived<br />ORA-00354: corrupt redo log block header<br />ORA-00312: online log 2 thread 1: '/opt/<strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">oracle</strong>/oradata/conner/redo02.log'<br />ARCH: Connecting to console port...<br />ARCH:<br />Thu Apr 13 23:33:26 <strong style="COLOR: black; BACKGROUND-COLOR: #ff66ff">2006</strong><br />ORA-16038: log 2 sequence# 23 cannot be archived<br />ORA-00354: corrupt redo log block header<br />ORA-00312: online log 2 thread 1: '/opt/<strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">oracle</strong>/oradata/conner/redo02.log'<br /></td>
        </tr>
    </tbody>
</table>
<p>&nbsp;</p>]]></description>
<link>http://www.eygle.com/archives/2006/04/more_about_disable_logging.html</link>
<guid>http://www.eygle.com/archives/2006/04/more_about_disable_logging.html</guid>
<category>Internal</category>
<pubDate>Fri, 14 Apr 2006 16:54:22 +0800</pubDate>
</item>


</channel>
</rss>