Toad World® Forums

Custom menu in all grids

I would like to see if there is an option to create custom menu entries for every grid presentation.

Example, partition grid

  • record count in that partition (mine script)
  • run gather stat (mine script)

as you see it is no possible to place all needs and suit everyone.

but with custom menu, attached with scripts it is possible.

Grid should only return elementary data of selected item (owner, table, partition_name in previous example) and maybe item in grid which has a focus (i.e. num_rows, blocks...etc).

The Schema Browser allows some custom queries.  It is designed just for SELECT statements, but you might be able to use it to build calls to DBMS_STATS for one table at a time.

Right-click on a table, choose "Custom queries" (it's the last choice on the menu).   You can see a few pre-designed ones, or to make your own, click "Edit Custom Queries" and follow the example of the others.  

Hi John

I was focused on all kinds of grids results ... not schema browser.

I would like that you propose interface that will return some important parts from the grid (for multiple column let say comma separated values) and for current cell value last out parameter.

Then we all could make some queries that will use &1, &2 or &3 in (generated list..ok need some thinking how exactly would that be the best)

>DBMS_STATS for one table at a time

Do not follow you really but in mine pr-axis 99% of DBMS_STATS on partitioned tables are based on few partitions and very rarely on the whole table. and the best of all most of them are pretty customized (histogram, parallelism etc) so there is no easy way for that until you allow custom scripts on menu item generated by users.

I hope I was more clear in mine explanation.

"for multiple column " should be "multiple rows" ...cannot edit previous post

imagine ....  you have split 10 partitions.

then you sort the partitions grid to have last_analyze blank on the top

you select all partitions without stat and then execute custom dbms_stats for selected partitions.

similar is for count in selected partitions (with parallle hint added by user) or any other query based on selection

imagine ....  you have split 10 partitions.

then you sort the partitions grid to have last_analyze blank on the top

you select all partitions without stat and then execute custom dbms_stats for selected partitions.

similar is for count in selected partitions (with parallel hint added by user) or any other query based on selection

similar may be with index partitions which are invalid so you need to rebuild them

later only imagination is the limit ... but it is important to return some values from selection, as stated before owner, table(index) partition_name(s)

Yeah, I can see the value in that and will think about it.    

Maybe these were just examples but just so you know - there are easy ways to do some of these things in Toad already.

To collect stats on just some partitons - rt-click the table and choose "analyze".   that will send it to the "Analyze all objects" window.   If partitions aren't loaded automatically in the list, click the dropdown arrow next to the 3rd toolbar button, choose "Partitioned table options" and set it to load partitions.    The setting will be remembered.   So close the Analyze All Objects window and repeat.     This time it will load all of the partitions and you can sort and collect stats on whichever ones you want, as you were hoping to do in the Schema Browser RHS Partitions tab.

As far as rebuilding unusable index partitions or subpartitions, just double-click the index from the Schema Browser.   When the Alter Index window comes up, go to the "Partitions" tab.  it will identify the unusable partitions or subpartitions.   On the status bar at the bottom it will say something like "3 subpartitions are unusable.  Click here to rebuild them".   Then you can just click OK and you are done.

Actually, now that I think about this a little more - what you are asking for was in a way implemented with the Query Iterator in the App Designer.    It's not on every grid, but the idea is the same....to do something with a query result (pass to a script, export DDL, export data....anything you can do with an action in Toad).  

Look at the 2nd example in this blog:

www.toadworld.com/.../new-in-toad-39-s-automation-designer-query-iterator

thx will look for it