ArangoDB - Where database files are stored? - database

I am using ArangoDB community edition, I have upgraded the ArangoDB and ArangoDB client softwares, hence I can see multiple installations of ArangoDB on my machine.
Well, depending on my activity I would like to uninstall unused installations.
To have a back-up I would like to save the actual database files.
I would like to save these different database files. viz : Db1 , Db2 , Db3
Just in case I mess up installations or something.
There is no option to download the complete download of database. We can only export Collections as JSON as of now
I would like to know what's the typical location where the database
files are stored.
I did complete check of below locations and I dint find database storage files.
C:\Program Files\ArangoDB3 3.X.X\etc\arangodb3
C:\Users\Prateek\AppData\Local\ArangoDB3-client 3.X.X
and other locations by Search function.

Having multiple installations of ArangDB after upgrading sounds like a bug. Would be nice if you would open a github issue for that.
The recommended way of making backups of your data is by using arangodump and then arangorestore to restore the data.

The actual default location where these database files stored is
C:\ProgramData\ArangoDB\databases
ProgramData is usually hidden under Windows.
Each collection has its own folder and has 2 files;
parameter.json
journal-NNNN.db
We can also see other ArangoDB files under C:\ProgramData\ArangoDB such as
journals
rocksdb
Even though I have had multiple installation showing up due to upgrades these database files are common. I verified this by switching to different server by running arangod.exe in Administrator mode and then calling respective arangodump by switching to that location.
Note : to get the version arangodump is running for we can check from arangodump -version true If we dont run particular aranghodump(exe) this is fetched from environment path variable.

Related

Do two installations of Oracle SQL Developer on the same machine conflict?

I already have oracle SQL developer installed in my machine. I want to install another oracle SQL developer in my computer that I want to use for my personal web application. Of course I can work with one SQL developer, but in order to ease my maintenance I am planing to have two.
So, do they conflict? Can I run my applications smoothly?
yes you can have two copies of SQL Developer 'installed' on your computer. There's not an install process - there's nothing written to the registry for example, and there's no un-installer.
You unzip the application to a directory, and run the EXE.
SQL Developer will write its preferences to your User AppData Roaming profiles folder. If they're the same exact version #, they'll share a parent directory, but there is a system_cache folder that can handle multiple instances of the app.
The framework uses the system_cache folder under user settings to ...
1. Speed up SQL Developer startup.
2. Persist certain settings if multiple instances are opened. Each additional instance creates a system_cache_N, where N=1,2,..
In your scenario, I can't think why you would need to do this. You could simply start up the application twice - it would have the same net effect.
So, do they conflict? Can I run my applications smoothly?
No. And, yes. But you don't need to do this.
Yes, you can have 2 instance of sql developer on same machine without conflicting each other. They both can share same TNS file if you want to or keep them separately.
I have used 2 instances of it and never faced any issue. In my case they were or different version, but that doesn't matter.

Store SSIS package in named database?

I have a server hosting a number of different databases, all with the same structure, and a library of SSIS packages, some of which are common across the client databases and others are client-specific.
I'm aware that you can store packages in MSDB, but this is a shared store across the whole SQL instance - is it possible to attach a package to a specific database?
Actually, when you store packages into the msdb, they are stored in specific instance's msdb. Either run SELECT * FROM dbo.sysdtspackages90 (2005) or SELECT * FROM dbo.sysssispackages (2008) across all your instances and you'll determine which one is currently hosting your packages. If you are using folders, I have fancier version of these queries available.
What I believe you are observing is an artifact of the tools. There is only one instance of the SQL Server Integration Services Service. This service doesn't stop you from storing packages in specific instance, it just makes it a little more complex to do so. Or as I see it, by ditching the GUI (SSMS) you free yourself from the fetters of non-automated administration.
How do you push packages into the other named instances? You can either edit the service's .ini file as described in the above link and then reconnect to the Integration Services thing in SSMS or use a command line or query approach to managing your packages. We used the SSISDeployManifest in my previous shops with success to handle deployments. There is a GUI associated to the .ssisDeploymentManifest and you can use that to handle your deploys or you're welcome to work with the .NET object model to handle deployments. I was happy with my PowerShell SSIS deployment and maintenance but your mileage my vary.
Finally to give concrete examples for a command line deployment, the following would deploy a package named MyPackage.dtsx sitting in the root of C to named instances on the current machine and deploy them into the root of MSDB.
dtutil.exe /file "C:\MyPackage.dtsx" /DestServer .\Dev2008 /COPY SQL;"MyPackage"
dtutil.exe /file "C:\MyPackage.dtsx" /DestServer .\Test2008 /COPY SQL;"MyPackage"
I have an earlier version of my PowerShell script for generating calls to dtexec instead of using the object library directly.
Let me know if you have further questions

