Application Express: Tips, tricks and best practice (2024)

Application Express and HTTPS: Never see "Certificate Validation Error" again

Published APEX version Database version
June 2017 all all

In this article we'll talk about performing HTTPS requests with Application Express. At the first glance, this is pretty simple - instead of an URL beginning with http://, we use one beginning with https://. As an example, we'll try out the HTTPS URL of the USGS (US Geological Survey), which is also being used in the article about using REST services in Application Express. The following code example tries to fetch a JSON feed from earthquake.usgs.gov using HTTPS.

select apex_web_service.make_rest_request( p_url => 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson', p_http_method => 'GET' ) from dual;

In most cases, the first attempt fails:

ORA-29273: HTTP request failedORA-29024: Certificate validation failureORA-06512: at "SYS.UTL_HTTP", line 380

Blogs and discussion forums are full of questions and answers how to deal with this situation. This article provides an explanation and explains how to solve the problem for PL/SQL as well as for Application Express. The error message basically states that the Oracle database was not able to validate the SSL certificate, which the external web server sent in order to prove its identity. To get certificate validation working, we need to create an Oracle Wallet and configure it in Application Express. But before doing that, here is a simple explanation about HTTPS and SSL certificates - "in a nutshell" (these explanations are far away from being complete, but they should be sufficient to understand what the Oracle Database is doing and what the Oracle Wallet is needed for).

When an HTTPS request to a webserver is done, the first step is the SSL handshake, in which client and server negotiate about the details of the SSL encryption. As part of this handshake, the server sends its SSL certificate, which is similar to an ID card for humans: The certificate is there to prove, that the responding server is really the one, which the client expects.

The obvious question is now, whether the ID card is authentic - and this authenticity is certified by a Certificate Authority (CA). The web servers' SSL certificate is "signed" by the certificate authority using - again - a certificate. Now we can ask, whether the CA's certificate is authentic ... so it might be signed by another CA - and we have another certificate in the game. It's obvious that, at some point, this chain must come to an end. The client has to trust one CA certificate without looking into who has signed it - such a trusted certificate is then the end of the chain.

In a browser like Firefox, Chrome or others, all common CA certificates are pre-installed and this list of certificates is also being updated with each browser update. The Oracle Database maintains such certificates in an Oracle Wallet - but this wallet has to be created; and right after creation it is empty. We have to add the CA certificates we need.

To create and configure the wallet, we need access to the file system of the database server; when the wallet is ready, it must reside in a folder in the database server's file system. On a private development system (on a laptop) this is typically no problem; on a production system you will need the help of the database administrator. Thus, as the next step, log into the database server and create a wallet using the orapki utility, which is part of the database installation.

$ orapkiOracle PKI Tool : Version 12.2.0.1.0Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.orapki [crl|wallet|cert|help] <-nologo> <-jsafe>

Create the (empty) wallet as follows:

$ orapki wallet create -wallet https_wallet -pwd ****** -auto_loginOracle PKI Tool : Version 12.2.0.1.0Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.Operation is successfully completed.

The folder, in which you have invoked orapki should now contain a subfolder named https_wallet. These files make up the wallet. When referencing the wallet later on, only the path up to the folder https_wallet is needed.

$ ls https_wallet $ ls https_wallet/cwallet.sso cwallet.sso.lck ewallet.p12 ewallet.p12.lck

Next, use your browser to navigate to the HTTPS URL you are about to access with APEX_WEB_SERVICE or UTL_HTTP (in this example, we use Firefox). The following screenshots show, how earthquake.usgs.gov is accessed with the browser and how SSL certificate information can be revealed (start by clicking the tiny lock left to the browser address bar).

Application Express: Tips, tricks and best practice (1)
Application Express: Tips, tricks and best practice (2)
Application Express: Tips, tricks and best practice (3)
Application Express: Tips, tricks and best practice (4)

Look up SSL-related information in the browser

The fourth dialog of the above screenshots displays the Certificate Chain: The SSL certificate of earthquake.usgs.gov is signed with a CA certificate from Symantec; and this has been signed by Verisign Class 3 Public Primary Certification Authority. The last one is not signed by another CA, Firefox trusts it.

Thus, in order to access earthquake.usgs.gov with APEX_WEB_SERVICE or UTL_HTTP, we need to add the certificate from Verisign Class 3 Public Primary Certification Authority into the Oracle Wallet as a Trusted Certificate. First we need to download it - and the good news is that you can use the Firefox browser to do this: In the dialog, which displays the Certificate Chain, first click on Verisign Class 3 Public Primary Certification Authority and then in the lower left corner, on the Export button. Download the file (VeriSignClass3PublicPrimaryCertificationAuthority-G5.crt) to your local computer and tranfer it to the filesystem of the database server.

Application Express: Tips, tricks and best practice (5)
Application Express: Tips, tricks and best practice (6)

Download the CA certificate to your local computer with the Firefox browser

Add the CA certificate to your wallet with the orapki utility.

$ orapki wallet add -wallet https_wallet -cert VeriSignClass3PublicPrimaryCertificationAuthority-G5.crt -trusted_cert -pwd ******Oracle PKI Tool : Version 12.2.0.1.0Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.Operation is successfully completed.

Now the database should be able to validate the SSL certificate of earthquake.usgs.gov. Before configuring the wallet for Application Express, we might test it in SQL*Plus: When using APEX_WEB_SERVICE.MAKE_REST_REQUEST, we can pass a wallet path as the P_WALLET_PATH argument.

select apex_web_service.make_rest_request( p_url => 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson', p_http_method => 'GET', p_wallet_path => 'file:///path/to/directory/https_wallet' ) from dual;APEX_WEB_SERVICE.MAKE_REST_REQUEST('HTTPS://EARTHQUAKE.USGS.GOV/EARTHQUAKES/FEED--------------------------------------------------------------------------------{"type":"FeatureCollection","metadata":{"generated":1496331042000,"url":"https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson","title":"USGS Magnitude 2.5+ Earthquakes, Past Day","status":200,"api":"1.5.7","count":15},"features":[{"type":"Feature","properties":{"mag":3.18,"place":"27km WSW of Westm:

When this test has been successful, it makes sense to configure the wallet in Application Express, making it available to all workspaces and applications and to all APEX PL/SQL packages. Then we don't have to pass a wallet argument in APEX_WEB_SERVICE calls any more.

Log into the INTERNAL workspace of your Application Express installation and navigate to Instance Settings.

Application Express: Tips, tricks and best practice (7)

Workspace INTERNAL - Instance Settings

Then navigate to the Wallet section and enter the path to the wallet directory (with the file:// prefix) as the Wallet Path attribute. Since we have used the -auto_login switch when creating the wallet, we don't need to set a password.

Application Express: Tips, tricks and best practice (8)

Configure the path to the wallet files as the Wallet Path attribute in Application Express Instance Settings

If you need to add more certificates, for other HTTPS endpoints, simply repeat the above steps and add these to the existing wallet. As a second example, we want to access the Github API (api.github.com).

begin apex_web_service.g_request_headers( 1 ).name := 'User-Agent'; apex_web_service.g_request_headers( 1 ).value := 'Application Express';end;/select apex_web_service.make_rest_request( p_url => 'https://api.github.com/', p_http_method => 'GET' ) from dual;ORA-29273: HTTP request failedORA-29024: Certificate validation failureORA-06512: at "SYS.UTL_HTTP", line 380

Open the github.com page in the Firefox browser, open the dialog containing the SSL certificate details, navigate to the certificate chain, select the root CA certificate and export it to your local computer.

Application Express: Tips, tricks and best practice (9)

Export the root certificate for the github.com website

Finally add the file DigiCertHighAssuranceEVRootCA.crt to your existing wallet with orapki.

$ orapki wallet add -wallet https_wallet -cert /apex_install/DigiCertHighAssuranceEVRootCA.crt -trusted_cert -pwd ******Oracle PKI Tool : Version 12.2.0.1.0Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.Operation is successfully completed.

When you are testing with SQL*Plus, log out and in again in order to make sure that the wallet files are being re-read.

begin apex_web_service.g_request_headers( 1 ).name := 'User-Agent'; apex_web_service.g_request_headers( 1 ).value := 'Application Express';end;/select apex_web_service.make_rest_request( p_url => 'https://api.github.com/', p_http_method => 'GET' ) as response from dual;RESPONSE--------------------------------------------------------------------------------{"current_user_url":"https://api.github.com/user","current_user_authorizations_h

With these steps you can add the necessary CA certificates for almost every HTTPS endpoint in the intranet or the internet.

Finally we'll talk about another class of HTTPS endpoints: Servers using a self-signed certificate. Development or test servers often skip the process of getting an authentic SSL certificate from a certificate authority. Instead a self-signed SSL certificate is generated. This kind of certificate is not signed by a CA, instead it's signs itself. Of course, such a certificate proves nothing, and therefore every browser shows a warning when such a web site is being accessed. The Oracle database will consequently also throw a "certificate validation error" for these as well.

Application Express: Tips, tricks and best practice (10)

Browsers show a warning when a web site with a self-signed certificate is accessed

Imn Firefox, click on the Add Exception button (other browsers should show a similar one). Then you should see a dialog as follows.

Application Express: Tips, tricks and best practice (11)

The browser shows details about the web site using the self-signed certificate

Clicking the Confirm Security Exception button would lead the browser to continue accessing the web site and to finally display it. But we want to access this HTTPS endpoint with the database, so we need to download this self-signed certificate. Thus click the View button in order to get to the details of the certificate itself. You should already know this dialog. It shows a "certificate chain" with only one entry and in the lower left, you'll find the Export button.

Application Express: Tips, tricks and best practice (12)

Export the self-signed certificate

Then, as before, add the downloaded file to the existing wallet with orapki.

$ orapki wallet add -wallet https_wallet -cert /apex_install/serverwithselfsignedcert.crt -trusted_cert -pwd ******Oracle PKI Tool : Version 12.2.0.1.0Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.Operation is successfully completed.

If you have multiple server using a self-signed certificate you have to take these steps for each of them. If you have multiple databases or larger systems with requirements to access multiple HTTPS endpoints on the internet or within the intranet, you might think about setting up a process to maintain Oracle Wallets ... this process should define steps to ...

  • ... get new CA certificates into the Wallets. Request, Approval, Implementation
  • ... renew expired CA certificates
  • ... deploy the wallet to all databases after changes have been applied.

back to blogs.oracle.com/aoex

Application Express: Tips, tricks and best practice (2024)

FAQs

How to improve query performance on large table Oracle? ›

Best Practices for Query Tuning in Oracle
  1. Best Practice 1: Clarify Goals. ...
  2. Best Practice 2: Identify High-Impact SQL Statements. ...
  3. Best Practice 3: Identify Your Execution Plan. ...
  4. Best Practice 4: Avoid Large Scans. ...
  5. Best Practice 5: Optimize SELECTs. ...
  6. Best Practice 6: Use a Third-Party Tool.
Jun 16, 2020

How can I improve my Oracle query performance? ›

There are several hints to improve query performance in Oracle:
  1. Restructure indexes.
  2. Restructure the statement.
  3. Restructure data.
  4. Modify or disable triggers.
  5. Keep statistics in the relevant state and use the plan stability to have execution plans.

Is Oracle APEX in demand? ›

Oracle APEX Administrator

You'll have to become an expert in things like system console (bash or PowerShell) and low-level tools (like RMAN) that Oracle provides in their distribution. Specialists of this kind are in demand.

Does Oracle APEX use PL SQL? ›

As Oracle APEX and Oracle Forms are both SQL and PL/SQL based, and provide declarative development environments, it is easy for developers to transition from Oracle Forms to Oracle APEX.

How to resolve query slowness in Oracle? ›

Create Indexes

If you are running a query and it's slow, it could benefit from indexes. Indexes are often the most useful when created on columns as part of the Join clause and the Where clause. So, check which columns are used there, check if they have indexes, and create them if they don't.

Which is the fastest query method for a table in Oracle? ›

Ans: Row can be fetched from table by using ROWID. Using ROW ID is the fastest query method to fetch data from the table.

What can improve query performance? ›

Top 10 Tips to Improve SQL Query Performance
  • Do not use * in select Statment. ...
  • Use Exists instead of Sub Query. ...
  • Use Proper join instead of subqueries. ...
  • Use “Where” instead of “Having” a clause. ...
  • Apply UNION ALL instead of UNION if possible. ...
  • Avoid query in a loop. ...
  • Apply valid datatype on the column.
Mar 3, 2022

What is query optimization techniques? ›

Query optimization is formally described as the process of transforming a query into an equivalent form that may be evaluated more efficiently. The goal of query optimization is to find an execution plan that reduces the time required to process a query.

How to resolve performance issues in Oracle database? ›

There are six best practices DBAs should follow when conducting Oracle database performance tuning:
  1. Improving SQL execution efficiency.
  2. Increasing availability.
  3. Managing operating system resources.
  4. Optimizing storage performance.
  5. Using the query optimizer.
  6. Using and configuring memory.
Jun 16, 2020

What is the average salary of Oracle APEX? ›

Oracle Apex Developer salary in India ranges between ₹ 1.8 Lakhs to ₹ 12.6 Lakhs with an average annual salary of ₹ 5.0 Lakhs. Salary estimates are based on 175 latest salaries received from Oracle Apex Developers.

Is Oracle APEX difficult to learn? ›

Learning Oracle APEX is easy and it won't take long to pick up the basics. However, if you're not sure where to begin, need some reading material, or just need a push along the way, check out these helpful resources.

How many days will it take to learn Oracle APEX? ›

How long does it take to learn APEX? You'll be able to begin creating simple applications within a week but, realistically, to become proficient in developing secure web applications, 6 months of learning and developing.

What programming language does Oracle APEX use? ›

The main programming language behind APEX is PL/SQL, although as they are web applications, you can enhance them with custom HTML, CSS, and JavaScript.

What are two main benefits of Oracle APEX? ›

Oracle APEX is unique in that it eliminates complexity at all layers.
  • APEX eliminates mapping between relational and application objects.
  • APEX eliminates remote procedure call complexity.
  • APEX eliminates proliferation of database connections.
  • APEX eliminates middle-tier application logic.

Which database is used in Oracle APEX? ›

Because Oracle APEX is native to Oracle Database, you have direct access to all of Oracle Database features and capabilities.

How to find top 10 long running queries in Oracle? ›

Answer: You can query the v$session_longops view to find long-running queries and you can query the AWR to find historical queries (if you have purchased the AWR packs).. The Oracle data dictionary contains a little-known view called the v$session_longops.

How to make insert query faster in Oracle? ›

To optimize insert speed, combine many small operations into a single large operation. Ideally, you make a single connection, send the data for many new rows at once, and delay all index updates and consistency checking until the very end.

How to cache a query in Oracle? ›

How to cache query results in Oracle?
  1. SELECT /*+ result_cache */ e. ...
  2. EXPLAIN PLAN FOR SELECT /*+ result_cache */ e. ...
  3. SELECT ID, type, status, creation_timestamp, column_count AS cols, row_count AS "rows" FROM V$RESULT_CACHE_OBJECTS WHERE CACHE_ID = 'a1pfq5gpbag4wgj0zth2xasdj1';
  4. 1947 Result Published 11/NOV/20 3 19.
Dec 4, 2020

How to get top 5 records in Oracle SQL? ›

The SQL SELECT TOP Clause
  1. SQL Server / MS Access Syntax: SELECT TOP number|percent column_name(s) FROM table_name. ...
  2. MySQL Syntax: SELECT column_name(s) FROM table_name. ...
  3. Oracle 12 Syntax: SELECT column_name(s) FROM table_name. ...
  4. Older Oracle Syntax: SELECT column_name(s) ...
  5. Older Oracle Syntax (with ORDER BY): SELECT *

Which is the fastest database in Oracle? ›

The Oracle Exadata X9M can perform analytic scans at up to 1 Terabyte per second — meaning it can scan a exabyte in just over 16 minutes; try doing that on a general- purpose cloud compute instance or on-premises server.

Which is faster join or subquery in Oracle? ›

I won't leave you in suspense, between Joins and Subqueries, joins tend to execute faster. In fact, query retrieval time using joins will almost always outperform one that employs a subquery. The reason is that joins mitigate the processing burden on the database by replacing multiple queries with one join query.

How do you optimize a poor performing query? ›

Contents
  1. SQL query optimization basics.
  2. 12 Query optimization tips for better performance. Tip 1: Add missing indexes. Tip 2: Check for unused indexes. Tip 3: Avoid using multiple OR in the FILTER predicate. Tip 4: Use wildcards at the end of a phrase only. Tip 5: Avoid too many JOINs. ...
  3. SQL query optimization best practices.
Dec 23, 2021

What are the 7 simple tips that will boost the performance of your SQL queries? ›

Supercharge Your SQL Queries for Production Databases
  • Define business requirements first. ...
  • SELECT fields instead of using SELECT * ...
  • Avoid SELECT DISTINCT. ...
  • Create joins with INNER JOIN (not WHERE) ...
  • Use WHERE instead of HAVING to define filters. ...
  • Use wildcards at the end of a phrase only. ...
  • Use LIMIT to sample query results.

How would you optimize a query that is slow? ›

So as you see, the key in optimizing your slow queries is to find those long sequential scans that the database is performing, and adding the proper indexes to the affected tables so that the database can replace the scans with equivalent operations that use indexes.

What are the three optimization techniques? ›

There are three main elements to solve an optimization problem: an objective, variables, and constraints.

What are the 2 query Optimisation techniques? ›

What are the different query optimization techniques? There are two most common query optimization techniques – cost-based optimization and rule (logic) based optimization. For large databases, a cost-based query optimization technique is useful as it table join methods to deliver the required output.

How to clean up database in Oracle? ›

Use the Oracle Database Appliance cleanup deploy script, cleanup.pl for the following activities:
  1. Uninstall Oracle Auto Service Request (Oracle ASR)
  2. Uninstall Oracle Trace File Analyzer (TFA)
  3. Delete Oracle Database Console (dbconsole) files.
  4. Uninstall GI and Oracle stack.
  5. Reset the Oracle Linux udev rules.

How do you check DB slowness? ›

How to do it…
  1. Log in to the SQL database as an administrator.
  2. Execute the following SQL query: SELECT * FROM (SELECT sql_fulltext, sql_id, child_number, disk_reads, executions, first_load_time, last_load_time FROM v$sql ORDER BY elapsed_time DESC) WHERE ROWNUM < 10 / Copy.

How do you troubleshoot database slowness? ›

Follow these steps to troubleshoot the issue:
  1. First, find out if SQL Server is causing high CPU usage (using Perfmon counters).
  2. Identify queries contributing to CPU usage.
  3. Update statistics.
  4. Add missing indexes.
  5. Investigate and resolve parameter-sensitive issues.
  6. Investigate and resolve SARGability issues.
Mar 23, 2023

What is the lowest salary in Oracle? ›

Minimum salary at Oracle depends on the role you are applying for. For Financial Analyst the minimum salary is ₹4.2 Lakhs per year, for Technical Analyst the minimum salary is ₹8.5 Lakhs per year and so on.

What are the highest paying jobs in Oracle? ›

High-Paying Jobs at Oracle Corporation
  • Consulting Technical Manager. ...
  • SaaS Engineer. ...
  • Engineer. ...
  • Solution Architect (Consulting Solution Senior Director) - Oracle Cloud HCM Solutions. ...
  • Oracle Head of NAA Sales Methodology. ...
  • Senior Manager, Client Application Management. ...
  • Applications Sales Representative V. ...
  • IT Director.

What is the minimum salary of Oracle? ›

Average Oracle Software Engineer salary in India is ₹ 12.2 Lakhs for experience between 1 years to 7 years. Software Engineer salary at Oracle India ranges between ₹ 3.0 Lakhs to ₹ 22.0 Lakhs. According to our estimates it is 130% more than the average Software Engineer Salary in Software Product Companies.

Why is Oracle so difficult? ›

Oracle is a multi-platform database and it dates from the original RDBMS implementations generation (one of the first which competed to replace older systems), so it has a lot of layers at install which can be very challenging to deal with.

Why is APEX so hard? ›

The first and most obvious explanation for why you are dying so soon in the game is that you're putting yourself in bad positions. Many new players get so focused on getting kills and doing damage that they forget to restrain themselves and will rush forwards into a vulnerable position.

What is the hardest legend to learn in APEX? ›

Mirage is definitively the hardest legend to master in Apex Legends. Mirage requires a lot of gun skill, a strategic brain, and a deeper understanding of the game in order to make the most of his abilities. His abilities aren't offensive, he was even switched to a support Legend in Season 17.

Is APEX language difficult? ›

Features of Apex

The programming language comes with a syntax similar to Java and is relatively easy to understand and code. Once you use Apex, you will come to understand that the array annotation, loop syntax and conditional statement syntax are all similar to Java.

What skills are required for Oracle APEX? ›

Required Skills and Experience:

Oracle SQL / Oracle PL/SQL programming experience. Experience in managing web page layouts with APEX templates and themes. Relational Data modeling. Knowledge of web application usability trends.

Is Oracle APEX easy to use? ›

Easy to use: Oracle Apex is a user-friendly tool that allows developers to create applications quickly and easily, without requiring extensive coding knowledge. Cost-effective: Oracle Apex is included with Oracle databases, which makes it a cost-effective option for creating web-based applications.

What is the Microsoft equivalent of Oracle APEX? ›

PowerApps is a low code / rapid application development product from Microsoft that allows users to quickly build apps.

What are the limitations of Oracle APEX? ›

Autonomous Database Limitations in APEX Service
  • No support for Oracle Database clients. ...
  • No ability to store database client connections (SQL*Net) in Connections service.
  • Deployment of the customer managed Oracle REST Data Services is not supported.

What are the disadvantages of APEX? ›

One example of the disadvantages that I believe of using APEX is that the business logic and data has to reside on the same tier. While when considering Java for example, the business logic will reside on one tier, while the data will reside in another tier (multi tier architecture).

Is Oracle APEX a good skill? ›

They understand native APEX tools, as well as advanced components like Automations, Oracle REST data services, and embedded API – and they can use them all successfully. If you want to make a change in your professional life, or simply expand your skillset, APEX development is a good choice.

What is the difference between Oracle forms and Oracle APEX? ›

In conclusion; an Oracle Form provides a basic search and filter option using wildcard searches in the first row of the search results. In comparison, APEX provides the same basic searches, plus advanced searching, plus much more with report customisation.

Which is the most stable Oracle database? ›

Oracle Database Technologies. Oracle Database offers market-leading performance, scalability, reliability, and security, both on-premises and in the cloud. Oracle Database 19c is the current long term release, and it provides the highest level of release stability and longest time-frame for support and bug fixes.

What are the two form types that you can create in an apex application? ›

The Create Application from the Spreadsheet wizard in Chapter 4 actually built two forms in the application: one for INSERTs, and one for UPDATEs and DELETEs. This exercise will cover building a single page that will perform INSERTs, UPDATEs, and DELETEs.

What is Oracle Application Express used for? ›

Oracle APEX is a low-code development platform that enables you to build stunning, scalable, secure apps with world-class features that can be deployed anywhere. Using APEX, developers can quickly develop and deploy compelling apps that solve real problems and provide immediate value.

How do you improve database performance for table having a large number a row? ›

When you have to join a large table and there are conditions on said table, you can increase database performance by transferring your data in a temp table, and then making a join on that. Your temp table will have fewer rows than the original (large) table, so the join will finish faster!

What is the fastest way to update rows in a large table in Oracle? ›

Efficient way to UPDATE bulk of records in Oracle Database
  1. Update each record individually and COMMIT in FOR LOOP.
  2. Update each record individually in FOR LOOP but COMMIT after the loop.
  3. BULK UPDATE using BULK COLLECT and FOR ALL.
  4. DIRECT UPDATE SQL.
  5. MERGE STATEMENT.
  6. UPDATE using INLINE View Method.
Sep 2, 2019

Does table size affect query speed? ›

Table size: If your query hits one or more tables with millions of rows or more, it could affect performance. Joins: If your query joins two tables in a way that substantially increases the row count of the result set, your query is likely to be slow.

How to update large table with millions of rows in Oracle? ›

"How to Update millions or records in a table", version 8.1.7
  1. First create your dummy hold table: create table xyz_HOLD as select * from xyz where rownum<1. ...
  2. insert /*+ append parallel (xyzhold,12) */ into xyz_hold xyzhold (field1, field2, field3) select /*+ parallel (x,12) */ xyz.

What is the most important technique used in SQL performance Optimisation? ›

1. Use the Database Engine Tuning Advisor. An important performance optimization tool for SQL performance tuning is the Database Engine Tuning Advisor. This tool allows admins to evaluate single Transact-SQL statements or a batch of statements to determine where improvements can be made.

How do I optimize SQL query with millions of rows? ›

  1. Avoid auto-increment primary key. ...
  2. Avoid joining table records (left join, outer join, inner join, etc) ...
  3. Don't use SQL lock. ...
  4. Avoid aggregation functions. ...
  5. Try to use SQL function only with a single record query.

How to delete millions of rows fast with Oracle? ›

Delete all the Rows Fast with Truncate
  1. reuse storage leaves all the space allocated to the table.
  2. drop storage (the default) deallocates all the space above the minextents for the table.
  3. drop all storage deallocates all space from the table.
Feb 10, 2020

How to get top 10 rows from Oracle table? ›

Getting the top-N rows for a group is a two-step process:
  1. Assign row numbers starting at one for each group.
  2. Filter the result of this down to the rows less than or equal to the number you want.
Jan 27, 2021

What is the fastest query method for a table? ›

Fetch by rowid is the fastest query method for a table. The "table fetch by rowid" Oracle metric occurs when rows are fetched using a ROWID (usually recovered from an index), each row returned increments this counter.

What slows down queries? ›

WAITING: Queries can be slow because they're waiting on a bottleneck for a long time. See a detailed list of bottlenecks in types of Waits. RUNNING: Queries can be slow because they're running (executing) for a long time. In other words, these queries are actively using CPU resources.

Is merge faster than UPDATE? ›

The UPDATE statement will most likely be more efficient than a MERGE if the all you are doing is updating rows. Given the complex nature of the MERGE command's match condition, it can result in more overhead to process the source and target rows.

What happens to indexes when table is dropped? ›

We use the SQL DROP Table command to drop a table from the database. It completely removes the table structure and associated indexes, statistics, permissions, triggers and constraints. You might have SQL Views and Stored procedures referencing to the SQL table.

How do I make UPDATE query run faster? ›

Removing the index on the column to be updated

Thus, an update query runs much faster if the column to be updated is not an index key column. The index can always be created once the update completes.

References

Top Articles
Latest Posts
Article information

Author: Golda Nolan II

Last Updated:

Views: 5581

Rating: 4.8 / 5 (58 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Golda Nolan II

Birthday: 1998-05-14

Address: Suite 369 9754 Roberts Pines, West Benitaburgh, NM 69180-7958

Phone: +522993866487

Job: Sales Executive

Hobby: Worldbuilding, Shopping, Quilting, Cooking, Homebrewing, Leather crafting, Pet

Introduction: My name is Golda Nolan II, I am a thoughtful, clever, cute, jolly, brave, powerful, splendid person who loves writing and wants to share my knowledge and understanding with you.