大家好:
    我的环境是 SUSE Linux Enterprise Server 11 + Oracle 11gR2,有两个数据库: orcl 和 demo。
我在 demo 数据库中运行 awrrpt.sql 检查脚本时,在输入起始Snap Id 为 1,结束 Snap Id 为 2时,提示错误,如下:
SQL> @/oracle/product/database/rdbms/admin/awrrpt.sqlCurrent Instance
~~~~~~~~~~~~~~~~   DB Id    DB Name      Inst Num Instance
----------- ------------ -------- ------------
 3559378370 DEMO                1 demoElapsed: 00:00:00.01
Elapsed: 00:00:00.01Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
Would you like an HTML report, or a plain text report?
Enter 'html' for an HTML report, or 'text' for plain text
Defaults to 'html'
Enter value for report_type: textType Specified:                  text
Elapsed: 00:00:00.00
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   DB Id     Inst Num DB Name      Instance     Host
------------ -------- ------------ ------------ ------------
* 3559378370        1 DEMO         demo         SLES11Using 3559378370 for database Id
Using          1 for instance number
Specify the number of days of snapshots to choose from
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Entering the number of days (n) will result in the most recent
(n) days of snapshots being listed.  Pressing <return> without
specifying a number lists all completed snapshots.
Enter value for num_days: 1Listing the last day's Completed Snapshots                                                        Snap
Instance     DB Name        Snap Id    Snap Started    Level
------------ ------------ --------- ------------------ -----
demo         DEMO                 1 13 May 2013 11:00      1                                  2 13 May 2013 14:31      1Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 1
Begin Snapshot Id specified: 1Enter value for end_snap: 2
End   Snapshot Id specified: 2
declare
*
ERROR at line 1:
ORA-20200: The instance was shutdown between snapshots 1 and 2
ORA-06512: at line 42

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
------
请问这是什么原因导致的,起始和结束 Snap Id应该填什么才正确呢?
待复,感谢!oracle11gawr

解决方案 »

  1.   

    13 May 2013 11:00--13 May 2013 14:31之间数据库曾经关闭过两次快照之间是不能停机的
      

  2.   


    您好,那请问如何创建数据库的快照呢?可以给出详细的语句参考一下吗?谢谢!
    网上查到的好像很凌乱,好像要先创建dblink?
      

  3.   

    取得 可用 的snap id
    select to_char(s.startup_time,'dd Mon "at" HH24:mi:ss')  instart_fmt
         , di.instance_name                                  inst_name
         , di.db_name                                        db_name
         , s.snap_id                                         snap_id
         , to_char(s.end_interval_time,'dd Mon YYYY HH24:mi') snapdat
         , s.snap_level                                      lvl
      from dba_hist_snapshot s
         , dba_hist_database_instance di
     where di.dbid             = s.dbid
       and di.instance_number  = s.instance_number
       and di.startup_time     = s.startup_time
     order by db_name, instance_name, snap_id;
      

  4.   

    手动收集一次snap信息
    begin
      DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT;
    end;
      

  5.   

    你好,那请问这个数据库快照是指当时数据库的镜像吗?如果我要利用awr检查数据库的性能,如果即时创建一个快照,根据这个快照进行巡检,是巡检从什么时候到什么时候数据库的性能状态呢?
      

  6.   

    你应该是在本地虚拟机上做的测试吧,
     
    这个错误是说你的两个快照执行的两个时间段是不连续的,可能是因为你第一个快照执行后数据库被停掉了,然后在重启后执行了第二个快照,那个AWR报告用的两个快照应该是在数据库持续运行过程中生成的两个快照。
      

  7.   

    前短时间我刚整理一点比较简单的快照管理文档,你可以到http://blog.csdn.net/mensuo1111/article/details/8900381
    看下,希望对你有点帮助
      

  8.   

    两个 SNAPSHOT id之间是不能重启过数据库的。