{"id":89080,"date":"2020-11-19T20:12:22","date_gmt":"2020-11-19T20:12:22","guid":{"rendered":"https:\/\/www.red-gate.com\/simple-talk\/?p=89080"},"modified":"2021-07-14T13:06:51","modified_gmt":"2021-07-14T13:06:51","slug":"sql-developer-a-great-tool-and-better-ways-to-use-it","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/databases\/oracle-databases\/sql-developer-a-great-tool-and-better-ways-to-use-it\/","title":{"rendered":"SQL Developer \u2013 A great tool and better ways to use it"},"content":{"rendered":"<p>SQL Developer is a free tool provided by Oracle. It has a wide variety of options and utilities to help in day to day development or support activities. Some of the key features are discussed here to help navigate the tool and better understand it. Compared to other tools for Oracle database, this comes in handy for database development and support tasks.<\/p>\n<h2>Schema Browser \u2013 Scan the database<\/h2>\n<p>The database connections can be easily set up using a TNS name file or keying in all the connection details. Any person who connects to a schema would like to check its contents and browse through it. Schema Browser helps to review the existing objects in the schema. To open, right-click on the connection name and select <em>Schema Browser<\/em>. It also helps to browse through other schemas based on the permissions granted in the database.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"385\" height=\"714\" class=\"wp-image-89081\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-31.png\" \/><\/p>\n<p>The schema browser shows Tables, Views, Indexes, Packages, Procedures, Functions, Operators, Triggers, Types, Sequences, Materialized Views, Synonyms, and few other object types for the selected schema.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"341\" height=\"524\" class=\"wp-image-89082\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-32.png\" \/><\/p>\n<p>One other option is to search the objects by name in the selected type. To do this, type the search string in the <em>contains<\/em> area.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"422\" height=\"660\" class=\"wp-image-89083\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-33.png\" \/><\/p>\n<p>From here, based on the object type, all its related operations can be performed at ease. By right-clicking on the object, it can be viewed, edited, recompiled, or executed. The below figure shows the whole range of operations available for table <code>oe.customers<\/code>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"349\" height=\"582\" class=\"wp-image-89084\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-34.png\" \/><\/p>\n<p>By clicking the down arrow next to Tables, <em>New Table<\/em> can be created by just filling in the values without writing the DDL statement.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"384\" height=\"260\" class=\"wp-image-89085\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-35.png\" \/><\/p>\n<p>You can enter the table name, column name, data type, and all other parameters here.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"783\" height=\"597\" class=\"wp-image-89086\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-36.png\" \/><\/p>\n<p>After keying in the values, the DDL tab provides the corresponding SQL statement to prepare any deployment scripts.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"786\" height=\"593\" class=\"wp-image-89087\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-37.png\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Unshared SQL worksheet and SQL History \u2013 A multi-tasker with a good memory<\/h2>\n<p>SQL worksheets are commonly used to run queries and to execute any PL SQL process. By default, the sheets open in shared mode. When running SQL statements in multiple sheets, the SQL statements run based on the execution order. A process run in one worksheet has to be completed for the next one to kick off.<\/p>\n<p>One unique feature available in SQL Developer is to open up SQL worksheets in unshared mode. Click the <em>Unshared SQL Worksheet<\/em> icon or use the shortcut is CTRL + SHIFT + N. to open it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"585\" height=\"301\" class=\"wp-image-89088\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-38.png\" \/><\/p>\n<p>Unshared SQL worksheet helps to execute different queries or processes in parallel. Each of these sheets acts as a separate database connection. This will save a considerable amount of development time as multiple tasks can be done in parallel, like fetching data from two different views, validating more than one process, etc. The unshared SQL worksheets contain a * icon in the sheet name.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1069\" height=\"685\" class=\"wp-image-89089\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-39.png\" \/><\/p>\n<p>These unshared SQL worksheets work as independent sessions, and so a DML operation performed on one worksheet does not reflect on the other until it is committed. The update statement executed in sheet <em>LOCAL \u2013 OE (Unshared)<\/em> does not reflect in the data used in other worksheets without running a commit.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1565\" height=\"929\" class=\"wp-image-89090\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-40.png\" \/><\/p>\n<p>Also, any number of repeated rollbacks can be performed without impacting data on other sessions. This provides the flexibility of handling data in two or more ways simultaneously for any specific testing. Multiple unshared SQL worksheets can be opened up from each database connection.<\/p>\n<p>If the sessions disconnect for any reason, the tool automatically reconnects when a SQL is executed in this sheet. A good practice would be to limit the number of unshared worksheets to two or three, as it would be hard to keep track of what operations are performed in each of the sheets.<\/p>\n<p>The SQL history option would be your savior if you forgot to store your recently executed SQL statements or PL SQL process. Go to <em>Tools -&gt; Preferences -&gt; Environment -&gt; Local history<\/em> to enable history or modify settings, and by default, this option will be enabled.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"694\" height=\"505\" class=\"wp-image-89091\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-41.png\" \/><\/p>\n<p>This saves the history of executed SQL statements in the current SQL Developer session. With this, you can pull most of the recently executed SQL with a single click. It is also helpful when you keep enhancing a SQL statement and later refer back to its previous versions.<\/p>\n<p>To open up the history, hit the <em>F8<\/em> key or right-click and choose <em>SQL history<\/em> on any SQL worksheet.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1644\" height=\"924\" class=\"wp-image-89092\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-42.png\" \/><\/p>\n<p>The SQL history opens up at the bottom and now, choose the required SQL statements. Click the <img loading=\"lazy\" decoding=\"async\" width=\"20\" height=\"20\" class=\"wp-image-89093\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-43.png\" \/> to append the selected statements to the existing SQL worksheet. You can highlight multiple SQL statements and copy all of them to the worksheet at once.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"855\" height=\"544\" class=\"wp-image-89094\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-44.png\" \/><\/p>\n<p>The highlighted SQL statements got added to the SQL worksheet in one shot.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1334\" height=\"1024\" class=\"wp-image-89096\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-45.png\" \/><\/p>\n<p>There is also a search option with this window. This helps to narrow down the SQL statements based on an object name, SQL functions used, or any other specific detail from the SQL statement. The keyword <em>select<\/em> is entered in the search box to filter only SQL statements containing <code>select<\/code>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"468\" height=\"374\" class=\"wp-image-89097\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-46.png\" \/><\/p>\n<h2>Find DB object \u2013 Catch me if you can<\/h2>\n<p>This search feature is great to perform impact analysis across the database. It helps to identify the dependencies and directly look into the code segment containing the object name or literals or any other search string. Go to <em>View -&gt; Find DB object<\/em> to open up the window.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1392\" height=\"1002\" class=\"wp-image-89098\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-47.png\" \/><\/p>\n<p>You can customize the search by selecting the required schemas, object types, or include\/exclude source code. If a search is going to take a long time, it can be run in the background as well; this allows you to work on other items when the search is running.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"679\" height=\"521\" class=\"wp-image-89099\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-48.png\" \/><\/p>\n<p>The various objects using the searched string are shown.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1580\" height=\"956\" class=\"wp-image-89100\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-49.png\" \/><\/p>\n<p>By clicking the line of code from the search results, the respective object opens up. With this, you can quickly look into all the impacted objects and save many clicks in individually opening them through a schema browser.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"745\" height=\"354\" class=\"wp-image-89101\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-50.png\" \/><\/p>\n<p>The trigger <code>INSERT_ORD_LINE<\/code> opens up after clicking it from the search results, as shown below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"782\" height=\"415\" class=\"wp-image-89102\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-51.png\" \/><\/p>\n<p>Search results can also be collapsed or expanded at the schema level.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1577\" height=\"938\" class=\"wp-image-89103\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-52.png\" \/><\/p>\n<p>There is a limitation in the output; only up to 500 records are displayed on this search screen. For any extensive searches, one approach would be to break it down into multiple searches restricting into limited schemas.<\/p>\n<h2>Database compare \u2013 Catch the difference<\/h2>\n<p>This option helps to compare two schemas, usually between different databases. Navigate to <em>Tools -&gt; Database Diff<\/em> to access it. After refreshing the database or post-deployment, you can run this process to ensure the required objects are available or to check if the migration is successful.<\/p>\n<p>After clicking <em>Database Diff<\/em>, choose the database connections and various other comparison options in <em>Step 1 of 4<\/em>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"626\" height=\"472\" class=\"wp-image-89104\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-53.png\" \/><\/p>\n<p>Choose the object types to be compared between the selected schemas in <em>Step 2 of 4<\/em>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"631\" height=\"478\" class=\"wp-image-89105\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-54.png\" \/><\/p>\n<p>In <em>Step 3 of 4<\/em>, you have an option to run the comparison for a specific set of objects. To do that, select the schema, type, and click <img loading=\"lazy\" decoding=\"async\" width=\"101\" height=\"19\" class=\"wp-image-89106\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-55.png\" \/> . The list of all items is shown; choose the required ones, click <img loading=\"lazy\" decoding=\"async\" width=\"53\" height=\"25\" class=\"wp-image-89107\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-56.png\" \/> to finalize. To include all objects, just hit <em>Next<\/em> and move on.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"629\" height=\"477\" class=\"wp-image-89108\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-57.png\" \/><\/p>\n<p>In <em>Step 4 of 4<\/em>, the summary of the comparison performed is shown. Click <em>Finish<\/em> to generate the report. As you can see, for tables, only the identified ones from Step 3 are included.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"633\" height=\"482\" class=\"wp-image-89109\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-58.png\" \/><\/p>\n<p>The summary of the comparison is shown below. Any objects available in one schema but not in another is highlighted in green. You can see the details by clicking the item. <em>PKG_OE_CUST<\/em> is available in the <em>LOCAL_OE<\/em> Database and not available in <em>LOCAL_PROD<\/em> database.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1534\" height=\"870\" class=\"wp-image-89110\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-59.png\" \/><\/p>\n<p>Similarly, a warning sign is used to highlight any difference in the objects between the two schemas. Click the item and view the differences.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1544\" height=\"865\" class=\"wp-image-89111\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-60.png\" \/><\/p>\n<p>This process also can be executed in the background to gain some productivity.<\/p>\n<h2>Reports \u2013 Tell me about everything<\/h2>\n<p>SQL Developer contains standard reports which help to quickly browse through the contents and save time compared to manually running the queries required to get those data. This option is available from <em>View -&gt; Reports<\/em>. This will open a window listing all the available reports<\/p>\n<p><strong>Invalid objects \u2013<\/strong> This report provides a list of all invalid objects and can be run before and after deployments to ensure no new invalid objects are created.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"883\" height=\"1031\" class=\"wp-image-89112\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-61.png\" \/><\/p>\n<p><strong>Object Grants report \u2013<\/strong> This provides the overall view of grants assigned to the individual schemas.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1150\" height=\"1029\" class=\"wp-image-89113\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-62.png\" \/><\/p>\n<p>Custom reports are also available in SQL Developer under <em>Reports -&gt; User Defined Reports<\/em>. By right-clicking on <em>User Defined Report<\/em> and choosing <em>New report<\/em>, the below screen opens up. You can save any frequently used report or SQL with a report name.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1335\" height=\"835\" class=\"wp-image-89114\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-63.png\" \/><\/p>\n<p>Click on the report name to view the results from the newly created report.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"876\" height=\"1002\" class=\"wp-image-89115\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-64.png\" \/><\/p>\n<h2>Pinning \u2013 Stay where you are<\/h2>\n<p>This is a minuscule item but saves many repeated clicks, especially if you are new to SQL Developer. When you open a new object, SQL Developer automatically closes the tab for certain object types. When I open the <em>oe.customers<\/em> table to view it and then open the <em>oe.oc_inventories<\/em> table, it closes the <em>oe.customers<\/em> window. In a way, it helps avoid accumulating a lot of tabs to browse through back and forth. But if you would like to keep the tab open, then it can be pinned.<\/p>\n<p>You can pin the window with the universal icon <img loading=\"lazy\" decoding=\"async\" class=\"wp-image-89116\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/c-users-srinivasan-suresh-appdata-local-microsoft.png\" alt=\"C:\\Users\\Srinivasan.Suresh\\AppData\\Local\\Microsoft\\Windows\\INetCache\\Content.MSO\\751DB26A.tmp\" width=\"19\" height=\"19\" \/> , and it is always on the top left corner of the window. Any pinned tabs must be manually closed.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"722\" height=\"612\" class=\"wp-image-89117\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-65.png\" \/><\/p>\n<p>In PL SQL packages, procedures, functions, and few other object types, the windows are automatically pinned, which means opening another package does not close the existing package.<\/p>\n<h2>Format and Explain Plan \u2013 Make it legible<\/h2>\n<p>After developing a PL SQL object, the code can be formatted using the format option (ctrl + F7) or right-clicking on the SQL worksheet and choosing <em>Format<\/em>. The settings related to the format can be controlled in the preferences section (<em>Tools -&gt; Preferences -&gt; Code Editor -&gt; Format<\/em>). The formatter settings can be auto-detected as well.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1072\" height=\"717\" class=\"wp-image-89118\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-66.png\" \/><\/p>\n<p>A common standard can be created across the team, which would help maintain the same code format and easier maintenance. Selected pieces of code can also be formatted by highlighting only the required portion and formatting it.<\/p>\n<p>The explain plan option helps evaluate the cost and the sequence of operations performed in the SQL statement. This is available from the SQL worksheet and can be viewed by hitting the <em>F10<\/em> key or right-clicking and choosing <em>Explain Plan<\/em>. The cost and cardinality for the SQL statement are shown.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1568\" height=\"931\" class=\"wp-image-89119\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-67.png\" \/><\/p>\n<p>Two different explain plans can be compared to see the difference in steps. Usually, this is done when tuning queries to look for any improvements. Generate the explain plan for the first statement and remember to pin it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1579\" height=\"950\" class=\"wp-image-89120\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-68.png\" \/><\/p>\n<p>Now, generate for the next statement and right-click on the second explain plan tab to compare with the first one. This helps to compare the plans side by side.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1579\" height=\"946\" class=\"wp-image-89121\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-69.png\" \/><\/p>\n<h2>Debugging \u2013 A blessing for every developer<\/h2>\n<p>SQL Developer has a debugging feature for the PL SQL programs. A specific procedure, function, or package can be debugged with breakpoints, and the value of the variables can be observed during the execution. To set a breakpoint, click on the desired line of code on its left side and compile it with the debug option.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"837\" height=\"490\" class=\"wp-image-89122\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-70.png\" \/><\/p>\n<p>Click the <img loading=\"lazy\" decoding=\"async\" width=\"18\" height=\"21\" class=\"wp-image-89123\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-71.png\" \/> icon to start the debug process. The input values to be provided during execution can be keyed in the parameters section. The program gets executed after clicking <em>OK<\/em>. I have provided an input value of 1001 to <em>p_customer_id<\/em> and 50 to <em>p_credit_limit<\/em>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1748\" height=\"1019\" class=\"wp-image-89124\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-72.png\" \/><\/p>\n<p>Now, the process has stopped at the breakpoint. Here, a whole range of operations can be performed. Under the <em>Data<\/em> tab, the values of the variables can be observed as the process gets executed. With the icons on the top, the debugging process can be stopped, resumed, moved into another subprogram, etc.<\/p>\n<p>Under the <em>Data<\/em> tab, you can observe that <em>l_credit_limit<\/em> is set to 50 before entering the IF clause.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"853\" height=\"559\" class=\"wp-image-89125\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-73.png\" \/><\/p>\n<p>After hitting <img loading=\"lazy\" decoding=\"async\" width=\"23\" height=\"19\" class=\"wp-image-89126\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-74.png\" \/> or <em>F9<\/em> to resume, the process stops at the next breakpoint. Here, you can observe, the <em>l_credit_limit<\/em> value is updated to 100.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"699\" height=\"450\" class=\"wp-image-89127\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-75.png\" \/><\/p>\n<p>Hitting <img loading=\"lazy\" decoding=\"async\" width=\"23\" height=\"19\" class=\"wp-image-89128\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-76.png\" \/> or <em>F9<\/em> to resume will complete the execution of the <em>cust_update<\/em> procedure, as there are no more breakpoints.<\/p>\n<p>If there are output cursors returned as part of a function, the cursors&#8217; dataset can be viewed as well. The procedure <em>get_customers<\/em> returns a cursor to view the customer details for an input customer. The process is executed by clicking <img loading=\"lazy\" decoding=\"async\" width=\"18\" height=\"21\" class=\"wp-image-89129\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-77.png\" \/> , entering 1000 for <em>p_customer_id<\/em> under the parameters section, and clicking <em>OK<\/em>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"841\" height=\"501\" class=\"wp-image-89130\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-78.png\" \/><\/p>\n<p>After running the function, the cursor&#8217;s output value is shown under the <em>Output Variables \u2013 Log<\/em> section.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"841\" height=\"498\" class=\"wp-image-89131\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-79.png\" \/><\/p>\n<p>In some instances, the code block to execute the procedure or function can be copied to a SQL worksheet and executed from there. This helps to quickly set up the parameters when running these processes from a worksheet. The <em>p_customer_id<\/em> is set to 1001 and <em>p_credit_limit<\/em> to 300. This process can be executed several times for different values directly from this SQL worksheet by clicking <img loading=\"lazy\" decoding=\"async\" width=\"19\" height=\"20\" class=\"wp-image-89132\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-80.png\" \/> on the top left.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1096\" height=\"458\" class=\"wp-image-89133\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-81.png\" \/><\/p>\n<h2>Sessions monitor \u2013 What&#8217;s going on<\/h2>\n<p>The sessions monitor screen identifies the active sessions currently executed in the database with details like SQL Id, SID, execution time, OS user, client identifier, and many others. It can be opened up from <em>Tools -&gt; Monitor Sessions<\/em>. If you have any long-running processes, those can be identified here and you can monitor the batch processes.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1579\" height=\"939\" class=\"wp-image-89134\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-82.png\" \/><\/p>\n<p>There is a refresh timer at the top, which can be set for an automatic refresh of the screen. Filters can be applied at the top of each column to look for sessions only under a particular schema, specific OS user, or only active sessions.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1113\" height=\"557\" class=\"wp-image-89135\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-83.png\" \/><\/p>\n<p>It would be hard to capture any process which takes less than a few seconds here, and a better approach would always be creating debug logs for such processes. In the case of SQL statements with bind variables, this does not show the bind values; rather only displays them as bind variables.<\/p>\n<p>The wait tab at the bottom shows any session waits caused due to object locks or resource availability. The <em>Active SQL<\/em> tab displays the exact statement currently executed by the process, and the <em>Explain Plan<\/em> tab shows the cost associated with the statement and execution plan.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1098\" height=\"585\" class=\"wp-image-89136\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-84.png\" \/><\/p>\n<p>These features help to quickly get a grasp of the current processes executed in the database.<\/p>\n<h2>Database Design diagram \u2013 A must-have artifact<\/h2>\n<p>A data model diagram of the database assists in understanding the relationships between the objects. The option is available under <em>File -&gt; Data Modeler -&gt; Import -&gt; Data Dictionary<\/em>. After choosing the connection to log in, the list of schemas can be selected.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"943\" height=\"610\" class=\"wp-image-89137\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-85.png\" \/><\/p>\n<p>Following that would be a screen to select tables, views, and any other objects. After choosing those, hit finish. To select all the tables, use the check all icon at the bottom left.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"395\" class=\"wp-image-89138\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-86.png\" \/><\/p>\n<p>The data model diagram showing the relationships between the objects and keys, indices, and many other details is provided. These details are entirely customizable, and the diagram can be saved as a PDF or Image file by right-clicking and choosing <em>Print Diagram -&gt; To image file \/ To PDF file<\/em>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1567\" height=\"891\" class=\"wp-image-89139\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2020\/11\/word-image-87.png\" \/><\/p>\n<p>This is one of the essential artifacts maintained for the database, and it also helps to perform the impact analysis at a high level.<\/p>\n<h2>Get the most from SQL Developer<\/h2>\n<p>Just like any other tool, you get used to this and discovery new functionality as you start working in it. The tool is easy to set it up and does not require the Oracle client to be installed. There are a lot more features and utilities available in this tool apart from the items discussed here. Give SQL Developer a try and improve your skills.<\/p>\n<p>Use the links below to download the SQL Developer and the documentation to explore further.<\/p>\n<p><a href=\"https:\/\/www.oracle.com\/tools\/downloads\/sqldev-downloads.html\">https:\/\/www.oracle.com\/tools\/downloads\/sqldev-downloads.html<\/a><\/p>\n<p><a href=\"https:\/\/docs.oracle.com\/en\/database\/oracle\/sql-developer\/20.2\/books.html\">https:\/\/docs.oracle.com\/en\/database\/oracle\/sql-developer\/20.2\/books.html<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQL Developer is a popular free tool for working with Oracle databases. In this article Srinivasan Suresh explains several features of SQL Developer that can make you more productive.&hellip;<\/p>\n","protected":false},"author":335194,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[53,143533],"tags":[124952],"coauthors":[126269],"class_list":["post-89080","post","type-post","status-publish","format-standard","hentry","category-featured","category-oracle-databases","tag-redgate-deploy"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/89080","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/335194"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=89080"}],"version-history":[{"count":4,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/89080\/revisions"}],"predecessor-version":[{"id":89141,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/89080\/revisions\/89141"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=89080"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=89080"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=89080"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=89080"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}