Quantcast
Channel: Toad for Oracle
Viewing all 4009 articles
Browse latest View live

Forum Post: RE: Script manager and send SQL query results to excel format

$
0
0
I'm using toad 11 and will soon use 13. OK thanks it works now My goal is to put several queries with comments in the export dataset , is this possible in the same editor ?

Forum Post: RE: Script manager and send SQL query results to excel format

$
0
0
Export Dataset can only take one query at a time. To get around that, make multiple Export Dataset actions - one for each query. If you want them to all have the same properties (except the query), a fast way to do that is copy/paste the action in the automation desgner. You can then run them all by right-click on the App (on the left side of the Automation Designer) and choosing "run". I don't think this was in Toad 11, but in Toad 13, there is an option to add a new sheet in the Excel file instead of overwrite.

Forum Post: toad thinks I'm trying to export a cross-connection query to Excel, but I'm it's not a cross-connection query

$
0
0
I'm running a simple select * from a small table, and it runs just fine, in Data point 4.1.0.226. If I try to export the results to a linked query in Excel, I'm greeted with an error that says "Direct Connections can not be used with Cross-Connection queries". But I'm definitely NOT running a cross connection query. Why would Toad think that I am, and how do I get around this?

Forum Post: Beta Released (13.1.0.18)

$
0
0
Beta Notes Create/Alter DB Objects The following encryption algorithms are now supported in Oracle 12cR2 and newer in create/alter table and create/alter tablespace. ARIA 128 ARIA 192 ARIA 256 GOST 256 SEED 128 In Create/Alter table, Toad now also support integrity algorithm and "identified by". Schema Browser "Shared" property of DB Links has been added to Schema Browser listing. Compare Schemas Constraint validity can now be ignored in Schema Compare

Forum Post: Toad 13 not showing object grants in role script

$
0
0
Hi, I have just upgraded to Toad 13 and I noticed that when I browse roles in the schema browser and select the script tab on the RHS it not longer shows the objects that are granted in the role. It now only shows the users that are granted to the role. I can see the object grants if I select the object grants tab on the RHS. Is there an option to change this so the script tab not only shows users granted the role but also the objects that are granted to the role ? regards, R,

Forum Post: RE: Bracket highlighting in Editor Now highlights too many

$
0
0
I could live with that! Thanks Michael.

Forum Post: TOAD 13 connects very slow when starting editor

$
0
0
Hi all, I ran into an problem when starting Toad 13.0 on Windows 10 with a 12.2.0 Oracle Client. All components are on 64-Bit. When I start the Editor it needs approx. 10-20 seconds to start. I crosstested this behaviour on a Windows7 VMware-Installation where Toad 12.11 with 11.2.0.1 Client is installed. 64-Bit too. There I cannot reproduce this and the Editor starts very fast. What I've done so far: I installed Toad 13 on the VMware-Guest where it even run very fast. I installed Toad 12.11 on my Win10 machine and it was even slow to start the editor. I started Toad with "Debug=1" in Toad.ini to check where it hangs. Here ist a snapshot taken on the slow machine: And this one taken on the Windows 7 VMware guest: The time from connection start til editor full load is 27 sec (Win10) and 6 sec (Win7) So, are there any issues when running Toad (13 or 12.11) on Windows10 ? Thanks in advance Regards Klaus

Forum Post: RE: TOAD 13 connects very slow when starting editor

$
0
0
You may be able to speed up the "Loading owners" section by: 1) right click on the "Current Schema" dropdown at the far right of the Editor toolbar. 2) Choose "Users to Load" -> "Load all users". This will query only dba_users or all_users, depending on your privileges. The other two choices have to join in dba/all_objects and might be a little slower.

Forum Post: Ctrl Key Behavior

$
0
0
I hope it is not too troublesome for me to ask a few really basic questions. I apologize. In an editor window, when the moue cursor is in a word and I press the Ctrl key, the whole word gets a pink background, which disappears when I release the Ctrl key. What is Toad indicating with this behavior? While in an editor window, the processes at the bottom of the screen includes a small panel with what appears to be a button of sorts. Before I do anything, the button is grey. After I run queries or scripts, for the rest of the edit window's life, shile the Prg is busy that button is grey, and while it is idle the button is red. What is this indicating? I managed to associate opening a Master/Detail report with Ctrl+Alt+M. But I cannot find an "Open Edit Window" action to associate with a short-cut combo. Is there a way, with the keyboard, to open a new Edit window? Thank you for indulging me. I am new to Toad (6 months), and want to become more proficient.

