How to install Oracle11g in Linux

Source: Internet
Author: User
Tags stop script
Oracle11GforRHLAS5 Installation server configuration: Xeon 3.0 GHZ * 24GECCDDR memory 300GSCSIUtrl32015K hard drive * 2 prerequisites: memory and swap space; For details, see the official database \ doc \ install directory documentation

Installation of Oracle11G for RHL AS5

Server Configuration:
Xeon 3.0 GHZ * 2
4 gb ecc ddr memory
300 gb scsi Utrl 320 15 K hard drive X 2

 

Prerequisites:

Memory and swap space; For details, see the official database \ doc \ install directory documentation
Available RAM Swap Space Required
Between 1024 MB and 2048 MB 1.5 times the size of RAM
Between 2049 MB and 8192 MB Equal to the size of RAM
More than 8192 MB 0.75 times the size of RAM


1. Prepare servers and operating systems:
1. Physical memory: 4 GB
2. 4 GB swap space
3. Disable secure Linux
4. You have installed the following packages (for simplicity, it is best to install all the packages when installing RedHat AS 4 ):
A, X Window System
B. GNOME Desktop Environment
C. Editors
D. Graphical Internet
E. Text-based Internet
F. Server Configuration Tools
G. Development Tools
H. Administration Tools
I, System Tools


2. Preparations before installation

 

1. Check hardware
Memory
# Grep MemTotal/proc/meminfo
Swap space
# Grep SwapTotal/proc/meminfo
Disk Space
# Df-ah

2. Download Software
Oracle Database 10g Release 2 (10.2.0.1) Software download location:
Http://otn.oracle.com/software/products/database/oracle10g/index.html

3. Modify the host file
View the/etc/hosts file must contain a fully qualified name for the server

 

4. Check the installation package

1. Check whether the following packages are installed. If not, install them first:

Binutils-2.17.50.0.6-2.el5

Compat-libstdc ++-33-3.2.3-61

Elfutils-libelf-0.125-3.el5

Elfutils-libelf-devel-0.125

Glibc-2.5-12

Glibc-common-2.5-12

Glibc-devel-2.5-12

Gcc-4.1.1-52

Gcc-c ++-4.1.1-52

Libaio-0.3.106

Libaio-devel-0.3.106

Libgcc-4.1.1-52

Libstdc ++-4.1.1

Libstdc +-devel-4.1.1-52.e15

Make-3.81-1.1

Sysstat-7.0.0

UnixODBC-2.2.11

UnixODBC-devel-2.2.11

 

# Rpm-qa | grep make gcc glibc compat openmotif21 setarch and so on

 

5. Make a link (for old version requirements, do not set the new version of oracle11 ):
Ln-s/usr/lib/libstdc ++. so.6.0.3/usr/lib/libstdc ++. so.5

# Check if this link is not used. If a database is created during installation, the database cannot be connected.

 

Iii. parameter settings


1. Set core parameters
Add the following lines to the/etc/sysctl. conf file:

# Kernel. core_uses_pid = 1
Kernel. shmall = 2097152
Kernel. shmmax = 2147483648 -- (in bytes, physical memory x 1024x1024x2, double the memory size)
Kernel. shmmni = 4096
# Semaphores: semmsl, semmns, semopm, semmni
Kernel. sem = 250 32000 100 128
Fs. file-max = 65536
Net. ipv4.ip _ local_port_range = 1024 65000
Net. core. rmem_default = 8388608
Net. core. rmem_max = 8388608
Net. core. wmem_default = 262144
Net. core. wmem_max = 262144

Esc: wq!


# Sysctl-p # Run the following command to change the core parameter

 

2. Set Shell Limits (system resource limit) to improve the running efficiency of the software.

A. Add the following red lines to the/etc/security/limits. conf file:

Oracle soft nofile 65536
Oracle hard nofile 65536
Oracle soft nproc 16384
Hard nproc 16384

 

B. Add the following lines to the/etc/pam. d/login file, if not:
Session required/lib/security/pam_limits.so
Session required pam_limits.so


C. Add the following statement after/etc/profile:
Vi/etc/profile
If [$ USER = "oracle"]; then
If [$ SHELL = "/bin/ksh"]; then
Ulimit-p 16384
Ulimit-n 65536
Else
Ulimit-u 16384-n 65536
Fi
Fi


3. Create users and groups and related directories
-- Create a dba/Rule/oinstall Group
/Usr/sbin/groupadd dba
/Usr/sbin/groupadd Partition
/Usr/sbin/groupadd oinstall


-- Create an oracle user and set the user group

/Usr/sbin/usermod-g oinstall-G dba oracle
/Usr/sbin/useradd-g oinstall-G dba oracle
Passwd oracle

# Id oracle
Uid = 501 (oracle) gid = 501 (oinstall) groups = 501 (oinstall), 502 (dba)

-- Create related installation Directories

Mkdir-p/opt/oracle/product
Mkdir-p/opt/oracle/product/OraHome

Mkdir-p/opt/oraInventory # (the default inventory folder)
Mkdir-p/opt/oracle/oradata # (change the right file owner)
Mkdir-p/var/opt/oracle


-- Set directory owner and permissions
Chown-R oracle. oinstall/opt/oracle
Chown-R oracle. oinstall/opt/oracle/oradata

Chown-R oracle. oinstall/opt/oracle/product/OraHome

Chown-R oracle. dba/opt/oraInventory
Chown oracle. dba/var/opt/oracle
Chmod-R 775/opt/oracle
Chmod-R 755/var/opt/oracle

 

4. Set the installation environment variables

# Su-oracle -- su to the oracle user,

Modify user configurations
$ Vi. bash_profile

