Oracle : install database 11g

De Wiki de Romain RUDIGER
Aller à : navigation, rechercher

Simple note of a quick DB install for test purpose.

Steps to install the DB

Install dependencies for Oracle:

[root@lab-oem ~]# yum install gcc.x86_64 gcc-c++.x86_64 glibc-devel.x86_64 glibc-headers kernel-headers libstdc++-devel.x86_64 glibc-headers.x86_64 sysstat.x86_64 elfutils-libelf-devel.i386 libaio-devel.x86_64

Create the user oracle, the group dba and the /OEMDB:

[root@lab-oem database]# groupadd -g 200 dba
[root@lab-oem database]# useradd -g 200 -u 200 oracle
[root@lab-oem ~]# mkdir /OEMDB
[root@lab-oem ~]# chown oracle:dba /OEMDB

Change limitations for the dba group in '/etc/security/limits.conf':

@dba soft nproc 2047
@dba hard nproc 16384
@dba soft nofile 4096
@dba hard nofile 65536

Add the kernel parameters in '/etc/sysctl.conf' and reload with 'sysctl -p':

kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
net.ipv4.ip_local_port_range = 32768 61000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
fs.file-max = 6815744

Log as oracle, keep X11 wih 'xauth add' and start the 'Oracle Universal Installer':

[root@lab-oem ~]# xauth list
lab-oem/unix:10  MIT-MAGIC-COOKIE-1  7ff8859f65e1d01c7db147a61d07f0b3
[root@lab-oem ~]# su - oracle
[oracle@lab-oem ~]$ cd /mnt/appz/Oracle/RDBMS-11.2.0.3_Linux64bit/database/
[oracle@lab-oem database]$ xauth add lab-oem/unix:10  MIT-MAGIC-COOKIE-1  7ff8859f65e1d01c7db147a61d07f0b3
[oracle@lab-oem database]$ ./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 8947 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 3999 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2012-11-09_09-51-00PM. Please wait ...
Oracle Database 11g-R2-installer RDBMS-Step01.png
Oracle Database 11g-R2-installer RDBMS-Step02.png
Oracle Database 11g-R2-installer RDBMS-Step03.png
Oracle Database 11g-R2-installer RDBMS-Step04.png
Oracle Database 11g-R2-installer RDBMS-Step05.png
Oracle Database 11g-R2-installer RDBMS-Step06.png
Oracle Database 11g-R2-installer RDBMS-Step07.png
Oracle Database 11g-R2-installer RDBMS-Step08.png
Oracle Database 11g-R2-installer RDBMS-Step09.png
Oracle Database 11g-R2-installer RDBMS-Step10.png
Oracle Database 11g-R2-installer RDBMS-Step11.png
Oracle Database 11g-R2-installer RDBMS-Step12.png
Oracle Database 11g-R2-installer RDBMS-Step13-memory.png
Oracle Database 11g-R2-installer RDBMS-Step13-character-sets.png
Oracle Database 11g-R2-installer RDBMS-Step14.png
Oracle Database 11g-R2-installer RDBMS-Step15.png
Oracle Database 11g-R2-installer RDBMS-Step16.png
Oracle Database 11g-R2-installer RDBMS-Step17.png
Oracle Database 11g-R2-installer RDBMS-Step18.png
Oracle Database 11g-R2-installer RDBMS-Step19.png
Oracle Database 11g-R2-installer RDBMS-Step20.png
Oracle Database 11g-R2-installer RDBMS-Step21-complete.png
Oracle Database 11g-R2-installer RDBMS-Step21-complete2.png
Oracle Database 11g-R2-installer RDBMS-Step21-complete-scripts.png
[root@lab-oem ~]# /OEMDB/oraInventory/orainstRoot.sh
Changing permissions of /OEMDB/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /OEMDB/oraInventory to dba.
The execution of the script is complete.
[root@lab-oem ~]# /OEMDB/oracle/product/11.2.0/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /OEMDB/oracle/product/11.2.0

Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
Oracle Database 11g-R2-installer RDBMS-Step22.png

Quick check the installed DB

Check these files:

/OEMDB/oracle/diag/rdbms/oemdb/oemdb/trace/alert_oemdb.log
cat /OEMDB/oracle/product/11.2.0/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /OEMDB/oracle/product/11.2.0/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

OEMDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = lab-oem.novalan.priv)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = oemdb.novalan.priv)
    )
  )
cat /OEMDB/oracle/product/11.2.0/network/admin/listener.ora
# listener.ora Network Configuration File: /OEMDB/oracle/product/11.2.0/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = lab-oem.novalan.priv)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = /OEMDB/oracle

Check connectivity:

[oracle@lab-oem database]$ . oraenv
ORACLE_SID = [oracle] ? oemdb
The Oracle base has been set to /OEMDB/oracle
[oracle@lab-oem database]$ env | grep ORA
ORACLE_SID=oemdb
ORACLE_BASE=/OEMDB/oracle
ORACLE_HOME=/OEMDB/oracle/product/11.2.0

sqlplus sys/Oracle123@oemdb as sysdba

SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE    11.2.0.3.0  Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

sqlplus system/Oracle123@oemdb

sqlplus dbsnmp/Oracle123@oemdb

Steps to remove the DB Console (em)

[oracle@lab-oem database]$ . oraenv
ORACLE_SID = [oracle] ? oemdb
The Oracle base has been set to /OEMDB/oracle

[oracle@lab-oem database]$ emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Nov 10, 2012 1:55:08 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: oemdb
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:

----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Nov 10, 2012 1:55:28 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /OEMDB/oracle/cfgtoollogs/emca/oemdb/emca_2012_11_10_01_55_07.log.
Nov 10, 2012 1:55:28 AM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Nov 10, 2012 1:55:52 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Nov 10, 2012 1:57:21 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Nov 10, 2012 1:57:22 AM