File: Comparación de Consultas SQL "Auto Optimize SQL" (Toad for Oracle) vs. "Autotrace" (Oracle SQL Developer)

$
0
0
Video tutorial por Clarisa Maman Orfali

Blog Post: Comparison of SQL Queries Using Toad for Oracle "Auto Optimize SQL" vs. Oracle SQL Developer "Autotrace"

$
0
0
When we are working on a project, an important task of the developer is to make their SQL statements as efficient as possible since it is well known that addressing the problems related to SQL in development costs a fraction of what it would cost to correct those same problems when we are already in production. Also, when we are working in a dev/test environment with SQL queries that have a poor execution, meaning they are slow SQL queries, we are condemning the project to having significant problems in production; imagine the issue of the scalability of your project and poor execution of your SQL queries, it would be a real disaster. If we have a DBA on our team, we can ask for his/her help to correct our SQL queries. But if we do not have one, we would have to incur more costs to get one. And if someone asks you, “how many different ways do you think we can write this SQL query?”… SELECT c.customer_id, c.cust_last_name || ', ' || c.cust_first_name Customer_Name, SUM(DECODE(p.category, 'Accessories', oi.quantity * oi.unit_price, 0)) "Accessories", SUM(DECODE(p.category, 'Mens', oi.quantity * oi.unit_price, 0)) "Mens", SUM(DECODE(p.category, 'Womens', oi.quantity * oi.unit_price, 0)) "Womens" FROM demo_customers c INNER JOIN demo_order_items oi ON 1 = 1 INNER JOIN demo_product_info p ON oi.product_id = p.product_id INNER JOIN demo_orders o ON c.customer_id = o.customer_id + 0 AND oi.order_id = o.order_id + 0 GROUP BY c.customer_id, c.cust_last_name, c.cust_first_name ORDER BY c.cust_last_name …what would your answer be? Developers often write their SQL queries the way they initially learned and don’t know exactly if their SQL is written in the most efficient way for their projects. Also, they are often not sure what to do to correct a SQL statement that has a deficient execution, so if they think their SQL is deficient, they will try to rewrite it manually, but that will take a long time and in general, will be quite inefficient. For these reasons, I want to share with the community this powerful tool that Toad for Oracle provides, called Auto Optimize SQL . This tool allows us to quickly optimize SQL statements, so that Toad for Oracle can search for faster alternatives and then compare them with the original SQL statement. We will also work with Autotrace of the Oracle SQL Developer to compare two SQL statements and see the differences between both tools. Toad for Oracle: Auto Optimize SQL To access the tool, from Toad for Oracle, select the menu Database > Optimize > Auto Optimize SQL: The Auto Optimize SQL window opens, in which we can define the type of database that we are using for the analysis of our SQL queries and different optimization options. In the box on the right we can see three tabs: - Statement to Tune : where we place our SQL query for analysis. - Alternative Detail: where the selected alternative query is displayed. - Compare Alternatives : compare the original SQL query with the selected alternative SQL query. The SQL statements that can be analyzed are: SELECT, INSERT, UPDATE, DELETE and MERGE. Enter the SQL query to be analyzed within the "Statement to Tune" tab: We adjust the options that we want for the analysis of the query; for example, in Search depth , if we select less deep we consume less time and less rewriting; however, if we select deeper we consume more time and more rewriting. To analyze this SQL query, we execute the tool by clicking on the green button: If we are using the tool for the first time, a modal window will appear requesting that we enter the name of the Table Schema Plan and click on the OK button. Once the execution of the optimizer is finished, Toad will provide us with a series of different alternatives to the original SQL query. In our example case, Toad shows us 116 different alternatives: We can visualize the alternatives from different views. For example, we select to see the alternatives based on the Plan Cost . If we want the tool to generate the alternatives without executing them, we must check the option: Generate rewrites only (do not executable) in the options window. This tool is very powerful because it evaluates the performance of each alternative by elapsed time, CPU cycles, I/O and more than a dozen other metrics. Each alternative has a unique execution plan and statistics information. In addition, the best performance alternative appears along with our original SQL so we can study it. To find the best SQL query we have the ability to compare each of the alternatives suggested by Toad with the original SQL query. For example, as we see in the following image, the original query has a cost of 15 (67% worse) and alternative 2 has a cost of 9 (40% better) . Oracle SQL Developer - version 18.1: Now let’s compare with using Oracle SQL Developer. Let’s enter in the working area the same original SQL query which we were working with in Toad for Oracle and then click on the "Autotrace ... (F6)" button. We can see the "Execution Plan" of the original query and the auto trace information. Oracle SQL Developer doesn’t provide the functionality to generate different alternatives to be compared with the original query and we can’t see the different alternatives according to different views, unless we have enabled the Oracle Tuning Pack and use the SQL Tuning Advisor, which gives us recommendations on the analyzed consultation with a justification for each recommendation and its expected benefit. It is important to mention that this package requires a license to be enabled. To make the comparison of two SQL statements for this demo, we will use one of the alternative queries generated by Toad for Oracle. SELECT /*+ INDEX(C) */ c.customer_id, c.cust_last_name || ', ' || c.cust_first_name Customer_Name, SUM(DECODE(p.category, 'Accessories', oi.quantity * oi.unit_price, 0)) "Accessories", SUM(DECODE(p.category, 'Mens', oi.quantity * oi.unit_price, 0)) "Mens", SUM(DECODE(p.category, 'Womens', oi.quantity * oi.unit_price, 0)) "Womens" FROM demo_customers c INNER JOIN demo_order_items oi ON 1 = 1 INNER JOIN demo_product_info p ON oi.product_id = p.product_id INNER JOIN demo_orders o ON c.customer_id = o.customer_id AND oi.order_id = o.order_id GROUP BY c.customer_id, c.cust_last_name, c.cust_first_name ORDER BY c.cust_last_name In order to keep the autotrace of the original query, we click on the red pin icon. We select the alternative SQL query which we want to compare to the original SQL query and we click on the autotrace button; that way, a new autotrace file is opened. To compare the two SQL queries, we click with the right mouse button on the Autotrace 1 tab and select Compare with Autotrace . This opens a new tab with the comparison of the two SQL queries: Conclusion As we have seen in this article, the help that the Auto Optimize SQL tool gives to the developers is very important and necessary, since the work of improving an SQL statement is often a great challenge for all of us who are developers. Also, having a tool that automatically rewrites our slow SQL statements with a couple of mouse clicks is really quite amazing. In addition, by using this tool regularly, we not only can quickly improve the performance of SQL statements, but we can also easily learn how to write a better SQL.

