温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Oracle重建awr步骤

发布时间:2020-08-09 20:33:47 来源:ITPUB博客 阅读:252 作者:甲骨文技术支持 栏目:关系型数据库
1.稳妥起见,建议停机重建

2.如果是rac环境需要修改如下参数:

  1. alter system set cluster_database = false scope = spfile;
3.执行如下脚本开始清除,执行速度很快,因为都是drop,如果遇到某个表不存在的报错,无须理会

  1. @?/rdbms/admin/catnoawr.sql
4.运行脚本执行重建

  1. @?/rdbms/admin/catawrtb.sql
5.运行脚本编译无效对象

  1. @?/rdbms/admin/utlrp.sql
6. 11g运行如下脚本

  1. @?/rdbms/admin/execsvrm.sql
运行这个脚本的时候,遇到如下报错:

  1. BEGIN
  2. *
  3. ERROR at line 1:
  4. ORA-04068: existing state of packages has been discarded
  5. ORA-04061: existing state of package "SYS.DBMS_SWRF_INTERNAL" has been
  6. invalidated
  7. ORA-04065: not executed, altered or dropped package "SYS.DBMS_SWRF_INTERNAL"
  8. ORA-06508: PL/SQL: could not find program unit being called:
  9. "SYS.DBMS_SWRF_INTERNAL"
  10. ORA-06512: at line 3
解决办法是对包重新编译:

  1. alter package dbms_swrf_internal compile;
  2. alter package dbms_swrf_internal compile body;
7.重新执行第六步

8.生成一个报告试试

  1. exec dbms_workload_repository.create_snapshot;
遇到如下报错:

  1. SQL> exec dbms_workload_repository.create_snapshot;
  2. BEGIN dbms_workload_repository.create_snapshot; END;

  3. *
  4. ERROR at line 1:
  5. ORA-13518: Invalid database id (819500514)
  6. ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 99
  7. ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 122
  8. ORA-06512: at line 1
在MOS上找到一篇文章说了这个问题


  1. ORA-13518 : 'Invalid Database Id' On Call to DBMS_WORKLOAD_REPOSITORY Package [ID 984447.1]


    Changes
     Recently AWR was recreated using catnoawr.sql and catawrtb.sql. 
    Cause
     When a function / procedure is called from DBMS_WORKLOAD_REPOSITORY package,  it refers table WRM$_DATABASE_INSTANCE to get dbid information.
     As the AWR repositories has been recreated , the table doesn't not have any data present in it. 
     
    SQL> select * from WRM$_DATABASE_INSTANCE ;
     no rows selected


    Solution
    The WRM$_DATABASE_INSTANCE gets populated with instance information when the instance is rebooted. 
    So, If you have recreated AWR using catnoawr.sql , catawrtb.sql , then you need to bounce the Instance . 
    On restart , the table will be populated with the requisite information. 
    Hence , better option for recreating AWR is to use startup restrict method. 
    After the recreation activity is completed , shutdown the database and open it normally.


9.重启后问题解决

10.修改rac 相关参数

  1. alter system set cluster_database =truescope= spfile;
11.生成awr报告

  1. @$ORACLE_HOME/rdbms/admin/awrrpt.sql




向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI