前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Oracle 23c 中的 DBMS_HCHECK 包

Oracle 23c 中的 DBMS_HCHECK 包

作者头像
Yunjie Ge
发布2024-02-22 15:44:08
1040
发布2024-02-22 15:44:08
举报
文章被收录于专栏:数据库与编程

在 Oracle 23c 中,DBMS_HCHECK 包允许我们检查数据库中已知的数据字典问题。

几年前,Oracle 发布了 hcheck.sql 脚本(文档 ID 136697.1)来检查数据库中已知的数据字典问题。DBMS_HCHECK 包意味着我们不再需要下载 hcheck.sql 脚本来执行此操作。

DBMS_HCHECK.FULL

FULL 过程执行所有检查并在屏幕上显示输出,并将其写入跟踪文件。我们可以针对根容器或可插拔数据库运行它。

代码语言:javascript
复制
--conn sys/SysPassword1@//localhost:1521/free as sysdba
conn sys/SysPassword1@//localhost:1521/freepdb1 as sysdba


SQL> set serveroutput on size unlimited
SQL> exec dbms_hcheck.full
dbms_hcheck on 26-JUL-2023 19:16:19
----------------------------------------------
Catalog Version 23.0.0.0.0 (2300000000)
db_name: FREE
Is CDB?: YES CON_ID: 3 Container: FREEPDB1
Trace File: /opt/oracle/diag/rdbms/free/FREE/trace/FREE_ora_11866_HCHECK.trc

                                   Catalog       Fixed
Procedure Name                     Version    Vs Release    Timestamp
Result
------------------------------ ... ---------- -- ---------- --------------
------
.- OIDOnObjCol                 ... 2300000000 <=  *All Rel* 07/26 19:16:19 PASS
.- LobNotInObj                 ... 2300000000 <=  *All Rel* 07/26 19:16:19 PASS
.- SourceNotInObj              ... 2300000000 <=  *All Rel* 07/26 19:16:19 PASS
.- OversizedFiles              ... 2300000000 <=  *All Rel* 07/26 19:16:19 PASS
.- PoorDefaultStorage          ... 2300000000 <=  *All Rel* 07/26 19:16:19 PASS
.- PoorStorage                 ... 2300000000 <=  *All Rel* 07/26 19:16:19 PASS
.- TabPartCountMismatch        ... 2300000000 <=  *All Rel* 07/26 19:16:19 PASS
.- TabComPartObj               ... 2300000000 <=  *All Rel* 07/26 19:16:19 PASS
.- Mview                       ... 2300000000 <=  *All Rel* 07/26 19:16:19 PASS
.- ValidDir                    ... 2300000000 <=  *All Rel* 07/26 19:16:19 PASS
.- DuplicateDataobj            ... 2300000000 <=  *All Rel* 07/26 19:16:19 PASS
.- ObjSyn                      ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- ObjSeq                      ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- UndoSeg                     ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- IndexSeg                    ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- IndexPartitionSeg           ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- IndexSubPartitionSeg        ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- TableSeg                    ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- TablePartitionSeg           ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- TableSubPartitionSeg        ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- PartCol                     ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- ValidSeg                    ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- IndPartObj                  ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- DuplicateBlockUse           ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- FetUet                      ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- Uet0Check                   ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- SeglessUET                  ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- ValidInd                    ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- ValidTab                    ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- IcolDepCnt                  ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- ObjIndDobj                  ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- TrgAfterUpgrade             ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- ObjType0                    ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- ValidOwner                  ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- StmtAuditOnCommit           ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- PublicObjects               ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- SegFreelist                 ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- ValidDepends                ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- CheckDual                   ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- ObjectNames                 ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- ChkIotTs                    ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- NoSegmentIndex              ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- NextObject                  ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- DroppedROTS                 ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- FilBlkZero                  ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- DbmsSchemaCopy              ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- IdnseqObj                   ... 2300000000 >  1201000000 07/26 19:16:20 PASS
.- IdnseqSeq                   ... 2300000000 >  1201000000 07/26 19:16:20 PASS
.- ObjError                    ... 2300000000 >  1102000000 07/26 19:16:20 PASS
.- ObjNotLob                   ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- MaxControlfSeq              ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- SegNotInDeferredStg         ... 2300000000 >  1102000000 07/26 19:16:20 PASS
.- SystemNotRfile1             ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- DictOwnNonDefaultSYSTEM     ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- ValidateTrigger             ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- ObjNotTrigger               ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
.- InvalidTSMaxSCN             ... 2300000000 >  1202000000 07/26 19:16:20 PASS
.- OBJRecycleBin               ... 2300000000 <=  *All Rel* 07/26 19:16:20 PASS
---------------------------------------
26-JUL-2023 19:16:20  Elapsed: 1 secs
---------------------------------------
Found 0 potential problem(s) and 0 warning(s)
Trace File: /opt/oracle/diag/rdbms/free/FREE/trace/FREE_ora_11866_HCHECK.trc

PL/SQL procedure successfully completed.

SQL>

DBMS_HCHECK.CRITICAL

CRITICAL 过程仅执行关键检查并在屏幕上显示输出,并将其写入跟踪文件。我们可以针对根容器或可插拔数据库运行它。

代码语言:javascript
复制
--conn sys/SysPassword1@//localhost:1521/free as sysdba
conn sys/SysPassword1@//localhost:1521/freepdb1 as sysdba


SQL> set serveroutput on size unlimited
SQL> execute dbms_hcheck.critical
dbms_hcheck on 26-JUL-2023 19:19:29
----------------------------------------------
Catalog Version 23.0.0.0.0 (2300000000)
db_name: FREE
Is CDB?: YES CON_ID: 3 Container: FREEPDB1
Trace File: /opt/oracle/diag/rdbms/free/FREE/trace/FREE_ora_11866_HCHECK.trc

                                   Catalog       Fixed
Procedure Name                     Version    Vs Release    Timestamp
Result
------------------------------ ... ---------- -- ---------- --------------
------
.- UndoSeg                     ... 2300000000 <=  *All Rel* 07/26 19:19:29 PASS
.- MaxControlfSeq              ... 2300000000 <=  *All Rel* 07/26 19:19:29 PASS
.- InvalidTSMaxSCN             ... 2300000000 >  1202000000 07/26 19:19:29 PASS
---------------------------------------
26-JUL-2023 19:19:29  Elapsed: 0 secs
---------------------------------------
Found 0 potential problem(s) and 0 warning(s)
Trace File: /opt/oracle/diag/rdbms/free/FREE/trace/FREE_ora_11866_HCHECK.trc

PL/SQL procedure successfully completed.

SQL>
本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2024-02-04,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 山东Oracle用户组 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
容器服务
腾讯云容器服务(Tencent Kubernetes Engine, TKE)基于原生 kubernetes 提供以容器为核心的、高度可扩展的高性能容器管理服务,覆盖 Serverless、边缘计算、分布式云等多种业务部署场景,业内首创单个集群兼容多种计算节点的容器资源管理模式。同时产品作为云原生 Finops 领先布道者,主导开源项目Crane,全面助力客户实现资源优化、成本控制。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档