[20181206]關於一致性讀取3.txt

来源:https://www.cnblogs.com/lfree/archive/2018/12/06/10074945.html
-Advertisement-
Play Games

[20181206]關於一致性讀取3.txt--//簡單演示一致性讀取以及如何讀取undo重構數據塊的.我不想轉儲對應的undo塊,解析那些複雜的過程.1.環境:SCOTT@book> @ ver1PORT_STRING VERSION BANNER x86_64/Linux 2.4.xx 11.2 ...


[20181206]關於一致性讀取3.txt

--//簡單演示一致性讀取以及如何讀取undo重構數據塊的.我不想轉儲對應的undo塊,解析那些複雜的過程.

1.環境:
SCOTT@book> @ ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

--//以scott用戶登錄,執行如下:
create table t (id number,name varchar2(10));
insert into t  select 1 id ,lpad('A',10,'A') name from dual ;
commit ;
--//分析略.

SCOTT@book> select rowid,t.* from t;
ROWID                      ID NAME
------------------ ---------- --------------------
AAAWGdAAEAAAAIMAAA          1 AAAAAAAAAA

SCOTT@book> @ rowid AAAWGdAAEAAAAIMAAA
    OBJECT       FILE      BLOCK        ROW ROWID_DBA            DBA                  TEXT
---------- ---------- ---------- ---------- -------------------- -------------------- ----------------------------------------
     90525          4        524          0  0x100020C           4,524                alter system dump datafile 4 block 524 ;


SQL> alter system set "_smu_debug_mode" = 45;
System altered.
--//可以指定回滾段.要重啟才生效.
--//說明之所以這樣,主要我發現執行dml使用的回滾段會使用相同的塊.

2.建立測試腳本:

$ cat b1.txt
var x refcursor;
set numw 12
select current_scn from v$database;
exec open :x for select * from t where id=1;
pause
alter system flush buffer_cache;
alter system flush buffer_cache;
@ 10046on 12
print :x
@ 10046off
@ pp
quit

$ cat b4.txt
set linesize 300
column name new_value v_rollname
column name noprint

select name from v$rollname where usn=1;
set transaction use rollback segment "&&v_rollname";
update t set name=lpad('B',9,'B') where id=1;
@ xid
commit ;

select name from v$rollname where usn=2;
set transaction use rollback segment "&&v_rollname";
update t set name=lpad('C',8,'C') where id=1;
@ xid
commit;

select name from v$rollname where usn=3;
set transaction use rollback segment "&&v_rollname";
update t set name=lpad('D',7,'D') where id=1;
@ xid
commit ;

select name from v$rollname where usn=4;
set transaction use rollback segment "&&v_rollname";
update t set name=lpad('E',6,'E') where id=1;
@ xid
commit ;

column name print

3.執行腳本:
SCOTT@book> @ b1.txt
 CURRENT_SCN
------------
 13815694556
PL/SQL procedure successfully completed.

--//這裡暫停執行腳本 b4.txt
System altered.
System altered.
old   1: alter session set events '10046 trace name context forever, level &1'
new   1: alter session set events '10046 trace name context forever, level 12'
Session altered.
          ID NAME
------------ --------------------
           1 AAAAAAAAAA
Session altered.
TRACEFILE
--------------------------------------------------------------------------------
/u01/app/oracle/diag/rdbms/book/book/trace/book_ora_38984.trc

SCOTT@book> @ b4.txt
old   1: set transaction use rollback segment "&&v_rollname"
new   1: set transaction use rollback segment "_SYSSMU1_3724004606$"
Transaction set.
1 row updated.
XIDUSN_XIDSLOT_XIDSQN
------------------------------
1.22.1560

