Repairing SQL Failures with the SQL Repair Advisor
在SQL语句出现严重错误而失败的罕见情况下,您可以运行SQL Repair Advisor来尝试修复失败的语句。
This section covers the following topics:
About the SQL Repair Advisor
在SQL语句出现严重错误失败后运行SQL Repair Advisor。advisor分析语句,并在许多情况下建议使用补丁来修复语句。如果您实现了建议,那么应用的SQL补丁将通过使查询优化器为将来的执行选择一个替代执行计划来避免失败。
Running the SQL Repair Advisor
您可以从支持工作台的问题详细信息页面运行SQL Repair Advisor。本节中的说明假定您已经收到了由SQL语句引起的一个关键错误的通知,并且您遵循了“调查、报告和解决问题”中描述的工作流。
To run the SQL Repair Advisor:
-
Access the Problem Details page for the problem that pertains to the failed SQL statement.
See "Viewing Problems with the Enterprise Manager Support Workbench" for instructions.
-
In the Investigate and Resolve section, under the Self Service tab, under the Resolve heading, click SQL Repair Advisor.
Description of the illustration advisor_access1.gif
-
On the SQL Repair Advisor page, complete these steps:
-
Modify the preset task name if desired, optionally enter a task description, modify or clear the optional time limit for the advisor task, and adjust settings to schedule the advisor to run either immediately or at a future date and time.
-
Click Submit.
A "Processing" page appears. After a short delay, the SQL Repair Results page appears.
Description of the illustration sql_repair_advisor_results.gif
A check mark in the SQL Patch column indicates that a recommendation is present. The absence of a check mark in this column means that the SQL Repair Advisor was unable to devise a patch for the SQL statement.
Note:
If the SQL Repair Results page fails to appear, then complete these steps to display it:-
Go to the Database Home page.
-
Under Related Links, click Advisor Central.
-
On the Advisor Central page, in the Results list, locate the most recent entry for the SQL Repair Advisor.
-
Select the entry and click View Result.
-
-
If a recommendation is present (there is a check mark in the SQL Patch column), click View to view the recommendation.
The Repair Recommendations page appears, showing the recommended patch for the statement.
-
Click Implement.
The SQL Repair Results page returns, showing a confirmation message.
-
(Optional) Click Verify using SQL Worksheet to run the statement in the SQL worksheet and verify that the patch successfully repaired the statement.
Viewing, Disabling, or Removing a SQL Patch
在使用SQL Repair Advisor应用SQL补丁之后,您可能希望查看它,以确认它的存在、禁用它或删除它。删除补丁的一个原因是,如果您安装了Oracle数据库的后续版本,该版本修复了导致补丁SQL语句失败的bug。
To view, disable, or remove a SQL patch:
-
Access the Database Home page in Enterprise Manager.
For Oracle Enterprise Manager Database Control, see Oracle Database 2 Day DBA for instructions. For Oracle Enterprise Manager Grid Control, go to the desired database target.
-
At the top of the page, click Server to display the Server page.
-
In the Query Optimizer section, click SQL Plan Control.
The SQL Plan Control page appears. See the online help for information about this page.
-
At the top of the page, click SQL Patch to display the SQL Patch subpage.
The SQL Patch subpage displays all SQL patches in the database.
-
Locate the desired patch by examining the associated SQL text.
Click the SQL text to view the complete text of the statement.
-
To disable the patch, select it, and then click Disable.
A confirmation message appears, and the patch status changes to
DISABLED
. You can later reenable the patch by selecting it and clicking Enable. -
To remove the patch, select it, and then click Drop.
A confirmation message appears.
See Also: