You are on page 1of 20

Creating a Minimalist Oracle 11g Database

The Oracle 11g database is nothing short of a modern technical marvel. From the features it offers to the many platforms it runs upon its amazing how far theyve come. But as a true enterprise database, Oracle 11g requires some DBA oversight to be applied when creating databases. Although Oracle supplies a very simple and yet fully capable database creation assistant (DBCA) utility, one needs to use it intelligently. As I tried to point out in a one of my blogs, Oracle 11g on a notebook: Tread Lightly, creating an Oracle 11g database on a notebook is not ideally done with DBCA defaults. So in this article, I thought Id walk you through my basic recommendations for creating a light weight Oracle 11g database. Following my recommendations below, youll end up with a 1GB database that requires just 600 MB of SGA memory and that on my modest IBM X61 ultra-portable notebook was created in just under 10 minutes. Thats far less resources than the defaults would create. When you run DBCA, the first screen youll see displayed is the following:

Note that it says there will be 15 steps so there are going to be lots of screen snapshots with some screens having pop-up screens and other additional info. But here you simply choose create a database. That takes you to step 2 choosing from among your database templates for the new database being created:

Now the first time you run DBCA, youre NOT going to see the ORCL choice shown above youre going to be creating and saving that DBCA template as you proceed. So it will be there the next time you run DBCA. Youll want to choose Custom Database. The other two choices are predefined templates that limit your options on what you can set, specifically they simply copy some pre-defined Oracle data files rather than run the scripts required to create empty tablespaces and data files. Dont use them ever. That takes you to step 3 specifying the identification for the new database being created:

This is simply the SID that you want your database known by (i.e. what both the listener and tnsnames files will reference and how youll choose what database to connect to using tools like Toad). Youll have an opportunity later to define a DBCA template name to save all these option settings under and the names do not have to match. That takes you to step 4 deciding if the new database includes Oracle Enterprise Manager (OEM):

Here youll make your first key decision regarding how light or heavy the newly created database will be (i.e. how much of your notebook or desktop resources will be consumed by the database). If you dont need or want to use Oracle Enterprise Manager, then dont check this box. OEM requires additional Windows services to run on your PC as well as additional disk space. That takes you to step 5 providing the user credentials for the new database being created:

In this case there are just two pre-canned users: SYS and SYSTEM. Had you chosen one of the non-custom templates or included OEM, you would see more choices here. Since youre trying to create a minimalist database, more choices equates to more space and/or resources. Thus having just these two users shown above is about as low as you can go. That takes you to step 6 specifying the storage options for the new database being created (i.e. how and where will tablespace data files be placed):

You really have just two basic alternatives here: File System or Automatic Storage Management (ASM), because RAW Devices are generally not worth the hassle they cost for the meager and debatable improvements they might offer. If you choose ASM, note that youll be creating two database instances one for ASM and one for the new database. And remember, more means more space and/or resources (e.g. ASM instance will require its own SGA memory in addition to the database SGA memory). So for your minimalist database, I generally recommend sticking with the File System choice. But for testing out some cool new Oracle features, you might decide to choose ASM thats OK, just realize youre picking more for a reason. That takes you to step 7 specifying the file locations for the new database being created:

Since your notebook or desktop PC probably only has a single disk drive, this choice doesnt really make that much difference so for this one screen, the default option of just use the defaults is OK. The default option will place files under ORACLE_HOME within the ADMIN and ORADATA directories. That takes you to step 8 specifying whether to enable flashback and archive log mode for the new database being created:

In most cases neither flashback nor archive log mode are necessary for a light weight database so uncheck both boxes. If you want to experiment with or utilize flashback, then by all means check it but note that it requires you to define a flashback area size. The default is another two gigabytes you can probably tone that down some since our entire database will be just 1 GB. As for archiving, this is not a production database, so its just generally not worth turning on. But if you want to be able to do hot database backups, then you could turn this feature on just remember that offline archive log file will accumulate and thus require much more disk space over time. That takes you to step 9 specifying the default pre-existing content for the new database being created:

Youll note that there are two screen snapshots above. Unless you have a reason or need for features such as Oracle text, Oracle Spatial, Warehouse Builder, etc then turn them all off (i.e. uncheck them). Furthermore, you can apply the same elimination logic to the standard database components as well. I recommend turning everything off. Do note that un-checking ORACLE XML DB will result in the following warning which can

also be generally ignored (unless you need or want to use one of those four PL/SQL packages).

That takes you to step 10 specifying the key configuration parameters for the new database being created:

This is a very critical screen to pay close attention to for its going to define and decide numerous configuration values that will significantly affect CPU and memory resources your new database will require as well as other general performance factors. This one screen alone should consume the majority of your DBCA database creation attention. The first tab on this screen (shown above) contains the single most critical parameter that youll need to choose: how much memory can the SGA consume. I recommend 600MB. I believe the install guide says no less than 800MB and Ive seen other materials suggest as high as 1GB. But if youre turning off all the stuff Ive said so far 600MB will work. I also recommend keeping Use Automatic Memory Management checked for creating a minimalist database. While there are some scenarios in an enterprise setting where one can manually tweak the SGA memory management parameters more effectively, for a little database where youre aiming for least memory the automatic option works well. Can you go lower? Possibly but 600MB is the lowest number that Ive found to work reliably. So experiment lower if you must, but also realize that 600MB is not too bad by todays cheap memory prices and standards. That then takes you to the second tab on this screen (shown below) for two critical database sizing parameters.

