+ All Categories
Home > Documents > Creating a Minimalist Oracle 11g Database

Creating a Minimalist Oracle 11g Database

Date post: 07-Apr-2018
Category:
Upload: subhi-quroush
View: 220 times
Download: 0 times
Share this document with a friend

of 20

Transcript
  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    1/20

    Creating a Minimalist Oracle 11g Database

    The Oracle 11g database is nothing short of a modern technical marvel. From thefeatures it offers to the many platforms it runs upon its amazing how far theyvecome. But as a true enterprise database, Oracle 11g requires some DBA oversight tobe applied when creating databases. Although Oracle supplies a very simple and yetfully 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 creatinga 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 create d in just under 10 minutes. Thats far less resources than the defaults wouldcreate.

    When you run DBCA, the first screen you ll see displayed is the following:

    http://www.toadworld.com/Community/Blogs/tabid/67/EntryID/151/Default.aspxhttp://www.toadworld.com/Community/Blogs/tabid/67/EntryID/151/Default.aspxhttp://www.toadworld.com/Community/Blogs/tabid/67/EntryID/151/Default.aspxhttp://www.toadworld.com/Community/Blogs/tabid/67/EntryID/151/Default.aspx
  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    2/20

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

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

  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    3/20

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

  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    4/20

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

  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    5/20

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

  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    6/20

    You really have just two basic alternatives here: File System or Automatic StorageManagement (ASM) , because RAW Devices are generally not worth the hassle theycost 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 newdatabase. And remember, more means more space and/or resources (e.g. ASM instancewill require its own SGA memory in addition to the database SGA memory). So for yourminimalist database, I generally recommend sticking with the File System choice. Butfor testing out some cool new Oracle features, you might decide to choose ASM thatsOK, just realize youre picking more for a reason. That takes you to step 7 specifyingthe file locations for the new database being created:

  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    7/20

    Since your notebook or desktop PC probably only has a single disk drive, this choicedoesn t 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_HOMEwithin the ADMIN and ORADATA directories. That takes you to step 8 specifyingwhether to enable flashback and archive log mode for the new database being created:

  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    8/20

    In most cases neither flashback nor archive log mode are necessary for a light weightdatabase 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 ourentire database will be just 1 GB. As for archiving, this is not a production database, soits just generally not worth turning on. But if you want to be able to do hot databasebackups, then you could turn this feature on just remember that offline archive log filewill accumulate and thus require much more disk space over time. That takes you tostep 9 specifying the default pre-existing content for the new database being created:

  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    9/20

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

  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    10/20

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

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

  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    11/20

    This is a very critical screen to pay close attention to for its going to define and decidenumerous configuration values that will significantly affect CPU and memory resourcesyour new database will require as well as other general performance factors. This onescreen alone should consume the majority of your DBCA database creation attention.

    The first tab on this screen (shown above) contains the single most critical parameterthat youll need to choose : how much memory can the SGA consume. I recommend600MB. I believe the install guide says no less than 800MB and Ive seen other materialssuggest as high as 1GB. But if youre turning off all the stuff Ive said so far 600MB willwork. I also recommend keeping Use Automatic Memory Management checked forcreating a minimalist database. While there are some scenarios in an enterprise settingwhere one can manually tweak the SGA memory management parameters moreeffectively, for a little database where youre aiming for least memory the automaticoption works well.Can you go lower? Possibly but 600MB is the lowest number that Ive found to workreliably. So experiment lower if you must, but also realize that 600MB is not too bad bytodays cheap memory prices and standards. That then takes you to the second tab onthis 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

  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    12/20

    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 forthe number of processes, just remember that all the Oracle background ones countagainst this number so dont choose too low. Next youll need to press the AllInitialization Parameters button (launching the pop-up window shown below), and

    then choose to Show Advanced Parameters .

  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    13/20

    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 explanationfor some key settings to follow.

    11g now defaults to auditing turned on and stored in the databaseDB multi file read count defaults to 128 instead of prior value of 16File system IO options defaults to NONE wish it would just choose SETALLMax 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 beingcreated:

    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 theprior section, auditing is now on by default in 11g. If youre using older applications thatmight have issues with case sensitive passwords, then revert to the pre-11g behavior asshown abov e. 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. Whenin doubt, choose to revert or remain with the pre-11g style life will be simpler for you.

  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    14/20

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

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

  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    15/20

    This will be the second most time consuming screen for properly configuring a trulyminimalist database because here youll decide upon key tablespace and data filecharacteristics (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 themany screen snapshots that will follow. First for each tablespace in the tree-view, visitthe General tab and select Use Big File Tablespace option. This keeps life muchsimpler as each tablespace will have but one data file and that file can grow as big asneeded. Second for each tablespace in the tree-view , visit the Storage tab as shownbelow.

  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    16/20

    Here you will want to make two changes (where permitted, as it varies slightly by thedifferent tablespace types). Choose the Uniform Allocation size option and thenchoose 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 onceagain, this is not an enterprise database that were building so some overheads can beeliminated. Now youll need to move on to the data files as shown below.

  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    17/20

    Once again this is going to be a two step process where youll need to visit each datafile and two tabs for each. First for each data file in the tree-view, visit the General taband define the size. Here are my recommendations for the initial data file sizes:

    SYAUX 200MBSYSTEM 400MBTEMP 100MBUNDO 100MBUSERS 200MB

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

  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    18/20

    Here are my recommendations for the data file auto-increment sizes:

    SYAUX 50MB

    SYSTEM 50MBTEMP 10MBUNDO 50MBUSERS 50MB

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

  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    19/20

    Note that youll want to check Save as Database Template and give it a name. You donot have to name it the same as the SID, I just did so in this case it is not required anddoes 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 nothingmore 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 processfor your new database that starts automatically. I recommend that you instead make itmanual and simply start Oracle when you need it, because Windows boot times arealready slow enough these days.

    Finally, take five minutes to stop your database and zip up a copy. That way youll have anice physical cold backup to restore from that will take just moments in a pinch. And asyou see below, my entire 1GB database compresses to a mere 60MB so it fits nicely onmy flash drive.

  • 8/6/2019 Creating a Minimalist Oracle 11g Database

    20/20

    About the Author

    Bert Scalzo is a Database Domain Expert for Quest Software and a member of the TOAD team. He hasworked extensively with TOAD's developers and designed many of its features. Mr. Scalzo has workedwith Oracle databases for well over two decades, starting with version 4. His work history includes t ime atOracle Education and Oracle Consulting, plus he holds several Oracle Masters certifications. Mr. Scalzoalso has an extensive academic background - including a BS, MS and PhD in Computer Science, an MBAand several insurance industry designations. Mr. Scalzo is an accomplished speaker and has presented atnumerous 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 OraclesTechnology Network (OTN), Oracle Magazine, Oracle Informant, PC Week (eWeek), Dell PowerEdgeMagazine, The Linux Journal, www.linux.com , and www.orafaq.com . Mr. Scalzo can be reached via emailat [email protected] or [email protected] .

    Bert was recently added to the elite list of Oracle ACEs . Oracle ACEs are known for their strong credentialsas Oracle community enthusiasts and advocates, with candidates nominated by anyone in the OracleTechnology

    http://www.linux.com/http://www.linux.com/http://www.linux.com/http://www.orafaq.com/http://www.orafaq.com/http://www.orafaq.com/mailto:[email protected]:[email protected]:[email protected]:[email protected]:[email protected]:[email protected]://www.oracle.com/technology/community/oracle_ace/index.htmlhttp://www.oracle.com/technology/community/oracle_ace/index.htmlhttp://www.oracle.com/technology/community/oracle_ace/index.htmlhttp://www.oracle.com/technology/community/oracle_ace/index.htmlmailto:[email protected]:[email protected]://www.orafaq.com/http://www.linux.com/

Recommended