在线精品99_中国九九盗摄偷拍偷看_91免费版在线观看_91.app_91高清视频在线_99热最新网站

Oracle怎样部署Statspack并生成报告

128次阅读
没有评论

共计 5124 个字符,预计需要花费 13 分钟才能阅读完成。

Oracle 怎样部署 Statspack 并生成报告,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。

Oracle 部署 Statspack

[实验环境]
操作系统 RedHat 5.5
主机名 lxh
数据库版本 Oracle 10.2.0
字符集 GHS16GBK
生产库实例名 prod

[实验过程]
1. 部署 statspack

1.1、创建一个专门用于 statspack 的表空间 statspack

SYS@ prod create tablespace statspack datafile /u01/app/oracle/oradata/prod/statspack01.dbf size 300m;

1.2、以 sysdba 身份执行创建 prefstat 对象的脚本
SYS@ prod @?/rdbms/admin/spcreate.sql
Choose the PERFSTAT user s password
———————————–
Not specifying a password will result in the installation FAILING

Enter value for perfstat_password:oracle
oracle
Choose the Default tablespace for the PERFSTAT user
—————————————————
Below is the list of online tablespaces in this database which can
store user data.  Specifying the SYSTEM tablespace for the user s
default tablespace will result in the installation FAILING, as
using SYSTEM for performance data is not supported.
Choose the PERFSTAT users s default tablespace.  This is the tablespace
in which the STATSPACK tables and indexes will be created.
TABLESPACE_NAME                CONTENTS  STATSPACK DEFAULT TABLESPACE
—————————— ——— —————————-
EXAMPLE                        PERMANENT
STATSPACK                      PERMANENT
SYSAUX                         PERMANENT *
TBS1                           PERMANENT
TEST3                          PERMANENT
USERS                          PERMANENT

Pressing return will result in STATSPACK s recommended default
tablespace (identified by *) being used.

Enter value for default_tablespace:statspack
Using tablespace STATSPACK as PERFSTAT default tablespace.
Choose the Temporary tablespace for the PERFSTAT user
—————————————————–
Below is the list of online tablespaces in this database which can
store temporary data (e.g. for sort workareas).  Specifying the SYSTEM
tablespace for the user s temporary tablespace will result in the
installation FAILING, as using SYSTEM for workareas is not supported.
Choose the PERFSTAT user s Temporary tablespace.
TABLESPACE_NAME                CONTENTS  DB DEFAULT TEMP TABLESPACE
—————————— ——— ————————–
TEMP                           TEMPORARY *
Pressing return will result in the database s default Temporary
tablespace (identified by *) being used.
Enter value for temporary_tablespace: 回车
… …
NOTE:
SPCPKG complete. Please check spcpkg.lis for any errors.
PERFSTAT@ prod

Statstack 安装完成。

1.3、设置 statspack 自动产生快照的间隔时间为 15 分钟

[oracle@James ~]$vi /u01/app/oracle/product/10.2.0/db_1/rdbms/admin/spauto.sql
variable jobno number;
variable instno number;
begin
 select instance_number into :instno from v$instance;
 dbms_job.submit(:jobno, statspack.snap; ,trunc(sysdate+1/96, MI), trunc(SYSDATE+1/96, MI) , TRUE, :instno);
 commit;
end;
/
1.4、设置快照的默认级别为 7 级

