ORA-20200: End Snapshot Id 2 does not exist for this database/instance

使用SP
调用下面这个过程,产生快照
exec statspack.snap

用SP有了快照后,怎样产生报告呢?
@?/rdbms/admin/spreport

出现以下错误:

Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 2
Begin Snapshot Id specified: 2

Enter value for end_snap: 5
End   Snapshot Id specified: 5


declare
*
ERROR at line 1:
ORA-20200: Begin Snapshot Id 2 does not exist for this database/instance
ORA-06512: at line 28

出错原因:

exec statspack.snap时,用的是sys用户,而没有用perfstat用户。

解决方法:用perfstat用户执行下面语句就行。

exec statspack.snap

@?/rdbms/admin/spresport.它会提示begin snapshot id与end snapshot id.

你可能感兴趣的:(ORA-20200: End Snapshot Id 2 does not exist for this database/instance)