设为首页 收藏本站
查看: 1057|回复: 0

[经验分享] Oracle技术之AWR概述—导出

[复制链接]

尚未签到

发表于 2018-9-26 10:50:34 | 显示全部楼层 |阅读模式
  AWR的SNAP生成后,不一定要在原数据库上生成报告,可以利用AWR提供的导出、导入功能,将AWR数据迁移到测试数据库上进一步分析。
  AWR的导出并不复杂,利用有权限的用户调用$ORACLE_HOME/rdbms/admin/awrextr.sql脚本就可以了:
  SQL> @?/rdbms/admin/awrextr.sql
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Disclaimer: This SQL/Plus script. should only be called under
  the guidance of Oracle Support.
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~~~~~~~~~~~~~
  AWR EXTRACT
  ~~~~~~~~~~~~~
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~  This script. will extract the AWR data for a range of snapshots  ~
  ~  into a dump file.  The script. will prompt users for the         ~
  ~  following information:                                          ~

  ~     (1) database>  ~     (2) snapshot range to extract                                ~
  ~     (3) name of directory object                                 ~
  ~     (4) name of dump file                                        ~
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Databases in this Workload Repository schema
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  DB>  ------------ ------------ ------------
  * 96312462   TESTRAC      racnode1
  * 96312462   TESTRAC      racnode2
  * 96312462   TESTRAC      racnode3
  3944144691 CCICDB       ccicdbsrv5

  The default database>
  database>  输入dbid的值:

  Using   96312462 for Database>  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  without
  specifying a number lists all completed snapshots.
  输入num_days的值:  3
  Listing the last 3 days of Completed Snapshots

  DB Name        Snap>  ------------ --------- ------------------
  TESTRAC           2758 14 11月2010 00:00
  2759 14 11月2010 01:00
  2760 14 11月2010 02:00
  .
  .
  .
  2780 14 11月2010 22:00
  2781 14 11月2010 23:00
  2782 15 11月2010 00:00
  2783 15 11月2010 01:00
  2784 15 11月2010 02:00
  2785 15 11月2010 03:00
  2786 15 11月2010 04:00
  2787 15 11月2010 05:00
  2788 15 11月2010 06:00
  2789 15 11月2010 07:00
  2790 15 11月2010 08:00
  2791 15 11月2010 09:00
  2792 15 11月2010 10:00
  2793 15 11月2010 11:00
  2794 15 11月2010 12:00
  2795 15 11月2010 13:00
  2796 15 11月2010 14:00
  2797 15 11月2010 15:00
  2798 15 11月2010 16:00
  2799 15 11月2010 17:00
  2800 15 11月2010 18:00
  2801 15 11月2010 19:00
  2802 15 11月2010 20:00
  2803 15 11月2010 21:00
  2804 15 11月2010 22:00
  2805 15 11月2010 23:00
  2806 16 11月2010 00:00
  .
  .
  .
  2822 16 11月2010 16:00
  2823 16 11月2010 17:00

  Specify the Begin and End Snapshot>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  输入begin_snap的值:  2782

  Begin Snapshot>  输入end_snap的值:  2806

  End   Snapshot>  Specify the Directory Name
  ~~~~~~~~~~~~~~~~~~~~~~~~~~
  Directory Name                 Directory Path
  ------------------------------ -------------------------------------------------
  ADMIN_DIR                      /data/oracle/product/10.2/database/md/admin
  DATA_PUMP_DIR                  /data/oracle/product/10.2/database/rdbms/log/
  D_AWR                          /data1/awr
  ORACLE_OCM_CONFIG_DIR          /data/oracle/product/10.2/database/ccr/state
  WORK_DIR                       /data/oracle/product/10.2/database/work
  Choose a Directory Name from the above list (case-sensitive).
  输入directory_name的值:  D_AWR
  Using the dump directory: D_AWR
  Specify the Name of the Extract Dump File
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  The prefix for the default dump file name is awrdat_2782_2806.
  To use this name, press  to continue, otherwise enter

  an>  输入file_name的值:  awr_testrac_2782_2806
  Using the dump file prefix: awr_testrac_2782_2806
  |
  | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  |  The AWR extract dump file will be located
  |  in the following directory/file:
  |   /data1/awr
  |   awr_testrac_2782_2806.dmp
  | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  |
  |  *** AWR Extract Started ...
  |
  |  This operation will take a few moments. The
  |  progress of the AWR extract operation can be
  |  monitored in the following directory/file:
  |   /data1/awr
  |   awr_testrac_2782_2806.log
  |
  WHERE (dbid, snap_id) IN (SELECT dbid, snap_id FROM SYS.WRM$_SNAPSHOT WHERE DBID = 96312462 AND SNAP_ID >=
  2782 AND SNAP_ID  host ls -l /data1/awr/awr_testrac*
  -rw-rw----   1 oracle   oinstall 17158144 Nov 16 17:32 /data1/awr/awr_testrac_2782_2806.dmp
  -rw-rw-r--   1 oracle   oinstall   25939 Nov 16 17:32 /data1/awr/awr_testrac_2782_2806.log
  其中dmp文件就是脚本利用数据泵导出的snap数据,将这个文件拷贝到目标数据库上执行导入,就可以实现AWR数据的迁移。
  oracle视频教程请关注:http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-602267-1-1.html 上篇帖子: Oracle技术之10204 AWR导入性能问题 下篇帖子: Oracle技术之V$SESSION_LONGOPS超过系统时间
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表