vrijdag 2 maart 2012

Install Oracle Server software + Create database together in one step

In this post I'll show you how to install the Oracle database software and create a database directly from the Oracle Universal Installer.

  1. Check that the oracle account exists, and is in the groups oinstall and dba:
    id oracle
    uid=500(oracle) gid=500(oracle) groups=500(oracle)
    In my case it exists, but it's not yet in the groups dba and oinstall.
    Create the groups:
    /usr/sbin/groupadd oinstall
    /usr/sbin/groupadd -g 502 dba
    /usr/sbin/groupadd -g 503 oper
    Assign the Oracle account to the dba and oracle groups
    /usr/sbin/usermod -g oinstall -G dba  oracle [, oper]
    (If the Oracle account didn't exist yet, run this instead:

    /usr/sbin/useradd -u 502 -g oinstall -G dba,[oper] oracle
    )

  2. Create the ORACLE_BASE directory (logged on as root):
    mkdir -p /u01/app/oracle
    chown -R oracle:oinstall /u01/app/oracle
    chmod -R 775 /u01/app/oracle
  3. Create the Oracle inventory location (logged on as root)
    mkdir -p /u01/app/oraInventory
    chown -R oracle:oinstall /u01/app/oraInventory
    chmod -R 775 /u01/app/oraInventory
  4. Add The following lines to .bash_profile:
    umask 022
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
    export PATH=$ORACLE_HOME/bin:$PATH
    export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib32:$ORACLE_HOME/lib:$LD_LIBRARY_PATH
    export LIBPATH=$ORACLE_HOME/lib32:$ORACLE_HOME/lib:$LIBPATH
  5. Log on as the Oracle user.
    If you're already logged on, run: . $HOME/.bash_profile
    I didn't bother changing kernel parameters / setting resource limits. In theory, the installer will come up with a fixup script to alter this. So let's check if it succeeds in doing so ;-)
  6. Copy over the first 2 11gR2 installation CD's  to $HOME/11gR2 (you can download the correct version immediately from Oracle support, no need anymore to first install the base release and apply patch sets afterwards).Unzip both zip files:
    cd $HOME/11gR2
    unzip p10404530_112030_Linux-x86-64_1of7.zipunzip p10404530_112030_Linux-x86-64_2of7.zip
    rm *.zip
    cd database
  7. Unset the ORACLE_HOME: unset ORACLE_HOME
    Start the Oracle Universal Installer: ./runInstaller

    Press Next in the following screen, and ignore the warning by pressing the Yes button:
    image 

    Choose Skip Software Updates:
    image 

    Choose: Create and configure a database. This will install a database and automatically launch dbca (the Database Creation Assistant) to create a database.
    image 

    Choose Server Class:

    image 


    Choose Single instance database installation:
    image 

    Choose Advanced Install:
    image
    Add all the languages in the following screen:
    image 

    Choose Enterprise Edition (or the edition for which you have a licence...):
    image 

    The ORACLE_BASE environment variable was set => the OUI has filled out the Oracle Base automatically, and derived an OFA compliant directory for the ORACLE_HOME. Accept both values.
    image 

    Accept /u01/app/oraInventory as a location for the Oracle inventory, and choose oinstall:
    image 

    Choose General Purpose / Transaction Processing:
    image 

    Enter a global database name:
    image 

    Leave memory allocated at 40 %, we can change the memory settings afterwards using the memory advisors.
    image 

    Oracle recommends using AL32UTF8 as character set:
    image 

    Leave the new security settings in place:
    image 

    Choose “Use Oracle Enterprise Manager Database Control”:
    image 

    Choose File System, and choose a path for the datafiles. Preferably on a different disk than the software
    (the screenshot shows a bad example because the datafiles are stored on the same disk as the software…).
    image 

    Don’t enable automatic backups, we’ll configure this afterwards.
    image 

    Enter passwords for the administrative accounts:
    image 

    Enter the groups for the OSDBA and OSOPER groups:
    image

    The installer will perform some prerequisite checks, and will show you the result:
    image 

    Click on Fix and Check Again. Oracle will generate a fix up script (since 11g):
    image 

    Run the generated script as root: /tmp/CVU_11.2.0.0.2_oracle/runfixup.sh
    Click Check Again => No errors are displayed. Click Next to go to the following screen, and click on Install:
    image 

    Note down the URL for Database Control and the global database name:

    Execute the following scripts as root, and afterwards press OK:


    Click Close to exit the Oracle Universal Installer:
    image

In the next post I’ll show you how to install only the software, and afterwards create a database with DBCA (DataBase Creation Assistant).

Geen opmerkingen:

Een reactie posten