Proper structure of asp.net website and database in visual studio

My main problem is where does database go?
The project will be on SVN and is developed using asp.net mvc repository pattern. Where do I put the sql server database (mdf file)? If I put it in app_data, then my other team mates can check out the source and database and run it with the database being deployed in the vs instance.
The problem with this method are:
I cannot use SQL Management Studio with this database.
Most web hosts require me to deploy the database using their UI or SQL Management studio. Putting it in App Data will make no sense.
Connection String has to be edited each time I'm moving from testing locally to testing on the web host.
If I create the database using SQL Management studio, my problems are:
How do I keep this consistent with the source control (team mates have to re-script the db if the schema changes).
Connection string again. (I'd like to automatically use the string when on production server).
Is there a solution to all my problems above? Maybe some form of patterns of tools that I am missing?
Basically your two points are correct - unless you're working off a central database everyone will have to update their database when changes are made by someone else. If you're working off a central database you can also get into the issues where a database change is made (ie: a column dropped), and the corresponding source code isn't checked in. Then you're all dead in the water until the source code is checked in, or the database is rolled back. Using a central database also means developers have no control over when databsae schema changes are pushed to them.
We have the database installed on each developer's machine (especially good since we target different DBs, each developer has one of the supported databases giving us really good cross platform testing as we go).
Then there is the central 'development' database which the 'development' environment points to. It is build by continuous integration each checkin, and upon successful build/test it publishes to development.
Changes that developers make to the database schema on their local machine need to be checked into source control. They are database upgrade scripts that make the required changes to the database from version X to version Y. The database is versioned. When a customer upgrades, these database scripts are run on their database to bring it up from their current version to the required version they're installing.
These dbpatch files are stored in the following structure:
./dbpatches
./23
./common
./CONV-2345.dbpatch
./pgsql
./CONV-2323.dbpatch
./oracle
./CONV-2323.dbpatch
./mssql
./CONV-2323.dbpatch
In the above tree, version 23 has one common dbpatch that is run on any database (is ANSI SQL), and a specific dbpatch for the three databases that require vendor specific SQL.
We have a database update script that developers can run which runs any dbpatch that hasn't been run on their development machine yet (irrespective of version - since multiple dbpatches may be committed to source control during a single version's development).
Connection strings are maintained in NHibernate.config, however if present, NHibernate.User.config is used instead, however NHibernate.User.config is ignored from source control. Each developer has their own NHibernate.User.config, which points to their local database and sets the appropriate dialects etc.
When being pushed to development we have a NAnt script which does variable substitution in the config templates for us. This same script is used when going to staging as well as when doing packages for release. The NAnt script populates a templates config file with variable values from the environment's settings file.
Use management studio or Visual Studios server explorer. App_Data isn't used much "in the real world".
This is always a problem. Use a tool like SqlCompare from Redgate or the built in Database Compare tools of Visual Studio 2010.
Use Web.Config transformations to automatically update the connection string.
I'm not an expert by any means but here's what my partner and I did for our most recent ASP.NET MVC project:
Connection strings were always the same since we were both running SQL Server Express on our development machines, as were our staging and production servers. You can just use a dot instead of the computer name (eg. ".\SQLEXPRESS" or ".\SQL_Named_Instance").
Alternatively you could also use web.config transformations for deploying to different machines.
As far as the database itself, we just created a "Database Updates" folder in the SVN repository and added new SQL scripts when updates needed to be made. I always thought it was a good idea to have an organized collection of database change scripts anyway.
A common solution to this type of problem is to have the database versioning handled in code rather than storing the database itself in version control. The code is typically executed on app_start but could be triggered in other ways (build/deploy process). Then developers can run their own local databases or use a shared development database. The common term for this is called database migrations (migrating from one version to the next). Here is a stackoverflow question for .net tools/libraries to make this easier: https://stackoverflow.com/questions/8033/database-migration-library-for-net
This is the only way I would handle this on projects with multiple developers. I've used this successfully with teams of over 50 developers and it's worked great.
The Red Gate solution would be to use SQL Source Control, which integrates into SSMS. Its maintains a sql scripts folder structure in source control, which you can keep in the same folder/ respository that you keep your app code in.
http://www.red-gate.com/products/SQL_Source_Control/

