Oracle Database Export AWR report

AWR (Automatic Workload Repository) is automatically load abbreviation repository, AWR report is a performance collection and analysis tools provided by later versions of Oracle 10g, providing a period of time the entire system resource usage reports, you can learn by report the entire operation of a system.

AWR report generation

  • Switch User

    Oralce user login using the operating system, if you do not know the oracle user password can be obtained from the root user su - oracle:

    server01:root:/>whoami
    root
    server01:root:/>su - oracle
    server01:oracle:/home/oracle>whoami
    oracle
    server01:oracle:/home/oracle>
  • sqlplus database connection

    Oracle performed at user sqlplus / as sysdbacommand, connect to database oracle:

    server01:oracle:/home/oracle>sqlplus / as sysdba 
    SQL*Plus: Release 11.2.0.4.0 Production on Thu Dec 12 00:01:02 2019
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL>
  • Exporting AWR report the current instance

    Execution in sqlplus @?/rdbms/admin/awrrpt.sql:

    SQL> @?/rdbms/admin/awrrpt.sql
    Current Instance
    ~~~~~~~~~~~~~~~~
    DB Id    DB Name      Inst Num Instance
    ----------- ------------ -------- ------------
    919662622 DEVDB               1 devdb
    Specify the Report Type
    ~~~~~~~~~~~~~~~~~~~~~~~
  • Enter the format of the exported report

    ? @ After performing / rdbms / admin / awrrpt.sql command prompts for the format to export the report, the default format is html, html format if you want to export directly to Enter:

    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:
  • Enter the number of days to export

    The specific number of days required report, derived input, i.e., the present time of all the information of N days:

    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:
  • Enter to export snap start ID

    After you enter the number of days you want to export, oracle will list the information about the number of days to meet the expectations of snap and, if necessary, enter the snap start ID:

    
    Listing the last 2 days of Completed Snapshots                     
    Instance     DB Name       Snap Id    Snap Started   Snap Level
    ------------ ---------   --------- ------------------ -----
    devdb        DEVDB          3151 11 Dec 2019 00:00      1
                                3152 11 Dec 2019 01:00      1
                                3153 11 Dec 2019 02:00      1
                                3154 11 Dec 2019 03:00      1
                                3155 11 Dec 2019 04:00      1
                                3156 11 Dec 2019 05:00      1
                                3157 11 Dec 2019 06:00      1
                                3158 11 Dec 2019 07:00      1
                                3159 11 Dec 2019 08:00      1
                                3160 11 Dec 2019 09:00      1
                                3161 11 Dec 2019 10:00      1
                                3162 11 Dec 2019 11:00      1
                                3163 11 Dec 2019 12:00      1
                                3164 11 Dec 2019 13:00      1
                                3165 11 Dec 2019 14:00      1
                                3166 11 Dec 2019 15:00      1
                                3167 11 Dec 2019 16:00      1
                                3168 11 Dec 2019 17:00      1
                                3169 11 Dec 2019 18:00      1
                                3170 11 Dec 2019 19:00      1
                                3171 11 Dec 2019 20:00      1
                                3172 11 Dec 2019 21:00      1
                                3173 11 Dec 2019 22:00      1
                                3174 11 Dec 2019 23:00      1
                                3175 12 Dec 2019 00:00      1
    Specify the Begin and End Snapshot Ids
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Enter value for begin_snap:
  • Enter to export snap cutoff ID

    After entering the start ID, you will be prompted cutoff ID, enter the required deadline ID:

    Enter value for end_snap:
  • Set the name of the exported report

    When you export a report, if you need to set the name of the exported report can be modified according to the prompt:

    Specify the Report Name
    ~~~~~~~~~~~~~~~~~~~~~~~
    The default report file name is awrrpt_1_3151_3175.html.  To use this name,
    press <return> to continue, otherwise enter an alternative.
    
    Enter value for report_name:
  • View report
    after report after input name and hit Enter, oracle will automatically generate AWR reports, you can exit sqlplus view:

    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    server01:oracle:/home/oracle>ls -lrt
    total 12544
    drwxr-xr-x    4 root     system          256 Jul 02 1972  app
    -rw-r--r--    1 oracle   dba           25178 Jul 02 1972  db.rsp
    -rw-r--r--    1 oracle   dba               8 Jul 03 1972  #UNTITLED#
    -rw-r-----    1 oracle   dba         4950061 Jul 06 1972  core
    -rw-r-----    1 oracle   dba          289692 Jul 29 22:31 install2019-07-29_22-17-53.log
    drwxr-xr-x    2 oracle   dba             256 Aug 01 00:40 scripts
    -rw-r--r--    1 oracle   dba          594527 Dec 11 22:37 test.html
    -rw-r--r--    1 oracle   dba          545490 Dec 12 00:51 awr.html

    This article is for daily learn to share, if wrong, please correct me.

Guess you like

Origin www.cnblogs.com/Scavenger-B/p/12176564.html