Resource concept:
Resources are memory structures. These structures represent the components in the database. Access to these components must be in the restricted or serialized mode. In other words, this resource can only be accessed by one process or an instance in parallel. If the resource is currently in use, other processes that want to access the resource must wait in the queue until the resource becomes available.
A queue is a memory structure that is used to concurrently access special resources. If these resources are only required by local instances, the queue can be obtained locally without coordination. However, if this resource is requested by a remote instance, the local queue must become global.
Optimize global queues
Global locks will significantly affect performance, which will lead to increased waits, or even deadlocks. However, some simple methods can greatly reduce the impact of global locks.
Many global locks are related to analysis activities. Therefore, you should avoid unnecessary parsing everywhere. There are many ways to achieve this. In the OLTP environment, the text should be replaced by the bound variable. The best way to implement this replacement method is to modify the source code. However, if you do not have the permission to access the source code, you may consider enabling cursor sharing, which can achieve the same purpose, but will increase the additional overhead slightly, because each statement executed in the database must be scanned as a text and then parsed.
PL/SQL will contain a series of optimization policies to improve performance. For example, after a statement is executed, PL/SQL does not close the cursor. Instead, it efficiently places the cursor in a pool for another need. In this case, if the statement is executed again recently, repeated soft Parsing is avoided. If you use C or Java to develop applications, You can retain the above information and therefore reduce the amount of parsed information.
Another way to reduce resolution is to optimize the size of the library cache and reduce the number of cursors in this case. These cursors will soon be reloaded after the age is out of the cache. You can pin frequently-used packages and cursors to the memory to improve database efficiency.
You should also try to remove unnecessary DDL statements from your application. The most common cause is that temporary tables need to be created in intermediate steps in complex steps, including reporting or batch quantum processes. These tables can often be replaced by global temporary tables.
In the end, one way to reduce the global enqueue is to execute fewer SQL statements. To achieve this effect, we can reduce unnecessary statements. It can also be implemented by combining existing SQL statements.
For example, using Union all. In addition, it is worth taking the time to check your application logic and determine whether the SQL statements that are being periodically executed can be executed as a set operation. For example, you may be able to modify an SQL statement. This statement can use one statement to update all rows at a time, instead of the old single command statement to update the statement 100 times.
English/Translation
Resources and enqueues
A resource is a memory structure that represents some component of the database to which access must be restricted
Or serialized. In other words, the resource can only be accessed by one process or one instance concurrently. If
Resource is currently in use, other processes or instances needing to access the resource must wait in a queue
The resource becomes available.
Resources are memory structures. These structures represent the components in the database. Access to these components must be in the restricted or serialized mode. In other words, this resource can only be accessed by one process or an instance in parallel. If this resource is currently in use status, other processes that want to access this resource must wait in the queue until the resource becomes available.
An enqueue is a memory structure that serializes access to particle resource. If the resource is only required
By the local instance, then the inqueue can be acquired locally, and no coordination is necessary. However, if
Resource is required by a remote instance, then the local enqueue must become global.
A queue is a memory structure that is used to concurrently access special resources. If these resources are only required by local instances, the queue can be obtained locally without coordination. However, if this resource is requested by a remote instance, the local queue must become global.
Optimize global Queues:
Optimizing global enqueues
Global locking can significantly impact performance causing increased wait times and possibly even dead locks.
However, a few simple measures can greatly reduce the impact of global locking.
Global locks will significantly affect performance, which will lead to increased waits, or even deadlocks. However, some simple methods can greatly reduce the impact of global locks.
Much Global locking is related to parsing activity. Therefore, you shoshould avoid unnecessory parsing wherever possible.
There are always ways to archive this.
Many global locks are related to analysis activities. Therefore, you should avoid unnecessary parsing everywhere. There are many ways to achieve this.
In OLTP environments, literals shocould be replaced by bind variables. This replacement is best archived by modifying
The source code.
In the OLTP environment, the text should be replaced by the bound variable. The best way to implement this replacement method is to modify the source code.
Howerver, if you do not have access to the source code, you might consider enabling cursor sharing, which archives
Same goal but incurs a slight overhead, as the text of every statement executed in the database must be scanned
Literals before the statement is parsed.
However, if you do not have the permission to access the source code, you may consider enabling cursor sharing, which can achieve the same purpose, but will increase the additional overhead slightly, because each statement executed in the database must be scanned as a text and then parsed.
PL/SQL contains a number of optimazions aimed at improving performance. For example, it does not close cursors when
Statement completes. Instead, it should tively retains cursors in a pool in case they are needed again, which avoids
Need to perform a soft parse if the cursor is executed again in the near future. If you develop your own applications in
C or Java, you can copy this behavior and thereby reduce the amount of parsing required.
PL/SQL will contain a series of optimization policies to improve performance. For example, after a statement is executed, PL/SQL does not close the cursor. Instead, it efficiently places the cursor in a pool for another need. In this case, if the statement is executed again recently, repeated soft Parsing is avoided. If you use C or Java to develop applications, You can retain the above information and therefore reduce the amount of parsed information.
Another way to reduce Parsing is simply to optimize the size of the library cache to reduce the number of cursors
That are aged out of the cache and subsequently reloaded. You may also benifit from pinning commonly used packages
And cursors in memory.
Another way to reduce resolution is to optimize the size of the library cache and reduce the number of cursors in this case. These cursors will soon be reloaded after the age is out of the cache. You can pin frequently-used packages and cursors to the memory to improve database efficiency.
You shoud also attempt to remove unnecessary DDL statements from your application. The most common cause of these
Is the creation of temporary tables for intermediate steps in complex tasks, such as reports and batch processes.
These tables can often be replaced by global temporary tables.
You should also try to remove unnecessary DDL statements from your application. The most common cause is that temporary tables need to be created in intermediate steps in complex steps, including reporting or batch quantum processes. These tables can often be replaced by global temporary tables.
Finally, the impact of global enqueue can be partitioned ced by simply executing fewer SQL statements, which can often be
Archived by eliminating unnecessary statements. It can also be archived by combining existing SQL statements.
In the end, one way to reduce the global enqueue is to execute fewer SQL statements. To achieve this effect, we can reduce unnecessary statements. It can also be implemented by combining existing SQL statements.
For example, using a union all. It is also worth examining your application logic to establish whether statements
That are being executed procedurally (ie, row by row) cocould be executed as a set operation. For example, you might be
Able to replace 100 single-row update statements with a single statement that updates all rows at the same time.
For example, using Union all. In addition, it is worth taking the time to check your application logic and determine whether the SQL statements that are being periodically executed can be executed as a set operation. For example, you may be able to modify an SQL statement. This statement can use one statement to update all rows at a time, instead of the old single command statement to update the statement 100 times.