1. 概述

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: 2

Listing the last 2 days of Completed Snapshots

Snap

Instance DB Name Snap Id Snap Started Level

------------ ------------ --------- ------------------ -----

orcl ORCL 4759 29 Mar 2028 17:04 1

现象:查看snapshot生成历史,发现很长一段时间都没有生成snapshot

这是一个开发数据库,经过和开发沟通,由于业务测试经常修改操作服务器系统时间。

原因分析:由于修改操作系统时间,在修改成正确的时间后,snapshot 无法自动生成

2. 解决办法

2.1 查看所有的snapshot

SQL> select snap_id,dbid from dba_hist_snapshot order by 1;

SNAP_ID DBID

---------- ----------

4752 1373768042

4753 1373768042

4754 1373768042

4755 1373768042

4756 1373768042

4757 1373768042

4758 1373768042

2.2 删掉所有的已经存在的snapshot

dbms_workload_repository.drop_snapshot_range(low_snap_id=>4752,high_snap_id=>4758,dbid=> 1373768042);

2.3 手工创建新的snapshot

exec dbms_workload_repository.create_snapshot();

2.4 修改自动收集snapshot的周期测试

收集间隔时间改为30 分钟一次。并且保留5天时间

exec dbms_workload_repository.modify_snapshot_settings(interval=>30, retention=>5*24*60);

2.5 查看收集周期

SQL> select * from dba_hist_wr_control;

DBID SNAP_INTERVAL RETENTION TOPNSQL

---------- --------------------------------------------------------------------------- --------------------------------------------------------------------------- ----------

1373768042 +00000 00:30:00.0 +00008 00:00:00.0 DEFAULT

2.6 查看新生成的snapshot

SQL> select snap_id,dbid,BEGIN_INTERVAL_TIME from dba_hist_snapshot;

SNAP_ID DBID BEGIN_INTERVAL_TIME

---------- ---------- ---------------------------------------------------------------------------

4759 1373768042 29-MAR-17 04.51.37.190 PM

4760 1373768042 29-MAR-17 05.04.47.970 PM

2.7 正常生成AWR报告

SQL> @ $ORACLE_HOME/rdbms/admin/awrrpti.sql

Specify 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:

Type Specified: html

Instances in this Workload Repository schema

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

DB Id Inst Num DB Name Instance Host

------------ -------- ------------ ------------ ------------

* 1373768042 1 ORCL orcl ceshi

Enter value for dbid: 1373768042

Using 1373768042 for database Id

Enter value for inst_num: 1

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: 2

Listing the last 2 days of Completed Snapshots

Snap

Instance DB Name Snap Id Snap Started Level

------------ ------------ --------- ------------------ -----

orcl ORCL 4759 29 Mar 2017 17:04 1

4760 29 Mar 2017 17:13 1

Specify the Begin and End Snapshot Ids

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Enter value for begin_snap:

转载于:https://www.cnblogs.com/rencheng/p/6640888.html

