What is the default location where mac stores sqlite3 databases - database

I want to pull data from a remote db into an sqlite database I just don't know where the path is to where mac stores sqlite3 files. It's just the default location.
This is the answer I came up with and will post it as an answer when SO lets me.
I don't know if this is the default but I never changed the sqlite3 settings on my macbook so I would assume that this is in fact the default location but like I said I don't know and it just worked for me.
The default location for me was
sqlite://my-apps-name.db
If you keep your sqlite db the same as your applications name all you need to do is give the application name which is also the db file's name after sqlite:// and that should do it.

SQLite3 is not a server-based DBMS like MySQL, which has a centralized location for all its served database files. It does not typically have a default (or even a central) location for databases. It relies on individual files for its databases, which could potentially be located anywhere within the file system.
If you want to create a database, it's up to you where to put it.

The default location for me was
sqlite://my-apps-name.db
If you keep your sqlite db the same as your applications name all you need to do is give the application name which is also the db file's name after sqlite:// and that should do it.

Related

Restore an Oracle database to another disk drive in Windows Server 2012

My question is about the following, it is required to pass a database of Oracle Database 10g Express Edition to 11g. I was given the backup on a pendrive, it is a file with extension .dmp (Dump file).
I installed the 11g Express Edition on a new server but also installed the database that comes with this (XE).
I want to restore the database from the 10g to another unit other than C, which is where the Oracle 11g database is installed. I also want this new database to "replace" the XE (I do not know if it is the correct way to say it).
I have only found adjustments and location changes but only within the same unit.
Any scope would be very useful.
Thank you.
Judging from the comments, it sounds like you have been given a Database Dump file (.dmp) from a database on a pendrive, and you need to figure out how to get that file into a database, correct?
First, let's go over some background. What is a dump file (.dmp)? From Oracle:
The dump file set is made up of one or more disk files that contain
table data, database object metadata, and control information. The
files are written in a proprietary, binary format. During an import
operation, the Data Pump Import utility uses these files to locate
each database object in the dump file set.
At a high level, that .dmp file is a collection of DDL and DML statements that will recreate whatever data and objects that were exported. .dmp files make it easier to transport and move large amounts of data between databases using Data Pump. But what is Data Pump? Again, from Oracle:
Oracle Data Pump technology enables very high-speed movement of data and metadata from one database to another.
Basically, Data Pump is a set of utilities (EXPDP & IMPDP) that are used to move data between databases. The .dmp file you have was likely created using EXPDP. You will need to use IMPDP to import that .dmp file into a database.
Here's were it gets interesting - you say that you already have an 11g database, correct? If you want to, you should be able to import the 10g dump file directly into your 11g database without any issues. The reason is that Oracle tends to be backwards compatible, and typically speaking, anything that you do with one version of Oracle will be compatible with the version that immediately succeeds it. Jumping from something like Oracle 8i to 11g won't work, but you can always go from 8i to 9i, from 9i to 10g, and so on.
If you want to import that dump file into your 11g database, here's what you'll need to do:
Create a DBA account, or have an account that has been granted Data Pump privileges explicitly.
Move the .dmp file to the server where your 11g database lives. If you want to make it even easier for yourself, you can move the .dmp file to your database's datapump directory. If you don't know where that is, execute the following query on your database: select * from all_directories where directory_name = 'DATA_PUMP_DIR'; This query will return a directory. You don't have to use this directory, it will just make it easier.
Once you have the dump file in place and you have all of the necessary database and operating system privileges, you are ready to import the dmp file. Open a new command line window, set your Oracle home if it is not already set, and then navigate to the directory where you placed the .dmp file. Your import command will look something like this:
impdp [USERNAME]/[PASSWORD]#[DATABASE] directory=[DIRECTORY] dumpfile=[FILENAME].dmp logfile=[LOGFILE].log
Where [USERNAME]/[PASSWORD] are your credentials, [DATABASE] is the name of the database you're importing the dump file into, [DIRECTORY] is whatever directory you placed the dump file in, [FILENAME] is the name of the .dmp file, and [LOGFILE] is whatever name you chose for your log file.
Assuming your database has everything necessary for the .dmp file, the import should begin and you will start seeing status updates that look similar to this:
Starting [USERNAME]."SYS_IMPORT_FULL_01": [USERNAME]/******** directory=DATA_PUMP_DIR dumpfile=[FILENAME].dmp logfile=[LOGFILE].log
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Note that this is just an example, your results may look different. Assuming all goes well, you will see a message like this at the end:
Job [USERNAME]."SYS_IMPORT_FULL_01" completed
If you don't want to import it into your existing 11g database, you could always spin up a new database and import the .dmp file to that one using these same guidelines.
That should be enough to get you started down the right path, hope this helps and good luck!
P.S. Here is a great FAQ on the Data Pump utilities as well: http://www.orafaq.com/wiki/Import_Export_FAQ

Exporting Neo4j database for importing in another Neo4j-desktop application

I should say, that neo4j-admin tools didnt work for me.
neo4j-admin dump --database=<database-name> --to=<database-address>
and i get an error every time, that database doesnt exist.
so is there any other way to export my Neo4j database ??
C:\Users\Shafigh\.Neo4jDesktop\neo4jDatabases\database-2912eb35-11ba-4ae1-
b5b9-cb4b88a6f0a9\installation-3.4.7\bin> neo4j-admin dump --database=test_1
--to=C:/Users/Shafigh/Desktop/files
org.neo4j.commandline.admin.CommandFailed: database does not exist: test_1
at org.neo4j.commandline.dbms.DumpCommand.execute(DumpCommand.java:83)
at org.neo4j.commandline.admin.AdminTool.execute(AdminTool.java:127)
at org.neo4j.commandline.admin.AdminTool.main(AdminTool.java:51)
Caused by: java.lang.IllegalArgumentException: Directory
'C:\Users\Shafigh\.Neo4jDesktop\neo4jDatabases\database-2912eb35-11ba-4ae1-
b5b9-cb4b88a6f0a9\installation-3.4.7\data\databases\test_1' does not contain
a database
at
org.neo4j.kernel.impl.util.Validators.lambda$static$3(Validators.java:111)
at org.neo4j.commandline.dbms.DumpCommand.execute(DumpCommand.java:79)
... 2 more
command failed: database does not exist: test_1
snapshot of my Neo4j desktop
graph_db size
test_1 is just the name of your Neo4j Desktop "project". It is not the name of your "database".
Use this command line instead (which uses the default database name, which is what you are using):
neo4j-admin dump --database=graph.db --to=C:/Users/Shafigh/Desktop/files
[UPDATED with more details, from my comments]
Neo4j Desktop is an environment that allows you to have many projects, with each project having possibly multiple DBs and plugins with different versions. So, your "test_1" is just the name of your project. Within that project, each DB will have its own directory structure, and by default the directory in that structure that contains your DB is given the name "graph.db". You can change the name of that DB if you want by setting the dbms.active_database property in that DB's neo4j.conf file -- but that is rarely useful.

get database from xampp (not via phpmyadmin)

I would like to ask, if it is possible to get my database from an offline (not functioning) xampp ?
You see, I have backed up my database earlier but I am not sure whether there are all the data I need now and the DB is pretty big (like 50 tables). I wanted to go for a local implementation of apache, mysql and PHP for my web applications. So I have reinstalled mysql and want to use my own local apache server instead of xampp.
I would like to know where can I find some .sql or something that is stored in xampp that could be otherwise accessible via the phpmyadmin? Is it even possible? I have scrolled through the xampp folder and tried to figure out where it can be, but didnt find anything though.
Thanks for help.
EDIT
I am on a mac running mavericks.
First go to localhost/phpmyadmin and create a database as before you have. Then import your database file through browse.
If your database name exmaple.sql then create database name will be example and import example.sql

Copying users between AD-LDS (ADAMish) instances

I have set up an instance of AD-LDS as in here
http://www.thegeekispeak.com/archives/28
and connected to it with Softerra LDAP Browser
What I don't know how to do is get the users stored in the AD-LDS "database" on my colleague's machine into my machine. Is there some export/import process? Do I do it from the LDAP browser or somewhere else?
If someone has done this and can tell me how it could save me a lot of time and I would really appreciate it.
A good tool to work with directories in general is Apache Directory Studio and the language used to export/import datas from one Directory to another is LDIF. Apache Directory Studio log all your operation on a Directory in LDIF format.
Another is to build your version of AD-LDS as a replicate of the one of your colleague's machine.
There isn't a way to copy the entire object including attributes like SID and Password. If you simply want to share data, you can create replicas and the instances will be in sync.

SQLite database file created from JDBC?

I have created a SQLite database from Java. Now I want to know where it is stored physically on disk, so that I can push that file on to Android.
You specified a database name as part of the JDBC connection URL. Look for a file with that name on your harddisk. Example:
jdbc:sqlite:test.db
-> look for test.db
SQLite usually produces one file with the extension .sqlite, but this is just convention, the extension can be anything.
As already was said, the code which opens the database spefifies the path where the file should be stored, so you have to look there.

Resources