C70                                                                        XIDUSN    XIDSLOT     XIDSQN     UBAFIL     UBABLK     UBASQN     UBAREC STATUS            USED_UBLK  USED_UREC XID              ADDR             START_DATE                FLAG
---------------------------------------------------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------------- ---------- ---------- ---------------- ---------------- ------------------- ----------
ALTER SYSTEM DUMP UNDO BLOCK '_SYSSMU1_3724004606$' XID 1 22 1560;              1         22       1560          3       1356        768         11 ACTIVE                    1          1 0100160018060000 0000000082360348 2018-12-06 08:48:44 -2.147E+09
ALTER SYSTEM DUMP UNDO HEADER '_SYSSMU1_3724004606$';
ALTER SYSTEM DUMP DATAFILE 3 BLOCK 1356;
Commit complete.

old   1: set transaction use rollback segment "&&v_rollname"
new   1: set transaction use rollback segment "_SYSSMU2_2996391332$"
Transaction set.

1 row updated.

XIDUSN_XIDSLOT_XIDSQN
------------------------------
2.24.1784

C70                                                                        XIDUSN    XIDSLOT     XIDSQN     UBAFIL     UBABLK     UBASQN     UBAREC STATUS            USED_UBLK  USED_UREC XID              ADDR             START_DATE                FLAG
---------------------------------------------------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------------- ---------- ---------- ---------------- ---------------- ------------------- ----------
ALTER SYSTEM DUMP UNDO BLOCK '_SYSSMU2_2996391332$' XID 2 24 1784;              2         24       1784          3       1217        559         46 ACTIVE                    1          1 02001800F8060000 0000000082360348 2018-12-06 08:48:44 -2.147E+09
ALTER SYSTEM DUMP UNDO HEADER '_SYSSMU2_2996391332$';
ALTER SYSTEM DUMP DATAFILE 3 BLOCK 1217;
Commit complete.

old   1: set transaction use rollback segment "&&v_rollname"
new   1: set transaction use rollback segment "_SYSSMU3_1723003836$"
Transaction set.
1 row updated.

XIDUSN_XIDSLOT_XIDSQN
------------------------------
3.18.1777

C70                                                                        XIDUSN    XIDSLOT     XIDSQN     UBAFIL     UBABLK     UBASQN     UBAREC STATUS            USED_UBLK  USED_UREC XID              ADDR             START_DATE                FLAG
---------------------------------------------------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------------- ---------- ---------- ---------------- ---------------- ------------------- ----------
ALTER SYSTEM DUMP UNDO BLOCK '_SYSSMU3_1723003836$' XID 3 18 1777;              3         18       1777          3       1010        921         52 ACTIVE                    1          1 03001200F1060000 0000000082360348 2018-12-06 08:48:44 -2.147E+09
ALTER SYSTEM DUMP UNDO HEADER '_SYSSMU3_1723003836$';
ALTER SYSTEM DUMP DATAFILE 3 BLOCK 1010;
Commit complete.

old   1: set transaction use rollback segment "&&v_rollname"
new   1: set transaction use rollback segment "_SYSSMU4_1254879796$"

Transaction set.


1 row updated.

XIDUSN_XIDSLOT_XIDSQN
------------------------------
4.11.1571

C70                                                                        XIDUSN    XIDSLOT     XIDSQN     UBAFIL     UBABLK     UBASQN     UBAREC STATUS            USED_UBLK  USED_UREC XID              ADDR             START_DATE                FLAG
---------------------------------------------------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------------- ---------- ---------- ---------------- ---------------- ------------------- ----------
ALTER SYSTEM DUMP UNDO BLOCK '_SYSSMU4_1254879796$' XID 4 11 1571;              4         11       1571          3        179        811         45 ACTIVE                    1          1 04000B0023060000 0000000082360348 2018-12-06 08:48:44 -2.147E+09
ALTER SYSTEM DUMP UNDO HEADER '_SYSSMU4_1254879796$';
ALTER SYSTEM DUMP DATAFILE 3 BLOCK 179;
Commit complete.

--//使用的回滾段保存前映像的塊的dba是(3,179) (3,1010) (3,1217) (3,1356) [註:從尾部向前看.]

4.分析轉儲:
$ grep -i "nam='db file" /u01/app/oracle/diag/rdbms/book/book/trace/book_ora_38984.trc
WAIT #140008354428832: nam='db file sequential read' ela= 12 file#=4 block#=522 blocks=1 obj#=90525 tim=1544057363227135 --//讀數據段段頭.
WAIT #140008354428832: nam='db file scattered read' ela= 27 file#=4 block#=523 blocks=5 obj#=90525 tim=1544057363227276  --//讀數據塊,註意blocks=5,包括了dba=4,524.
WAIT #140008354428832: nam='db file sequential read' ela= 10 file#=3 block#=179 blocks=1 obj#=0 tim=1544057363227374     --//修改lpad('E',6,'E')的事務.
WAIT #140008354428832: nam='db file sequential read' ela= 11 file#=3 block#=1010 blocks=1 obj#=0 tim=1544057363227490    --//修改lpad('D',7,'D')的事務.
WAIT #140008354428832: nam='db file sequential read' ela= 8 file#=3 block#=1217 blocks=1 obj#=0 tim=1544057363227553     --//修改lpad('C',6,'C')的事務
WAIT #140008354428832: nam='db file sequential read' ela= 17 file#=3 block#=1356 blocks=1 obj#=0 tim=1544057363227624    --//修改lpad('B',6,'B')的事務.

SYS@book> @ bh 4 524
HLADDR              DBARFIL     DBABLK      CLASS CLASS_TYPE         STATE             TCH CR_SCN_BAS CR_SCN_WRP CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ BA               OBJECT_NAME
---------------- ---------- ---------- ---------- ------------------ ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------------- --------------------
0000000084D68628          4        524          1 data block         cr                  1  930792668          3          3        179        811 0000000076B3C000 T
0000000084D68628          4        524          1 data block         xcur                0          0          0          0          0          0 0000000078784000 T

--//看看state='cr',ba=0000000063C2A000地址指向的塊信息:

SYS@book> oradebug setmypid
Statement processed.
SYS@book> oradebug peek 0x76B3C000 8192 1
[076B3C000, 076B3E000) = 0000A206 0100020C 377AC521 00000003 00000000 00000001 0001619D 377AC4F1 00000003 00320002 01000208 0018000A 000052D1 00C001B1 ...
SYS@book> oradebug tracefile_name
/u01/app/oracle/diag/rdbms/book/book/trace/book_ora_39054.trc

--//檢查轉儲:
*** 2018-12-06 08:53:44.097
Processing Oradebug command 'peek 0x76B3C000 8192 1'
[076B3C000, 076B3E000) = 0000A206 0100020C 377AC521 00000003 00000000 ...
Dump of memory from 0x076B3C014 to 0x076B3E000
076B3C010          00000001 0001619D 377AC4F1      [.....a....z7]
076B3C020 00000003 00320002 01000208 0018000A  [......2.........]
076B3C030 000052D1 00C001B1 00070F3B 00038000  [.R......;.......]
076B3C040 377AC304 00000000 00000000 00000000  [..z7............]
076B3C050 00000000 00000000 00000000 00000000  [................]
076B3C060 00000000 00010100 0014FFFF 1F731F0F  [..............s.]
076B3C070 00001F73 1F0F0001 00000000 00000000  [s...............]
076B3C080 00000000 00000000 00000000 00000000  [................]
        Repeat 494 times
076B3DF70 2C000000 C1020200 41410A02 41414141  [...,......AAAAAA]
076B3DF80 41414141 0202002C 420902C1 42424242  [AAAA,......BBBBB]
076B3DF90 42424242 0202002C 430802C1 43434343  [BBBB,......CCCCC]
076B3DFA0 2C434343 C1020200 44440702 44444444  [CCC,......DDDDDD]
076B3DFB0 02012C44 0602C102 45454545 002C4545  [D,......EEEEEE,.]
076B3DFC0 02C10202 44444407 44444444 0202002C  [.....DDDDDDD,...]
076B3DFD0 430802C1 43434343 2C434343 C1020200  [...CCCCCCCC,....]
076B3DFE0 42420902 42424242 2C424242 C1020200  [..BBBBBBBBB,....]
076B3DFF0 41410A02 41414141 41414141 C5210600  [..AAAAAAAAAA..!.]

