sqlid2file

NAME
SYNOPSIS
OPTIONS
EXAMPLE
COPYRIGHT
SEE ALSO

NAME

sqlid2file.rwl − Extract sql text from gv$sql or dba_hist_sqltext

SYNOPSIS

rwloadsim -u -l u/p@c sqlid2file.rwl sqlid ...

For each provided sqlid, the sqlid2file.rwl utility extracts sql text from either gv$sql or dba_hist_sqltext and writes the text to a file named with the sqlid and a suffix of .rws. The file can subsequently be used in sql declarations in rwl programs with the result that the sqlid when executing from rwloadsim is the same sqlid that was originally executed against the database. You must provide for your rwl program using the sql to provide any necessary bind variables and/or defines for queries.

OPTIONS

-u

Compulsory option to find the sqlid2file.rwl script in the public directory.

-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 gv$sql and dba_hist_sqltext. If you omit /p, rwloadsim will prompt for the password.

sqlid

For each sqlid provided, you will either get an error that the sqlid is found in neither gv$sql nor dba_hist_sqlstat or a message that the sql statement text was written to a .rws file.

EXAMPLE

rwloadsim -ul system/{password} sqlid2file.rwl 4um7hy903rzyx 1t7aypsgcxwt0 123bengsig456


RWP*Load Simulator Release 2.3.2.2 Development on Mon, 01 Feb 2021 15:31:18 UTC
Connected default database to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
text of sqlid 4um7hy903rzyx found in gv$sql written to 4um7hy903rzyx.rws
text of sqlid 1t7aypsgcxwt0 found in dba_hist_sqltext written to 1t7aypsgcxwt0.rws
sqlid 123bengsig456 neither found in gv$ nor in workload repository

COPYRIGHT

Copyright © 2023 Oracle Corporation
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl

SEE ALSO

rwloadsim(1rwl), utilities(2rwl)