使用 SQL Server 的多机开发/远程开发
为了提高工作效率,我需要能够在不止一台机器上进行开发。当我在家时,我在主工作站上进行开发,但当我在路上时,我使用笔记本电脑。当然,我不能在我的家庭网络上使用 sql 服务器,因为当我在路上时我无法访问。我尝试使用附加的 mdf 文件并在工作站和笔记本之间同步我的开发文件夹,但在连接到 mdf 文件时总是遇到问题。我不记得我收到的所有错误消息。我确实记得必须删除 TR 日志文件并让 sql server 重新创建它才能解决问题。有更好的办法吗?
To be productive i need to be able to do my development on more than one machine. When i'm home i develop on my main workstation but when i'm on the road i use my notebook. I can't use the sql server on my home network of course because i wouldn't have access when i'm on the road. I've tried to use an attached mdf file and sync my development folder between my workstation and my notebook but i always run into issues connecting to the mdf file. I don't remember all the error messages that i've got. I do remember having to delete the TR log file and have sql server recreate it in the past to solve the problem. Is there a better way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您正在将所有工作编写到 .SQL 文件中,不是吗?如果这是一个全新的应用程序,您应该有脚本来删除和创建数据库,创建所有安全帐户,创建所有模式,创建所有数据库对象等。然后您只需继续将您的开发添加到脚本中,然后运行整个过程针对您当前使用的 SQL Server 进行更新。
如果您正在开发现有应用程序,则只需为当前版本编写更改脚本即可。同步包括恢复生产备份的副本并运行更改后的脚本。
You are scripting all of your work to an .SQL file, aren't you? If this is a brand new application, you should have scripts to DROP and CREATE the database, create all security accounts, create all schemas, create all database objects, etc. Then you just need to keep adding your development to the script, and run the whole thing against the current SQL Server you are using to make it up to date.
If you are working on an existing application, then you just need to script your changes for the current release. Syncing would consist of restoring your copy of the production backup and running your script with the changes.
我在本地运行 sql server,并经常将生产数据库的过时版本交换到本地环境。我还使用 Dropbox 来管理我的 ADP,并且无论我走到哪里都可以访问它们。看起来效果不错,但我们是一家小商店,没有太多需要管理的变化。
如果我需要做认真的工作,我在办公室有一个运行桌面环境的虚拟机,所以我总是通过 VPN 连接 + RDP 远离生产数据库的本地。
I run sql server locally and swap a dated version of the production database on to my local environment every so often. I also use Dropbox to manage my ADPs and have them accessible where ever I go. It seems to work pretty well, but we're a small shop and there aren't too many changes to manage.
If I need to do serious work, I have a VM available at the office which is running a desktop environment so I'm always a VPN connection + RDP away from being local to the production db.
你的工作中有版本控制系统吗?如果是这样,您可以考虑使用 SQL 源代码管理在两个实例上进行开发。当您返回工作岗位时,只需将在家开发的更改同步到版本控制即可。
我在 Red Gate 担任产品经理,所以我有兴趣了解您最终如何解决这个问题。
Do you have a version control system at work? If so, you might consider using SQL Source Control to develop on both your instances. When you return to work, simply sync the changes developed at home to version control.
I work for Red Gate as a product manager so I'd be interested to understand how you end up solving this problem.
您是否考虑过使用 VMWare 或其他虚拟化软件包?我可以将整个开发环境卸载到几乎任何机器上,并且在几分钟内就可以开始使用。
我设置它主要是为了灾难恢复,但它对于我需要上路并可以随身携带所有东西的情况很有用。
Have you considered using VMWare or another virtualization package? I can offload my entire development environment onto almost any machine and be good to go in minutes.
I setup this up primarily for disaster recovery, but it is useful for the occasions when I need to hit the road and can take everything with me.