91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

AWR 導出/導入/生成報告

發布時間:2020-08-12 10:51:11 來源:ITPUB博客 閱讀:178 作者:不一樣的天空w 欄目:關系型數據庫
      客戶的生產系統總是那么重要,一般不會讓你長時間的在他們的生產機器上做操作,但是分析和生成AWR報告都是一個相對耗時的工作,當然只生成一個AWR報告是不費時的,但是要對系統進行詳細分析的時候,我們可能需要的是一段時間內的所有AWR數據,需要根據實際情況進行選取。這時我們就需要將客戶的AWR數據導出,然后進行分析,這個操作主要涉及AWR數據導出、導入和生成報告三個階段,下面對每個步驟進行詳細描述。
     1、導出

  1. SQL> @?/rdbms/admin/awrextr.sql
  2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. Disclaimer: This SQL/Plus script should only be called under
  5. the guidance of Oracle Support.
  6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


  8. ~~~~~~~~~~~~~
  9. AWR EXTRACT
  10. ~~~~~~~~~~~~~
  11. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  12. ~ This script will extract the AWR data for a range of snapshots ~
  13. ~ into a dump file. The script will prompt users for the     ~
  14. ~ following information:                     ~
  15. ~ (1) database id                         ~
  16. ~ (2) snapshot range to extract                 ~
  17. ~ (3) name of directory object                 ~
  18. ~ (4) name of dump file                     ~
  19. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


  20. Databases in this Workload Repository schema
  21. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  22.    DB Id DB Name     Host
  23. ------------ ------------ ------------
  24. * 2182516689 GYL     rac01
  25. * 2182516689 GYL     rac02

  26. The default database id is the local one: '2182516689'. To use this
  27. database id, press <return> to continue, otherwise enter an alternative.

  28. Enter value for dbid: 2182516689        <<<<<<<輸入DBID

  29. Using 2182516689 for Database ID


  30. Specify the number of days of snapshots to choose from
  31. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  32. Entering the number of days (n) will result in the most recent
  33. (n) days of snapshots being listed. Pressing <return> without
  34. specifying a number lists all completed snapshots.


  35. Enter value for num_days: 7                  <<<<<<<輸入需要導出數據的天數

  36. Listing the last 7 days of Completed Snapshots

  37. DB Name Snap Id     Snap Started
  38. ------------ --------- ------------------
  39. GYL         37 07 Nov 2014 10:05
  40.          38 07 Nov 2014 11:00
  41.          39 07 Nov 2014 12:00
  42.          40 07 Nov 2014 13:00
  43.          41 07 Nov 2014 14:00
  44.          42 07 Nov 2014 15:00
  45.          43 07 Nov 2014 16:00
  46.          44 10 Nov 2014 13:51
  47.          45 10 Nov 2014 15:00
  48.          46 10 Nov 2014 16:00
  49.          47 12 Nov 2014 14:11

  50. DB Name Snap Id     Snap Started
  51. ------------ --------- ------------------
  52. GYL         48 12 Nov 2014 14:37
  53.          49 12 Nov 2014 16:00
  54.          50 12 Nov 2014 17:00
  55.          51 12 Nov 2014 18:00
  56.          52 13 Nov 2014 10:16
  57.          53 13 Nov 2014 11:00
  58.          54 13 Nov 2014 12:00
  59.          55 13 Nov 2014 13:00
  60.          56 13 Nov 2014 14:00
  61.          57 13 Nov 2014 16:21


  62. Specify the Begin and End Snapshot Ids
  63. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  64. Enter value for begin_snap: 52            <<<<<<< 輸入起始snap_id
  65. Begin Snapshot Id specified: 52           

  66. Enter value for end_snap: 57              <<<<<<< 輸入結束snap_id
  67. End Snapshot Id specified: 57


  68. Specify the Directory Name
  69. ~~~~~~~~~~~~~~~~~~~~~~~~~~

  70. Directory Name         Directory Path
  71. ------------------------------ -------------------------------------------------
  72. DATA_PUMP_DIR         /oracle/app/oracle/product/10.2/db_1/rdbms/log/
  73. ORACLE_OCM_CONFIG_DIR     /oracle/app/oracle/product/10.2/db_1/ccr/state

  74. Choose a Directory Name from the above list (case-sensitive).

  75. Enter value for directory_name: DATA_PUMP_DIR

  76. Using the dump directory: DATA_PUMP_DIR             <<<<<<< 指定一個存放導出數據的directory(如果沒有需要自己建立一個directory)

  77. Specify the Name of the Extract Dump File
  78. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  79. The prefix for the default dump file name is awrdat_52_57.
  80. To use this name, press <return> to continue, otherwise enter
  81. an alternative.

  82. Enter value for file_name: gyl_rac01

  83. ...........省略部分輸出.............
  84. Master table \"SYS\".\"SYS_EXPORT_TABLE_01\" successfully loaded/unloaded
  85. ******************************************************************************
  86. Dump file set for SYS.SYS_EXPORT_TABLE_01 is:
  87. /oracle/app/oracle/product/10.2/db_1/rdbms/log/gyl_rac01.dmp
  88. Job \"SYS\".\"SYS_EXPORT_TABLE_01\" successfully completed at 12:38:07
        2、導入
       先將上面生成的dump文件拷貝到目標機器的一個directory下,然后按如下操作進行導入。

  1. SQL> @$ORACLE_HOME/rdbms/admin/awrload.sql
  2. ~~~~~~~~~~
  3. AWR LOAD
  4. ~~~~~~~~~~
  5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  6. ~ This script will load the AWR data from a dump file. The ~
  7. ~ script will prompt users for the following information: ~
  8. ~ (1) name of directory object             ~
  9. ~ (2) name of dump file                 ~
  10. ~ (3) staging schema name to load AWR data into     ~
  11. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  12. Specify the Directory Name
  13. ~~~~~~~~~~~~~~~~~~~~~~~~~~

  14. Directory Name         Directory Path
  15. ------------------------------ -------------------------------------------------
  16. DATA_FILE_DIR         /oracle/app/oracle/product/11.2.0/db_1/demo/schem
  17.              a/sales_history/

  18. DATA_PUMP_DIR         /oracle/app/oracle/admin/gyl/dpdump/
  19. LOG_FILE_DIR         /oracle/app/oracle/product/11.2.0/db_1/demo/schem
  20.              a/log/

  21. MEDIA_DIR         /oracle/app/oracle/product/11.2.0/db_1/demo/schem
  22.              a/product_media/

  23. ORACLE_OCM_CONFIG_DIR     /oracle/app/oracle/product/11.2.0/db_1/ccr/state

  24. Directory Name         Directory Path
  25. ------------------------------ -------------------------------------------------
  26. SS_OE_XMLDIR         /oracle/app/oracle/product/11.2.0/db_1/demo/schem
  27.              a/order_entry/

  28. SUBDIR             /oracle/app/oracle/product/11.2.0/db_1/demo/schem
  29.              a/order_entry//2002/Sep

  30. XMLDIR             /oracle/app/oracle/product/11.2.0/db_1/rdbms/xml

  31. Choose a Directory Name from the list above (case-sensitive).

  32. Enter value for directory_name: DATA_PUMP_DIR           <<<<<<< 輸入dump所在directory

  33. Using the dump directory: DATA_PUMP_DIR

  34. Specify the Name of the Dump File to Load
  35. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  36. Please specify the prefix of the dump file (.dmp) to load:

  37. Enter value for file_name: gyl_rac01                  <<<<<<< 輸入dump文件名,不要帶后綴

  38. Loading from the file name: gyl_rac01.dmp

  39. Staging Schema to Load AWR Snapshot Data
  40. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  41. The next step is to create the staging schema
  42. where the AWR snapshot data will be loaded.
  43. After loading the data into the staging schema,
  44. the data will be transferred into the AWR tables
  45. in the SYS schema.


  46. The default staging schema name is AWR_STAGE.
  47. To use this name, press <return> to continue, otherwise enter
  48. an alternative.

  49. Enter value for schema_name: AWR_STAGE          <<<<<<< 輸入一個schema名,用于導入,導入結束后自動會刪除該schema

  50. Using the staging schema name: AWR_STAGE

  51. Choose the Default tablespace for the AWR_STAGE user
  52. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  53. Choose the AWR_STAGE users's default tablespace. This is the
  54. tablespace in which the AWR data will be staged.

  55. TABLESPACE_NAME      CONTENTS DEFAULT TABLESPACE
  56. ------------------------------ --------- ------------------
  57. EXAMPLE          PERMANENT
  58. SYSAUX             PERMANENT *
  59. TEST             PERMANENT
  60. USERS             PERMANENT

  61. Pressing <return> will result in the recommended default
  62. tablespace (identified by *) being used.

  63. Enter value for default_tablespace: SYSAUX           <<<<<<< 輸入存放AWR數據的表空間名

  64. Using tablespace SYSAUX as the default tablespace for the AWR_STAGE


  65. Choose the Temporary tablespace for the AWR_STAGE user
  66. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  67. Choose the AWR_STAGE user\'s temporary tablespace.

  68. TABLESPACE_NAME      CONTENTS DEFAULT TEMP TABLESPACE
  69. ------------------------------ --------- -----------------------
  70. TEMP             TEMPORARY *

  71. Pressing <return> will result in the database\
       3、生成報告
      在目標機器上生成報告

  1. SQL> @?/rdbms/admin/awrrpti.sql

  2. Specify the Report Type
  3. ~~~~~~~~~~~~~~~~~~~~~~~
  4. Would you like an HTML report, or a plain text report?
  5. Enter 'html' for an HTML report, or 'text' for plain text
  6. Defaults to 'html'
  7. Enter value for report_type: html

  8. Type Specified: html


  9. Instances in this Workload Repository schema
  10. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  11.    DB Id     Inst Num DB Name     Instance    Host
  12. ------------ -------- ------------ ------------ ------------
  13. * 2184766987     1 GYL     gyl        oracle11g
  14.   2182516689     2 GYL     gyl2       rac02
  15.   2182516689     1 GYL     gyl1       rac01

  16. Enter value for dbid: 2182516689            <<<<<<< 輸入dbid
  17. Using 2182516689 for database Id
  18. Enter value for inst_num: 1                 <<<<<<< 輸入inst_num號
  19. Using 1 for instance number


  20. Specify the number of days of snapshots to choose from
  21. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  22. Entering the number of days (n) will result in the most recent
  23. (n) days of snapshots being listed. Pressing <return> without
  24. specifying a number lists all completed snapshots.


  25. Enter value for num_days: 2                <<<<<<< 輸入生成報告的天數  

  26. Listing the last 2 days of Completed Snapshots

  27.                             Snap
  28. Instance DB Name     Snap Id Snap Started Level
  29. ------------ ------------ --------- ------------------ -----
  30. gyl1     GYL         52 13 Nov 2014 10:16     1
  31.                  53 13 Nov 2014 11:00     1
  32.                  54 13 Nov 2014 12:00     1
  33.                  55 13 Nov 2014 13:00     1
  34.                  56 13 Nov 2014 14:00     1

  35.                  57 13 Nov 2014 16:21     1



  36. Specify the Begin and End Snapshot Ids
  37. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  38. Enter value for begin_snap: 52                <<<<<<< 輸入起始snap_id
  39. Begin Snapshot Id specified: 52

  40. Enter value for end_snap: 56                  <<<<<<< 輸入結束snap_id
  41. End Snapshot Id specified: 56



  42. Specify the Report Name
  43. ~~~~~~~~~~~~~~~~~~~~~~~
  44. The default report file name is awrrpt_1_52_56.html. To use this name,
  45. press <return> to continue, otherwise enter an alternative.

  46. Enter value for report_name: /oracle/app/oracle/admin/gyl/dpdump/awr_rac.html
       整個過程都很簡單,但有幾點需要注意:
      1、不能將同一個數據庫的AWR數據導出后再導入到自己,這樣會遇到下面的錯誤
            ERROR at line 1:
             ORA-20105: unable to move AWR data to SYS
             ORA-06512: at "SYS.DBMS_SWRF_INTERNAL", line 2950
             ORA-20107: not allowed to move AWR data for local dbid
             ORA-06512: at line 3
       2、在導入的時候,在輸入值時,盡量用大寫;
       3、如果不再需要的數據,可以用如下存儲過程刪除:
            SQL> exec DBMS_SWRF_INTERNAL.UNREGISTER_DATABASE(bdid);     --將dbid換成需要刪除的dbid號



向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

凌云县| 建湖县| 英超| 宁明县| 三门峡市| 安陆市| 略阳县| 波密县| 富顺县| 冀州市| 武鸣县| 梅河口市| 洪洞县| 小金县| 高邑县| 昌都县| 阿合奇县| 合肥市| 石台县| 治县。| 甘谷县| 乐都县| 河北区| 河东区| 涿鹿县| 伊吾县| 大理市| 海兴县| 湟中县| 许昌县| 大城县| 忻城县| 永新县| 晋中市| 仁化县| 清流县| 黎平县| 明溪县| 嘉黎县| 肥乡县| 玉山县|