next up previous contents
Next: Connect and Startup Up: Oracle Basics Previous: Oracle Basics   Contents

Create a database

Two methods are available for creating a new database: the Database Configuration Assistant (DBCA) GUI application and the CREATE DATABASE SQL statement. For simplicity we'll use the DBCA. You can read about creating a database using the SQL interface in Chapter 2 of the Oracle Database Administrators Guide.

To use the configuration assistant, export your display (if your not on the console) and run dbca:

bash-2.05$ export DISPLAY=10.10.1.100:0
bash-2.05$ pwd   
/u01/app/oracle/product/10.1.0/db_1/bin
bash-2.05$ ./dbca

We'll then use the following steps in the GUI.

  1. In step 1, choose "Create a database"
  2. In step 2, choose "General Purpose"
  3. In step 3, we'll name the database test.cuddletech.com with the SID test
  4. In step 4, we'll leave "Configure the database with Enterprise Manager" checked and also check "Enable Email Notifications" specifying both our local SMTP server and our email address.
  5. In step 5, we'll use the same password for all accounts. I'll use "passwd".
  6. In step 6, we'll use regular file system storage.
  7. In step 7, we'll choose "Use Common location for all database files", and according to the OFA we'll use /u02/oradata as the location.
  8. In step 8, we'll disable flash recovery by unchecking all boxes.
  9. In step 9, we'll uncheck "Sample Schemas"
  10. In step 10, we'll use the default settings for memory management. In my case thats 120M for the shared pool, 24M for the buffer cache, 8M for the Large pool, and 24M for the PGA. The only thing to change is "Java Pool", set it to 0.
  11. In step 11, look over the layout of the storage. Nothing needs to be changed here.
  12. Finally, in step 12 we can actually create the database or save it as a template. Make sure "Create Database" is checked and click Finish.
  13. We'll now have the chance to look at our configuration and save an HTML copy of it. When done, create the database.
  14. The database will now build. On my Sun Blade 100 this process took about 10 minutes.
  15. Lastly, you'll get a confirmation dialog with the database name, SID, Server Parameter Filename and an Enterprise Manager URL.

After the database has been created, you can go examine the files it created.

bash-2.05# cd /u02/oradata/test
bash-2.05# ls -alh
total 1451556
drwxr-xr-x   2 oracle   oinstall     512 Oct  5 16:43 .
drwxr-xr-x   4 oracle   dba          512 Oct  5 16:40 ..
-rw-r-----   1 oracle   oinstall    2.7M Oct  5 16:53 control01.ctl
-rw-r-----   1 oracle   oinstall    2.7M Oct  5 16:53 control02.ctl
-rw-r-----   1 oracle   oinstall    2.7M Oct  5 16:53 control03.ctl
-rw-r-----   1 oracle   oinstall     10M Oct  5 16:53 redo01.log
-rw-r-----   1 oracle   oinstall     10M Oct  5 16:46 redo02.log
-rw-r-----   1 oracle   oinstall     10M Oct  5 16:51 redo03.log
-rw-r-----   1 oracle   oinstall    210M Oct  5 16:53 sysaux01.dbf
-rw-r-----   1 oracle   oinstall    430M Oct  5 16:53 system01.dbf
-rw-r-----   1 oracle   oinstall     20M Oct  5 16:43 temp01.dbf
-rw-r-----   1 oracle   oinstall     25M Oct  5 16:53 undotbs01.dbf
-rw-r-----   1 oracle   oinstall    5.0M Oct  5 16:46 users01.dbf

There will also be files in your oracle admin directory (OFA path: /u01/app/oracle/admin/(sid)) and the dbs directory (OFA path: /u01/app/oracle/product/10.1.0/db_1/dbs).

If you want to play with Enterprise Manager, you can do so now. Go to the URL listed in the final dialog of the dbca session. At the login screen use the username "sys", the password "passwd" (as we specified during creation) and from the drop down choose "SYSDBA". Once you login you'll get a licensing information screen, agree to the terms to keep playing. After this you'll get the full Enterprise Manager experience. You'll see that the database has already been started and is up. On the "Administration" tab you can really play with some nifty things. You can create nearly any database component here without ever touching SQL*Plus.

If you playing with the Enterprise Manager (EM), go ahead and shutdown the database so we can see how to start it up using SQL*Plus.


next up previous contents
Next: Connect and Startup Up: Oracle Basics Previous: Oracle Basics   Contents
2005-02-10