PKG
PKG

Reputation: 301

Old SQL History in Oracle SQL Developer

In SQL Developer, i was finding some SQL commands of previous month but not able to find that as it is showing only the records of last 4-5 days.

Is there any way to find the old SQL commands those are not displaying under SQL history tab.

Thanks.

Upvotes: 24

Views: 115571

Answers (5)

Roberto Garcia
Roberto Garcia

Reputation: 11

Well, I think there is another option like this:

In SQL Developer> View menu: In SQL Developer> View menu

Then, go to file option: Then, go to file option

and you got recent file tab: and you got recent file tab

Upvotes: 1

Alberto Cerqueira
Alberto Cerqueira

Reputation: 1419

You can try

View > History SQL

For example, look this picture: enter image description here

Upvotes: 16

MiguelKVidal
MiguelKVidal

Reputation: 1538

In SQL Developer, to change the limit go to: Tools -> Preferences.

Inside this, navigate to:

Database –> Worksheet –> SQL History Limit

Change it to whatever you want. (In 4.0.1.14, the max was 999999999.)

Hope it helps.

Best regards.

Upvotes: 11

Patrick Bacon
Patrick Bacon

Reputation: 4640

As Oracle has documented, there is a SQL history folder and it is larger (has more SQL queries that go back about a year) than the SQL History tool bar (a couple of months).

Here is the content of my SQL History tool bar:

SQL History tool bar

With respect to the SQL history folder, release notes cite this location in Windows 7:

C:\Users\your_user_name\AppData\Roaming\SQL Developer\SqlHistory

While this folder contains SQL History, it also contains: User-defined reports and user-defined snippets files (e.g. see 3.1 Sql Developer release notes) Here is my SQL History folder:

My SQL History folder

I do not see any documentation to adjust the size of either.

Upvotes: 37

Lalit Kumar B
Lalit Kumar B

Reputation: 49082

If your queries are still in the shared_pool, you can use v$sql and v$sqlarea. They would be flushed out regularly, but you can find them till that period of time.

Upvotes: 0

Related Questions