Read about oracle pl sql performance tuning, The latest news, videos, and discussion topics about oracle pl sql performance tuning from alibabacloud.com
When Oracle database performance problems occur, it is effort-saving to use the Oracle toolkit and give reasonable optimization suggestions.
The following two packages are described and their specific practices.
The smallest adjustment tool for SQL Tuning Advisor.
Use one or
Tags: style c tar ext a intHow to use Oracle's Dbms_sqltune package to run SQL Tuning Advisor for SQL automatic tuning1 ". Here's a simple example of how dbms_sqltune is used.First execute the next SQL that you want to tune, and then get the SqlidSql> SELECT * from V$sqltext where sql_text like ' select * from dual% ';
Document directory
Preliminary steps
Using bind variables
There are several relatively easy steps you can take to improve performance. From the user's perspective, one of the most frequently used interfaces with a database involves SQL statements, so getting a handle on them is a good place to start, in terms of being able to see an immediate improvement. -->
Label:
After a piece of SQL code is written, you can initially predict the performance of the SQL at run time by looking at the SQL execution plan, especially if you find that the SQL statement is inefficient, we can analyze the problem of the
Pl/sql is Oracle's extension of the standard database language, Oracle has integrated PL/SQL into Oracle servers and other tools, and more developers and DBAs have started using Pl/
Io is very relevant, when the free buffer waiting in the v$session_wait of the entry is very small or not, Explain the DBWR process of your system will be enough, do not need to adjust, there are many items of free buffer wait, your system must feel very slow, then your DBWR is not enough, the resulting wio has become your database performance bottlenecks, the solution is as follows:
A.1 to increase the write process while adjusting the db_block_lru_
dbms_workload_repository. Create_snapshot;We can also use the Dbms_workload_repository package to complete the baseline, modification of the default settings and so on.ADDM (Automatic Database Diagnostic Monitor AWR)is a consultant system within Oracle that can automate some of the optimization recommendations for the most databases, give recommendations for SQL optimization, index creation, and statistics
/comprehensive) --Time_limit (in)-maximum duration in second for tuning --Task_name (in)-Optional tuning Task Name --Description (in)-Maximum of the SQL tuning session description -- --RETURNS: --SQL tuning Task unique Name -- --E
. In the case of Alpha 1200 for the revenue system, the SGA is about 160 megabytes in size.
Some parameters in the initialization parameter file have a decisive effect on the size of the SGA. Parameter db-block-buffers (number of buffers cached in the SGA), parameter shared-pool-size (number of bytes allocated to the shared SQL area), is the main influence of the SGA size.
The Db-block-buffers parameter is the most important determinant of the SGA siz
, Oracle will rearrange the NON-ACCESS predicate order to reduce CPU costs, but in most cases it will not be aware of performance differences.) )
Overall-it ' s definitely a good thing. In practice, you may have a much stronger bias towards indexed access paths which the May impact performance.
Anyway--it's certainly a good thing. In fact, you can find a stronge
part is the main body of the PL/SQL block and contains the executable statements of the block. This part defines the block function and is required. Start with the keyword begin and end with end.
PL/SQL block Exception Handling Section
This part contains the exception handler (error handler) of the block ). When a sta
Oracle tutorial pl/SQL introduction, oracle tutorial plsql
This example describes Oracle pl/SQL. We will share this with you for your reference. The details are as follows:
I. What is
), or (or), and not (non). Not can be used to negate any logical operation symbol. The following is an example of a NOT clause: ... where not (status = ' VALID ') If you want to use not, you should precede the phrase with parentheses and precede the phrase with the NOT operator. The NOT operator is included in another logical operator, which is the not equal to ( . : Where status For this query, it can be rewritten to not use not: SELECT * FROM employee where salary Although the results of thes
2009 21:00 1 7472 25 October 2009 22:00 1 7473 25 October 2009 23:00 1 7474 26 October 2009 00:00 1 7475 26 October 2009 01:00 1 7476 26 October 2009 02:00 1 7477 26 October 2009 03:00 1 7478 26 October 2009 04:00 1 7479 26 October 2009 05:00 1 7480 26 October 2009 06:00 1 7481 26 October 2009 07:00 1 7482 26 October 2009 08:00 1 7483 26 October 2009 09:00 1 7484 26 October 2009 10:00 1 Specify the Begin and End Snapshot Ids ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Enter value for begin_snap:7451
should precede the phrase with parentheses and precede the phrase with the NOT operator. The NOT operator is included in another logical operator, which is the not equal to (... where status For this query, it can be rewritten to not use not:SELECT * FROM employee where salaryAlthough the results of these two queries are the same, the second query scenario is faster than the first query scenario. The second query allows Oracle to use indexes on salar
optimization phase. If the difference between the two is very large, the actual performance statistics are stored as statistical information feedback, and the statement is also marked as re-optimized. When the statement is executed the next time, statistical feedback is used to select a more appropriate degree of parallelism (DOP).--Note:1) from the Oracle 11GR2 backwards, the parallel hint in the statemen
An outline that is roughly written in the optimization content of the physical design and logical design of the DB, mainly physical design, logical design introduction of the content is not much, the outline of the physical structure design and example optimization of organic combination of the logical structure design and application adjustment together ...
Oracle Performance
;5 END;6/
Package created.
SQL> CREATE OR REPLACE PACKAGE BODY pkg2 IS3 c_year_numberConstant integer: = 2013;45 FUNCTION year_number6 RETURN INTEGER7 IS8 BEGIN9 RETURN c_year_number;10 END;11 END;12/
Package body created.
SQL> SELECT pkg. year_number2 FROM employees3 WHERE employee_id = 1384/
YEAR_NUMBER-----------2013
So much code is added to reference a constant! However, in
follows:
. Pl/sql is a high-performance, transaction-based language that can run in any Oracle environment and support all data processing commands. Process SQL data definition and data control elements by using the PL/
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.