*** 2018-12-06 08:53:44.098
Oradebug command 'peek 0x76B3C000 8192 1' console output:
[076B3C000, 076B3E000) = 0000A206 0100020C 377AC521 00000003 00000000 00000001 0001619D 377AC4F1 00000003 00320002 01000208 0018000A 000052D1 00C001B1 ...

--//你可以發現一致性讀取如何通過undo重構數據塊的信息,就好像反轉操作.由於我每次修改長度都不等於原來的長度.這樣看到轉儲的信息包含A,B,C,D,E等字元串2遍.
--//換一種方式轉儲數據緩存的對應數據塊dba=4,524:

SYS@book> @ bbvi 4 524
BVI_COMMAND
----------------------------------------------------------------------------------------------------
bvi -b 4292608 -s 8192 /mnt/ramdisk/book/users01.dbf
xxd -c16 -g 2 -s 4292608 -l 8192 /mnt/ramdisk/book/users01.dbf
dd if=/mnt/ramdisk/book/users01.dbf bs=8192 skip=524 count=1 of=4_524.dd conv=notrunc 2>/dev/null
od -j 4292608 -N 8192 -t x1 -v /mnt/ramdisk/book/users01.dbf
hexdump -s 4292608 -n 8192 -C -v /mnt/ramdisk/book/users01.dbf
alter system dump datafile '/mnt/ramdisk/book/users01.dbf' block 524;

alter session set events 'immediate trace name set_tsn_p1 level 5';
alter session set events 'immediate trace name buffer level 16777740';

9 rows selected.

SYS@book> alter session set events 'immediate trace name set_tsn_p1 level 5';
Session altered.

SYS@book> alter session set events 'immediate trace name buffer level 16777740';
Session altered.


BH (0x76bf5770) file#: 4 rdba: 0x0100020c (4/524) class: 1 ba: 0x76b3c000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//ba地址與前面看到的一致.
  set: 65 pool: 3 bsz: 8192 bsi: 0 sflg: 2 pwc: 18,19
  dbwrid: 1 obj: 90525 objn: 90525 tsn: 4 afn: 4 hint: f
  hash: [0x787f8408,0x84d69f20] lru: [0x84bd22c0,0x783dbee0]
  ckptq: [NULL] fileq: [NULL] objq: [NULL] objaq: [NULL]
  st: CR md: NULL tch: 1
  cr: [scn: 0x3.377ac4dc],[xid: 0x4.b.623],[uba: 0xc000b3.32b.2d],[cls: 0x3.377ac520],[sfl: 0x1],[lc: 0x3.377ac4f2]
  flags: only_sequential_access
  buffer tsn: 4 rdba: 0x0100020c (4/524)
  scn: 0x0003.377ac521 seq: 0x00 flg: 0x00 tail: 0xc5210600
  frmt: 0x02 chkval: 0x0000 type: 0x06=trans data
Hex dump of block: st=0, typ_found=1
Dump of memory from 0x0000000076B3C000 to 0x0000000076B3E000
076B3C000 0000A206 0100020C 377AC521 00000003  [........!.z7....]
076B3C010 00000000 00000001 0001619D 377AC4F1  [.........a....z7]
076B3C020 00000003 00320002 01000208 0018000A  [......2.........]
076B3C030 000052D1 00C001B1 00070F3B 00038000  [.R......;.......]
076B3C040 377AC304 00000000 00000000 00000000  [..z7............]
076B3C050 00000000 00000000 00000000 00000000  [................]
076B3C060 00000000 00010100 0014FFFF 1F731F0F  [..............s.]
076B3C070 00001F73 1F0F0001 00000000 00000000  [s...............]
076B3C080 00000000 00000000 00000000 00000000  [................]
        Repeat 494 times
