sqlreport − Create a complete sql report
sqlreport [options] -l u/p@c sqlid
For the provided sqlid, the sqlreport utility creates sql a full report by calling dbms_sql_tune.report_sql_detail, using all default options except report_level which is set to ’ALL’. The output is written to a file named with the sqlid and a suffix of .html unless the --output-file option is provided. The file is created in your current directory unless the --output-directory option is provided.
-l u/p
-l u/p@c
Compulsory option to provide the username, password, and potentially connect string for a database connection that provides access to a login with access to various gv$ and dba_ views. If you omit /p, rwloadsim will prompt for the password.
--sessionid=N
--instance=N
--spid=T
By default, the sqlid is taken from the command line. It can alternatively be retrived as nvl(sql_id,prev_sql_id) in the v$session dictionary view, by providing the first of these options, which will become a predicate on the sid column of v$session. If the second option is also used, gv$session will be used in stead with an additional predicate on the inst_id column. If the third option is used, there will be a join to v$process or gv$process with a predicate on its spid column.
--output-file=<filename>
By default, the output is written to a file named as the sqlid with a suffix of .html. Use this option to specify a different filename.
--output-suffix=<text>
If you are not using --output-file, this option will cause the generated file name to include extra text between the sqlid and the .html suffix. This can be used to distinguish the generated file names if you are this utility and/or the sqlmonitor utility multiple times.
--output-directory=<directory>
By default, the output is written in your current directory. Use this option to specify a different directory.
sqlid
You must either provide a sqlid as an argument or retrieve it via the --sessionid or --spid option possibly in combination with the --instance option.
sqlreport -l system/{password} --output-suffix=.r 07rw9znc8g7aj
will create a file named 07rw9znc8g7aj.r.html containing the output from calling dbms_sqltune.report_sql_detail(sql_id=>’07rw9znc8g7aj’, type=>’active’, report_level=>’ALL’)
Copyright
© 2023 Oracle Corporation
Licensed under the Universal Permissive License v 1.0 as
shown at https://oss.oracle.com/licenses/upl
rwloadsim(1rwl), sqlmonitor(2rwl), sqlmonitorawr(2rwl), sqlexplain(2rwl), utilities(2rwl)