Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating new database under Oracle XE on Ubuntu

I've just installed Oracle XE in Ubuntu. Is there any way to create new databases, besides the one that comes with the installation, preferably from the command line so that I can do it from a script? It would be nice to have multiple databases started in the same time, if possible.

If it is not possible to create new databases, then maybe there is a way to "clean up" the default database? What I need is to be able to "start over" at any time with a fresh database.

I don't have experience with Oracle administration, so any hints, links, suggestions are welcome.

Thanks.

like image 297
Gabriel Avatar asked Apr 01 '09 14:04

Gabriel


1 Answers

I don't know if you are aware of this, but most beginners confuse this about Oracle:

In Oracle, a database means a collection of data files and control files stored on disk. You can have only one database with Oracle XE. A database is mounted by a Oracle instance, which means all the background daemons and programs that you can see with ps.

You probably want a schema, which is what other DBMS products (e.g. MySQL) often refer to as a "database". IIRC there was no limit on the number of schemas in Oracle XE. You can create those from the APEX UI that comes with XE, or from command line (with CREATE USER -- again, confusingly, a user and schema are largely synonymous in this case).

I recommend reading the Concepts guide from Oracle documentation, most of this basic stuff (e.g. how things are called in Oracle-lingo) is covered there.

like image 146
andri Avatar answered Sep 30 '22 12:09

andri