有没有一种简单的方法来备份 Oracle SQL Developer 的用户片段?
我喜欢 Oracle SQL Developer,因此我发现自己经常使用它来完成日常任务。 问题是我的自定义片段集合只会不断增长,所以我认为学习如何备份它们会很有趣。
在盲目提问之前,我做了一些工作试图找出答案。 我通过“snippet”在应用程序的文件夹中进行了搜索,并找到了以下文件:
oracle.sqldeveloper.snippet.jar
其中很可能包含我心爱的代码片段。 我可以保存该文件,希望最好,但为什么不以正确的方式进行操作,也许能够,比如说,只备份我创建的文件,避免开箱即用的文件,等等还有什么?
任何建议将不胜感激!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
在我的 WinXP 计算机上,我在以下位置找到了我的用户片段:
C:\Documents and Settings\eddie\Application Data\SQL Developer\UserSnippets.xml
PS:将 eddie 替换为您的用户名。
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.
同意 Eddie Awad 的观点,只需复制 xml 文件即可。 对于 windows7,可以在此处找到 sqldeveloper User-Snippets 文件:
C:\Users[用户名]\AppData\Roaming\SQL Developer\UserSnippets.xml
Agreeing with Eddie Awad, just copy the xml file. And for windows7 the sqldeveloper User-Snippets file can be found here:
C:\Users[username]\AppData\Roaming\SQL Developer\UserSnippets.xml
如果您在 Mac OS X 上使用 SQL Developer,则可以在 ~/Library/Application Support/SQL Developer/UserSnippets.xml 中找到这些片段
If you use SQL Developer on Mac OS X, then the snippets can be found in ~/Library/Application Support/SQL Developer/UserSnippets.xml
您在 Windows 上运行吗? 检查“C:\Documents and Settings\\Application Data\SQL Developer”目录中是否有 UserSnippets.xml 文件,它包含所有用户定义的代码片段。
另外,请查看在线帮助中的“用户相关信息的位置”主题。 它具有保存其他用户定义信息的文件的位置。
-戴夫
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
为什么不在 Oracle 服务器上创建一个用于日常维护的包,将其与数据库一起存储并存储在数据库备份中?
编辑:我这样做,发现以后在执行日常维护任务时使用它们更加容易。 有时能够调用打包过程真的非常方便。
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.
同意 Spyder -
C:\Users\[用户名]\AppData\Roaming\SQL Developer\UserSnippets.xml
是这个地方。 但我只是在创建第一个新片段后才发现这一点。
之后,我可以编辑 xml 以添加新的片段和新的类别。 对 xml 进行更改后,必须重新启动 SQLDev。 (因为它是一个 xml,所以当我有时间时,我将看看是否可以将其保存到 Git 以便在我的团队中共享......)
Agreeing with Spyder -
C:\Users\[username]\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...)
对于 OS X Mountain Lion (10.8.*) 上的 SQL Developer 3.2.20.09,代码段文件位于
~/.sqldeveloper/UserSnippets.xml
中。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 Yosemite (10.10.5) 上,我还发现了当前 SQL Developer(版本 4.1.0.19)的当前 UserSnippets.xml
~/.sqldeveloper/UserSnippets.xml
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