One or more execution plans can be saved to a file (.vec). Saving an execution plan creates what is referred to as an offline plan. Optionally, the corresponding visual plan, Explain text, statement text, or tool tips can be saved.
When saving the plan as a file, a file name can be entered or automatically generated. To generate a file name automatically, one or more parameters must be selected. The parameters form the foundation of the file name. For example, selecting the USER and SERVER parameters results in a plan saved as john_server1.vec.
Before saving, open one or more execution plans.
The Save As dialog box appears.
Under Save Options, do one of the following:
Select one or more check boxes to define the type of information saved.
Select the All check box (default setting) to save all options.
Check Box Description All Saves the visual plan, Explain text, statement text, and tool tips in separate files. Explain text Saves the Explain text of the plan in a text file (.txt). Tool tips Saves the tool tips that are displayed in the visual plan in a text file (.txt). Visual plan Saves the plan details into a binary file (.vec).
Also saves the Explain text, statement text, and tool tips in the .vec file so they are available when the offline plan is opened.
Statement text Saves the query text of the plan in a text file (.sql).
- [Optional] Under Multiple Plans, click Select plans to select open plans to save.
[Optional] Under Multiple Plans, select check boxes to further define how the selected plans are saved.
Check Box Description Save multiple plans Save all plans selected in Step 3.If the check box is clear, only the active plan is saved. Click Select plans to specify plans to save. Save all plans to single file Save all plans selected in Step 3 to a single file. The file name must be specified in the File Name box.Automatic filename generation is unavailable when this check box is selected, and the File Name Preview box becomes the File Name box. If the Save all plans to single file check box is clear, plans are saved to separate files.
Under File Name Format, do one of the following:
To create the file name manually:
- Clear the Generate file name(s) automatically check box.
- Type a file name in the File Name box.
To generate the file name automatically:
- Select the Generate file name(s) automatically check box (default setting).
- In the Available box, select one or more parameters.
- Click Add.
Parameter Information Included in File Name USER Name of the user who captured the plan SERVER Name of the server where the plan was captured QUERYTAG Query tag for the plan QCD QCD for the plan QUERYID Query ID for the plan TIMESTAMP Date and time the file is savedFormat is day, month, hour, minute, second (ddmmm-hh-mm-ss).
Selected parameter names appear in the File Name Preview box. Parameter names appear in the order in which they were selected and are separated by the _ symbol. For example, if the first parameter selected and moved to the Selected box is SERVER and the second parameter is USER, the file name is SERVER_USER .
[Optional] To remove parameters so they are not included in the file name:
- In the Selected box, select the parameter to remove.
- Click Remove.
[Optional] To change the default location at which the file is saved, do one of the following:
- Type a location in the Path box.
- Click to browse for a folder.
- Click Save to save the execution plans.