chaicsd14 发表于 2014-4-3 09:58:06

RAC和单实例commit后对块的操作

本帖最后由 chaicsd14 于 2014-4-3 09:58 编辑

OS:Red Hat Enterprise Linux Server release 5.5 (Tikanga)
oracle:11.2.0.3



在RAC环境下测试:SQL>  / as sysdba
Connected.
SQL> create table t (id number,name char(10));

Table created.

SQL> insert into t values (1,'chai');

1 row created.

SQL> commit;

Commit complete.

SQL> alter system checkpoint;

System altered.

SQL>    Select Dbms_Rowid.Rowid_Object(Rowid) Object_Id,
  2            Dbms_Rowid.Rowid_Relative_Fno(Rowid) File_Id,
  3            Dbms_Rowid.Rowid_Block_Number(Rowid) Block_Id,
  4            Dbms_Rowid.Rowid_Row_Number(Rowid) Num
  5        From wilson.t
  6  
SQL> /

OBJECT_ID    FILE_ID   BLOCK_ID        NUM
---------- ---------- ---------- ----------
     79149          4        229          0

SQL> alter system dump datafile 4 block 229;

System altered.

SQL> oradebug setmysid;
ORA-00070: command setmysid is not valid
SQL> oradebug setmypid;
Statement processed.
SQL> oradebug tracefile_name;
/u01/app/oracle/diag/rdbms/orcl/orcl2/trace/orcl2_ora_4851.trc

cat /u01/app/oracle/diag/rdbms/orcl/orcl2/trace/orcl2_ora_4851.trc

Itl           Xid                  Uba         Flag  Lck        Scn/Fsc
0x01   0x0003.00a.000008db  0x00c00682.0445.0f  C---    0  scn 0x0000.015bd2aa
0x02   0x0000.000.00000000  0x00000000.0000.00  ----    0  fsc 0x0000.00000000
锁已经被清除掉了


在单实例上操作:SQL> create table wilson.t (id number,name varchar2(10));

Table created.

SQL> insert into wilson.t values(1,'cyx');

1 row created.

SQL> commit;     

Commit complete.

SQL>    Select Dbms_Rowid.Rowid_Object(Rowid) Object_Id,
  2            Dbms_Rowid.Rowid_Relative_Fno(Rowid) File_Id,
  3            Dbms_Rowid.Rowid_Block_Number(Rowid) Block_Id,
  4            Dbms_Rowid.Rowid_Row_Number(Rowid) Num
  5        From wilson.t;

OBJECT_ID    FILE_ID   BLOCK_ID        NUM
---------- ---------- ---------- ----------
     75591          4        204          0

SQL> alter system checkpoint;

System altered.

SQL> alter system dump datafile 4 block 204;

System altered.

SQL> oradebug setmypid;
Statement processed.
SQL> oradebug tracefile_name;
/u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_13426.trc

cat /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_13426.trc

Itl           Xid                  Uba         Flag  Lck        Scn/Fsc
0x01   0x0004.018.000002a5  0x00c01814.008a.0f  --U-    1  fsc 0x0000.000fd9d5
0x02   0x0000.000.00000000  0x00000000.0000.00  ----    0  fsc 0x0000.00000000
锁资源还保留着


请教下各位老师,这两者之间的机制有什么不同吗?
页: [1]
查看完整版本: RAC和单实例commit后对块的操作