The database block size and the number of processes are seemingly easy enough to set. While I know the rage is to use bigger block sizes for better performance, this is a not an

enterprise database with a costly disk array attached its a notebook or desktop with just a single hard drive. Trust me pick 4K, youll not be unhappy with the results. As for the number of processes, just remember that all the Oracle background ones count against this number so dont choose too low. Next youll need to press the All Initialization Parameters button (launching the pop-up window shown below), and then choose to Show Advanced Parameters.

Now there are far too many INIT.ORA parameters for me to go over, so let me instead just sort the above window to show just those that I changed with a little explanation for some key settings to follow. 11g now defaults to auditing turned on and stored in the database DB multi file read count defaults to 128 instead of prior value of 16 File system IO options defaults to NONE wish it would just choose SETALL Max dump file size still defaults to UNLIMITED never a good choice for PCs Recycle BIN still defaults to ON and thus people potentially collecting junk That takes you to step 11 specifying the security settings for the new database being created:

Note that database security has significantly changed from 10g and prior. For example, user passwords are by default now case sensitive in 11g. And as was mentioned in the prior section, auditing is now on by default in 11g. If youre using older applications that might have issues with case sensitive passwords, then revert to the pre-11g behavior as shown above. While the choices here really wont affect the database footprint per se, they will however decide how well your application works with the new database. When in doubt, choose to revert or remain with the pre-11g style life will be simpler for you.

That takes you to step 12 specifying the status of automatic maintenance tasks for the new database being created:

This one is rather easy leave it checked. While you could save a few CPU cycles here by un-checking it, the 11g automatic statistics collection job alone warrants leaving this one be. That takes you to step 13 specifying the database storage parameters for the new database being created:

This will be the second most time consuming screen for properly configuring a truly minimalist database because here youll decide upon key tablespace and data file characteristics (e.g. file size and nature). This is where youll define the total new database size to be 1GB. We have a lot of work to do via this screen, so bear with the many screen snapshots that will follow. First for each tablespace in the tree-view, visit the General tab and select Use Big File Tablespace option. This keeps life much simpler as each tablespace will have but one data file and that file can grow as big as needed. Second for each tablespace in the tree-view, visit the Storage tab as shown below.

Here you will want to make two changes (where permitted, as it varies slightly by the different tablespace types). Choose the Uniform Allocation size option and then choose a size that works for your hardware. I have found 1MB to be very reasonable for notebooks and desktops. As for logging, choose No or to disable it. Remember once again, this is not an enterprise database that were building so some overheads can be eliminated. Now youll need to move on to the data files as shown below.

Once again this is going to be a two step process where youll need to visit each data file and two tabs for each. First for each data file in the tree-view, visit the General tab and define the size. Here are my recommendations for the initial data file sizes: SYAUX SYSTEM TEMP UNDO USERS 200MB 400MB 100MB 100MB 200MB

Second for each data file in the tree-view, visit the Storage tab as shown below.

Here are my recommendations for the data file auto-increment sizes: SYAUX SYSTEM TEMP UNDO USERS 50MB 50MB 10MB 50MB 50MB

That takes you to step 14 wrapping up the process for saving and execution:

Note that youll want to check Save as Database Template and give it a name. You do not have to name it the same as the SID, I just did so in this case it is not required and does not make any difference. Its simply the name that will be displayed back at step 2. So once you hit finish this minimalist database should create rather quickly. Now here are a couple of notes to wrap this up. What if you wanted to share this template with someone where is it? It is nothing more than a simple text XML file that can be found as follows: C:\Oracle\product\11.1.0\db_1\assistants\dbca\templates\ORCL.dbt If you open your Windows services manager, you will find that DBCA creates a process for your new database that starts automatically. I recommend that you instead make it manual and simply start Oracle when you need it, because Windows boot times are already slow enough these days. Finally, take five minutes to stop your database and zip up a copy. That way youll have a nice physical cold backup to restore from that will take just moments in a pinch. And as you see below, my entire 1GB database compresses to a mere 60MB so it fits nicely on my flash drive.

About the Author


Bert Scalzo is a Database Domain Expert for Quest Software and a member of the TOAD team. He has worked extensively with TOAD's developers and designed many of its features. Mr. Scalzo has worked with Oracle databases for well over two decades, starting with version 4. His work history includes time at Oracle Education and Oracle Consulting, plus he holds several Oracle Masters certifications. Mr. Scalzo also has an extensive academic background - including a BS, MS and PhD in Computer Science, an MBA and several insurance industry designations. Mr. Scalzo is an accomplished speaker and has presented at numerous Oracle conferences and user groups - including OOW, ODTUG, IOUGA, OAUG, RMOUG, et al. His key areas of DBA interest are Data Modeling, Database Benchmarking, Database Tuning & Optimization, "Star Schema" Data Warehouses and Linux. Mr. Scalzo has written articles for Oracles Technology Network (OTN), Oracle Magazine, Oracle Informant, PC Week (eWeek), Dell PowerEdge Magazine, The Linux Journal, www.linux.com, and www.orafaq.com. Mr. Scalzo can be reached via email at bert.scalzo@quest.com or bert.scalzo@yahoo.com. Bert was recently added to the elite list of Oracle ACEs. Oracle ACEs are known for their strong credentials as Oracle community enthusiasts and advocates, with candidates nominated by anyone in the Oracle Technology

You might also like