Configuring GIT in Oracle SQL developer 18.x - database

First of all please accept my apologies if my explanation is poor but I'll do my best to be as clear as possible.
Situation: I have access to a database only via connection so no local copy to initialize GIT.
Question: Is it possible to have a local copy of the source DB in order to initialize the GIT repository AND also, for the developers, after cloning from the GIT, is it possible to work on there local copy and have those changes reflected on the source DB.
Thank you in advance.

You might want to take a look at https://gitora.com/

Related

Cannot attach database after using syncing with git

I have a problem attaching ms sql server database after syncing with git. My steps are:
1. I use Dropbox to keep the bare repository instead of github.
2. The working repository stored in C drive. This repository contains my code and database (ms sql server 2008). So I commit and push changes to bare repository (in dropbox).
3. On the second computer, I clone that project from dropbox (bare repository).
4. At first, the 2nd computer can attach database. Then it edits database, detach database, and push changes to bare repository in dropbox.
5. The problem occurs here, the first computer cannot pull the changes from bare repository. It shows permission deny. I use SmartGit as GUI for git. Beside, when I do these steps again, the other problem is that the first computer can pull the changes but it cannot attach the database any more.
I guess when the second computer edits database, it gave its own permission to access database, that’s why the first one cannot get changes or attach database.
The purpose of the above steps is that I want to keep my database in dropbox using git so that I can work with database from any computer without copying it. Before I used Dropbox to do this, but it cannot sync database, that’s why I think of using git. I do not need git to version control my database, just keeps it in one place for portable working.
If you guys think the above method is not practical, could you suggest me a way of doing this? Thank you so much in advance.
Update:
Problem is solved.
Resolution: 2 ways:
- Generate script based on ms sqlserver using msdeploy and version control that script. (I'm using this method).
- Using data tier app (DAC), but I'm new in this. Will play with it later.

How to update an already published database?

I have a web application that has an SQL database.
For clarity I'm using Asp.Net 4.0/c#/SQL Server 2008 Web edition.
I recently puclished the site, which was my first, by creating a deployment package for the database.
Now a couple of months down the line, I need to update the database structure. The web application now has data that has been entered via the web, so i'll need to update the structure, then copy data across.
As this is the first time I've done it, I'm unsure of the process I should follow - is there a standard practice for this kind of update?
Also, since some of the tables use incremental ID's I need to ensure they remain the same in the newly updated database.
Any tips, links, advice appreciated.
Important Guidelines:
I assume you have not changed structure entirely (means keys column are same though solution is around for that too)
Steps are as follows:
Take export of the database
Add or remove the columns or whatever changes you want
Import the database back
Check the log for rows/tables (if some) were not updated successfully
Make SQL queries for them and run them to sync
Here are some general steps for this:
Take backup of your online database and restore it locally
Modify local database to suite your needs
Use third party comparison and synchronization tool to publish changes to your production database
There are many of these available and you can use them in trial mode to get the job done if you’re on a tight budget. You can try tools from Red Gate, ApexSQL, Idera, Dev Art and others…

Database Synchronization for remote development

As the title describes, I am looking for an efficient way to synchronize the structure & the data of a project's Database.
As I have not found a "right way" to achieve it, I have propose a solution of dumping the Database into a SQL file before every git commit and import the SQL file on each git pull. This results a smart way to administrate data with git, yet this solution doesn't scale and sometimes creates more issues than solutions. For example, it's not an autonomous way so human mistakes are taking place too often, and all the development team should use the same dumping tool.
Any suggestion of your custom solution would be also fine. Thank you!
Cheers!
You can compare and synchronize or just view differences between two databases with a help of Schema/Data Comparison tools in dbForge Studio for MySQL.

Git And SQL Server MDF Files

OK..so I'm new to Git / Github after being on Visual Source Safe most of my career and have seen the light - love it. So I have migrated all my .NET projects to my Github account and would like to also manage all my SQL Server databases with Git as well. In all my projects I always put my database files in a /Database subdirectory so I have, for example, /Databases/MyDatabase.mdf and /Databases/MyDatabase.ldf in my source tree. I am tracking these files with Git and they show in Github nicely with all the rest of my source.
Here's what I was expecting to happen: I stop SQL Server with a NET STOP MSSQLSERVER and I checkout a branch so Git will pull down the MDF and LDF files for that branch. Restart SQL Server with NET START MSSQLSERVER and do whatever work I need to do on the source and database for that particular branch. Git would track my changes to the MDF file and when I do a stage / commit / push it would send the changes back up to the remote repository.
I tried this by pulling down the database and adding a new column to a table and doing a commit. Git told me that there were no changes to any items which I was not expecting...I changed the MDF file. Is it not possible for Git to track changes in an MDF file? My first guess was that maybe because it was binary and not text base Git might have trouble with it but I believe it's possible to use Git to keep track of image files and other binary items so that doesn't seem like it would be the issue. Any ideas? Is it just not possible? Should I not even be trying to do this? Thanks in advance for your comments.
It is very bad idea to place changing database files into any source control. Try to create/update appropriate scripts and store them in source control - this is the proper way to track schema changes inside the DB
If you're using Visual Studio - this is a good point to start with database and server projects in it. But sometimes it behave in weird manner, so use with caution and gently
OR you can use some commercial/free software to track the changes inside DB schema and data, like RedGate Schema Compare or Redgate Data Compare
Have you considered using our SQL Source Control tool to keep track of development changes. This does all the 'scripting out' for you behind the scenes. It actually uses SQL Compare's engine under the hood.
http://www.red-gate.com/products/sql-development/sql-source-control/
As Oleg correctly points out, it's possible to track schema changes using SQL Compare and SQL Data Compare, but here at Red Gate we wouldn't recommend you do this over maintaining your development environment under source control. Ideally you should do both. Grant Fritchey has written an excellent article describing how SQL Compare's command line can be used with a source control system to track schema changes. He uses SourceGear Vault in his examples, but the principles apply to any source control system.
http://www.simple-talk.com/sql/database-administration/auditing-ddl-changes-in-sql-server-databases/

Subversion over SQL Server

Is it possible to store Subversion meta data in SQL Server? We want a SQL Server based Subversion.
There isn't anyway to do that right now. Subversion lets you choose between FSFS and Berkeley DB, with FSFS being the better choice for most people. (Berkeley DB has some issues around getting corrupt).
Is there a reason you want to store the data in SQL Server?
I with James Avery - why do you want to store the data in an SQL Server? If you're wanting someway to interface with the underlying subversion data from a .NET library, check out SharpSVN: http://sharpsvn.open.collab.net/.
Subversion used to have BDB (Berkley Database) as its core storage. Most people moved away from that because it was hard to back up and corruption sometimes became an issue. I wouldn't recommend it but I am sure you could go look at the BDB code and have it hook up to a SQL Server.
Why use a backing store that you can so easily corrupt? Sure, you can corrupt the filesystem store, but most people have enough sense not to touch it.
As it is, future versions of SVN are looking to store revprop data in a sqlite db instead of files. If they do, then you should be able to access that in much the same way, but for the mutable revprops only. I'm not sure if they intend to restrict access to it to the svn libraries of allow any other process to read and write to it.
Of course, the biggest reason SQL server is not suitable for subversion is that it would completely break its ability to be cross-platform.

Resources