Statspackのインストール

とりあえず、次回の実験のために、Statspackのインストールだけ
先にすませておきます。超簡単ですよ。


$ORACLE_HOME/rdbms/admin/spcreate.sql
を実行して、プロンプトに従うだけで、インストール完了です。


まず、実行します。

SQL> @?/rdbms/admin/spcreate

Choose the PERFSTAT user's password
-----------------------------------
Not specifying a password will result in the installation FAILING

perfstat_passwordに値を入力してください: perfstat
perfstat


Statspackの管理用ユーザ「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
------------------------------ --------- ----------------------------
SYSAUX                         PERMANENT *
USERS1                         PERMANENT

Pressing <return> will result in STATSPACK's recommended default
tablespace (identified by *) being used.

default_tablespaceに値を入力してください:

Using tablespace SYSAUX as PERFSTAT default tablespace.


「PERFSTAT」ユーザのデフォルト表領域を聞いてきます。
10g以降の場合は、そのままEnterを押せば、「SYSAUX」が選択されます。
使用方法的にここでいいと思いますが、
変更したい場合は、表領域名を入力してください。

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.

temporary_tablespaceに値を入力してください:

Using tablespace TEMP as PERFSTAT temporary tablespace.


同じくここはデフォルト一時表領域。
そのままEnterすれば、データベースのデフォルト一時表領域の設定が
そのまま反映される形になります。
同じように、変更したい場合は表領域名を入力。


ここまで終われば後は放置。

... Creating PERFSTAT user


... Installing required packages


... Creating views


... Granting privileges

NOTE:
SPCUSR complete. Please check spcusr.lis for any errors.

SQL>
SQL> --
SQL> --  Build the tables and synonyms
SQL> connect perfstat/&&perfstat_password

(中略)

Creating Package STATSPACK...

パッケージが作成されました。

エラーはありません。
Creating Package Body STATSPACK...

パッケージ本体が作成されました。

エラーはありません。

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

SQL>


はい、終了。
簡単ですね。