oracle statspack学习(一)(五)

2014-11-24 11:29:42 · 作者: · 浏览: 1
部创建的表,我们也可以直接查看。
7)删除report数据。
oracle 提供了两种方法,一种是delete,另一种是truncate
分别对应脚本sqpurge.sql和sptrunc.sql
[oracle@oracle-one admin]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Sat Sep 14 20:47:57 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/sppurge
Database Instance currently connected to
========================================
Instance
DB Id DB Name Inst Num Name
----------- ---------- -------- ----------
2738540715 RHYS 1 RHYS
Snapshots for this database instance
。。。。。。。。。。。。。。。。。。。
SQL> @ /rdbms/admin/sptrunc
Warning
~~~~~~~
Running sptrunc.sql removes ALL data from Statspack tables. You may
wish to export the data before continuing.
About to Truncate Statspack Tables
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If would like to exit WITHOUT truncating the tables, enter any text at the
begin_or_exit prompt (e.g. 'exit'), otherwise if you would like to begin
the truncate operation, press
Enter value for begin_or_exit:
Entered at the 'begin_or_exit' prompt
... Starting truncate operation
Table truncated.
Table truncated.
Table truncated.
Table truncated.
。。。。。。。。。。。。。。。。。
8)导出数据
statspack中的数据是存在于表中的,有时候需要对这些数据发送给support,那么statspack提供了导出数据的脚本为: spuexp.par
file=spuexp.dmp log=spuexp.log compress=y grants=y indexes=y rows=y constraints=y owner=PERFSTAT consistent=y
可以使用exp导出数据
eg:
[oracle@oracle-one admin]$ exp perfstat/amy parfile=./spuexp.par
Export: Release 11.2.0.4.0 - Production on Sat Sep 14 20:55:28 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. 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
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses WE8MSWIN1252 character set (possible charset conversion)
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user PERFSTAT
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user PERFSTAT
About to export PERFSTAT's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export PERFSTAT's tables via Conventional Path ...
. . exporting table STATS$BUFFERED_QUEUES 0 rows exported
. . exporting table STATS$BUFFERED_SUBSCRIBERS 0 rows exported
. . exporting table STATS$BUFFER_POOL_STATISTICS 1 rows exported
. . exporting table STATS$CR_BLOCK_SERVER 0 rows exported
. . exporting table STATS$CURRENT_BLOCK_SERVER 0 rows exported
. . exporting table STATS$DATABASE_INSTANCE 1 rows exported
. . exporting table STATS$DB_CACHE_ADVICE 21 rows exported
. . exporting table STATS$DLM_MISC 0 rows exported
. . expor