{"id":655,"date":"2012-07-26T15:17:08","date_gmt":"2012-07-26T06:17:08","guid":{"rendered":"http:\/\/www.whoocus.com\/blog\/?p=655"},"modified":"2012-07-26T15:19:49","modified_gmt":"2012-07-26T06:19:49","slug":"statspack%e3%81%ae%e4%bd%bf%e7%94%a8%e6%ba%96%e5%82%99%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.blowfish.co.jp\/?p=655","title":{"rendered":"StatsPack\u306e\u4f7f\u7528\u6e96\u5099\u3002"},"content":{"rendered":"<p>StatsPack\u3092\u4f7f\u7528\u3057\u3066\u307f\u3088\u3046\u3068\u8a66\u307f\u308b\u3002<br \/>\n[bash]<br \/>\nSQL&gt; @$ORACLE_HOME\/rdbms\/admin\/spcreate.sql<br \/>\n[\/bash]<\/p>\n<p>\u3057\u304b\u3057\u30a8\u30e9\u30fc\u3002<br \/>\n\u3069\u3046\u3084\u3089\u3001X$KCBFWAIT \u3068\u3044\u3046view\u3092\u53c2\u7167\u3059\u308b\u6a29\u9650\u304c\u306a\u3044\u3089\u3057\u3044\u3002<br \/>\n[bash]<br \/>\n&#8230; Creating views<br \/>\ncreate or replace view STATS$X_$KCBFWAIT as select * from X$KCBFWAIT<br \/>\n                                                          *<br \/>\n\u884c1\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002:<br \/>\nORA-00942: \u8868\u307e\u305f\u306f\u30d3\u30e5\u30fc\u304c\u5b58\u5728\u3057\u307e\u305b\u3093<br \/>\n[\/bash]<\/p>\n<p>sysdba\u6a29\u9650\u3067\u63a5\u7d9a\u3057\u3066\u307f\u308b\u3002<br \/>\n\u3057\u304b\u3057\u3001OS\u30e6\u30fc\u30b6\u304c oralce\u30e6\u30fc\u30b6\u3067\u306a\u3044\u3068sysdba\u6a29\u9650\u304c\u30c0\u30e1\u3089\u3057\u3044\u3002<br \/>\n[bash]<br \/>\nOracle Database 11g Release 11.2.0.1.0 &#8211; 64bit Production<br \/>\n\u306b\u63a5\u7d9a\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\nSQL&gt; connect \/ as sysdba<br \/>\nERROR:<br \/>\nORA-01031: \u6a29\u9650\u304c\u4e0d\u8db3\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n[\/bash]<\/p>\n<p>\u3069\u3046\u3084\u3089\u3001OS\u306eoracle\u30e6\u30fc\u30b6\u3067\u306a\u3044\u3068\u6012\u3089\u308c\u308b\u3088\u3046\u3060\u3002<br \/>\n\u4eca\u307e\u3067\u3001\u666e\u901a\u306b\u4f55\u3068\u306a\u304f\u77e5\u3063\u3066\u3044\u308b\u3064\u3082\u308a\u3067Oracle\u306b\u63a5\u3057\u3066\u304d\u305f\u3002\u305d\u306e\u3064\u3051\u3042\u3063\u3066\u3061\u3087\u3063\u3068\u30cf\u30de\u308b\u3002<br \/>\n\u53cd\u7701\u3002<\/p>\n<p>[bash]<br \/>\nsu oracle<br \/>\n[\/bash]<\/p>\n<p>\u3053\u3093\u3069\u306fOS\u306e\u30e6\u30fc\u30b6\u3092\u5909\u3048\u3066\u3001system\u30e6\u30fc\u30b6\u3067\u30ed\u30b0\u30a4\u30f3\u3002\u305d\u3057\u3066 sysdba\u3068\u3057\u3066\u63a5\u7d9a\u3002<br \/>\n[bash]<br \/>\n[oracle@work]$ sqlplus system\/xxxxx<\/p>\n<p>SQL*Plus: Release 11.2.0.1.0 Production on \u6728 7\u6708 26 14:49:17 2012<br \/>\nCopyright (c) 1982, 2009, Oracle.  All rights reserved.<br \/>\nOracle Database 11g Release 11.2.0.1.0 &#8211; 64bit Production<br \/>\n\u306b\u63a5\u7d9a\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\nSQL&gt; connect \/ as sysdba<br \/>\n\u63a5\u7d9a\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n[\/bash]<\/p>\n<p>\u6c17\u3092\u53d6\u308a\u76f4\u3057\u3066\u518d\u5ea6\u5b9f\u884c\u3002<br \/>\n[bash]<br \/>\nSQL&gt; @$ORACLE_HOME\/rdbms\/admin\/spcreate.sql<br \/>\n[\/bash]<\/p>\n<p>\u3057\u304b\u3057\u307e\u305f\u30a8\u30e9\u30fc\u3002<br \/>\n\u3069\u3046\u3084\u3089\u5148\u7a0b\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u5b9f\u884c\u304c\u4e2d\u9014\u534a\u7aef\u3067\u3001\u30e6\u30fc\u30b6\u3060\u3051\u6b8b\u3063\u3066\u3057\u307e\u3063\u305f\u3088\u3046\u3060\u3002<\/p>\n<p>[bash]<br \/>\n&#8230; Creating PERFSTAT user<br \/>\ncreate user perfstat<br \/>\n            *<br \/>\n\u884c1\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002:<br \/>\nORA-01920: \u30e6\u30fc\u30b6\u30fc\u540d&#8217;PERFSTAT&#8217;\u306f\u4ed6\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u307e\u305f\u306f\u30ed\u30fc\u30eb\u540d\u3068\u7af6\u5408\u3057\u3066\u3044\u307e\u3059<br \/>\nOracle Database 11g Release 11.2.0.1.0 &#8211; 64bit Production\u3068\u306e\u63a5\u7d9a\u304c\u5207\u65ad\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n[\/bash]<\/p>\n<p>\u8ff7\u308f\u305a\u3001drop user\u3002<br \/>\n[bash]<br \/>\nSQL&gt; drop user perfstat cascade;<br \/>\n\u30e6\u30fc\u30b6\u30fc\u304c\u524a\u9664\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n[\/bash]<\/p>\n<p>\u305d\u3057\u3066\u3001$ORACLE_HOME\/rdbms\/admin\/spcreate.sql \u3092\u5b9f\u884c\u3002<br \/>\nPERFSTAT\u30e6\u30fc\u30b6\u304c\u4f5c\u3089\u308c\u308b\u306e\u3067\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u3068\u304b\u8868\u9818\u57df\u3068\u304b\u4e00\u6642\u8868\u9818\u57df\u3068\u304b\u5c0b\u306d\u3089\u308c\u308b\u3002<\/p>\n<p>[bash]<br \/>\nSQL&gt; @$ORACLE_HOME\/rdbms\/admin\/spcreate.sql<\/p>\n<p>Choose the PERFSTAT user&#8217;s password<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nNot specifying a password will result in the installation FAILING<\/p>\n<p>perfstat_password\u306b\u5024\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044: xxxxxx<br \/>\nperfstat<br \/>\nChoose the Default tablespace for the PERFSTAT user<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nBelow is the list of online tablespaces in this database which can<br \/>\nstore user data.  Specifying the SYSTEM tablespace for the user&#8217;s<br \/>\ndefault tablespace will result in the installation FAILING, as<br \/>\nusing SYSTEM for performance data is not supported.<\/p>\n<p>Choose the PERFSTAT users&#8217;s default tablespace.  This is the tablespace<br \/>\nin which the STATSPACK tables and indexes will be created.<\/p>\n<p>TABLESPACE_NAME                CONTENTS  STATSPACK DEFAULT TABLESPACE<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nDATA1                          PERMANENT<br \/>\nINDEX1                         PERMANENT<br \/>\nSET_DTL                        PERMANENT<br \/>\nSET_HST                        PERMANENT<br \/>\nSET_HST2                       PERMANENT<br \/>\nSET_IDX                        PERMANENT<br \/>\nSET_RP                         PERMANENT<br \/>\nSET_SWK                        PERMANENT<br \/>\nSET_TMP                        PERMANENT<br \/>\nSYSAUX                         PERMANENT *<br \/>\nUSERS                          PERMANENT<\/p>\n<p>Pressing &lt;return&gt; will result in STATSPACK&#8217;s recommended default<br \/>\ntablespace (identified by *) being used.<\/p>\n<p>default_tablespace\u306b\u5024\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044:<\/p>\n<p>Using tablespace SYSAUX as PERFSTAT default tablespace.<\/p>\n<p>Choose the Temporary tablespace for the PERFSTAT user<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nBelow is the list of online tablespaces in this database which can<br \/>\nstore temporary data (e.g. for sort workareas).  Specifying the SYSTEM<br \/>\ntablespace for the user&#8217;s temporary tablespace will result in the<br \/>\ninstallation FAILING, as using SYSTEM for workareas is not supported.<\/p>\n<p>Choose the PERFSTAT user&#8217;s Temporary tablespace.<\/p>\n<p>TABLESPACE_NAME                CONTENTS  DB DEFAULT TEMP TABLESPACE<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nTEMP                           TEMPORARY *<\/p>\n<p>Pressing &lt;return&gt; will result in the database&#8217;s default Temporary<br \/>\ntablespace (identified by *) being used.<\/p>\n<p>temporary_tablespace\u306b\u5024\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044:<\/p>\n<p>Using tablespace TEMP as PERFSTAT temporary tablespace.<br \/>\n[\/bash]<\/p>\n<p>\u3059\u308b\u3068\u3001\u5b9f\u884c\u3055\u308c\u308b\u3002<br \/>\n[bash]<br \/>\n&#8230; Creating PERFSTAT user<br \/>\n&#8230; Installing required packages<br \/>\n&#8230; Creating views<br \/>\n&#8230; Granting privileges<br \/>\nNOTE:<br \/>\nSPCUSR complete. Please check spcusr.lis for any errors.<\/p>\n<p>SQL&gt;<br \/>\nSQL&gt; &#8212;<br \/>\nSQL&gt; &#8212;  Build the tables and synonyms<br \/>\nSQL&gt; connect perfstat\/&amp;&amp;perfstat_password<br \/>\n\u63a5\u7d9a\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\nSQL&gt;<br \/>\nSQL&gt; set showmode off echo off;<\/p>\n<p>\u2026\u7701\u7565\u2026<\/p>\n<p>&#8230; Creating STATS$SNAPSHOT_ID Sequence<\/p>\n<p>\u9806\u5e8f\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n\u30b7\u30ce\u30cb\u30e0\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n&#8230; Creating STATS$&#8230; tables<br \/>\n\u8868\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n\u30b7\u30ce\u30cb\u30e0\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n1\u884c\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n1\u884c\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u2026\u7701\u7565\u2026<\/p>\n<p>NOTE:<br \/>\nSPCTAB complete. Please check spctab.lis for any errors.<br \/>\nSQL&gt; &#8212;  Create the statistics Package<br \/>\nSQL&gt; @@spcpkg<br \/>\nSQL&gt; Rem<br \/>\nSQL&gt; Rem    densor.uk   03\/31\/93 &#8211; Modified<br \/>\nSQL&gt; Rem    cellis.uk   11\/15\/89 &#8211; Created<br \/>\nSQL&gt; Rem<br \/>\nSQL&gt;<br \/>\nSQL&gt; set echo off;<br \/>\nCreating Package STATSPACK&#8230;<\/p>\n<p>\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u30a8\u30e9\u30fc\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\nCreating Package Body STATSPACK&#8230;<\/p>\n<p>\u30d1\u30c3\u30b1\u30fc\u30b8\u672c\u4f53\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u30a8\u30e9\u30fc\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>NOTE:<br \/>\nSPCPKG complete. Please check spcpkg.lis for any errors.<br \/>\nSQL&gt;<br \/>\n[\/bash]<\/p>\n<p>\u3046\u307e\u304f\u3044\u3063\u305f\u3088\u3046\u3060\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>StatsPack\u3092\u4f7f\u7528\u3057\u3066\u307f\u3088\u3046\u3068\u8a66\u307f\u308b\u3002 [bash] SQL&gt; @$ORACLE_HOME\/rdbms\/admin\/spcreate.sql [\/bash] \u3057\u304b\u3057\u30a8\u30e9\u30fc\u3002 \u3069\u3046\u3084\u3089\u3001X$KCBFWAIT \u3068 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"saved_in_kubio":false,"footnotes":""},"categories":[12,4],"tags":[],"class_list":["post-655","post","type-post","status-publish","format-standard","hentry","category-oracle","category-tech"],"_links":{"self":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=655"}],"version-history":[{"count":2,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/655\/revisions"}],"predecessor-version":[{"id":657,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/655\/revisions\/657"}],"wp:attachment":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}