Blog Post: Comparación de Consultas SQL usando el “Auto Optimize SQL” del Toad for Oracle Vs “Autotrace” del Oracle SQL Developer

$
0
0
Cuando estamos trabajando en un proyecto, una importante tarea del desarrollador es lograr que sus instrucciones SQL sean lo mas eficiente posible ya que es un hecho bien conocido que abordar los problemas relacionados con el SQL en el desarrollo cuesta una fracción de lo que costaría corregir esos mismos problemas cuando ya estamos en producción. Además, cuando estamos trabajando en un entorno dev/test con consultas SQL con una ejecución pobre, es decir, consultas SQL lentas, estamos condenando al proyecto a tener importantes problemas en producción; imagina el tema de la escabilidad de tu proyecto y una mala ejecución de tus consultas SQL, sería un verdadero desastre. Si en nuestro equipo tenemos un DBA podemos pedir su ayuda para que corrija nuestras consultas SQL, pero en el caso que no dispongamos de uno tendríamos que incurrir en más costos. Y si alguien te pregunta: ¿De cuántas formas diferentes crees tú que podemos escribir esta consulta SQL? ... SELECT c.customer_id, c.cust_last_name || ', ' || c.cust_first_name Customer_Name, SUM(DECODE(p.category, 'Accessories', oi.quantity * oi.unit_price, 0)) "Accessories", SUM(DECODE(p.category, 'Mens', oi.quantity * oi.unit_price, 0)) "Mens", SUM(DECODE(p.category, 'Womens', oi.quantity * oi.unit_price, 0)) "Womens" FROM demo_customers c INNER JOIN demo_order_items oi ON 1 = 1 INNER JOIN demo_product_info p ON oi.product_id = p.product_id INNER JOIN demo_orders o ON c.customer_id = o.customer_id + 0 AND oi.order_id = o.order_id + 0 GROUP BY c.customer_id, c.cust_last_name, c.cust_first_name ORDER BY c.cust_last_name ... ¿Cuál sería tu respuesta? Los desarrolladores a menudo escriben sus consultas SQL de la forma en que inicialmente aprendieron y no saben exactamente si su SQL está escrito de la manera más eficiente para sus proyectos y además, no están seguros de qué hacer para corregir una declaración SQL que tiene una ejecución deficiente, entonces, si ellos creen que es deficiente su SQL, intentarán reescribirla manualmente, pero eso les llevará mucho tiempo y en general, es bastante ineficiente. Por estas razones, en esta entrega quiero compartir con la comunidad esta herramienta poderosa que nos provee el Toad for Oracle llamada Auto Optimize SQL que nos permite optimizar rápidamente instrucciones SQL, es decir, el Toad for Oracle busca alternativas más rápidas y nos permite compararlas con la declaración SQL original. Por otro lado, también vamos a trabajar con el Autotrace del Oracle SQL Developer para poder comparar dos instrucciones SQL y ver las diferencias entre ambas herramientas. Toad for Oracle: Auto Optimize SQL Para ingresar a la herramienta, desde el Toad for Oracle, seleccionamos el menú Database > Optimize > Auto Optimize SQL: Se abre la ventana del Auto Optimize SQL en el cual podemos definir el tipo de base de datos que estamos utilizando para el análisis de nuestras consultas SQL y las diferentes opciones de optimización. En el recuadro de la derecha podemos ver tres fichas: - Statement to Tune : donde colocamos nuestra consulta SQL para analizar - Alternative Detail : se muestra la consulta alternativa seleccionada - Compare Alternatives : se comparan la consulta SQL original con la consulta SQL alternativa seleccionada Las sentencias SQL permitidas para analizar son: SELECT, INSERT, UPDATE, DELETE y MERGE. Ingresamos la consulta SQL a analizar dentro de la ficha “Statement to Tune”: Ajustamos las opciones que deseamos para el análisis de la consulta, por ejemplo, en Search depth , si seleccionamos menos profundo consumimos menos tiempo y menos re-escritura, en cambio, si seleccionamos más profundo consumimos más tiempo y más re-escritura. Para analizar esta consulta SQL ejecutamos la herramienta haciendo clic en el botón verde: En el caso que usemos la herramienta por primera vez, aparecerá una ventana modal solicitando que ingresemos el nombre del Plan Table Schema y hacemos clic en el botón Ok. Una vez finalizada la ejecución del optimizador, el Toad nos brindará una serie de distintas alternativas a la consulta SQL original. En nuestro caso de ejemplo, el Toad nos muestra 116 alternativas diferentes: Además, podemos visualizar las alternativas desde distintas vistas, por ejemplo, seleccionamos ver las alternativas en base al Plan Cost . Si queremos que la herramienta genere las alternativas sin que las ejecute, debemos tildar la opción: Generate rewrites only (do not executable) , en la ventana de opciones. Esta herramienta es muy poderosa porque califica el rendimiento de cada alternativa por tiempo transcurrido, ciclos de CPU, E/S y más de una docena de otras métricas. Cada alternativa tiene un plan de ejecución único y la información de las estadísticas. Además, la alternativa de mejor rendimiento aparece junto con nuestra SQL original para que podamos estudiarla. Para encontrar la mejor consulta SQL tenemos la posibilidad de comparar cada una de las alternativas sugeridas por el Toad con la consulta SQL original. Por ejemplo, como vemos en la siguiente imagen, la consulta original tiene un costo de 15 (67% worse) y la alternativa 2 tiene un costo de 9 (40% better) . Oracle SQL Developer - versión 18.1: Ingresamos en la ventana de trabajo la misma consulta SQL original con la cual estábamos trabajando en el Toad for Oracle. Hacemos clic en el botón “Autotrace… (F6)” Podemos ver el “Plan de Ejecución” de la consulta original y la información del autotrace. El Oracle SQL Developer no nos provee la funcionalidad de generar diferentes alternativas para ser comparadas con la consulta original y tampoco podemos ver las diferentes alternativas según distintas vistas, a menos que tengamos habilitado el Oracle Tuning Pack y utilizar el SQL Tuning Advisor el cual nos brinda recomendaciones de la consulta analizada con una justificación para cada recomendación y su beneficio esperado. Es importante mencionar que este paquete requiere de una licencia para ser habilitado. Para el caso de realizar la comparación de dos sentencias SQL vamos a utilizar para este demo una de las consultas alternativas generadas por el Toad for Oracle. SELECT /*+ INDEX(C) */ c.customer_id, c.cust_last_name || ', ' || c.cust_first_name Customer_Name, SUM(DECODE(p.category, 'Accessories', oi.quantity * oi.unit_price, 0)) "Accessories", SUM(DECODE(p.category, 'Mens', oi.quantity * oi.unit_price, 0)) "Mens", SUM(DECODE(p.category, 'Womens', oi.quantity * oi.unit_price, 0)) "Womens" FROM demo_customers c INNER JOIN demo_order_items oi ON 1 = 1 INNER JOIN demo_product_info p ON oi.product_id = p.product_id INNER JOIN demo_orders o ON c.customer_id = o.customer_id AND oi.order_id = o.order_id GROUP BY c.customer_id, c.cust_last_name, c.cust_first_name ORDER BY c.cust_last_name Para poder conservar el autotrace de la consulta original, hacemos clic en el icono del pin rojo. Seleccionamos la consulta SQL alternativa con la cual queremos compararla con la consulta SQL original y hacemos clic en el botón de autotrace, de esa forma se abre una nueva ficha de autotrace. Para comparar las dos consultas SQL, hacemos clic con el botón derecho del ratón sobre la ficha Autotrace 1 y seleccionamos Compare with Autotrace . De esta forma se abre una nueva ficha con la comparación de las dos consultas SQL: Conclusión Como vimos a lo largo de todo este artículo la ayuda que brinda a los desarrolladores la herramienta Auto Optimize SQL del Toad for Oracle es muy importante y necesaria , ya que, el trabajo de mejorar una instrucción SQL a menudo es un gran desafío para todos los que somos desarrolladores y disponer de una herramienta que reescribe automáticamente nuestras instrucciones SQL lentas con un par de clics del ratón, realmente es asombroso. Además, con esta herramienta al usarla continuamente no solo podemos mejorar rápidamente el rendimiento de las instrucciones SQL, sino que también podemos de forma muy fácil aprender a escribir un mejor SQL.

