views:

1001

answers:

3

In Oracle SQL Developer, one can list the data in a table using the Data tab when viewing a table. There is also a 'Sort...' button to set the sort order of the data you are viewing. This can be very handy for viewing some data on the fly.

The problem: I set a sort order for viewing a particular table which is not supported by the indexes on that table. It seems that SQL Developer does the sort on the fly when you go to view that data. At first the delay wasn't too bad. But the table has grown and now it takes forever. There is no way to stop it except by force quitting SQL Developer, losing anything unsaved. (If you know another way to stop this sort, let me know!) So, I should change the viewing sort order to something else, but you can only access the Sort... button when viewing the data.

Is there another way to delete the viewing sort order besides viewing the data?

Where does SQL Developer store this information?

Any way to stop the sorting of the data after clicking on the data tab while waiting for it to appear?

+1  A: 

I believe there isn't currently a way, but there is a suggested enhancement not to retain the filter between sessions that you can vote on here on the SQL Developer forum

Tony Andrews
Thanks. But I would rather not give Oracle all my contact information to have access to that forum.
Justsalt
+1  A: 

I haven't found a command from the GUI to eliminate the sort order but you can use this workaround:

  1. Go in the sqldeveloper settings folder. On M$ Windows is located in %HOME_USER%/Application Data/SQL Developer
  2. Perform a full text search specifying the name of the sorted column. If the column's name is too common (ex: data) specify another column with a different name in the same table. You will find one or more xml files matching your searching criteria. Those files are table descriptors.
  3. At the end of the xml descriptor search for the taf element with name 'orderByClause'. If it contains the name of the column you want eliminate from sorting replace the line with an empty element ()
  4. Restart sqldeveloper and ... sort is not there anymore!

Hope this helps

Cheers, Fabrizio Fortino

+1  A: 

If you are willing to take a little risk, you can follow start by doing Fabrizio's suggestion, and then clean house as follows:

  1. Go in the sqldeveloper settings folder. On M$ Windows is located in %HOME_USER%/Application Data/SQL Developer
  2. Perform a search using the following mask "*tablesettings.xml".
  3. Delete the files that were returned to you.
  4. Restart sqldeveloper and your problem is gone.

  5. To be safe, you might want to just move those files to a quarantine directory.