[20201126]檔案相對號與絕對號問題.txt

lfree發表於2020-11-26

[20201126]檔案相對號與絕對號問題.txt

--//一般情況兩者一致,今天在18c pdb環境遭遇這個問題。
1.環境:
TTT@192.168.2.7:1521/orcl> select banner_full from v$version;
BANNER_FULL
----------------------------------------------------------------------
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0

2.測試:
TTT@192.168.2.7:1521/orcl> create table t1 as select rownum n1, lpad('x',5) v1 from dual connect by level <=5;
Table created.

TTT@192.168.2.7:1521/orcl> alter table t1 add c1 number default 42 not null;
Table altered.

TTT@192.168.2.7:1521/orcl> alter session set statistics_level = all;
Session altered.

TTT@192.168.2.7:1521/orcl> select count(1) from t1 where c1=42;
  COUNT(1)
----------
         5

TTT@192.168.2.7:1521/orcl> select rowid from t1 where rownum=1;
ROWID
------------------
AAA3JfAAMAAAACDAAA

TTT@192.168.2.7:1521/orcl> @ rowid AAA3JfAAMAAAACDAAA
    OBJECT       FILE      BLOCK        ROW ROWID_DBA                      DBA                  TEXT
---------- ---------- ---------- ---------- ------------------------------ -------------------- ----------------------------------------
    225887         12        131          0  0x3000083                     12,131               alter system dump datafile 12 block 131
                                                                                                ;
TTT@192.168.2.7:1521/orcl> alter system dump datafile 12 block 131;
System altered.

3.檢查跟蹤檔案發現:

Error: alter system dump datafile/tempfile: file 12 not readable

TTT@192.168.2.7:1521/orcl> select file#,rfile#,name from v$datafile where name like '%user%';
FILE#       RFILE# NAME
----- ------------ ------------------------------------------------------------------------------------------
   41           12 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/users.276.985549575

--//絕對檔案號是41.不是12.
TTT@192.168.2.7:1521/orcl> alter system dump datafile 41 block 131;
System altered.

--//檢查轉儲ok,也許以後在PDB下會遇到這類問題更多,一般以前存在表空間傳輸的情況。



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2737351/,如需轉載,請註明出處,否則將追究法律責任。

相關文章