076B3DF70 2C000000 C1020200 41410A02 41414141  [...,......AAAAAA]
076B3DF80 41414141 0202002C 420902C1 42424242  [AAAA,......BBBBB]
076B3DF90 42424242 0202002C 430802C1 43434343  [BBBB,......CCCCC]
076B3DFA0 2C434343 C1020200 44440702 44444444  [CCC,......DDDDDD]
076B3DFB0 02012C44 0602C102 45454545 002C4545  [D,......EEEEEE,.]
076B3DFC0 02C10202 44444407 44444444 0202002C  [.....DDDDDDD,...]
076B3DFD0 430802C1 43434343 2C434343 C1020200  [...CCCCCCCC,....]
076B3DFE0 42420902 42424242 2C424242 C1020200  [..BBBBBBBBB,....]
076B3DFF0 41410A02 41414141 41414141 C5210600  [..AAAAAAAAAA..!.]
Block header dump:  0x0100020c
 Object id on Block? Y
 seg/obj: 0x1619d  csc: 0x03.377ac4f1  itc: 2  flg: E  typ: 1 - DATA
     brn: 0  bdba: 0x1000208 ver: 0x01 opc: 0
     inc: 0  exflg: 0

 Itl           Xid                  Uba         Flag  Lck        Scn/Fsc
0x01   0x000a.018.000052d1  0x00c001b1.0f3b.07  C---    0  scn 0x0003.377ac304
0x02   0x0000.000.00000000  0x00000000.0000.00  ----    0  fsc 0x0000.00000000
bdba: 0x0100020c
data_block_dump,data header at 0x76b3c064
===============
tsiz: 0x1f98
hsiz: 0x14
pbl: 0x76b3c064
     76543210
flag=--------
ntab=1
nrow=1
frre=-1
fsbo=0x14
fseo=0x1f0f
avsp=0x1f73
tosp=0x1f73
0xe:pti[0]  nrow=1  offs=0
0x12:pri[0] offs=0x1f0f
block_row_dump:
tab 0, row 0, @0x1f0f    --//這個偏移與第1次插入的問題不同.
tl: 17 fb: --H-FL-- lb: 0x0  cc: 2
col  0: [ 2]  c1 02
col  1: [10]  41 41 41 41 41 41 41 41 41 41
end_of_block_dump

4.換一種方式:

$ cat b5.txt
alter system flush buffer_cache;
alter system flush buffer_cache;
@ 10046on 12
select * from t  as of scn 13815694556 where id=1;
@ 10046off
@ pp

SCOTT@book> @ b5.txt
System altered.
System altered.
old   1: alter session set events '10046 trace name context forever, level &1'
new   1: alter session set events '10046 trace name context forever, level 12'
Session altered.
        ID NAME
---------- --------------------
         1 AAAAAAAAAA
Session altered.

TRACEFILE
--------------------------------------------------------------------------------
/u01/app/oracle/diag/rdbms/book/book/trace/book_ora_39134.trc


