Creating Databases

From Outrun Wiki
Jump to: navigation, search

Preparation

Before installing a database, make sure you have [Installation installed] Outrun and worked through the [Oracle_Installation Oracle Install] phase. Verify that clusterware and ASM are running (menu Clusterware - Status).

Database profiles

Outrun comes with a concept for installing databases in a certain way, using profiles. A profile contains at least the storage locations for the data files, and optionally some options where they are different from the Outrun defaults.

Prebuilt database profiles
Profile Description Notes
ASM-minimal Minimal ASM (1 ASM diskgroup) A very basic deployment where the entire database uses only one diskgroup (+DATA)
ASM-basic Basic ASM (3 ASM diskgroups: data, temp, redo) A standard deployment in line with EMC best practices
ASM-prod DATA, REDO, FRA, TEMP Like Basic but with an extra diskgroup +FRA (for archive logs)
ASM-X-POC XtremIO test: DATA + REDO Optimized for All-flash Array testing
Template Do not use A template which you can copy to a different filename and change to your requirements
Filesys-prod Using /u02/dbname/fs A database deployed on flat file systems (not ASM). Still requires clusterware to be running. Experimental, not tested yet!

For getting familiar with Outrun I recommend to use "minimal" to see how it works, you can always create a new database later using another profile.

Creating ASM volumes

Before you deploy a database you have to create ASM diskgroups first (at least one). In Outrun, the standard device path for Oracle ASM disks is /dev/oracleasm/. All devices used by ASM should be made available in this directory and have permissions as specified by the ASM configuration (user grid, group asmdba, read/write access for user and group).

ASM makes use of a tool called "asmdisks" which I wrote specially for this purpose, as an alternative to Oracle ASMLib which does not require kernel modules and proprietary tools for creating ASM usable disk volumes. asmdisks is a toolset that generates config files for Linux UDEV in a more standard way.

In Outrun, the procedure for creating ASM diskgroups is as follows:

  1. Create ASM volumes under /dev/oracleasm (at least one)
  2. Create ASM diskgroups on one or more ASM volumes

NOTE: When using VMware, you must have configured "Disk.EnableUUID=TRUE" in the virtual machine's VMX config file otherwise the asmdisks tool will fail. The Outrun-checks procedure also checks for this so if you got to this point you are probably OK.

Go to menu "Storage" - "Add" (Add a volume).

Enter the name you wish to give to the volume. Note that Oracle ASM does not care at all what the name is as it writes its own volume IDs on the disk. It's only for admin purposes. Try to give it some useful name such as "redo01" or "data05".

The default is volXX where XX is the first one that hasn't been used yet from 01 to 99.

After you "Submit" in the menu you get a list of available candidates. Criteria is that the disk should be blank (i.e. not have a partition table or other detectable signature). Choose the disk you want to configure.

CLI alternative: asm createdisk vol99 /dev/sdz. Run man asm for more info on the asm command.

Creating ASM diskgroups

Go to Menu -> ASM (Manage ASM diskgroups).

use the menu option "Create" to create a new disk group. Note that the database profiles define on what diskgroup the database is deployed. If you use "ASM Minimal" the name of the diskgroup should be "DATA".

After pressing "Submit" you will get a list of available disk volumes (there should be at least one). If you want to build a diskgroup out of multiple volumes, select all volumes that you want included.

CLI alternative: running diskgroup create data vol1 (where vol1 is the volume listed under /dev/oracleasm or by using asm list

The ASM menu has options to list asm diskgroups, disks, etc. You can also add or delete disks to/from existing diskgroups.

Creating a database

Once the storage is prepared, you can start creating a database.

The procedure for this is:

  1. Select a profile
  2. Select a new name for the database to be created (with password)
  3. Start the creation process

In the Main -> Database menu, choose the correct profile (start with ASM-minimal).

In the Database -> New menu, choose the name for the new database, i.e. "demo" (note that you should enter valid identifiers, no non-ASCII characters, no spaces etc. Outrun does not validate the input). Change the default password if you like. This password is used for the SYS and SYSMAN accounts.

The database creation process can take a long time (depending on your CPU speed, expect roughly 5 minutes (fast) to over an hour (slow). Most of the process is single threaded so a beefy machine with 120 cores is not much faster than a VMware desktop with a fast desktop CPU.

CLI alternative: db-create create demo /opt/outrun/etc/asm-minimal.prof (for creating a database named "demo" using the ASM-minimal profile). Run db-create -? to show tuning parameters for advanced usage.

The scripts generated to create the database can be found in the home directory of "oracle", i.e.
/home/oracle/dbcreate
If anything goes wrong during database creation, you can inspect these script to find the root cause, or check
/tmp/<dbname>

Additional steps for database creation

If the right database is selected, you may find options to start, stop (graceful) or abort the database.

You can also set it to Autostart (Oracle clusterware will then start the database after reboot and shut down gracefully before system shutdown).

NOTE: It's highly recommended to stop and restart the database to make sure it works, also because it needs to reload parameters (SPFILE settings).

Enterprise Manager DB Console

If the database version is 11.2, you can go through the DBconsole options to create the dbconsole web management setup. This feature was removed by Oracle in 12c and replaced by a much simpler "EM DB Express" feature which I find hardly useful (this is why I recommend to stick with 11.2 for the time being).

Enterprise Manager DB console is a standalone "element manager" for one database and it's a fairly heavy, java based app, but it is very feature rich and a good learning tool for starting users.

You can browse to DBconsole after configuring it. Usually the web server listens on port 1158, after reinstalls it might change to 5500.

Default DB console

DB console on port 5500

Login: sys (select "Connect AS" SYSDBA)

Once logged in, you can also manage ASM diskgroups but you have to specify different credentials (usually once).

Login: asmsnmp (select "Connect AS" SYSASM) and mark "Saved credential".