Sunteți pe pagina 1din 2

log in as sys/oracle@orcl as sysdba

Step 2.
sql> @%ORACLE_HOME\rdbms\admin\spcreate.sql
Step 3. Provide a password.
Step 4. choose a default tablespace by hitting enter same thing for temp.
Step 5.
NOTE:
SPCPKG complete. Please check spcpkg.lis for any errors.
SQL> conn / as sysdba
Connected.
SQL> grant create job to perfstat;
Grant succeeded.
SQL> conn perfstat/strong_password
Connected.

SQL> begin
2 dbms_scheduler.create_job(job_name=>'PERF_STATS',
3 job_type=>'PLSQL_BLOCK',
4 job_action=>'begin statspack.snap(i_snap_level=>7); end;',
5 start_date=>( trunc(sysdate)
6 + (1 + floor((sysdate - trunc(sysdate))*1440/30)) / 48),
7 repeat_interval=>'freq=minutely;interval=30',
8 enabled=>true);
9 end;
10 /
PL/SQL procedure successfully completed.
SQL>

SQL> select state,enabled,run_count,last_start_date,next_run_date


2 from user_scheduler_jobs
3 where job_name='PERF_STATS';
STATE ENABL RUN_COUNT
--------------- ----- ----------
LAST_START_DATE
---------------------------------------------------------------------------
NEXT_RUN_DATE
---------------------------------------------------------------------------
SCHEDULED TRUE 0
30-JAN-10 11.00.00.000000 PM -05:00

1 row selected.

SQL>
SQL> @%ORACLE_HOME%\rdbms\admin\spreport
Current Instance
~~~~~~~~~~~~~~~~
DB Id DB Name Inst Num Instance
----------- ------------ -------- ------------
1218017680 ORCL 1 orcl

Instances in this Statspack schema


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Using 1218017680 for database Id
Using 1 for instance number
declare
*
ERROR at line 1:
ORA-20200: Database/Instance 1218017680/1 does not exist in
STATS$DATABASE_INSTANCE
ORA-06512: at line 23

Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Pr


oduction
With the Partitioning, OLAP and Data Mining options
C:\Users\akhan>

http://oraperf.com
www.ondataperf.com
desc perfstat.stats$.....

S-ar putea să vă placă și