$ grep -i "nam='db file" /u01/app/oracle/diag/rdbms/book/book/trace/book_ora_39134.trc
WAIT #140406431959032: nam='db file scattered read' ela= 45 file#=2 block#=416 blocks=8 obj#=272 tim=1544058316954648
WAIT #140406431959032: nam='db file scattered read' ela= 48 file#=2 block#=74816 blocks=8 obj#=272 tim=1544058316954781
WAIT #140406431959032: nam='db file scattered read' ela= 52 file#=2 block#=71376 blocks=8 obj#=270 tim=1544058316954972
--//上面是讀 以下部分訪問的數據塊與前面測試一直.
WAIT #140406431960096: nam='db file sequential read' ela= 11 file#=4 block#=522 blocks=1 obj#=90525 tim=1544058316956075
WAIT #140406431960096: nam='db file scattered read' ela= 38 file#=4 block#=523 blocks=5 obj#=90525 tim=1544058316956220
WAIT #140406431960096: nam='db file sequential read' ela= 17 file#=3 block#=179 blocks=1 obj#=0 tim=1544058316956314
WAIT #140406431960096: nam='db file sequential read' ela= 10 file#=3 block#=1010 blocks=1 obj#=0 tim=1544058316956431
WAIT #140406431960096: nam='db file sequential read' ela= 10 file#=3 block#=1217 blocks=1 obj#=0 tim=1544058316956497
WAIT #140406431960096: nam='db file sequential read' ela= 9 file#=3 block#=1356 blocks=1 obj#=0 tim=1544058316956558

--//前面的3條訪問的數據塊是:
SCOTT@book> @ which_obj 2 416
OWNER  SEGMENT_NAME          PARTITION_NAME SEGMENT_TYPE       TABLESPACE_NAME  EXTENT_ID    FILE_ID   BLOCK_ID      BYTES     BLOCKS RELATIVE_FNO
------ --------------------- -------------- ------------------ --------------- ---------- ---------- ---------- ---------- ---------- ------------
SYS    SMON_SCN_TIME_SCN_IDX                INDEX              SYSAUX                   0          2        416      65536          8            2
       
SCOTT@book> @ which_obj 2 74816
OWNER  SEGMENT_NAME          PARTITION_NAME SEGMENT_TYPE       TABLESPACE_NAME  EXTENT_ID    FILE_ID   BLOCK_ID      BYTES     BLOCKS RELATIVE_FNO
------ --------------------- -------------- ------------------ --------------- ---------- ---------- ---------- ---------- ---------- ------------
SYS    SMON_SCN_TIME_SCN_IDX                INDEX              SYSAUX                   1          2      74816      65536          8            2

SCOTT@book> @ which_obj 2 71376
OWNER  SEGMENT_NAME          PARTITION_NAME SEGMENT_TYPE       TABLESPACE_NAME  EXTENT_ID    FILE_ID   BLOCK_ID      BYTES     BLOCKS RELATIVE_FNO
------ --------------------- -------------- ------------------ --------------- ---------- ---------- ---------- ---------- ---------- ------------
SYS    SMON_SCN_TO_TIME_AUX                 CLUSTER            SYSAUX                  17          2      71296    1048576        128            2

--//如果建立唯一索引在id欄位,你再重覆前面的測試,你會發現結果不同,大家可以參考我以前寫的:
--//鏈接:http://blog.itpub.net/267265/viewspace-772101/

--//附上測試腳本:
$ cat xid.sql
column XIDUSN_XIDSLOT_XIDSQN format a30
select dbms_transaction.local_transaction_id()  XIDUSN_XIDSLOT_XIDSQN from dual ;
--select XIDUSN,XIDSLOT,XIDSQN,UBAFIL,UBABLK,UBAREC, UBASQN,STATUS,used_ublk,USED_UREC,xid,ADDR  from v$transaction;

