Oracle Database health status check

Source: Internet
Author: User

Database health status check
Use utl directives, Statspack, awr to check the health of the database


Premise:

> Show parameter time_ timed_statistics;
NAME                                 TYPE        VALUE-----------------------------------------------------------------------------timed_ Statistics                     Boolean     TRUE


1:utl

# before #在 8i only this way, of course, in the subsequent version still has this function

$ cd/doiido/oracle/product/11.2.0.1/db_1/rdbms/admin
$ sqlplus/as SYSDBA
> @utlbstat. sql
> @utlestat. sql
# #上面两条指令分别代表了开始时间以及关闭时间 and then generate a report.txt file in the current directory


2:statspack
# #在 The method used in 8i,9i , of course, in the subsequent version of the feature also exists, the advantage is that you can use the job to dispatch it
2.1 First create a table space, you can not build, but must have at least 80M of space
sql> CREATE tablespace statspack datafile '/doiido/oracle/oradata/statspack.dbf ' SIZE 100M autoextend on NEXT 100M MAXS IZE 500M EXTENT MANAGEMENT local UNIFORM SIZE 128K SEGMENT SPACE MANAGEMENT Auto;


2.2 For Statspack Installation
$ cd/doiido/oracle/product/11.2.0.1/db_1/rdbms/admin
$ sqlplus/as SYSDBA
> @spcreate. sql
# #接下来会自动创建一个用户, you need to enter the password for this user, and also let you choose the default tablespace, the default temp table space

2.3 Use Statspack to generate performance reports manually. To crawl a snapshot, you must2 times or more
sql> Conn Perfstat/oracle
Sql> exec Statspack.snap
sql> exec Statspack.snap

2.4 Generating reports
sql> @spreport. SQL
# #这里会提示你输入报告的开始和结束的快照ID, attention must beA continuous snapshot within the same cycle without interrupting the database,It will then let you choose the name of the report, or you can choose default, report generation by default under the current directory

2.5 Other Features
(1) If the installation process is wrong
You must first delete with Spdrop.sql, spcreate.sql create the relevant information
Sql> Conn/as SYSDBA
sql> @spdrop. sql
sql> @spcreate. SQL


(2) Install Statspack to Auto-execute, grab snapshot once per hour
> @spauto. SQL
# #检查任务中是否有这个任务, and you can see the job ID
sql> SELECT * from Dba_job;
# #如果不想自动抓取快照, write down the job ID and execute it
Sql> Conn Perfstat/oracle
sql> exec dbms_remove (n)


3:arw
# #在10gLater versions support this feature, which is turned on by default
$ cd/doiido/oracle/product/11.2.0.1/db_1/rdbms/admin
> @awrrpt. SQL
# #然后让你选是要什么格式的 (default is HTML format), also to select the start and end of the snapshot ID, and then define the output file name can be generated in the current directory

Oracle Database health status check

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.