Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1206957
  • 博文数量: 350
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 5668
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-23 17:53
文章分类

全部博文(350)

文章存档

2013年(350)

分类: Oracle

2013-04-24 13:27:58

预计分3个章节:

statspack初步学和用(1) 安装初步

statspack初步学和用(2) 使用初步

statspack初步学和用(3) 分析初步


  Statspack是一款功能强大的,免费的,oracle自带的性能分析工具。需要用具有sysdba权限的用户登陆进行安装。

C:Documents and SettingsAdministrator>sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 9月 5 09:23:33 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

连接到:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

SQL>

SQL> show user;

USER is "SYS"

SQL> set lines 100

SQL> select file_name from dba_data_files;

FILE_NAME

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

F:ORACLEORADATAJSSWEBSYSTEM01.DBF

F:ORACLEORADATAJSSWEBUNDOTBS01.DBF

F:ORACLEORADATAJSSWEBSYSAUX01.DBF

F:ORACLEORADATAJSSWEBUSERS01.DBF

F:ORACLEORADATAJSSWEBJSSWEB.DBF

SQL> create tablespace perfstat datafile 'f:oracleoradatajsswebperfstat.dbf' size 2000m;

此处需要注意创建的数据文件大小。Statspack的报表数据还是相当占空间的,特别是在多次连续采样的情况下。

表空间已创建。

SQL> @spcreate

执行statspack的安装包。该文件物理存放于$oracle_home dbmsadminspcreate.sql

Choose the PERFSTAT user's password

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

Not specifying a password will result in the installation FAILING

输入 perfstat_password 的值: perfstat

perfstat

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

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

JSSWEB PERMANENT

PERFSTAT PERMANENT

SYSAUX PERMANENT *

USERS PERMANENT

Pressing will result in STATSPACK's recommended default

tablespace (identified by *) being used.

输入用户默认的表空间。就是我们刚创建的那个,以及临时表空间。

输入 default_tablespace 的值: perfstat

..........

..........

输入 temporary_tablespace 的值: temp

..........

..........

NOTE:

SPCPKG complete. Please check spcpkg.lis for any errors.

安装完成后,系统会自动切换到perfstat用户下。安装过程中的日志被记录在spcpkg.lis。关于安装日志我看到网上不少文章中都提到其生成路径与spcreate.sql相同,但是我这里却给创建到my documents目录下了,不知道哪里设置日志存储路径。

如果安装过程中出现错误,可以通过执行@spdrop删除相关对象,然后检查日志,确认出错原因,再次执行@spcreate进行创建。

SQL> show user;

USER is "PERFSTAT"

ok,安装完成了~


阅读(662) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~