EnterpriseDB Clusters and Databases
Oracle Tips by Burleson Consulting
in EnterpriseDB is much different from a database in Oracle. In Oracle,
a database is all of the data files in an instance. Many applications
may share a database and its data files. In Oracle, a database is a
physical separation of data.
In EnterpriseDB, a
database tends to separate applications rather than data files. The combination
of cluster and database(s) would encompass what we consider a database in
Oracle. This isn’t a one to one comparison though.
When you first
install EnterpriseDB, the installer creates a Cluster using the initdb command:
initdb –D <data_directory>
The initdb command
initializes the data directory (where the data for all of your databases will be
stored). You can run this command on an empty server and install a new
EnterpriseDB cluster yourself, but it is a much easier process to allow the
installer to execute the required steps for you.
After a cluster
has been created, you can then create a new database with the CREATE DATABASE
command. The CREATE DATABASE command will create a new sub-directory in your
database cluster data directory. The entire syntax to create a new database is:
CREATE DATABASE <databasename>;
Compare that to creating a database in Oracle. Creating a database in Oracle
is not something to be done lightly (or at a command prompt). In EnterpriseDB,
a database is just a logical separation of data.
There are a few
additional optional parameters to the create database statement. You can assign
an owner different from the OS user executing the command, you can override the
default template (template1), you can change the language encoding for the
database or you can assign a default tablespace.
When you first use
EnterpriseDB after installation, you will have four databases in the database
cluster available to you. The first two, template0 and template1, are template
databases that will be used whenever you create a new database (and are created
by the initdb command). The templates are seeded with system required tables,
procedural languages, etc. You will never use, modify or remove these templates
(unless you get some expert assistance).
The other two
databases are edb and mgmtsvr. The edb database is the seed database that you
will begin with. This database has a sample set of tables and you can create
your own tables and other objects here. We will use this database for the rest
of this book.
database supports the Remote DBA Management Server. You will interact with this
database via the Management Server screens.
You can drop a
database using the DROP DATABASE command or by using the dropdb command line
utility. Dropping a database is not recoverable so proceed with caution should
you choose to do so.
This is an excerpt
from the book "EnterpriseDB: The Definitive Reference" by Rampant TechPress.