Contents
Installing or Updating the Method R Profiler Extension for SQL Developer
Enabling Method R Profiler Extension
Generating a Profile
Creating a Directory Object
Working with the Profiler Extension History
Preferences
Logging
Profiling an Input File
Installing or Updating the Method R Profiler Extension for SQL Developer
To install Method R Profiler Extension for SQL Developer, or to update to the newest version:
- Select Help > Check for Updates...
- If the Welcome dialog appears, click Next.
- If you are updating a prior installation of Profiler Extension, make sure the Method R Extension box is checked
and skip to step 8. If you are installing for the first time, continue with the next step.
- Click Add. The Update Center dialog appears.
- In the Name field, enter: Method R Extension.
- In the Location field, enter: http://www.method-r.com/extension/
- Click OK. The 'Source' dialog appears.
- Click Next. The 'Updates' dialog appears.
- Click the checkbox next to the Method R Extension you want to install, then click Next. The 'Download' dialog will appear that will display progress status. Once the download completes the 'Summary' dialog appears.
- Click Finish. The Preferences dialog appears.
- Click OK. The Confirm Restart dialog appears.
- Click Yes to restart SQL Developer.
Enabling Method R Profiler Extension
To enable the Method R Profiler Extension, do one of the following:
- Select Method R Profiler > Profile Statements. A check mark next to Profile Statements
indicates the Profiler Extension is enabled.
- Click the Method R icon in the toolbar. The icon appears in color
when the Extension is enabled and is gray when it disabled.
If the icon will not show the enabled state, verify that Method R Profiler has been installed and that the environment variables
are set correctly.
Generating a Profile
To generate a profile:
- Enter the statements you want to profile in a SQL Worksheet.
- Click the Run Script icon. The Profiler Extension will begin processing and the log panel will display any status or error messages.
- If the Profiler completes successfully, the following actions will occur:
- An HTML document opens in your default web browser, if you have selected that option in your preferences.
- An entry appears in the Profiler History panel.
- The HTML output will be stored in the trace files directory as specified in the preferences panel.
Creating a Directory Object
The Method R Profiler Extension requires a directory object and permissions to the system views which allow access to the trace files
on the database server. Your DBA can execute a script (which appears in the Create Directory Object dialog) to provide this
access, or you can enter a password and select an option to execute the script automatically.
When this dialog appears:
- Select one of the following options:
- DBA has executed script manually.
- Select this option if your DBA has already granted the required access.
- Grant access to PUBLIC (all accounts).
- Select this option if you want to grant the required access to all accounts.
- Grant access to account only.
- Select this option if you want to grant the required access only to the specified user.
- Enter the password for the SYS account if you have selected one of the Grant access options.
- Click OK.
The following script is used to grant access to all accounts for the Profiler Extension:
DECLARE
v_schema VARCHAR2(40) := '"PUBLIC"';
v_user_dump_dest VARCHAR2(2000);
BEGIN
select value into v_user_dump_dest
from v$parameter
where name = 'user_dump_dest';
EXECUTE IMMEDIATE 'CREATE OR REPLACE DIRECTORY "METHODR_UDUMP_DEST" AS ''' || v_user_dump_dest || '''' ;
IF v_schema != '"SYS"' THEN
EXECUTE IMMEDIATE 'GRANT READ ON DIRECTORY METHODR_UDUMP_DEST TO ' || v_schema ;
EXECUTE IMMEDIATE 'GRANT ALTER SESSION TO ' || v_schema ;
EXECUTE IMMEDIATE 'GRANT SELECT ON SYS.V_$INSTANCE TO ' || v_schema ;
EXECUTE IMMEDIATE 'GRANT SELECT ON SYS.V_$SESSION TO ' || v_schema ;
EXECUTE IMMEDIATE 'GRANT SELECT ON SYS.V_$PROCESS TO ' || v_schema ;
EXECUTE IMMEDIATE 'GRANT SELECT ON SYS.V_$MYSTAT TO ' || v_schema ;
EXECUTE IMMEDIATE 'GRANT EXECUTE ON DBMS_UTILITY TO ' || v_schema ;
EXECUTE IMMEDIATE 'GRANT EXECUTE ON DBMS_LOB TO ' || v_schema ;
END IF;
END;
Working with the Profiler Extension History
The Method R Profiler Extension downloads copies of trace files to the directory you specify in the Preferences. You can view the history of the Profiler Extension
session, open the Profile output files, or clear those files from the history.
To view the Profiler Extension history, select View > Profiler History. The history appears as a docked
tab in SQL Developer.
To open one or more Profile output files from the history, select the desired files in the History panel, then click Open. The files will open in your default browser.
To clear files from the history, click Clear in the History panel. All history records will be cleared from the table. This does not delete the files from the drive.
Preferences
The preferences govern the Method R Profiler Extension output and how the Extension appears in SQL Developer.
- Select Tools > Preferences. The Preferences dialog appears.
- Select the Method R Profiler tree item. The Method R Profiler preferences appear displaying a panel with 2 tabbed pages. The first tabbed pane contain the Extension Preferences and the second contain the Profiler Parameters.
Extension Preferences
The Extension Preferences provide configuration settings that allow how the Profiler will interface with SQL Developer. These preferences are described below:
- Enable Profiler on startup
- Check this box if you want the Profiler Extension to be enabled when you start SQL Developer.
- Directory to save trace files
- Enter a directory path or click Browse to find a directory. All trace files generated with the Method R Profiler Extension
will be stored in the specified directory.
- Maximum trace file size (MB)
- Enter or select the maximum trace file size you want to automatically download when you profile code. If the trace file that is
generated exceeds this size, you will be asked to confirm the download, or the download will be skipped without confirmation, depending on the setting for
Confirm if limit is exceeded.
- Confirm if limit is exceeded
- If this box is checked, you will be asked to confirm the trace file download if the file exceeds the value specified in Maximum trace
file size (MB). If this box is not checked, the download will be skipped without a confirmation if the limit is exceeded.
- Logging Level
- This is the Java logging level that controls the type of messages that displayed for the Method R Profiler extension. Each log message is associated with a level to indicate the importance and urgency of the message. Changing this setting will result in increasing or decreasing the amount of messages that are displayed to the logging window.
Profiler Parameters
The Profiler Parameters are values that are passed to the Profiler kernel. These values are described below:
- Automatically open HTML output in default web browser
- Check this box if you want the Profiler output to automatically open in your default web browser when you profile code.
- Call definitions
- Enter a call definitions file location or click Browse to find a call definitions file. The Profiler User Guide contains
more information about specifying call definitions. To see the Profiler User Guide, select Start > All Programs >
Method R > Profiler > User Guide.
- Transform parameters
- Enter a transform parameters file location or click Browse to find a transform parameters file. The Profiler User Guide contains
more information about specifying transform parameters. To see the Profiler User Guide, select Start > All Programs >
Method R > Profiler > User Guide.
- Maximum Java heap size (MB)
- Select a maximum size for the Java heap during execution of the Method R Profiler.
- Nanoseconds per 'microsecond'
- Set the number of nanoseconds per Oracle “microsecond.”
Property Files
The preferences are loaded from property files located in the 'Method R' sub-directory of the user home directory. If the property files are not found then the default values are loaded into the preferences. The property files are created after closing the preferences panel. Currently the location of the preference files can not be changed.
Logging
Setting Up Logging
The Profiler Extension reports log messages to SQL Developer's built-in logging facility. The amount of data displayed in the log panel can be controlled by changing the log level in the Extension Preferences panel. The folllowing log levels are provided: OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, and ALL. Levels FINE through ALL can be used to show debugging output. The default log level is CONFIG.
Saving Log Messages to a File
You can save logging messages to a file by setting up the directory for log files in the SQL Developer preferences.
- Select Tools > Preferences. The Preference dialog appears.
- Select the Environment > Log tree items. The Environment:Log dialog opens.
- Check Save Logs to File, then enter a Log Directory or click Browse to find a directory.
- Select any other desired options, then click OK.
NOTE: Saving the log to a file does not work yet in SQL Developer, but should in a future version. To control the location of the log files,
add this line to your logging.conf file, modifying the directory to your desired location:
java.util.logging.FileHandler.pattern=C:\\SQLDeveloper\\sqldeveloper\\log\\sqldev%u.log
If you have set the logging level but have not specified a file location, you can look for a file with a name like
Profiling an input file
The Method R Profiler Extension can accept an input file. This can be used to profile a trace file that has already been collected.
- Select Method R > Profile Input File...
- A form will appear as shown below:
- Select a file to profile
- The first parameters is the input file that can selected by clicking the Browse button next to the text field. This can be a Trace file or a Zip file containing trace files.
- Profiler Parameters
- The other fields are exactly the Profiler Parameter as described in the Preferences section.
- Results
- The Results text area is the location where the logging data will be collected about the execution of the Profiler status.
|