首页 > Linux操作系统 > Linux操作系统 > statspack学习及操作实践
今天实验操作了一把。操作步骤如下:
step1:连接sysdba用户
Enter user-name: sys/sys as sysdba
step2:创建表空间
SQL> create tablespace perfstat datafile 'd:/oracle/oradata/mydb/perfstat.dbf' size 100m;
Tablespace created.
SQL> alter database datafile 'd:/oracle/oradata/mydb/perfstat.dbf' resize 200m;
Database altered.
step3:执行statspack创建脚本
SQL> start d:\oracle\ora92/rdbms\admin/spcreate.sql
step4:输入相关提示信息
Specify PERFSTAT password
Enter value for perfstat_password: perfstatSpecify PERFSTAT user's default tablespace
Enter value for default_tablespace: perfstatSpecify PERFSTAT user's temporary tablespace.
Enter value for temporary_tablespace: temp
step5:可在用户默认目录下看创建结果文件
C:\Documents and Settings\jiangzhiqiang
step6:执行两次statspack.snap:
SQL> execute statspack.snap
PL/SQL procedure successfully completed.
SQL> execute statspack.snap
PL/SQL procedure successfully completed.
step7:输出报表
SQL> start d:\oracle\ora92/rdbms\admin/spreport.sql
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 1
Begin Snapshot Id specified: 1Enter value for end_snap: 2
End Snapshot Id specified: 2
Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is sp_1_2. To use this name,
pressto continue, otherwise enter an alternative.
Enter value for report_name:Using the report name sp_1_2
step8:报表文件C:\Documents and Settings\jiangzhiqiang\sp_1_2.LST
step9:需要好好研究sp_1_2.LST
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/95429/viewspace-264842/ ,如需转载,请注明出处,否则将追究法律责任。