Install Oracle 10g R2 on centos5
I. Basic Conditions
Graphic Interface, in addition to Kde, full installation
To install a browser, you can connect to the Internet
It is best not to start SELinux
Vim/etc/sysconfig/SELinux
Remove unnecessary services, such as iptables, cups, and Postfix ....
Host Name
The hostname in/etc/sysconfig/network must be consistent with that in/etc/hosts.
Vim/etc/sysconfig/Network
Networking = Yes
Hostname = dbserver
Gateway = 192.168.137.1
Ntpserverargs = iBurst
Is the above hostname = dbserver
Vim/etc/hosts
127.0.0.1 localhost dbserver
: 1 localhost dbserver
# IP dbserver
Someone added the IP settings of the last line (I didn't add it)
2. Prepare the software to be installed: (this is very important. The first installation failure is because the software package is not fully loaded)
Rpm-Q xxx *
Yum install xxx
Rpm-ivh xxx. rpm
Command for direct installation:
Yum INSTALL \
Binutils \
Compat-libstdc ++-33 \
Compat-libstdc ++-33 *. i686 \
Elfutils-libelf \
Elfutils-libelf-devel \
GCC \
Gcc-C ++ \
Glibc \
Glibc *. i686 \
Glibc-common \
Glibc-devel \
Glibc-devel *. i686 \
Glibc-headers \
Ksh \
Libaio \
Libaio *. i686 \
Libaio-devel \
Libaio-devel *. i686 \
Libgcc \
Libgcc *. i686 \
Libstdc ++ \
Libstdc ++ *. i686 \
Libstdc ++-devel \
Make-3.81 \
Sysstat *. i686 \
Unixodbc *. i686 \
Unixodbc-devel \
Unixodbc \
Libxp \
Libxp *. i686
Yum install libxp. so.6 libxt. so.6 libxtst. so.6
3. Create users and groups
Groupadd oinstall
Groupadd DBA
Groupadd rule
Useradd-G oinstall-G dBA, role Oracle
Echo "oracle" | passwd -- stdin Oracle
4. create directories and permissions
Mkdir-P/u01/APP/Oracle/product/10.2.0/db_1
Chown-r ORACLE: oinstall/u01/APP/Oracle
Chmod-r 775/u01/APP/Oracle
5. Edit Variables
You can use Cat> XXX <EOF
>
>
> EOF
To append the input to the file to be edited.
1.
VI/etc/sysctl. conf note that this file has two variables (the last two) to be commented out
Kernel. Shmall = 2097152
Kernel. shmmax = 2147483648 memory.
Kernel. shmmni = 4096
Kernel. SEM = 250 32000 100 128
Net. ipv4.ip _ local_port_range = 1024 65000
Net. Core. rmem_default = 4194304
Net. Core. rmem_max = 4194304
Net. Core. wmem_default = 262144
Net. Core. wmem_max = 262144
Write kernel: sysctl-P
2.
VI/etc/security/limits. conf
Oracle soft nproc 2047
Hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536
Oracle soft stack 10240
3.
VI/etc/PAM. d/login
# Session required/lib/security/pam_limits.so
Session required pam_limits.so
4.
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
5.
VI ~ Oracle/. bash_profile
Export oracle_base =/u01/APP/Oracle # what may be changed
Export ORACLE_HOME = $ oracle_base/product/10.2.0/db_1 # What you may want to change
Export oracle_sid = oradb # which may be changed
Export display = 192.168.1.xxx: 0.0 # possible changes
Export Path = $ ORACLE_HOME/bin: $ path
7.
VI/etc/RedHat-release
Change centos Release 5 (final) to a redhat-4 or Red Hat Enterprise Linux Server Release 5.4 (tikanga)
The following message is displayed during installation:
Checking operating system versions: Must be a redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
6. decompress the package
Put the installation file on the target machine FTP, SCP (filezilla)
Put it in the/u01/APP/Oracle directory
Note: use an oracle user to run the following command Su-Oracle
Directions
1. Unzip the file: gunzip <FILENAME>
2. Extract the file: cpio-idmv <FILENAME>
3. Installation Guides and general Oracle Database 10g documentation can be found here.
4. Review the certification matrix for this product here.
In this way, you can also open a terminal in the graphic interface,
#> Xhost +
#> Su-Oracle
#> Unset Lang language # Fix garbled characters
Then, run the installer on this terminal.
Enter Terminal
SH/Oracle directory/runinstaller
Check whether there is a failed. If yes, check it and retry again.
An error occurred while installing "***** collector ***", continue
Ora-27125 problems in dbca
Use Root User
Id Oracle
Uid = 501 (Oracle) gid = 501 (oinstall) group = 501 (oinstall), 502 (DBA), 503 (region)
Note that the DBA group is 502.
Echo 502>/proc/sys/Vm/hugetlb_shm_group
Retry again on the installation page.
This will be added to the boot operation later
Finally, run two commands with root. The second command has an option. Press enter.
7. Run after installation
Since Oracle cannot be automatically started after installation, You need to manually start oracle in three ways.
1. Manual start
# Echo 502>/proc/sys/Vm/hugetlb_shm_group
# Su-Oracle
$ Sqlplus/As sysdba
SQL> startup
SQL> exit
$ LSNRCTL start
$ Emctl start dbconsole
2. boot
VI/etc/rc. d/rc. Local
Echo 502>/proc/sys/Vm/hugetlb_shm_group
Su-Oracle-c "/u01/APP/Oracle/product/10.2.0/bin/LSNRCTL start"
Su-Oracle-c "/u01/APP/Oracle/product/10.2.0/bin/dbstart start"
Su-Oracle-c "isqlplusctl start"
Su-Oracle-c "emctl start dbconsole"
VI/etc/oratab
Oradb:/u01/APP/Oracle/product/10.2.0: Y
3. Automatic startup. Sometimes there may be problems. I don't know what's going on.
Vim/etc/init. d/Oracle
#! /Bin/bash
#
# Chkconfig: 2345 80 05
# Description: Oracle 10g Server
#/Etc/init. d/Oracle
#
# Run-level STARTUP script for the Oracle instance, listener, and
# Web Interface
Echo 502>/proc/sys/Vm/hugetlb_shm_group
Export oracle_base =/u01/APP/Oracle
Export ORACLE_HOME = $ oracle_base/product/10.2.0
# Export oracle_sid = oradb
# Export Path = $ pathoracle_home/bin
Export oracle_owner = "oracle"
# If the executables do not exist -- Display Error
If [! -D $ ORACLE_HOME]
Then
Echo "cannot find $ ORACLE_HOME"
Exit 1
Fi
If [! -F $ ORACLE_HOME/bin/dbstart]
Then
Echo "cannot find $ ORACLE_HOME/bin/dbstart"
Exit 1
Fi
If [! -F $ ORACLE_HOME/bin/dbshut]
Then
Echo "cannot find $ ORACLE_HOME/bin/dbshut"
Exit 1
Fi
If [! -F $ ORACLE_HOME/bin/LSNRCTL]
Then
Echo "cannot find $ ORACLE_HOME/bin/LSNRCTL"
Exit 1
Fi
If [! -F $ ORACLE_HOME/bin/emctl]
Then
Echo "cannot find $ ORACLE_HOME/bin/emctl"
Exit 1
Fi
# Depending on Parameter -- startup, shutdown, restart
# Of the instance and listener or usage display
Case "$1" in
Start)
# Oracle listener and instance startup
Echo-n "Starting ORACLE :"
Su-$ oracle_owner-c "$ ORACLE_HOME/bin/dbstart"
Touch/var/lock/Oracle
Su-$ oracle_owner-c "$ ORACLE_HOME/bin/LSNRCTL start"
Su-$ oracle_owner-c "$ ORACLE_HOME/bin/emctl start dbconsole"
Echo "OK"
;;
Stop)
# Oracle listener and instance Shutdown
Echo-n "shutdown ORACLE :"
Su-$ oracle_owner-c "$ ORACLE_HOME/bin/emctl stop dbconsole"
Su-$ oracle_owner-c "$ ORACLE_HOME/bin/LSNRCTL stop"
Su-$ oracle_owner-c "$ ORACLE_HOME/bin/dbshut"
Rm-F/var/lock/Oracle
Echo "OK"
;;
Reload | restart)
$0 stop
$0 start
;;
*)
Echo "Usage: 'basename $ 0' START | stop | restart | reload"
Exit 1
Esac
Exit 0
Save and exit
Chmod U + x/etc/init. d/Oracle
Chkconfig oralce on
Usage: Oracle START | stop | restart | reload
Common commands
$ Dbca
$ Netca
$ Netmgr
$ LSNRCTL start
$ Emctl start dbconsole
$ Sqlplus/As sysdba
SQL> startup
SQL> shutdown immediate
Create tablespace XXX datafile '/u01/Oracle/oradata/xxx_01.dbf' size 500 m reuse autoextend on next 1024 K maxsize unlimited extent management local uniform size 500 K;
Create user OA identified by OA default tablespace ecology temporary tablespace temp;
Grant connect, resource, create view, DBA to OA;