是否有一种简单的方法来备份 Oracle SQL Developer 的用户片段?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/971792/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there an easy way to backup Oracle SQL Developer's User Snippets?
提问by Nano Taboada
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.
我喜欢 Oracle SQL Developer,所以我发现自己经常使用它来完成我的日常任务。问题是我的自定义片段集合只会不断增长,所以我虽然学习如何备份它们会很有趣。
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!
任何建议将不胜感激!
回答by Eddie Awad
On my WinXP machine, I found my User Snippets at:
在我的 WinXP 机器上,我在以下位置找到了我的用户片段:
C:\Documents and Settings\eddie\Application Data\SQL Developer\UserSnippets.xml
C:\Documents and Settings\eddie\Application Data\SQL Developer\UserSnippets.xml
PS: Replace eddiewith your username.
PS:将eddie替换为您的用户名。
回答by Spyder
Agreeing with Eddie Awad, just copy the xml file. And for windows7the sqldeveloper User-Snippets file can be found here:
同意 Eddie Awad,只需复制 xml 文件。对于windows7,可以在此处找到 sqldeveloper User-Snippets 文件:
C:\Users[username]\AppData\Roaming\SQL Developer\UserSnippets.xml
C:\Users[用户名]\AppData\Roaming\SQL Developer\UserSnippets.xml
回答by diederikh
If you use SQL Developer on Mac OS X, then the snippets can be found in ~/Library/Application Support/SQL Developer/UserSnippets.xml
如果您在 Mac OS X 上使用 SQL Developer,那么可以在 ~/Library/Application Support/SQL Developer/UserSnippets.xml 中找到这些片段
回答by David Mann
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.
你在 Windows 上运行吗?检查您的“C:\Documents and Settings\\Application Data\SQL Developer”目录中是否有 UserSnippets.xml 文件,它包含所有用户定义的片段。
Also, check the online help for "Location of User-Related Information" topic. It has location of files that hold other user defined info.
此外,请查看“用户相关信息的位置”主题的在线帮助。它具有保存其他用户定义信息的文件的位置。
-Dave
-戴夫
回答by Jonathan
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?
为什么不在 Oracle 服务器上创建一个用于日常维护的包,这样它就可以与您的数据库和数据库备份一起存储?
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.
编辑:我这样做并发现以后在执行日常维护任务时更容易使用它们。能够调用打包的过程有时真的非常方便。
回答by craig
For SQL Developer 3.2.20.09 on OS X Mountain Lion (10.8.*), the snippet file is located in ~/.sqldeveloper/UserSnippets.xml
.
对于 OS X Mountain Lion (10.8.*) 上的 SQL Developer 3.2.20.09,代码片段文件位于~/.sqldeveloper/UserSnippets.xml
.
回答by Paschi
On OS-X Yosemite (10.10.5) I found the current UserSnippets.xml for the current SQL Developer ( Version 4.1.0.19 ) also in
~/.sqldeveloper/UserSnippets.xml
在 OS-X Yosemite (10.10.5) 上,我发现当前 SQL Developer(版本 4.1.0.19)的当前 UserSnippets.xml 也在
~/.sqldeveloper/UserSnippets.xml
回答by Scott Williamson
Agreeing with Spyder -
同意 Spyder -
C:\Users\[username]\AppData\Roaming\SQL Developer\UserSnippets.xml
C:\Users\[用户名]\AppData\Roaming\SQL Developer\UserSnippets.xml
is the place. But I only found this after creating my first new Snippet.
是地方。但我是在创建我的第一个新代码段后才发现的。
After that, I was able to edit the xml to add new snippets and new categories. Once a change is made to the xml, SQLDev has to be relaunched. (And since it's an xml, I'm going to see if I can save it to Git to share amongst my team when I get a minute...)
之后,我能够编辑 xml 以添加新的片段和新类别。对 xml 进行更改后,必须重新启动 SQLDev。(而且由于它是一个 xml,我将看看是否可以将它保存到 Git 以便在我有时间时在我的团队中共享......)