Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

96

积分

0

好友

4

主题
1#
发表于 2012-3-16 11:34:10 | 查看: 5238| 回复: 2
hcheck工具怎么用,有什么用途?
2#
发表于 2012-3-16 16:49:13
"hcheck.sql" script to check for known problems in Oracle8i, Oracle9i, Oracle10g and Oracle 11g [ID 136697.1]

--------------------------------------------------------------------------------

  Modified 13-MAR-2012     Type SCRIPT     Status PUBLISHED   

  
  

Abstract  
Pro-actively detecting common data dictionary problems

Product Name, Product Version RDBMS, 9i onwards  
Stable/Old Release 2.00 (Discontinued - Supports 8i)
Current/New Release 3.45  
Date New: Thu Mar 1 13:52:11 CET 2012 / Old: Tue Mar 1 11:13:40 CET 2011
Platform  Platform Independent
Date Created  23-MAR-2001

Instructions  
Execution Environment:
     

Access Privileges:
     Requires to be run connected as SYS schema

Usage:$ sqlplus SQL*Plus: Release 9.2.0.2.0 - Production on Mon Nov 11 12:00:06 2002

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Enter user-name: / as sysdba

Connected to:
Oracle9i Enterprise Edition Release 9.2.0.2.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.2.0 - Production  SQL> set serveroutput on size unlimitedSQL> spool outputfileSQL> execute hcheck.full     
     

Instructions:

1. Connect as SYS schema in sqlplus2. Create package hOut as described in Note:101468.13. Create package hcheck in SYS schema (Refer the attachment under SCRIPT to Create package hcheck  4. spool outputfile5. execute hcheck.full

6. Output will go to the spool file and the session trace file.
   The script will report various dictionary related issues
   which may or may not be a problem - Any problems reported
   should be reviewed by an experienced support analyst as some
   reported "problems" may be normal and expected.


PROOFREAD THE SCRIPT BEFORE USING IT! Due to differences in the way text
editors, e-mail packages, and operating systems handle text formatting (spaces,
tabs, and carriage returns), this script may not be in an executable state
when you first receive it. Check over the script to ensure that errors of
this type are corrected.The script will produce an output file named [outputfile].
This file can be viewed in a browser or uploaded for support analysis.


Description  
To provide a single package which looks for common data dictionary
problems.
The script can be used with Oracle versions 9i onwards (release 2.00 includes 8.1)
It checks consistency of certain dictionary relationships and looks for certain
known issues - certain reported "problems" will be normal and expected.

This script is for use mainly under the guidance of Oracle Support.

References  
Note:101468.1 "hout.sql" script to install the "hOut" helper package
Note:101466.1 Introduction to the "H*" Helper Scripts

Script  
The script is no longer included inline but can be downloaded here:
hcheck2.sql .
hcheck3.sql .



Disclaimer  
EXCEPT WHERE EXPRESSLY PROVIDED OTHERWISE, THE INFORMATION, SOFTWARE,
PROVIDED ON AN "AS IS" AND "AS AVAILABLE" BASIS. ORACLE EXPRESSLY DISCLAIMS
ALL WARRANTIES OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NON-INFRINGEMENT. ORACLE MAKES NO WARRANTY THAT: (A) THE RESULTS
THAT MAY BE OBTAINED FROM THE USE OF THE SOFTWARE WILL BE ACCURATE OR
RELIABLE; OR (B) THE INFORMATION, OR OTHER MATERIAL OBTAINED WILL MEET YOUR
EXPECTATIONS. ANY CONTENT, MATERIALS, INFORMATION OR SOFTWARE DOWNLOADED OR
OTHERWISE OBTAINED IS DONE AT YOUR OWN DISCRETION AND RISK. ORACLE SHALL HAVE
NO RESPONSIBILITY FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR LOSS OF DATA THAT
RESULTS FROM THE DOWNLOAD OF ANY CONTENT, MATERIALS, INFORMATION OR SOFTWARE.

ORACLE RESERVES THE RIGHT TO MAKE CHANGES OR UPDATES TO THE SOFTWARE AT ANY
TIME WITHOUT NOTICE.

Limitation of Liability  
IN NO EVENT SHALL ORACLE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL OR CONSEQUENTIAL DAMAGES, OR DAMAGES FOR LOSS OF PROFITS, REVENUE,
DATA OR USE, INCURRED BY YOU OR ANY THIRD PARTY, WHETHER IN AN ACTION IN
CONTRACT OR TORT, ARISING FROM YOUR ACCESS TO, OR USE OF, THE SOFTWARE.

SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OR EXCLUSION OF LIABILITY.
ACCORDINGLY, SOME OF THE ABOVE LIMITATIONS MAY NOT APPLY TO YOU.

回复 只看该作者 道具 举报

3#
发表于 2012-3-19 20:41:10
HCHECK.SQL 脚本是 ORACLE SUPPORT 开发的 11g DICTIONARY HEALTH CHECK 出现前的  数据字典检查方案。

通过该脚本 可以发现数据字典的不一致问题, Oracle 数据字典不一致可能造成DB 使用故障。

具体用法:

下载 HOUT.SQL 和 HCHECK.SQL ,并先后运行:

sample:
SQL> @hout
Package created.
No errors.
Package body created.

SQL> @hcheck
Package created.
No errors.
Package body created.
No errors.

HCheck Version 8i-11/1.60
Problem:  Duplicate DATAOBJ#, may be valid under the following:
          - Using Transportable Tablespaces
          - OBJ's belong to different tablespaces
DATAOBJ#=51667 OBJ#=52267 Name=HR.REGIONS  Type#=2
DATAOBJ#=51671 OBJ#=52272 Name=HR.LOCATIONS  Type#=2
DATAOBJ#=51674 OBJ#=52277 Name=HR.DEPARTMENTS  Type#=2
DATAOBJ#=51677 OBJ#=52280 Name=HR.JOBS  Type#=2
DATAOBJ#=51709 OBJ#=52305 Name=OE.WAREHOUSES  Type#=2
DATAOBJ#=51717 OBJ#=52314 Name=OE.ORDER_ITEMS  Type#=2
DATAOBJ#=51721 OBJ#=52319 Name=OE.ORDERS  Type#=2
DATAOBJ#=51725 OBJ#=52327 Name=OE.PRODUCT_INFORMATION  Type#=2
DATAOBJ#=51729 OBJ#=52333 Name=OE.PROMOTIONS  Type#=2
Problem:  Dependency$ p_timestamp mismatch for VALID objects
May be Ok - needs checking, (Warning: [W], Error: [E]).
[E] - P_OBJ#=52850 D_OBJ#=52851
Found 10 potential problems and 0 warnings
Contact Oracle Support with the output
to check if the above needs attention or not
PL/SQL procedure successfully completed.


具体参考 http://www.oracledatabase12g.com ... and-oracle-11g.html

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-11-15 07:30 , Processed in 0.048261 second(s), 22 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569