查詢DBA_SEGMENTS,bytes=0
昨天遇到一個奇怪的問題,查詢DBA_SEGMENTS顯示的bytes=0,系統是開發商安裝的,oracle版本是9.2.0.8 for windows的。
查詢dba_segment 的定義如下:
CREATE OR REPLACE FORCE VIEW SYS.dba_segments (owner,
segment_name,
partition_name,
segment_type,
tablespace_name,
header_file,
header_block,
BYTES,
blocks,
extents,
initial_extent,
next_extent,
min_extents,
max_extents,
pct_increase,
FREELISTS,
freelist_groups,
relative_fno,
BUFFER_POOL
)
AS
SELECT owner, segment_name, partition_name, segment_type, tablespace_name,
header_file, header_block,
DBMS_SPACE_ADMIN.segment_number_blocks (tablespace_id,
relative_fno,
header_block,
segment_type_id,
buffer_pool_id,
segment_flags,
segment_objd,
blocks
)
* BLOCKSIZE,
DBMS_SPACE_ADMIN.segment_number_blocks (tablespace_id,
relative_fno,
header_block,
segment_type_id,
buffer_pool_id,
segment_flags,
segment_objd,
blocks
),
DBMS_SPACE_ADMIN.segment_number_extents (tablespace_id,
relative_fno,
header_block,
segment_type_id,
buffer_pool_id,
segment_flags,
segment_objd,
extents
),
initial_extent, next_extent, min_extents, max_extents, pct_increase,
FREELISTS, freelist_groups, relative_fno,
DECODE (buffer_pool_id,
0, 'DEFAULT',
1, 'KEEP',
2, 'RECYCLE',
NULL
)
FROM sys_dba_segs;
觀察另外的機器,發現這個定義不對,應該是:
CREATE OR REPLACE FORCE VIEW SYS.dba_segments (owner,
segment_name,
partition_name,
segment_type,
tablespace_name,
header_file,
header_block,
BYTES,
blocks,
extents,
initial_extent,
next_extent,
min_extents,
max_extents,
pct_increase,
FREELISTS,
freelist_groups,
relative_fno,
BUFFER_POOL
)
AS
SELECT owner, segment_name, partition_name, segment_type, tablespace_name,
header_file, header_block,
DECODE
(BITAND (segment_flags, 131072),
131072, blocks,
(DECODE
(BITAND (segment_flags, 1),
1, DBMS_SPACE_ADMIN.segment_number_blocks
(tablespace_id,
relative_fno,
header_block,
segment_type_id,
buffer_pool_id,
segment_flags,
segment_objd,
blocks
),
blocks
)
)
)
* BLOCKSIZE,
DECODE
(BITAND (segment_flags, 131072),
131072, blocks,
(DECODE
(BITAND (segment_flags, 1),
1, DBMS_SPACE_ADMIN.segment_number_blocks
(tablespace_id,
relative_fno,
header_block,
segment_type_id,
buffer_pool_id,
segment_flags,
segment_objd,
blocks
),
blocks
)
)
),
DECODE
(BITAND (segment_flags, 131072),
131072, extents,
(DECODE
(BITAND (segment_flags, 1),
1, DBMS_SPACE_ADMIN.segment_number_extents
(tablespace_id,
relative_fno,
header_block,
segment_type_id,
buffer_pool_id,
segment_flags,
segment_objd,
extents
),
extents
)
)
),
initial_extent, next_extent, min_extents, max_extents, pct_increase,
FREELISTS, freelist_groups, relative_fno,
DECODE (buffer_pool_id,
0, 'DEFAULT',
1, 'KEEP',
2, 'RECYCLE',
NULL
)
FROM sys_dba_segs;
怎麼會出現這樣的情況下,僅僅發現如下連結:
並沒有給出解決問題的答案。
我的感覺對方是複製安裝的。而且版本不是9.2.0.8.
我開始重新執行catalog.sql,cateproc.sql命令,結果執行中出現如下錯誤:
ORA-00604: 遞迴 SQL 層 1 出現錯誤
ORA-04020: 嘗試鎖定物件 SYS.CDC_ALTER_CTABLE_BEFORE 時檢測到死鎖
關閉再開啟還是依舊,查詢到如下連結:
http://www.itpub.net/thread-1026878-1-1.html
按照如下方法解決:
SolutionSet the following in the INIT.ORA then restart the database:
_system_trig_enabled=false
aq_tm_processes=0
job_queue_processes=0
Then rerun CATALOG.SQL.
完成後在檢視dba_segment檢視,一些OK。
查詢dba_segment 的定義如下:
CREATE OR REPLACE FORCE VIEW SYS.dba_segments (owner,
segment_name,
partition_name,
segment_type,
tablespace_name,
header_file,
header_block,
BYTES,
blocks,
extents,
initial_extent,
next_extent,
min_extents,
max_extents,
pct_increase,
FREELISTS,
freelist_groups,
relative_fno,
BUFFER_POOL
)
AS
SELECT owner, segment_name, partition_name, segment_type, tablespace_name,
header_file, header_block,
DBMS_SPACE_ADMIN.segment_number_blocks (tablespace_id,
relative_fno,
header_block,
segment_type_id,
buffer_pool_id,
segment_flags,
segment_objd,
blocks
)
* BLOCKSIZE,
DBMS_SPACE_ADMIN.segment_number_blocks (tablespace_id,
relative_fno,
header_block,
segment_type_id,
buffer_pool_id,
segment_flags,
segment_objd,
blocks
),
DBMS_SPACE_ADMIN.segment_number_extents (tablespace_id,
relative_fno,
header_block,
segment_type_id,
buffer_pool_id,
segment_flags,
segment_objd,
extents
),
initial_extent, next_extent, min_extents, max_extents, pct_increase,
FREELISTS, freelist_groups, relative_fno,
DECODE (buffer_pool_id,
0, 'DEFAULT',
1, 'KEEP',
2, 'RECYCLE',
NULL
)
FROM sys_dba_segs;
觀察另外的機器,發現這個定義不對,應該是:
CREATE OR REPLACE FORCE VIEW SYS.dba_segments (owner,
segment_name,
partition_name,
segment_type,
tablespace_name,
header_file,
header_block,
BYTES,
blocks,
extents,
initial_extent,
next_extent,
min_extents,
max_extents,
pct_increase,
FREELISTS,
freelist_groups,
relative_fno,
BUFFER_POOL
)
AS
SELECT owner, segment_name, partition_name, segment_type, tablespace_name,
header_file, header_block,
DECODE
(BITAND (segment_flags, 131072),
131072, blocks,
(DECODE
(BITAND (segment_flags, 1),
1, DBMS_SPACE_ADMIN.segment_number_blocks
(tablespace_id,
relative_fno,
header_block,
segment_type_id,
buffer_pool_id,
segment_flags,
segment_objd,
blocks
),
blocks
)
)
)
* BLOCKSIZE,
DECODE
(BITAND (segment_flags, 131072),
131072, blocks,
(DECODE
(BITAND (segment_flags, 1),
1, DBMS_SPACE_ADMIN.segment_number_blocks
(tablespace_id,
relative_fno,
header_block,
segment_type_id,
buffer_pool_id,
segment_flags,
segment_objd,
blocks
),
blocks
)
)
),
DECODE
(BITAND (segment_flags, 131072),
131072, extents,
(DECODE
(BITAND (segment_flags, 1),
1, DBMS_SPACE_ADMIN.segment_number_extents
(tablespace_id,
relative_fno,
header_block,
segment_type_id,
buffer_pool_id,
segment_flags,
segment_objd,
extents
),
extents
)
)
),
initial_extent, next_extent, min_extents, max_extents, pct_increase,
FREELISTS, freelist_groups, relative_fno,
DECODE (buffer_pool_id,
0, 'DEFAULT',
1, 'KEEP',
2, 'RECYCLE',
NULL
)
FROM sys_dba_segs;
怎麼會出現這樣的情況下,僅僅發現如下連結:
並沒有給出解決問題的答案。
我的感覺對方是複製安裝的。而且版本不是9.2.0.8.
我開始重新執行catalog.sql,cateproc.sql命令,結果執行中出現如下錯誤:
ORA-00604: 遞迴 SQL 層 1 出現錯誤
ORA-04020: 嘗試鎖定物件 SYS.CDC_ALTER_CTABLE_BEFORE 時檢測到死鎖
關閉再開啟還是依舊,查詢到如下連結:
http://www.itpub.net/thread-1026878-1-1.html
按照如下方法解決:
SolutionSet the following in the INIT.ORA then restart the database:
_system_trig_enabled=false
aq_tm_processes=0
job_queue_processes=0
Then rerun CATALOG.SQL.
完成後在檢視dba_segment檢視,一些OK。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-663346/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL 查詢常用操作(0) —— 查詢語句的執行順序MySql
- dba_segments與dba_rollback_segs查詢到的rollback結果不一樣(原創)
- ORACLE錯誤原因查詢表ORA-0Oracle
- Dba_segments詳解
- SQL查詢的:子查詢和多表查詢SQL
- 查詢之折半查詢
- mysql-分組查詢-子查詢-連線查詢-組合查詢MySql
- InnoDB: Error: log file ./ib_logfile0 is of different size 5242880 bytesError
- 複雜查詢—子查詢
- 查詢——二分查詢
- 子查詢-表子查詢
- 查詢(1)--靜態查詢
- 查詢(2)--動態查詢
- 作業系統中資料檔案與ORACLE資料庫中查詢的bytes大小不同的解析作業系統Oracle資料庫
- MYSQL學習筆記25: 多表查詢(子查詢)[標量子查詢,列子查詢]MySql筆記
- 資料庫 - 連線查詢、巢狀查詢、集合查詢資料庫巢狀
- 離線查詢與線上查詢
- 【SQL查詢】集合查詢之INTERSECTSQL
- 查詢與排序02,折半查詢排序
- bit,bytes
- 查詢
- #查詢演算法#【1】簡單查詢:順序、折半查詢演算法
- Elasticsearch從0到千萬級資料查詢實踐(非轉載)Elasticsearch
- 關於 MyBatis-Plus 分頁查詢的探討 → count 都為 0 了,為什麼還要查詢記錄?MyBatis
- oracle 精確查詢和模糊查詢Oracle
- 查詢演算法__插值查詢演算法
- pgsql查詢優化之模糊查詢SQL優化
- MySQL - 資料查詢 - 簡單查詢MySql
- Elasticsearch複合查詢——boosting查詢Elasticsearch
- MySQL聯結查詢和子查詢MySql
- select查詢之三:子查詢
- select查詢之一:普通查詢
- [Mysql 查詢語句]——查詢欄位MySql
- Python查詢-二分查詢Python
- group by,having查詢 ”每**“的查詢
- B樹查詢,磁碟查詢資料
- PostgreSQL實時高效搜尋-全文檢索、模糊查詢、正則查詢、相似查詢、ADHOC查詢SQL
- 21億Q綁查詢21億Q綁查詢21億Q綁查詢21億Q綁查詢21億Q綁查詢