Oracle 解决无法生成Snapshot问题的更多相关文章

  1. oracle中如何生成awr报告

    oracle中如何生成awr报告   1.进入数据库 sqlplus / as sysdba 2.查看用户 show parameter db_name 3.开始压测后执行 exec DBMS_WOR ...

  2. Oracle 解决【ORA-01704:字符串文字太长】(转)

    错误提示:oracle在toad中执行一段sql语句时,出现错误‘ORA-01704:字符串文字太长’.如下图: 原因:一般为包含有对CLOB字段的数据操作.如果CLOB字段的内容非常大的时候,会导致 ...

  3. Oracle解决索引碎片功能

    我们开始时向一个空的带索引的表中插入大量数据后,是不会产生碎片问题的,但是,数据库经过很长一段时间的增删改查后,难免会出现碎片问题,影响数据库的性能,Oracle对于这一问题有自己的解决方案. 下面介 ...

  4. ORACLE AWR报告生成步骤

    ORACLE AWR报告生成步骤 (以PL/SQL中命令窗口为例) 1.sqlplus或plsql的commod窗口(命令窗口)运行命令 @D:\oracle\product\10.2.0\db_1\ ...

  5. 解决 unity 生成 android apk read Resources

    http://www.cnblogs.com/solq/archive/2012/05/21/2511522.html TextAsset t = (TextAsset)Resources.Load( ...

  6. Oracle解决锁表语句与批量生成解锁语句

    --以下几个为相关表SELECT * FROM v$lock;SELECT * FROM v$sqlarea;SELECT * FROM v$session;SELECT * FROM v$proce ...

  7. Oracle AWRDD报告生成和性能分析

    我写的SQL调优专栏:https://blog.csdn.net/u014427391/article/category/8679315 对于局部的,比如某个页面列表sql,我们可以使用Oracle的 ...

  8. Oracle ADDM报告生成和性能分析

    我写的SQL调优专栏:https://blog.csdn.net/u014427391/article/category/8679315 对于局部的,比如某个页面列表sql,我们可以使用Oracle的 ...

  9. Oracle AWR报告生成和性能分析

    目录 一.AWE报告生成步骤 1.1 工具选择 1.2 自动创建快照 1.3 手工创建快照 1.4 生成AWR报告 二.AWR报告分析 2.1 AWR之DB Time 2.2 AWR之load_pro ...

随机推荐

  1. 20191213-RF中报告打不开提示Opening Robot Framework report failed

    配置好Jenkins的RF框架后跑了一次autotest发现哦豁report打不开,网上找了一堆方法都是只能临时解决,重启后又失效了.现在给出临时解决方案和永久解决方案 首先错误信息如下:  临时解决 ...

  2. nginx反向代理的一次实践

    场景:前端(VUE.js)应用部署在linux服务器,需要支持http和https访问. 问题1:阿里服务器不支持域名访问? 通过域名绑定服务器解决 问题2:如何通过http访问前端 前端通过ngin ...

  3. Logrotate滚动openresty日志

    一.摘要 Linux服务器上我们用Logrotate来分割归档日志文件,结合crond我们可以指定每天在某个时间自动整理日志等文档.本文主要说明了Centos下Logrotate的使用和配置的方法. ...

  4. Ubuntu 18.04 上使用xrdp远程桌面连接(Windows远程桌面连接)

    Ubuntu18.04设置#安装xrdpsudo apt-get install xrdp #安装vnc4serversudo apt-get install vnc4server tightvncs ...

  5. 查看MacOS中的Swift版本和SDK版本

    查看MacOS中的Swift版本和SDK版本 来源 https://juejin.im/post/5cde5a62f265da1bc55230e5 # 查看Swift版本 xcrun swift -v ...

  6. cxx11emu.h 和 logprint.h

    cxx11emu.h 和 logprint.h /* Start of cxx11emu.h */ #ifndef STDBP_CXX11EMU_H_ #define STDBP_CXX11EMU_H ...

  7. Java调用WebService方法总结(7)--CXF调用WebService

    CXF = Celtix + XFire,继承了Celtix和XFire两大开源项目的精华,是一个开源的,全功能的,容易使用的WebService框架.文中所使用到的软件版本:Java 1.8.0_1 ...

  8. java 使用GraphQL-关联对象

    GraphQL并不会实现关联查询,数据关联需要程序自己实现 官网首页有介绍获取多个资源只需要一个请求,如想获取用户信息和身份证信息,原来需要先查用户信息,再通过用户id查询身份证信息,而在GraphQ ...

  9. PHP写的简单数字验证码

    用PHP写的随机生成的5位数字验证码 $yzm = ""; for($i=0;$i<5;$i++) { $a = rand(0,9); $yzm.= $a; } echo $ ...

  10. Keil MDK fromelf生成bin文件

    找到Keil安装目录中fromelf.exe 配置Keil fromelf.exe --bin -o -\OBJ\LED.bin -\OBJ\LED.axf –bin:二进制文件 –i32:Intel ...