Forum Post: RE: Export the results of a query to csv

$
0
0
Hello John, I'm a new in this community… I get an opportunity to say hello to everybody. I did the same but I had more than 2 millions records, I tried to choose "Delimited" and I rename the ouput like for exemple "daly_record.csv" ... but the excel show me only on tab withe 65 000 records… how can I find others Thank you for a help.

Forum Post: Why does TOAD 12.10.0.30 take so long to report ORA-01017 invalid username/password?

$
0
0
When I enter the correct username/password, my connection goes through and I am doing work within 5 seconds. When I enter an invalid password, the screen hangs for what seems to be ages before displaying the error message. Actual clock time is around 45 seconds. When I spool the output, TOAD knows that the password was wrong in about .047 seconds so it seems like a horribly long time to wait for another chance to enter the correct password. Doing the same good/bad password test in SQL*Plus returns instantly in both cases. Here is the spool output with appropriate privacy edits applied: ---------------------------------- -- Timestamp: 10:55:45.005 Connect: SYSTEM@mydb.mydomain.COM ---------------------------------- -- Session: SYSTEM@mydb.mydomain.COM -- Timestamp: 10:55:45.052 Error: ORA-01017: invalid username/password; logon denied ---------------------------------- -- Timestamp: 10:56:43.840 Connect: SYSTEM@mydb.mydomain.COM ---------------------------------- -- Session: SYSTEM@mydb.mydomain.COM -- Timestamp: 10:56:43.902 SELECT version, product, sysdate FROM sys.PRODUCT_COMPONENT_VERSION WHERE UPPER(PRODUCT) LIKE '%ORACLE%';

