4m的asm au size
[grid@dgrac1 ~]$ kfed read /dev/asm-data blkn=0|grep ausize
kfdhdb.ausize: 4194304 ; 0x0bc: 0x00400000
SQL> select group_number,name,sector_size,block_size,allocation_unit_size from v$asm_diskgroup;
GROUP_NUMBER NAME SECTOR_SIZE BLOCK_SIZE ALLOCATION_UNIT_SIZE
------------ ------------------------------ ----------- ---------- --------------------
1 CRS 512 4096 4194304
2 DATA 512 4096 4194304
SQL> select NAME,GROUP_NUMBER,FILE_NUMBER from v$asm_alias where GROUP_NUMBER=2 and FILE_NUMBER<>4294967295 order by FILE_NUMBER asc;
NAME GROUP_NUMBER FILE_NUMBER
------------------------------ ------------ -----------
group_1.256.1034344559 2 256
log_3.257.1034351107 2 257
group_3.258.1034344657 2 258
thread_2_seq_31.259.1034347077 2 259
TEMP.260.1034348395 2 260
TEMP.261.1034348417 2 261
thread_1_seq_31.262.1034349109 2 262
thread_2_seq_32.263.1034349109 2 263
thread_2_seq_34.264.1034349261 2 264
UNDOTBS2.265.1034344459 2 265
SYSTEM.266.1034344469 2 266
NAME GROUP_NUMBER FILE_NUMBER
------------------------------ ------------ -----------
SYSAUX.267.1034344483 2 267
group_1.268.1034344533 2 268
current.269.1034344307 2 269
group_2.270.1034344597 2 270
group_6.271.1034344785 2 271
USERS.272.1034344467 2 272
Current.273.1034344305 2 273
group_3.274.1034344683 2 274
group_4.275.1034344709 2 275
thread_2_seq_35.276.1034349589 2 276
thread_1_seq_34.277.1034349589 2 277
NAME GROUP_NUMBER FILE_NUMBER
------------------------------ ------------ -----------
thread_2_seq_36.278.1034349593 2 278
thread_1_seq_35.279.1034349593 2 279
thread_1_seq_32.280.1034349137 2 280
thread_1_seq_36.281.1034349593 2 281
group_6.282.1034344803 2 282
group_7.283.1034344821 2 283
group_7.285.1034344837 2 285
UNDOTBS1.287.1034344445 2 287
TEMP.288.1034348379 2 288
thread_2_seq_33.289.1034349135 2 289
log_4.315.1034351119 2 315
NAME GROUP_NUMBER FILE_NUMBER
------------------------------ ------------ -----------
s_1034351779.316.1034351913 2 316
thread_2_seq_38.317.1034354249 2 317
thread_2_seq_39.318.1034355735 2 318
thread_2_seq_40.319.1034355735 2 319
thread_1_seq_39.320.1034355737 2 320
thread_2_seq_41.321.1034355737 2 321
thread_2_seq_42.322.1034355739 2 322
thread_1_seq_38.323.1034355739 2 323
thread_1_seq_37.324.1034355739 2 324
thread_1_seq_40.325.1034355741 2 325
thread_1_seq_41.326.1034459251 2 326
NAME GROUP_NUMBER FILE_NUMBER
------------------------------ ------------ -----------
thread_1_seq_42.327.1034459255 2 327
thread_1_seq_43.328.1034460245 2 328
thread_1_seq_1.329.1034460821 2 329
thread_1_seq_2.330.1034460823 2 330
thread_1_seq_3.331.1034461297 2 331
thread_1_seq_4.332.1034461301 2 332
thread_1_seq_5.333.1034461301 2 333
thread_1_seq_6.334.1034461513 2 334
thread_1_seq_7.335.1034461535 2 335
thread_1_seq_8.336.1034461565 2 336
group_4.337.1034344727 2 337
NAME GROUP_NUMBER FILE_NUMBER
------------------------------ ------------ -----------
group_5.338.1034344749 2 338
thread_1_seq_9.339.1034462707 2 339
thread_1_seq_1.340.1034462707 2 340
thread_1_seq_2.341.1034462709 2 341
log_2.342.1034351103 2 342
s_1034463068.343.1034463083 2 343
thread_1_seq_3.344.1034514313 2 344
thread_1_seq_4.345.1034514313 2 345
thread_1_seq_5.346.1034514531 2 346
thread_1_seq_6.347.1034514627 2 347
thread_1_seq_7.348.1034514779 2 348
NAME GROUP_NUMBER FILE_NUMBER
------------------------------ ------------ -----------
thread_1_seq_17.349.1044112587 2 349
group_8.350.1034344855 2 350
group_2.351.1034344631 2 351
thread_2_seq_1.353.1044112587 2 353
thread_1_seq_10.354.1044112587 2 354
thread_1_seq_11.355.1044112587 2 355
thread_1_seq_9.356.1044112589 2 356
thread_1_seq_33.360.1034349255 2 360
Current.361.1034344305 2 361
thread_2_seq_37.362.1034349593 2 362
s_1034350355.363.1034350489 2 363
NAME GROUP_NUMBER FILE_NUMBER
------------------------------ ------------ -----------
log_1.364.1034351095 2 364
group_5.365.1034344767 2 365
SYSTEM.374.1034344317 2 374
SYSTEM.375.1034344353 2 375
UNDOTBS1.376.1034344499 2 376
SYSAUX.377.1034344369 2 377
UNDO_2.378.1034344513 2 378
SYSAUX.379.1034344403 2 379
USERS.380.1034344529 2 380
UNDOTBS1.381.1034344419 2 381
thread_1_seq_30.397.1034347071 2 397
NAME GROUP_NUMBER FILE_NUMBER
------------------------------ ------------ -----------
thread_1_seq_29.398.1034347069 2 398
thread_2_seq_30.399.1034347069 2 399
dgorcl.400.1034346851 2 400
dr2dgorcl.dat 2 400
dgorcl.401.1034346851 2 401
dr1dgorcl.dat 2 401
orapworcl 2 402
pwddb_unknown.402.1034345499 2 402
spfile.403.1034345285 2 403
group_10.404.1034344945 2 404
group_10.405.1034344927 2 405
NAME GROUP_NUMBER FILE_NUMBER
------------------------------ ------------ -----------
group_9.406.1034344909 2 406
group_9.407.1034344889 2 407
group_8.408.1034344871 2 408
thread_1_seq_25.436.1044266633 2 436
thread_1_seq_24.437.1044266037 2 437
thread_1_seq_23.438.1044265827 2 438
thread_1_seq_22.439.1044265629 2 439
thread_1_seq_21.440.1044264143 2 440
thread_1_seq_20.441.1044264121 2 441
thread_1_seq_19.442.1044264107 2 442
thread_2_seq_6.443.1044263165 2 443
NAME GROUP_NUMBER FILE_NUMBER
------------------------------ ------------ -----------
thread_2_seq_5.444.1044263165 2 444
thread_1_seq_18.445.1044263163 2 445
thread_2_seq_4.446.1044113705 2 446
log_5.448.1044112607 2 448
thread_2_seq_2.449.1044112591 2 449
thread_2_seq_3.450.1044112591 2 450
thread_1_seq_16.451.1044112589 2 451
thread_1_seq_15.452.1044112589 2 452
thread_1_seq_14.453.1044112589 2 453
thread_1_seq_13.454.1044112589 2 454
thread_1_seq_8.455.1044112589 2 455
NAME GROUP_NUMBER FILE_NUMBER
------------------------------ ------------ -----------
thread_1_seq_12.456.1044112589 2 456
122 rows selected.
[grid@dgrac1 ~]$ kfed read /dev/asm-data aus=4m blkn=0|grep f1b1
kfdhdb.f1b1locn: 8 ; 0x0d4: 0x00000008
kfdhdb.f1b1fcn.base: 68672 ; 0x100: 0x00010c40
kfdhdb.f1b1fcn.wrap: 0 ; 0x104: 0x00000000
[grid@dgrac1 ~]$ kfed read /dev/asm-data aus=4m aun=8 blkn=272|grep xptr.au|grep -v 4294967295
kfffde[0].xptr.au: 254 ; 0x4a0: 0x000000fe
kfffde[1].xptr.au: 253 ; 0x4a8: 0x000000fd
[grid@dgrac1 ~]$ kfed read /dev/asm-data aus=4m aun=8 blkn=272|egrep "xptr.au|xptr.disk|Size"|egrep -v "4294967295|65535"
kfffdb.blkSize: 8192 ; 0x01c: 0x00002000
kfffde[0].xptr.au: 254 ; 0x4a0: 0x000000fe
kfffde[0].xptr.disk: 1 ; 0x4a4: 0x0001
kfffde[1].xptr.au: 253 ; 0x4a8: 0x000000fd
kfffde[1].xptr.disk: 3 ; 0x4ac: 0x0003
通过视图对比验证:
SQL> Select 'dd if='||d.path||' bs=4194304 count=1 skip='||p.au_kffxp||' of=users_'||p.XNUM_KFFXP||'.dbf'
2 from x$kffxp p, v$asm_alias a,v$asm_disk d,v$asm_diskgroup dg
3 where p.GROUP_KFFXP = a.GROUP_NUMBER
4 and p.NUMBER_KFFXP = a.FILE_NUMBER
5 and a.name in ('USERS.272.1034344467')
6 and p.LXN_KFFXP=0
7 and d.GROUP_NUMBER=p.GROUP_KFFXP
8 and dg.GROUP_NUMBER=p.GROUP_KFFXP
9 and p.DISK_KFFXP=d.disk_number
10 order by XNUM_KFFXP;
'DDIF='||D.PATH||'BS=4194304COUNT=1SKIP='||P.AU_KFFXP||'OF=USERS_'||P.XNUM_KFFXP||'.DBF'
----------------------------------------------------------------------------------------------------------------------------------------------------------------
dd if=/dev/asm-data1 bs=4194304 count=1 skip=254 of=users_0.dbf
dd if=/dev/asm-data3 bs=4194304 count=1 skip=253 of=users_1.dbf
SQL> --合并---
SQL> SELECT 'dd if=users_'||p.XNUM_KFFXP||'.dbf bs=4194304 count=1 seek='||p.XNUM_KFFXP||' of=users.all.dbf'
2 from x$kffxp p, v$asm_alias a,v$asm_disk d,v$asm_diskgroup dg
3 where p.GROUP_KFFXP = a.GROUP_NUMBER
4 and p.NUMBER_KFFXP = a.FILE_NUMBER
5 and a.name in ('USERS.272.1034344467')
6 and p.LXN_KFFXP=0
7 and d.GROUP_NUMBER=p.GROUP_KFFXP
8 and dg.GROUP_NUMBER=p.GROUP_KFFXP
9 and p.DISK_KFFXP=d.disk_number
10 order by XNUM_KFFXP;
'DDIF=USERS_'||P.XNUM_KFFXP||'.DBFBS=4194304COUNT=1SEEK='||P.XNUM_KFFXP||'OF=USERS.ALL.DBF'
----------------------------------------------------------------------------------------------------------------------------------------------------------------
dd if=users_0.dbf bs=4194304 count=1 seek=0 of=users.all.dbf
dd if=users_1.dbf bs=4194304 count=1 seek=1 of=users.all.dbf
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.5.0.0.0
[grid@dgrac1 ~]$ pwd
/home/grid
[grid@dgrac1 ~]$ dbv file=users.all.dbf blocksize=8192
DBVERIFY: Release 19.0.0.0.0 - Production on Tue Jun 30 12:54:37 2020
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
DBVERIFY - Verification starting : FILE = /home/grid/users.all.dbf
DBVERIFY - Verification complete
Total Pages Examined : 640
Total Pages Processed (Data) : 60
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 15
Total Pages Failing (Index): 0
Total Pages Processed (Other): 464
Total Pages Processed (Seg) : 0
Total Pages Failing (Seg) : 0
Total Pages Empty : 101
Total Pages Marked Corrupt : 0
Total Pages Influx : 0
Total Pages Encrypted : 0
Highest block SCN : 1309490 (0.1309490)
以380号user为例:
SQL> Select 'dd if='||d.path||' bs=4194304 count=1 skip='||p.au_kffxp||' of=users_'||p.XNUM_KFFXP||'.dbf'
2 from x$kffxp p, v$asm_alias a,v$asm_disk d,v$asm_diskgroup dg
3 where p.GROUP_KFFXP = a.GROUP_NUMBER
4 and p.NUMBER_KFFXP = a.FILE_NUMBER
5 and a.name in ('USERS.380.1034344529')
6 and p.LXN_KFFXP=0
7 and d.GROUP_NUMBER=p.GROUP_KFFXP
8 and dg.GROUP_NUMBER=p.GROUP_KFFXP
9 and p.DISK_KFFXP=d.disk_number
10 order by XNUM_KFFXP;
'DDIF='||D.PATH||'BS=4194304COUNT=1SKIP='||P.AU_KFFXP||'OF=USERS_'||P.XNUM_KFFXP||'.DBF'
----------------------------------------------------------------------------------------------------------------------------------------------------------------
dd if=/dev/asm-data2 bs=4194304 count=1 skip=349 of=users_0.dbf
dd if=/dev/asm-data bs=4194304 count=1 skip=350 of=users_1.dbf
dd if=/dev/asm-data1 bs=4194304 count=1 skip=355 of=users_2.dbf
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.5.0.0.0
[grid@dgrac1 ~]$ kfed read /dev/asm-data aus=4m blkn=0|grep f1b1
kfdhdb.f1b1locn: 8 ; 0x0d4: 0x00000008
kfdhdb.f1b1fcn.base: 68672 ; 0x100: 0x00010c40
kfdhdb.f1b1fcn.wrap: 0 ; 0x104: 0x00000000
[grid@dgrac1 ~]$ kfed read /dev/asm-data aus=4m aun=8 blkn=380|grep xptr.au|grep -v 4294967295
kfffde[0].xptr.au: 349 ; 0x4a0: 0x0000015d
kfffde[1].xptr.au: 350 ; 0x4a8: 0x0000015e
kfffde[2].xptr.au: 355 ; 0x4b0: 0x00000163
[grid@dgrac1 ~]$ kfed read /dev/asm-data aus=4m aun=8 blkn=380|egrep "xptr.au|xptr.disk"|egrep -v "4294967295|65535"
kfffde[0].xptr.au: 349 ; 0x4a0: 0x0000015d
kfffde[0].xptr.disk: 2 ; 0x4a4: 0x0002
kfffde[1].xptr.au: 350 ; 0x4a8: 0x0000015e
kfffde[1].xptr.disk: 0 ; 0x4ac: 0x0000
kfffde[2].xptr.au: 355 ; 0x4b0: 0x00000163
kfffde[2].xptr.disk: 1 ; 0x4b4: 0x0001
SQL> set linesize 140 pagesize 1400
SQL> col "FILE NAME" format a40
SQL> set head on
SQL> select NAME "FILE NAME",
2 NUMBER_KFFXP "FILE NUMBER",
3 XNUM_KFFXP "EXTENT NUMBER",
4 DISK_KFFXP "DISK NUMBER",
5 AU_KFFXP "AU NUMBER",
6 SIZE_KFFXP "NUMBER of AUs"
7 from x$kffxp, v$asm_alias
8 where GROUP_KFFXP = GROUP_NUMBER
9 and NUMBER_KFFXP = FILE_NUMBER
10 and system_created = 'Y'
11 and lxn_kffxp = 0
12 and name in ('USERS.380.1034344529')
13 order by XNUM_KFFXP;
FILE NAME FILE NUMBER EXTENT NUMBER DISK NUMBER AU NUMBER NUMBER of AUs
---------------------------------------- ----------- ------------- ----------- ---------- -------------
USERS.380.1034344529 380 0 2 349 1
USERS.380.1034344529 380 1 0 350 1
USERS.380.1034344529 380 2 1 355 1
SQL> col path for a40
SQL> col dd for a80
SQL>select 'dd if='||d.path||' bs=4194304 count=1 skip='||p.au_kffxp||' of=users_'||p.XNUM_KFFXP||'.dbf' dd,d.path,p.DISK_KFFXP,p.au_kffxp
2 from x$kffxp p, v$asm_alias a,v$asm_disk d,v$asm_diskgroup dg
3 where p.GROUP_KFFXP = a.GROUP_NUMBER
4 and p.NUMBER_KFFXP = a.FILE_NUMBER
5 and a.name in ('USERS.380.1034344529')
6 and p.LXN_KFFXP=0
7 and d.GROUP_NUMBER=p.GROUP_KFFXP
8 and dg.GROUP_NUMBER=p.GROUP_KFFXP
9 and p.DISK_KFFXP=d.disk_number
10* order by XNUM_KFFXP
DD PATH DISK_KFFXP AU_KFFXP
-------------------------------------------------------------------------------- ---------------------------------------- ---------- ----------
dd if=/dev/asm-data2 bs=4194304 count=1 skip=349 of=users_0.dbf /dev/asm-data2 2 349
dd if=/dev/asm-data bs=4194304 count=1 skip=350 of=users_1.dbf /dev/asm-data 0 350
dd if=/dev/asm-data1 bs=4194304 count=1 skip=355 of=users_2.dbf /dev/asm-data1 1 355
脚本:
例如:
--dd取出文件au--
Select 'dd if='||d.path||' bs=4194304 count=1 skip='||p.au_kffxp||' of=users_'||p.XNUM_KFFXP||'.dbf'
from x$kffxp p, v$asm_alias a,v$asm_disk d,v$asm_diskgroup dg
where p.GROUP_KFFXP = a.GROUP_NUMBER
and p.NUMBER_KFFXP = a.FILE_NUMBER
and a.name in ('USERS.272.1034344467')
and p.LXN_KFFXP=0
and d.GROUP_NUMBER=p.GROUP_KFFXP
and dg.GROUP_NUMBER=p.GROUP_KFFXP
and p.DISK_KFFXP=d.disk_number
order by XNUM_KFFXP;
--dd合并user文件--
SELECT 'dd if=users_'||p.XNUM_KFFXP||'.dbf bs=4194304 count=1 seek='||p.XNUM_KFFXP||' of=users.all.dbf'
from x$kffxp p, v$asm_alias a,v$asm_disk d,v$asm_diskgroup dg
where p.GROUP_KFFXP = a.GROUP_NUMBER
and p.NUMBER_KFFXP = a.FILE_NUMBER
and a.name in ('USERS.272.1034344467')
and p.LXN_KFFXP=0
and d.GROUP_NUMBER=p.GROUP_KFFXP
and dg.GROUP_NUMBER=p.GROUP_KFFXP
and p.DISK_KFFXP=d.disk_number
order by XNUM_KFFXP;
--查看path对应disk和au--
select 'dd if='||d.path||' bs=4194304 count=1 skip='||p.au_kffxp||' of=users_'||p.XNUM_KFFXP||'.dbf' dd,d.path,p.DISK_KFFXP,p.au_kffxp
from x$kffxp p, v$asm_alias a,v$asm_disk d,v$asm_diskgroup dg
where p.GROUP_KFFXP = a.GROUP_NUMBER
and p.NUMBER_KFFXP = a.FILE_NUMBER
and a.name in ('USERS.380.1034344529')
and p.LXN_KFFXP=0
and d.GROUP_NUMBER=p.GROUP_KFFXP
and dg.GROUP_NUMBER=p.GROUP_KFFXP
and p.DISK_KFFXP=d.disk_number
order by XNUM_KFFXP;
http://www.orasos.com/category/drop-pdb%E6%81%A2%E5%A4%8D