Statspack是Oracle自带的性能分析工具。安装需要使用sysdba权限的用户,并需要指定Statspack的用户密码、默认表空间和临时表空间。
脚本路径:$ORACLE_HOME/rdbms/admin
安装脚本:spcreate.sql
删除脚本:spdrop.sql (如果安装失败,可以通过spdrop.sql删除已经创建的内容,然后分析spcpkg.lis日志,确定问题后可以再次使用spcreate.sql进行安装)
安装成功后或切换到PERFSTAT下
具体安装步骤如下:
1、cd $ORACLE_HOME/rdbms/admin
2、sqlplus / as sysdba
2、执行 spcreate.sql(@spcreate.sql)
执行spcreate.sql后,开始statspack的安装,内容(这里删除了系统日志)如下:
-
SQL> @spcreate.sql
-
-
Choose the PERFSTAT user\'s password
-
-----------------------------------
-
Not specifying a password will result in the installation FAILING
-
-
Enter value for perfstat_password: moyefeng
-
-
Choose the Default tablespace for the PERFSTAT user
-
---------------------------------------------------
-
…………
-
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
-
PERFSTAT 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
-
-
Using tablespace PERFSTAT as PERFSTAT default tablespace.
-
-
-
Choose the Temporary tablespace for the PERFSTAT user
-
-----------------------------------------------------
-
…………
-
Choose the PERFSTAT user\'s Temporary tablespace.
-
-
TABLESPACE_NAME CONTENTS DB DEFAULT TEMP TABLESPACE
-
------------------------------ --------- --------------------------
-
TEMP TEMPORARY *
-
-
Pressing <return> will result in the database is default Temporary
-
tablespace (identified by *) being used.
-
-
Enter value for temporary_tablespace: TEMP
-
-
…………
-
Creating Package STATSPACK...
-
-
Package created.
-
-
No errors.
-
Creating Package Body STATSPACK...
-
-
Package body created.
-
-
No errors.
-
-
NOTE:
-
SPCPKG complete. Please check spcpkg.lis for any errors.
-
-
SQL> show user
-
USER is "PERFSTAT"
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/20753330/viewspace-1136534/
,如需转载,请注明出处,否则将追究法律责任。