Forum Post: RE: Why does TOAD 12.10.0.30 take so long to report ORA-01017 invalid username/password?

$
0
0
Thanks for the reply John. I can see the connect attempt and the error message in the spool window for the whole 45 seconds that I am waiting for the error message to pop up so the messages are being spooled out immediately. Several of my coworkers have reported the same problem since we upgraded to new Windows 10 machines with this newer version of TOAD loaded. Our old Windows 7 machines would display the error message in under 1 second. I only have Oracle Client 11.2.0.4 loaded on my PC. The old PC used 11.2.0.2 and a previous version of TOAD that I don't remember. It was probably a 10.x.

Forum Post: Beta Released (13.1.0.19)

$
0
0
Beta Notes Schema Browser Schema Dropdowns should load faster for some users Session Browser 18c There is a new button in the Session Browser that will allow you to cancel another user's SQL without killing their session.

Forum Post: RE: Export the results of a query to csv

$
0
0
It sounds like you are running an old version of Excel. Older versions had a limit of 65000 records. The newer versions do not have this limitation. Can you tell us what version of Excel you are running? -Mark

Forum Post: Toad Changes Display when I insert a code

$
0
0
Toad put red lines if I insert a code like in the below; "select * from table" There is the preview in the attachment. How can I fix it ?