SELECT 'ALTER SYSTEM DUMP UNDO BLOCK '''
       || (SELECT name
             FROM sys.undo$
            WHERE us# = xidusn)
       || ''' XID '
       || xidusn
       || ' '
       || xidslot
       || ' '
       || xidsqn
       || ';'
       || CHR (10)
       || 'ALTER SYSTEM DUMP UNDO HEADER '''
       || (SELECT name
             FROM sys.undo$
            WHERE us# = xidusn)
       || ''''
       || ';'
       || CHR (10)
       || 'ALTER SYSTEM DUMP DATAFILE '
       || UBAFIL
       || ' BLOCK '
       || UBABLK
       || ';'
          c70
      ,XIDUSN
      ,XIDSLOT
      ,XIDSQN
      ,UBAFIL
      ,UBABLK
      ,UBASQN
      ,UBAREC
      ,STATUS
      ,used_ublk
      ,USED_UREC
      ,xid
      ,ADDR
      ,START_DATE
      ,flag
      FROM v$transaction;

$ cat bbvi.sql
column bvi_command format a100
select 'bvi -b '|| &2*BLOCK_SIZE||' -s '||block_size||' '||NAME bvi_command from v$datafile where file#=&1
union all
select 'xxd -c16 -g 2 -s '|| &2*BLOCK_SIZE||' -l '||block_size||' '||NAME bvi_command from v$datafile where file#=&1
union all
select 'dd if='||name||' bs='||block_size||' skip='||&2||' count=1 of='||&1||'_'||&2||'.dd conv=notrunc 2>/dev/null' bvi_command from v$datafile where file#=&1
union all
select 'od -j '||&2*BLOCK_SIZE||' -N '||block_size||' -t x1 -v '||name bvi_command from v$datafile where file#=&1
union all
select 'hexdump -s '||&2*BLOCK_SIZE||' -n '||block_size||' -C -v '||name bvi_command from v$datafile where file#=&1
union all
select 'alter system dump datafile '||''''||name||''''||' block '||&2||';' from v$datafile where file#=&1
union all
select '' bvi_command from dual
union all
select 'alter session set events ''immediate trace name set_tsn_p1 level '|| to_char(ts#+1)||''';' bvi_command from sys.ts$
where name in (select TABLESPACE_NAME from v$datafile_header where FILE# = &&1)
union all
select 'alter session set events ''immediate trace name buffer level '||dbms_utility.make_data_block_address(&&1,&&2)||''';' bvi_command from dual;
      


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 一、發佈 上面有多種發佈方式,這裡我選擇事物發佈,具體區別請自行百度。 點擊下一步、然後繼續選擇需要發佈的對象。 如果需要篩選發佈的數據點擊添加。 根據自己的計劃選擇發佈的時間。 點擊安全設置,設置代理信息。 最後單擊完成系統會自動創建發佈。 如出現上述警告,則需要在電腦的服務中打開 SQL Se ...
  • 上面這條sql語句,仔細看一下,揣摩出思路也不難,大概也分為3步來理解: 根據條件,刪除原表中id大於t2中id的記錄 ...
  • create table,show tables,describe table,DROP TABLE,ALTER TABLE ,怎麼使用? ...
  • 先決條件 先運行mongodb肯定是必須的,然後導入以下包: MongoClient MongoClient()實例表示到資料庫的連接池; 你將只需要MongoClient類的一個實例,即使有多個線程也是一樣。 重要: 通常,您只能為給定的MongoDB部署(例如獨立,副本集或分片群集)創建一個Mo ...
  • create database ,drop database ,show Databases,use 資料庫 ,怎麼使用? ...
  • [TOC] 安裝依賴 (1)cmake是新版MySQL的編譯工具 安裝boost 如果安裝的MySQL5.7及以上的版本,在編譯安裝之前需要安裝boost,因為高版本mysql需要boots庫的安裝才可以正常運行。否則會報 錯誤 1. 切換到 目錄,然後在這個目錄下下載boost MySQL5.7. ...
  • 大數據已經成為時代發展的趨勢,很多人紛紛選擇學習大數據,想要進入大數據行業。大數據技術體系龐大,包括的知識較多,系統的學習大數據可以讓你全面掌握大數據技能。學習大數據需要掌握哪些知識?我還是要推薦下我自己創建的大數據資料分享群142973723,這是大數據學習交流的地方,不管你是小白還是大牛,小編都 ...
  • 源碼:https://github.com/HannahLihui/StudentManager-SSM/tree/master/SSM-git/StudentManager-SSM-master 1.前端有一個img引入,這裡this.src=this.src+'?'就會調用映射到後臺的check ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...