SYS@ prod exec statspack.modify_statspack_parameter(i_snap_level=

2. 产生 statspack 报告

2.1、启动 statspack 的自动快照

SCOTT@ prod conn perfstat/oracle
PERFSTAT@ prod @?/rdbms/admin/spauto

2.2、验证 statspack 自动生成的报告

PERFSTAT@prod alter session set nls_date_format= yyyy-mm-dd hh34:mi:ss
PERFSTAT@prod select snap_id,snap_time,snap_level from stats$snapshot order by snap_time;

  SNAP_ID SNAP_TIME           SNAP_LEVEL
———- ——————- ———-
        1 2014-08-25 17:52:02          7
        2 2014-08-25 19:05:03          7
        3 2014-08-25 19:20:04          7
        4 2014-08-25 19:35:05          7
        5 2014-08-25 19:50:05          7
        6 2014-08-25 20:05:01          7

2.3、生成 statspack 分析报告
SQL @?/rdbms/admin/spreport

Current Instance
~~~~~~~~~~~~~~~~
  DB Id    DB Name      Inst Num Instance
———– ———— ——– ————
 199802235 PROD                1 prod
Instances in this Statspack schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  DB Id    Inst Num DB Name      Instance     Host
———– ——– ———— ———— ————
 199802235        1 PROD         prod         lxh

Using  199802235 for database Id
Using          1 for instance number
Specify the number of days of snapshots to choose from
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Entering the number of days (n) will result in the most recent
(n) days of snapshots being listed.  Pressing return without
specifying a number lists all completed snapshots.
Listing all Completed Snapshots
                                                      Snap
Instance     DB Name        Snap Id   Snap Started    Level Comment
———— ———— ——— —————– —– ——————–
prod         PROD                 1 25 Aug 2014 17:52     7

                                 2 25 Aug 2014 19:05     7
                                 3 25 Aug 2014 19:20     7
                                 4 25 Aug 2014 19:35     7
                                 5 25 Aug 2014 19:50     7
                                 6 25 Aug 2014 20:05     7
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap:2
Enter value for end_snap: 3
Enter value for report_name:

@?/rdbms/admin/spreport

Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 3
Enter value for end_snap: 4
Enter value for report_name:

Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 4
Enter value for end_snap: 5
Enter value for report_name:

Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 5
Enter value for end_snap: 6
Enter value for report_name:

2.4、取消 statspack 自动生成快照
查看 job ID
PERFSTAT@ prod select job,log_user,last_date,next_date from user_jobs;

      JOB LOG_USER                       LAST_DATE           NEXT_DATE
———- —————————— ——————- ——————-
       22 PERFSTAT                       2014-08-25 20:05:01 2014-08-25 20:20:00

PERFSTAT@ prod exec dbms_job.remove(22

关于 Oracle 怎样部署 Statspack 并生成报告问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很多疑惑没有解开,可以关注丸趣 TV 行业资讯频道了解更多相关知识。

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-18发表,共计5124字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)
主站蜘蛛池模板: 精品久久久久久无码人妻热 | 亚洲精品一区二区三区五区 | 久久久高清免费视频 | 男人的天堂av社区在线 | 国产美女精品一区二区三区 | 国产一级又裸又黄又裸又 | 99久久99热久久精品免费看 | 亚洲成av人影院 | 久久久青草青青亚洲国产免观 | 国内精品一区二区三区最新 | 日韩欧美一区二区三区永久免费 | 四虎必出精品亚洲高清 | 夜鲁很鲁在线视频 | 国产三级午夜理伦三级 | 中文字幕一区二区三区久久网站 | 国产成人在线免费视频 | 伊人久久大香线焦在观看 | 丰满人妻熟妇乱又仑精品 | 国产一区二区精品久 | 日韩亚洲天堂 | 青青青国产高清在线观看视频 | 亚洲国产专区 | 好爽别插了无码视频 | 伊人久久大线蕉香港三级 | 欧美一级淫片a免费视频 | 啊v在线免费观看 | 四虎影视www在线播放 | 999久久久无码国产精品 | 麻豆亚洲一区 | 香蕉视频链接 | 国产97公开成人免费视频 | www.亚洲天堂| 久久久日韩精品国产成人 | 综合欧美日韩一区二区三区 | 99热久久国产这里有只有精品 | 国产精品日韩欧美亚洲另类 | 亚洲资源最新版在线观看 | 国产免费久久精品丫丫 | 成人综合久久综合 | 国产午夜精品无码 | 久久尹人香蕉国产免费天天 |