Forum Post: RE: TOAD 13 connects very slow when starting editor

$
0
0
The second group of debug lines you highlight for the IsActiveEditorForm are largely useless. They are leftovers from a release long gone by while tracking down a particular issue and were removed earlier in the Toad 13.1 beta cycle. I'm not sure what other code was executing around that time due to a lack of debug output. Michael

Forum Post: RE: Ctrl Key Behavior

$
0
0
Hi Brian, following up on what Mike said.... The icon will be grey (I'm in the UK - that's how we spell it, correctly!!!!) [;)] whenever you have executed a SQL statement or a PL/SQL statement in the editor, and no results grid is produced. Something like "CREATE TABLE ...;" or "EXEC somePackage.someProcedure();". The icon will be red when you have executed a "SELECT ...;" but have not included the ROWID of the table in the select list. "SELECT * FROM MYTABLE;" for example. This makes the grid non editable. What data you see is what you are going to have to change, if required, in some other way. The icon turns green when you do select the ROWID, "SELECT ROWID, T.* FROM MYTABLE T;". Now you can wander around the grid, clicking in cells, editing the contents and so on. When done, you click the POST button, and then COMMIT or ROLLBACK as necessary. They are on buttons too. You double click a TEXTual cell to open a separate editor window, make changes and click the green tick (check?) button to post the edit. The editor will remain open to allow further changes. Close it and commit by clicking the first button above the grid - a red down arrow pointing at a "database". Rollback is the button next to it, blue arrow pointing up away from the "database". You single-click a NUMERIC cell, once to select it, once to start editing, and if you want, click the down arrow that appears to open a calculator utility to create the new value for the column. Once done, tick the green tick (check) above the grid to post the edit, and commit or rollback as before. The buttons above an editable grid are: Commit, Rollback, Pivot Grid, Export Grid, First row, Previous row, Next row, Last Row, Add a row, delete current row, Edit current row, Post edit, Cancel Edit, Cancel data fetch and Calculate with selected cells - like a spreadsheet, you can add, average, count, min or max the cells you have selected. The results are written to the status line. Other options such as duplicating the current row are available on the right-click menu. Enjoy. Oh, by the way, you may notice that when you do select the ROWID, you never see it in the grid. Toad uses the ROWID being present to put the grid into read-write mode. The ROWID is not shown. If you need to actually see the ROWID for a table, you have to alias it, as in "SELECT ROWID as MYROWID, t.* FROM MYTABLE T;" this will display the ROWID column and will put the grid into read-write mode. DO NOT EDIT THE ROWID COLUMN! The grid allows this, but you may/will end up corrupting something if you do change it.
Viewing all 4009 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>