执行、安装-11g--statspack安装-by小雨
这段间时笔者几篇文章介绍了改执行、安装-的文章. 关联文章的地址
11g2中安装statspack,最好还是sys户用安装。安装程过如下:
1:首先创立表空间 用于放置statspack所发生的数据:
create tablespace perfstat datafile '/u01/app/oracle/oradata/orcl/perfstat01.dbf' size 500m;
2:执行
SQL> @?/rdbms/admin/spcreate.sql 其中@:示表执行某个sql ?:号示表ORACLE_HOME量变
在执行该sql时 oracle会主动创立户用perfstat并要求你义定一个密码
Choose the PERFSTAT user's password
-----------------------------------
Not specifying a password will result in the installation FAILING
Enter value for 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
------------------------------ --------- ----------------------------
PRESTAT PERMANENT
SYSAUX PERMANENT *
USERS PERMANENT
Pressing <return> will result in STATSPACK's recommended default
tablespace (identified by *) being used.
Enter value for default_tablespace: perfstat
oracle还会指定临时表空间,一般都应用系统自带的表空间 就行:
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: TEMP
如果安装失败的话:可以在sqlplus下行运: @?/rdbms/admin/spdrop.sql
安装完成后行运statspack需注意:
2次执行的间隔间时控制在20分钟内。不能越跨停机间时(就是不能再执行中程过关机)
手动执行集采:
execute statspack.snap
执行该命令后 oracle会手机系统的信息(起码要执行2次该命令 oracle才能发生告报)
发生报表:
@?/rdbms/admin/spreport
执行该命令后,oracle会叫你输入开始的快照id,和 结束的快照id(oracle后用利这2个快照发生报表):
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 1
Begin Snapshot Id specified: 1
Enter value for end_snap: 2
End Snapshot Id specified: 2
然后oracle会要求你指定报表名字,该名字认默 是 sp_<start id>_<end id>.lst 即:sp_1_2.lst。11g中该文件在认默放在:os中oracle户用的根目录下:即:
[root@test ~]# su - oracle
[oracle@test ~]$ pwd
/home/oracle
[oracle@test ~]$ ll
总计 632
-rw-r--r-- 1 oracle dba 143984 04-17 14:54 sp_1_2.lst
-rw-r--r-- 1 oracle dba 195 04-17 14:44 spcpkg.lis
-rw-r--r-- 1 oracle dba 5377 04-17 14:44 spctab.lis
-rw-r--r-- 1 oracle dba 2541 04-17 14:44 spcusr.lis
-rw-r--r-- 1 oracle dba 19878 04-17 14:42 spdtab.lis
-rw-r--r-- 1 oracle dba 2062 04-17 14:42 spdusr.lis
由于发生的Snapshot 还是当相的占用空间的,所以有必要把不需要的snapshot除删;有2个品级:
1:除删一行:delete stats$snapshot where snap_id=1;
2:truncate全部表,行运:@?/rdbms/admin/sptrunc.sql 该sql是直接将persstat户用的全部表都空清!
文章结束给大家分享下程序员的一些笑话语录:
看到有人回帖“不顶不是中国人”,他的本意是想让帖子沉了。