C:\Documents and Settings\Administrator>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:\Oracle\ORADATA\JSSWEB\SYSTEM01.DBF
F:\Oracle\ORADATA\JSSWEB\UNDOTBS01.DBF
F:\Oracle\ORADATA\JSSWEB\SYSAUX01.DBF
F:\Oracle\ORADATA\JSSWEB\USERS01.DBF
F:\Oracle\ORADATA\JSSWEB\JSSWEB.DBF
SQL> create tablespace perfstat datafile 'f:\Oracle\oradata\JSsweb\perfstat.dbf' size 2000m;
此處需要注意創建的數據文件大小。Statspack的報表數據還是相當占空間的,特別是在多次連續采樣的情況下。
表空間已創建。
SQL> @spcreate
執行statspack的安裝包。該文件物理存放於$Oracle_home\rdbms\admin\spcreate.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 <return> 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,安裝完成了~