Add the following parameters to configure the oracle software environment parameters:

# Get the aliases and functions
If [-f ~ /. Bashrc]; then
.~ /. Bashrc
Fi

 

Export ORACLE_BASE =/opt/oracle
Export ORACLE_HOME = $ ORACLE_BASE/product/OraHome

Export ORACLE_SID = orcl

Export ORACLE_OWNER = oracle
Export ORACLE_TERM = vt100

Export PATH = $ PATH: $ ORACLE_HOME/bin: $ HOME/bin
Export PATH = $ ORACLE_HOME/bin: $ ORACLE_HOME/Apache/bin: $ PATH
LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/local/lib
Export LD_LIBRARY_PATH
CLASSPATH = $ ORACLE_HOME/JRE: $ ORACLE_HOME/jlib: $ ORACLE_HOME/rdbms/jlib
CLASSPATH = $ CLASSPATH: $ ORACLE_HOME/network/jlib
Export CLASSPATH

 

Note:

11g: ORA_NLS33 = $ ORACLE_HOME/nls/admin/data

10g: ORA_NLS33 = $ ORACLE_HOME/ocommon/nls/admin/data
9i: ORA_NLS33 =/oracle/app/ora92/ocommon/nls/admin/data

Save and exit


-- Execute the following command to make the configuration take effect immediately or use oracle user login to make the configuration take effect
$ Source $ HOME/. bash_profile

Iv. Formal Installation

Open another terminal window as root

-- This step is critical. If you do not run this step, the graph-based installation interface cannot be started when the oracle user runs #./runInstaller.
(If you do not perform this step, you only need to start the installation program on the oracle desktop .)

Xhost +

Xhost + localhost

Log On As an oracle user. If the X mode is used, set the DISPLAY as follows:
DISPLAY =: 0.0; export DISPLAY
# Export DISPLAY = 192.168.1.170: 0.0

If you install cygwin remotely, start cygwin.
Run
# Startx

Method 1:

Mount the optical drive as root
# Mount/dev/cdrom/mnt

Log on to the system as an oracle user to install Oracle
# Su-oracle
Unzip linux_x86_11gR1_database.zip
Cd database/
./RunInstaller

./RunInstaller-ignoreSysprereqs # earlier version detection (optional)

 

Method 2:
1. unzip command: unzip 10201_database_linux32.zip
2. decompress the package and generate a database directory containing the installation file.
Note: It is best to create a folder on the root to store the installation files of ORACLE. However, before installing ORACLE, you need to change the owner of this folder to the user's oracle. It is best to change the folder permission to 777 to avoid problems during the installation process.

3. Custom Oracle installation files and permissions (optional)

Chmod 777/oracle
Chown-R oracle. oinstall/oracle

Mount/media/cdrom
/Media/cdrom/runInstaller

 

During installation:

Enter the appropriate ORACLE_HOME and Instance name during installation.

The management endpoint and sqlplus endpoint are displayed.

 

Select advanced Installation
In Select installation type, select Custom
Run as root during installation
#/Oracle/oraInventory/orainstRoot. sh
/Opt/oracle/product/OraHome/root. sh
After installation.

 

5. Start script generation and settings:

1. Supplement:
To enable RedHat Linux to automatically start Oracle at startup, follow these steps:
Run root. sh under $ ORACLE_HOME to generate a file/etc/oratab.
Edit/etc/oratab and set the restart flag of all instances to 'y', for example:
Ora10g:/home/oracle/OraHome_1: Y

Run the/etc/init. d/dbora script as follows:

#! /Bin/sh
# Description: Oracle auto start-stop script.
# Chkconfig:-20 80
#
# Set ORA_HOME to be equivalent to the $ ORACLE_HOME
# From which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of
# Oracle database in ORA_HOME.
ORA_HOME =/home/oracle/OraHome_1
ORA_OWNER = oracle
If [! -F $ ORA_HOME/bin/dbstart]
Then
Echo "Oracle startup: cannot start"
Exit
Fi
Case "$1" in
'Start ')
# Start the Oracle databases:
# The following command assumes that the oracle login
# Will not prompt the user for any values
Su-$ ORA_OWNER-c $ ORA_HOME/bin/dbstart
Su-$ ORA_OWNER-c "$ ORA_HOME/bin/lsnrctl start"
;;
'Stop ')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# Will not prompt the user for any values
Su-$ ORA_OWNER-c "$ ORA_HOME/bin/lsnrctl stop"
Su-$ ORA_OWNER-c $ ORA_HOME/bin/dbshut
;;
'Restart ')
$0 stop
$0 start
;;
Esac

Grant execution permission

Chown root. root/etc/rc. d/init. d/dbora
Chmod 750/etc/init. d/dbora

 

Initialize new service:

Chkconfig dbora reset
Chkconfig -- list dbora
Dbora 0: off 1: off 2: off 3: on 4: off 5: on 6: off

 

Note: When the system is not in runlevels 3 and 5, use

Service dbora start service

Service dbora stop service.

Make the following link:
Ln-s/etc/init. d/dbora/etc/rc0.d/K10dbora
Ln-s/etc/init. d/dbora/etc/rc3.d/S99dbora

Run the following command:
Chkconfig -- level 345 dbora on

 

2. vi $ ORACLE_HOME/bin/dbstart
# Set this to bring up Oracle Net Listener
ORACLE_HOME_LISTNER = $ ORACLE_HOME
If there is no ASM (Automatic Storage), delete the content. ASM needs to load the content before loading the instance.


3. restart the computer. The startup will be slow because em, database, listener, and agent must be started automatically.
In this case, OK. Oracle will also start/stop when the machine is switched on and off next time.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.