OCA 02 - Preparing the Database Environment

download OCA 02 - Preparing the Database Environment

of 29

Transcript of OCA 02 - Preparing the Database Environment

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    1/29

    02 - Preparing the Database

    Environment

    By Muhammad Asghar Khan

    Reference: OCA Oracle Database 11g - Admin I Exam Guide by John Watson

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    2/29

    Agenda

    http://asghars.blogspot.com

    Tools for Administering an Oracle Database Oracle Universal Installer (OUI)

    Database Creation (DBCA) and Upgrade Tools (DBUA)

    SQL*Plus and SQL Developer

    Oracle Enterprise Manager (OEM) Oracle Net Manager (netmgr) and Oracle Net

    Configuration Assistant (netca)

    Datapump and SQL*Loader

    Recovery Manager (RMAN)

    Plan an Oracle Database Installation

    Choice of Operating System

    1/2

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    3/29

    Agenda

    http://asghars.blogspot.com

    Configure OEL Kernel for Oracle Configure OEL Shell for Oracle

    Create Groups & User for Oracle

    Directory Structure & File Naming Conventions/OFA

    Configure Oracle Users Environment

    Running Oracle Universal Installer

    2/2

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    4/29

    Tools for Administering an Oracle Database

    http://asghars.blogspot.com

    Oracle Universal Installer (OUI) An Oracle product that is used to manage the

    installation and maintenance of many oracle products

    To launch the OUI, on Windows run the setup.exe file

    in the root of the DVD, on Linux and Unix, run therunInstaller shell script

    The OUI can be installed as a self-contained productin its own Oracle Home, or can be launched from the

    product installation DVD; it will install itself into theOracle Home along with the product

    An Oracle Home is the location of an Oracle productinstallation: a set of files in a directory structure

    1/8

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    5/29

    Tools for Administering an Oracle Database

    http://asghars.blogspot.com

    When the OUI prompts for the location of a products.xmlfile, specify the DVD with the product you want to install

    Always use the latest version of the OUI that you haveavailable

    OUI inventory stores details of all the Oracle products

    installed on the machine, including the exact version, thelocation, and in some cases details of patches that havebeen applied

    Every run of the OUI will check the inventory for

    incompatibilities before permitting an install into anexisting Oracle Home to proceed, and will then updatethe inventory with details of all pro ducts installed orupgraded

    2/8

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    6/29

    Tools for Administering an Oracle Database

    http://asghars.blogspot.com

    OUI look for a file /etc/oraInst.loc on Linux ,/var/opt/oracle/oraInst.loc on Solaris andHKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\inst_loc registry key on Windows to find an existinginventory

    As only the root user can write to /etc or /var andOUI will be always run by non-root user, therefore;OUI will generate a script (orainstRoot.sh script) to berun by the root user that will create the oraInst.loc

    file To relocate the inventory, first copy it to the new

    location, and then edit the oraInst.loc file or registrykey

    3/8

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    7/29

    Tools for Administering an Oracle Database

    http://asghars.blogspot.com

    The /install/oraparam.ini file specifies the location onthe DVD of the file products.xml

    The product requirements are listed in a

    /stage/prereq/db/refhost.xml file

    Database Creation (DBCA) and Upgrade Tools(DBUA)

    The DBCA,is a graphical tool for creating a database

    DBCA is discussed in database creation chapter Database upgrade can be done manually or through a

    graphical tool DBUA

    4/8

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    8/29

    Tools for Administering an Oracle Database

    http://asghars.blogspot.com

    SQL*Plus and SQL Developer

    SQL*Plus & SQL Developer are tools that can be used toconnect to an Oracle database

    SQL*Plus is available on all platforms to which thedatabase has been ported, installed into both Oracledatabase and Oracle client Oracle Homes

    To run SQL*Plus some environment variables(ORACLE_HOME, PATH and LD_LIBRARY_PATH) need to beset

    SQL Developer is a graphical tool with wizards forcommonly needed actions

    Database 11g does ship with a release of SQL Developer,and but is a completely self-contained product

    5/8

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    9/29

    Tools for Administering an Oracle Database

    http://asghars.blogspot.com

    On Windows, the executable file is sqldeveloper.exe.On Linux, it is the sqldeveloper.sh shell script

    Oracle Enterprise Manager (OEM)

    The version of Oracle EM relevant to the OCP

    examination is Database Control

    Database Control is a tool for managing one database

    (which can be a RAC database), whereas Grid Control

    can manage many databases (and more)

    If there are several database instances running off the

    same Oracle Home, each instance will be accessible

    through Database Control on a different port

    6/8

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    10/29

    Tools for Administering an Oracle Database

    http://asghars.blogspot.com

    Many DBAs like to work from the SQL*Plus or SQLDeveloper command line to understand out exactlyhow to do something, and then use EnterpriseManager to make doing it easy

    Oracle Net Manager (netmgr) and Oracle NetConfiguration Assistant (netca)

    These tools are used for configuring the Oraclenetworking environment

    Datapump and SQL*Loader Datapump extracts data from one database, writes it

    out to a file, and inserts it into another database(possibly a different version, on a different platform)

    7/8

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    11/29

    Tools for Administering an Oracle Database

    http://asghars.blogspot.com

    SQL*Loader is a tool for loading large amounts ofdata into an Oracle database from operating system

    files. These files can be laid out in a number of

    formats

    Recovery Manager (RMAN) RMAN is used for creating server-managed backups

    8/8

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    12/29

    Plan an Oracle Database Installation

    http://asghars.blogspot.com

    Choice of Operating System Oracle Corporation supports all the mainstream

    platforms, including

    Linux on Intel and AMD

    Microsoft Windows on Intel and AMD

    Solaris on SPARC

    AIX on POWER

    HPUX on PA-RISC When selecting an operating system, the choice

    should be informed by many factors, including

    Cost

    1/10

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    13/29

    Plan an Oracle Database Installation

    http://asghars.blogspot.com

    Ease of use

    Choice of hardware

    Available skills

    Scalability

    Fault tolerance Performance

    Linux deserves a special mention. Oracle Corporation

    has made a huge commitment to Linux, and Linux is

    used as the development platform for many products

    (including database release 11g)

    2/10

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    14/29

    Plan an Oracle Database Installation

    http://asghars.blogspot.com

    Configure OEL Kernel for Oracle Using any text editor, create or edit the

    /etc/sysconfig.conf file,

    and add or edit lines similar to

    the following

    Run /sbin/sysctl -p command

    to make it active

    3/10

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    15/29

    Plan an Oracle Database Installation

    http://asghars.blogspot.com

    Configure OEL Shell for Oracle Add the following lines to the/etc/security/limits.conf

    file

    Add or edit the following line in the /etc/pam.d/loginfile

    4/10

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    16/29

    Plan an Oracle Database Installation

    http://asghars.blogspot.com

    Create Groups & User for Oracle OSDBA group (dba); identifies operating system user

    accounts that have database administrative privileges

    (the SYSDBA privilege)

    Oracle Inventory group (oinstall); create this groupthe first time you install Oracle software on the

    system

    4/10

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    17/29

    Plan an Oracle Database Installation

    http://asghars.blogspot.com

    Directory Structure & File Naming Conventions/OFA

    Oracle strongly recommends a disk layoutmethodology formally called the Optimal FlexibleArchitecture (OFA)

    OFA was designed to achieve minimize diskcontention, to operate more than one databasewithout administrative confusion, and to improvedatabase performance

    Mount Points

    Oracle recommends that all your Oracle mount pointsbe named according to the convention /pm, e.g. /u01,/u02, /u03, and so on

    5/10

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    18/29

    Plan an Oracle Database Installation

    http://asghars.blogspot.com

    The first of these is for locating the Oracle Databaseserver binaries, and the other three are for holding thedatabase files

    Oracle Base Directory (ORACLE_BASE)

    The Oracle base directory is the top directory for allOracle software installations

    Oracle recommends that you use the form /pm/h/u fororacle base directory

    Where h is the name of a standard directory, u is thedirectorys owners name

    6/10

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    19/29

    Plan an Oracle Database Installation

    http://asghars.blogspot.com

    The default owner of the Oracle base directory is

    usually a user named oracle, and the standard directory

    is usually named app (e.g. /u01/app/oracle)

    The following commands create the Oracle Base

    Directory

    Change the owner of base directory to oracle and group

    to oinstall

    Change permission on the base directory

    7/10

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    20/29

    Plan an Oracle Database Installation

    http://asghars.blogspot.com

    Oracle Home Directory (ORACLE_HOME)

    Oracle server software executable files and otherconfiguration files are located under this directory

    To enable the simultaneous running of multiple versions ofOracle software, you need to install Oracle software in a

    directory with the following path:/pm/h/u/product/v/type_n

    Where v is the version of oracle software, type is the type ofinstallation e.g. database (db) or client, n is the counter,which enables you to install the same product multiple

    times The first part, /pm/h/u, is nothing but the Oracle base

    directory

    Oracle Home Directory (e.g. /u01/app/oracle/product

    /11.2.0/db_1), is automatically created by OUI

    8/10

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    21/29

    Plan an Oracle Database Installation

    http://asghars.blogspot.com

    Oracle Inventory Directory

    Also known as OraInventory, is used to store aninventory of all the Oracle software on a server

    Again the OUI will prompt for its location and no needto create manually

    Flash Recovery Area

    Used for storing all the recovery-related files

    Its a good idea to create it on entirely different storagedevices from where you have your data files

    Database Files A typical data file under the OFA guidelines would have

    a name like /u02/oradata/prod/system01.dbf, whichrefers to a data file in the System table-space

    9/10

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    22/29

    Plan an Oracle Database Installation

    http://asghars.blogspot.com

    Configure Oracle Users Environment Change the entry of .bash_profile file of the oracle

    user and add

    following lines

    10/10

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    23/29

    Running Oracle Universal Installer

    http://asghars.blogspot.com

    Copy downloaded oracle installation files to the/tmp directory

    Login with oracle, unzip both files, switch to the

    /tmp/database directory and run installation by

    running the ./runInstaller

    Follow the wizard

    1/7

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    24/29

    Running Oracle Universal Installer

    http://asghars.blogspot.com

    2/7

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    25/29

    Running Oracle Universal Installer

    http://asghars.blogspot.com

    Provide the name of the database and thepassword and click next

    3/7

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    26/29

    Running Oracle Universal Installer

    http://asghars.blogspot.com

    In the prerequisite check we was informed that weneed to install three packages as well. So mount the

    .iso file of the OEL installation, switch to the Server

    folder

    4/7

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    27/29

    Running Oracle Universal Installer

    http://asghars.blogspot.com

    Click on Check Again button and youll see thatthose notifications are disappeared. Check Ignore

    all checkbox and click Next

    Click Finish button to start the installation

    5/7

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    28/29

    Running Oracle Universal Installer

    http://asghars.blogspot.com

    DBCA tools automatically will start to create the

    database

    Run both shell scripts with root user

    6/7

  • 7/29/2019 OCA 02 - Preparing the Database Environment

    29/29

    Running Oracle Universal Installer

    http://asghars.blogspot.com

    Open a new terminal, export ORACLE_SID variableand connect to the database

    7/7