views:

1684

answers:

4

I love Oracle SQL Developer so I find myself using it a lot to complete my daily tasks. The thing is that my collection of custom snippets only keeps growing so I though it'd be interesting to learn how to backup them.

Before asking blindly I did a bit of work trying to figure out how. I've performed a search within the application's folder by "snippet" and found the following file:

oracle.sqldeveloper.snippet.jar

which quite probably contains my beloved pieces of code. I could just save that file hoping the best, but why not doing it the right way and perhaps being able to, say, only backup the ones and I've created, avoiding the ones that came out-of-the-box, et cétera?

Any suggestion would be really appreciated!

+1  A: 

Why not create a package on the Oracle server for daily maintenance that way it's stored with your DB and in your DB backups?

EDIT: I do this and find it even easier to use them later on when performing routine maintenance tasks. Being able to call a packaged procedure is really, REALLY handy sometimes.

Jonathan
Thanks much for your comment! I'd have to sort of disagree with you here, I don't think that performing such a server-side operation would be the best way to backup user snippets.
Nano Taboada
What are you backing up? Snippets of SQL?Your "daily tasks" you use "a lot" are going to be performed much faster as pre-compiled procedures rather than run-once statements. Not only do you gain a performance standard, you gain the backup capability.However, if these snippets you want to save are user-specific then I misunderstood your question.
Jonathan
+1  A: 

On my WinXP machine, I found my User Snippets at:

C:\Documents and Settings\eddie\Application Data\SQL Developer\UserSnippets.xml

PS: Replace eddie with your username.

EddieAwad
Wow, it's there! Thanks much! Clearly for some reason Windows search is not indexing that location.
Nano Taboada
+2  A: 

Are you running on Windows? Check your "C:\Documents and Settings\\Application Data\SQL Developer" directory for a UserSnippets.xml file, it contains all user defined snippets.

Also, check the online help for "Location of User-Related Information" topic. It has location of files that hold other user defined info.

-Dave

David Mann
+1  A: 

If you use SQL Developer on Mac OS X, then the snippets can be found in ~/Library/Application Support/SQL Developer/UserSnippets.xml

Diederik Hoogenboom