Exporting database on oracle

I have a DB on oracle on Windows Server 2003. How do I export it with all the data and put it into other Windows server?
Use RMAN to take a full backup. Then restore it on the new server.
See Clone using RMAN Article
You can use Oracle Data Pump to export and import database. Quote from documentation:
Oracle Data Pump is a feature of Oracle Database 11g Release 2 that enables very fast bulk data and metadata movement between Oracle databases.
Procedure is like this:
Export existing database using expdp utility
Install Oracle database server on new Windows server
Import database on new server using impdp utility
Check this link: Oracle Data Pump. There you will find complete documentation and examples how to use this utility.
If you are wanting to create an exact copy of an existing database on a new sever of the same operating system (though not necessarily the same O/S version) and the same Oracle version, the quickest and least problematic method is to just copy the database files. This is often referred to as database cloning, and it is a common method DBAs use to setup development and test databases that are intended to be exact duplicates of production databases.
Stop all instances of the database on the existing system. You could login to each instance "as sysdba" using SQLPlus and run the "shutdown immediate" command. You could also stop the Windows Services for the instances. They are named OracleServicesid where "sid" is the instance name. Usually, there is just one instance, but there could be multiple instances to a single database. All instances must be stopped for this procedure.
Locate the database files. Look for an "oradata" folder somewhere below the Oracle root folder and then find the folder for the database sid in there. (There could be multiple oradata folders. You need to find the one that has the folder named for the SID of your database.) There are also the files in the Admin folder for the sid as well as the %ORACLE_HOME%/database folder. If DBCA had been used to create the database, then the location of all of these files varies by the Oracle version.
Once you have identified all of the files for the database, you can use any method at your disposal to copy these files to the same locations on the new server. (Note: The database files, control files, and redo logs must be placed in the same locations (i.e., file system paths) where they exist on the old server. Otherwise, configuration files must be changed and commands must be run to alter the database's internal file paths.) The parameter file (initSID.ora) and server parameter file (spfileSID.ora) must be placed in the %ORACLE_HOME%/database folder.
On the new sever, you must run the oradim utility. (Note: oradim is an Oracle utility that is specific to Windows and is used to create, maintain, and delete instance services.) Here is a sample command:
oradim -new -sid yourdbsid -startmode automatic
Startup the database with SQLPlus, and you should be in business.
This is a general overview of the process, but it should help you get the job done quickly and easily. The problem with other tools is the need to create an empty database on the target server before loading the data by whatever means. If the target server has a different version of Oracle, it will be necessary to run data dictionary scripts to upgrade or downgrade the database. (Note: A downgrade may not always be possible.) If the new server has a different O/S, then the above procedure would require additional steps that would significantly increase its complexity.
It also possible to duplicate a database using RMAN. Google the words "clone oracle database using rman" to get some good sites on how this is done using that tool. If you are not already using RMAN, the procedure I have described above would probably be the way to go.

Managing databases in Open Source Software Projects

I was wondering how databases are managed in open source projects which are usually hosted in repositories like CVS or SVN. Placing codes in the SVN is very logical as it allows different team members to get updated pieces of code but how about databases?
Are their schemas and contents (.sql files I assume) placed inside the SVN too? In this case if I were creating a web application, would this require developers to keep on updating their local databases with the newest .sql file?
Or, is it more like having a central server which members can modify and their software just connects to over the net?
I'm planning to start an open source web application project (which requires the use of a database) but am a bit confused of how to go about the database management part.
Typically you would include one or two things:
Schema creation scripts
Initial data to be loaded into the database
Both of these should be text files. If your data needs any special processing before it can be loaded into the DBMS, then include a tool for that too.
One thing you should not do is include any particular binary database file in your source control. For example, a SQLite database file would not be appropriate. Binary database files are not normally portable across architectures or versions.
In my experience these types of applications usually include a database set up included with the build. Usually you have to install the DB where you need it then install the client. Also, usually these databases are also open source like MySQL or something.
This depends on the project you are doing. For example if all the developers are in same location in one company, the central database server may be applicaple. If the developers are distributed around the world, then the central database server is probably out of the question and every developer creates his own copy of database for development.
I would think that most common option is that every developer uses his own database.
In any case you'll want to keep the schema creation and initial data creation files in version control. This way all the developers can create a new database easily.

Resources