oracle statspack学习(一)(二)

2014-11-24 11:29:42 · 作者: · 浏览: 5
--r--. 1 oracle oinstall 16396 Mar 6 2012 spcusr.sql
-rw-r--r--. 1 oracle oinstall 94461 Mar 6 2012 spctab.sql
-rw-r--r--. 1 oracle oinstall 212780 Mar 6 2012 spcpkg.sql
[oracle@oracle-one admin]$ more spcreate.sql
Rem
Rem $Header: spcreate.sql 16-apr-2002.11:22:55 vbarrier Exp $
Rem
Rem spcreate.sql
Rem
Rem Copyright (c) 1999, 2002, Oracle Corporation. All rights reserved.
Rem
Rem NAME
Rem spcreate.sql - Statistics Create
Rem
Rem DESCRIPTION
Rem SQL*PLUS command file which creates the STATSPACK user,
Rem tables and package for the performance diagnostic tool STATSPACK
Rem
Rem NOTES
Rem Note the script connects INTERNAL and so must be run from
Rem an account which is able to connect internal.
Rem
Rem MODIFIED (MM/DD/YY)
Rem cdialeri 02/16/00 - 1191805
Rem cdialeri 12/06/99 - 1103031
Rem cdialeri 08/13/99 - Created
Rem
--
-- Create PERFSTAT user and required privileges
@@spcusr
--
-- Build the tables and synonyms
connect perfstat/&&perfstat_password
@@spctab
-- Create the statistics Package
@@spcpkg
可以看到在创建statspack的时候是引用了两个脚本,一个为创建对象的spctab.sql另一个是创建包的spcpkg.sql
[oracle@oracle-one admin]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Sat Sep 14 19:38:34 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> @ /rdbms/admin/spcreate
Choose the PERFSTAT user's password
-----------------------------------
Not specifying a password will result in the installation FAILING((((((((这是创建用户perfstat,并指定密码为:amy))))
Enter value for perfstat_password: amy
amy
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
------------------------------ --------- ----------------------------
EXAMPLE PERMANENT
STATSPACK PERMANENT
SYSAUX PERMANENT *
USERS PERMANENT
Pressing will result in STATSPACK's recommended default
tablespace (identified by *) being used.
Enter value for default_tablespace: statspack
Using tablespace STATSPACK as PERFSTAT default tablespace.
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.(((((((((选择临时表空间)))))))