Install Oralce 11gR2 database in CentOS 6.6
Environment requirements:
Rlwrap-0.42
CentOS release 6.6 (Final)
VMware Workstation 11
Linux. x64_11gR2_database_1of2 and linux. x64_11gR2_database_1of2
Download CentOS 6.6 official version
Rlwrap: http://utopia.knoware.nl /~ Hlub/uck/rlwrap/# rlwrap
CentOS release 6.6
There are no special requirements for selecting Basic Server:
There are no special requirements for the installation of VMware Workstation 11.
VMware Workstation 11.0 permanently does not expire to activate the key:
1F04Z-6D111-7Z029-AV0Q4-3AEH8
Oracle11gR2:
Http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_1of2.zip
Http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_2of2.zip
CentOS 6.6 Basic Environment Configuration:
1). IP Address Configuration
# Vi/etc/sysconfig/network-scripts/ifcfg-eth0
NM_CONTROLLED = yes
BOOTPROTO = static
IPADDR = 192.168.1.6
NETMASK = 255.255.255.0
NETWORK = 192.168.1.0
2). Host Name and Network Configuration
# Vi/etc/sysconfig/network
HOSTNAME = oracle. dba. No1
GATEWAY = 192.168.1.254
3). DNS Configuration
# Vi/etc/resolv. conf
Nameserver 192.168.1.254
4) Disable selinux
# Vi/etc/selinux/config
SELINUX = disabled
5) configure the relationship between the ip address and the Host Name
# Vi/etc/hosts
192.168.1.6 oracle. dba. No1
The static table lookup for host name (host name query static table) Linux/etc/hosts is The file that configures The IP address and its corresponding host name, the ip addresses of the local host or other hosts and their corresponding host names can be recorded here.
6) disable the Firewall
# Chkconfig -- list iptables
Iptables 0: Disable 1: Disable 2: Enable 3: Enable 4: Enable 5: Enable 6: Disable
# Chkconfig -- del iptables
7) Configure CentOS 6 update source
# Vi/etc/yum. repos. d/CentOS-Base.repo
[Aliyu]
Name = from http://mirrors.aliyun.com/centos/6.6/ OS /x86_64/
Base url = http://mirrors.aliyun.com/centos/6.6/ OS /x86_64/
Gpgcheck = 1
Enabled = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
# Yum clean all
# Yum makecache
8) install common packages
Yum groupinstall 'development tools '''compatibility libraries' 'desktop Platform Development'
9) Configure to remotely connect to CentOS6 using xrdp or Xmanager
# Yum install gestation
# Run the rpm-qi command to view the description of the message for the running of the Operating
Name: TPD Relocations: (not relocatable)
Version: 2.30.4 Vendor: CentOS
Release: 64. el6 Build Date:, Thursday, October 16, 2014
Install Date: Build Host: c6b8.bsys.dev.centos.org
Group: User Interface/X Source RPM: gdm-2.30.4-64.el6.src.rpm
Size: 4828731 License: GPLv2 +
Signature: RSA/SHA1, Saturday, November 31, October 18, 2014, Key ID 0946fca2c105b9de
Packager: CentOS BuildSystem
URL: http://download.gnome.org/sources/gdm
Summary: The GNOME Display Manager
Description:
Running the graphical login screen, shown shortly after boot up,
Log out, and when user-switching.
1) edit/etc/TPD/custom. conf with the following content:
[Daemon]
[Security]
AllowRemoteRoot = true
[Xdmcp]
Port = 177
Enable = 1
[Gui]
[Greeter]
[Chooser]
[Debug]
[Servers]
Copy custom. conf
> Cp custom. conf TPD. conf
Then, restart the desktop, such as running the machine-restart command.
Init 3
Init 5
Or restart the system.
2) set the firewall and add it to the/etc/sysconfig/iptables file:
-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 6000: 6010-j ACCEPT
-A RH-Firewall-1-INPUT-m state -- state NEW-m udp-p udp -- dport 177-j ACCEPT
Restart firewall: service iptables restart
3) install Xmanager in windows, open Xbrowser, create XDMCP session, and then you can see CentOS.
Note: When the firewall blocks access, you can use service iptables stop to disable the firewall. Or use the command system-config-firewall to disable the firewall.
Now the environment configuration of the host is complete ......................
Environment configuration required for oracle software:
1) install the dependency package
Mount the optical drive and install the missing software on the installation disc.
# Mkdir/mnt/cdrom
# Mount-t iso9660/dev/cdrom/mnt/cdrom
# Cd/mnt/cdrom/Packages/
Install the missing software package by rpm-ivh package name
Binutils-2.20.51.0.2-5.11.el6 (x86_64)
Compat-libcap1-1.10-1 (x86_64)
Compat-libstdc ++-33-3.2.3-69.el6 (x86_64)
Compat-libstdc ++-33-3.2.3-69.el6.i686
Gcc-4.4.4-13.el6 (x86_64)
Gcc-c ++-4.4.4-13. el6 (x86_64)
Glibc-2.12-1.7.el6 (i686)
Glibc-2.12-1.7.el6 (x86_64)
Glibc-devel-2.12-1.7.el6 (x86_64)
Glibc-devel-2.12-1.7.el6.i686
Ksh
Libgcc-4.4.4-13.el6 (i686)
Libgcc-4.4.4-13.el6 (x86_64)
Libstdc ++-4.4.4-13. el6 (x86_64)
Libstdc ++-4.4.4-13. el6.i686
Libstdc ++-devel-4.4.4-13.el6 (x86_64)
Libstdc +-devel-4.4.4-13.el6.i686
Libaio-0.3.107-10.el6 (x86_64)
Libaio-0.3.107-10.el6.i686
Libaio-devel-0.3.107-10.el6 (x86_64)
Libaio-devel-0.3.107-10.el6.i686
Make-3.81-19.el6
Sysstat-9.0.4-11.el6 (x86_64)
UnixODBC-2.2.14-11.el6 (x86_64) or later
UnixODBC-2.2.14-11.el6.i686 or later
UnixODBC-devel-2.2.14-11.el6 (x86_64) or later
UnixODBC-devel-2.2.14-11.el6.i686 or later
Solution to the dependency package installation error:
When unixODBC is installed:
# Rpm-ivh unixODBC-2.2.14-14.el6.i686.rpm
Error: Failed dependencies:
Libltdl. so.7 is needed by unixODBC-2.2.14-14.el6.i686
Libreadline. so.6 is needed by unixODBC-2.2.14-14.el6.i686
Solution:
# Rpm-ivh libtool-ltdl-2.2.6-15.5.el6.i686.rpm
# Rpm-ivh ncurses-libs-5.7-3.20090208.el6.i686.rpm
# Rpm-ivh readline-6.0-4.el6.i686.rpm
[Root @ oracle package] # rpm-ivh unixODBC-2.2.14-14.el6.i686.rpm
Preparing... ######################################## ### [100%]
1: unixODBC ####################################### #### [100%]
[Root @ oracle package] # rpm-ivh unixODBC-devel-2.2.14-14.el6.i686.rpm
Preparing... ######################################## ### [100%]
1: unixODBC-devel ##################################### ###### [100%]
[Root @ oracle Packages] # rpm-ivh unixODBC-
UnixODBC-2.2.14-14.el6.i686.rpm unixODBC-devel-2.2.14-14.el6.i686.rpm
UnixODBC-2.2.14-14.el6.x86_64.rpm unixODBC-devel-2.2.14-14.el6.x86_64.rpm
[Root @ oracle package] # rpm-ivh unixODBC-2.2.14-14.el6.x86_64.rpm
Preparing... ######################################## ### [100%]
1: unixODBC ####################################### #### [100%]
[Root @ oracle package] # rpm-ivh unixODBC-devel-2.2.14-14.el6.x86_64.rpm
Preparing... ######################################## ### [100%]
1: unixODBC-devel ##################################### ###### [100%]
2) create a user and group for the oracle software
# Groupadd oinstall
# Groupadd dba
# Useradd-g oinstall-G dba oracle
# Id oracle
Uid = 500 (oracle) gid = 500 (oinstall) group = 500 (oinstall), 501 (dba)
3). Modify Kernel Parameters
# Vi/etc/sysctl. conf
Fs. aio-max-nr = 1048576
Fs. file-max = 6815744
Kernel. shmall = 2097152
Kernel. shmmax = 536870912
Kernel. shmmni = 4096
Kernel. sem = 250 32000 100 128
Net. ipv4.ip _ local_port_range = 9000 65500
Net. core. rmem_default = 262144
Net. core. rmem_max = 4194304
Net. core. wmem_default = 262144
Net. core. wmem_max = 1048576
# Sysctl-p
4) Upload and decompress the oracle software
# Mkdir/oraapp
# Unzip linux.x64_11gR2_database_1of2.zip & unzip linux.x64_11gr2_database204 f2.zip
# Chown-R oracle: oinstall/oraapp/database/
# Rm-rf/oraapp/linux. x64_11gR2_database _*
# Du-sm database/view the size of the decompressed oracle software package
2367 database/
5). Modify Shell Limits to improve the execution efficiency of Oracle.
# Vi/etc/security/limits. conf
Oracle soft nofile 131072
Oracle hard nofile 131072
Oracle soft nproc 131072
Hard nproc 131072
Oracle soft core unlimited
Oracle hard core unlimited
Oracle soft memlock 50000000
Oracle hard memlock 50000000
6) Create an oracle Installation Directory
# Mkdir-p/u01/app/oracle
# Chown-R oracle: oinstall/u01
# Chmod-R 755/u01
7). modify oracle user environment variables
# Su-oracle
$ Vi. bash_profile
# My oracle set
Export TMP =/tmp
Export TMPDIR = $ TMP
Export EDITOR = vim
Export ORACLE_BASE =/u01/app/oracle
Export ORACLE_HOME = $ ORACLE_BASE/product/11.2/db_1
Export ORACLE_SID = secooler
Export NLS_LANG = american_america.zhs16gbk
Export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH: $ ORACLE_HOME/lib
Export PATH = $ ORACLE_HOME/bin: $ PATH
Export DISPLAY = 192.168.1.7: 0.0
Umask 022
$. Bash_profile
Verify that oracle user environment variables are successfully set
$ Echo $ ORACLE_HOME
/U01/app/oracle/product/11.2/db_1
$ Echo $ ORACLE_BASE
/U01/app/oracle
$ Echo $ ORACLE_SID
Secooler
The environment required for oracle11gR2 installation has been configured ...............
Run the following command to install the oracle11gR2 Gui:
1) run the command xhost + as root.
# Xhost +
Access control disabled, clients can connect from any host
# Su-oracle
$ Cd/oraapp/database/
$./RunInstaller if you do not want oracle to check the prerequisites,./runInstall-ignoresysprereqs
2). The first installation interface of oracle11gR2
It can be seen that the oracle11gR2 graphical interface installation requires 12 Steps
This does not select the next step.
3). Installation Options only install the database software. After installing the software, create a database and a listener.
4). Select the database installation type for single-instance Database Installation
5). Retain the default language
6) Select the database version. Here I select Enterprise Edition.
7). Before the installation location is specified, these locations are defined in the oracle user's environment variables.
8). Create a product list to keep the default value
9). The oracle Database privileged operating system group has been created to keep the default value.
10 ). oracle Installation prerequisites check these i386 software packages can also be ignored because a 64-bit package has been installed, if you are not at ease or look ugly, mount the RedHat 5.8 installation disc, which contains all these packages.
# Umount/dev/cdrom
# Mount/dev/cdrom/mnt
# Cd/mnt/Server/
If the 64-bit package is installed, an error occurs when the i386 package is installed again, but you can use the -- force option of rpm to force the installation.
# Rpm-ivh -- force libaio-0.3.106-5.i386.rpm
# Rpm-ivh -- force compat-libstdc ++-33-3.2.3-61.i386.rpm
# Rpm-ivh -- force libaio-devel-0.3.106-5.i386.rpm
# Rpm-ivh -- force libgcc-4.1.2-52.el5.i386.rpm
# Rpm-ivh -- force pdksh-5.2.14-37.el5.x86_64.rpm
# Rpm-ivh -- force unixODBC-libs-2.2.11-10.el5.i386.rpm
# Rpm-ivh -- force unixODBC-2.2.11-10.el5.i386.rpm
# Rpm-ivh -- force libstdc ++-4.1.2-52. el5.i386. rpm
# Rpm-ivh -- force unixODBC-devel-2.2.11-10.el5.i386.rpm
11). Summary
12). oracle Installation Process
13) during oracle installation, the following two scripts must be executed as root. You can also view the script content.
Run the preceding two scripts as the oracle user's environment variable root.
# Su-oracle
$ Su
Password:
# Echo $ ORACLE_HOME
/U01/app/oracle/product/11.2/db_1
# Cd $ ORACLE_BASE/
# Cd ../oraInventory/
#./OrainstRoot. sh
# Cd $ ORACLE_HOME
#./Root. sh
14). Last step
Oracle software graphical interface installation to this OK .............
Solution to errors during installation
1). Solve the following error when running./runInstaller:
# Yum install xdpyinfo *
2) The following garbled characters appear on the installation page:
Oracle Installation interface garbled solution: Install zysong. ttf font
# Mkdir-p/usr/share/fonts/zh_CN/TrueType
# Wget http://pkgs.Fedoraproject.org/repo/pkgs/ttfonts-zh_CN/zysong.ttf.tar.bz2/0cab6ea4d57a6a7d84ee31afea047ec2/zysong.ttf.tar.bz2
# Tar-xvf zysong.ttf.tar.bz2
Zysong. ttf
Rlwrap Installation
# Wget http://utopia.knoware.nl /~ Hlub/uck/rlwrap/rlwrap-0.42.tar.gz
# Tar xvf rlwrap-0.42.tar.gz
# Make & make install
Finally, add
Alias sqlplus = 'maid sqlplus'
Alias rman = 'rlwrap rman'
Alias adrci = 'rlwrap adrci'
# Source. bashrc
The following error occurs during rlwrap installation:
# Yum install readline-devel
Installation Directory of oracle software
# Su-oracle
$ Cd $ ORACLE_HOME
$ Pwd
/U01/app/oracle/product/11.2/db_1
Login:
Here is an error because we only installed the oracle software, but did not create a database.
Use dbca to create a Database
We have installed only the oracle software. Now we use dbca to create a database.
# Xhost + note that the user identity here is root
Access control disabled, clients can connect from any host
# Su-oracle
$ Dbca
Database configuration Assistant 1st Interfaces
Database configuration Assistant 2nd Interfaces
Select the operation you want to perform: Create a database
Database configuration Assistant 3rd Interfaces
Set the global database name and the oracle system identifier of the oracle database. This SID is like a linux user using a unique uid, and the process uses a unique ID of the pid. the SID uniquely identifies the database in the system. because we have defined the database name as secooler in the environment variables of oracle users, we need to use the global database name here.
Secooler
Export ORACLE_SID = secooler
Database configuration Assistant 4th Interfaces
EM (Enterprise Manager) oracle Enterprise Manager Configuration
An error occurs when you configure EM on the 4th interfaces of Database configuration Assistant. This error indicates that the listener is not configured. Therefore, after installing the Database software, you must first create a listener.
Use netca (Net Configuration Assistant oracle network Configuration Assistant) to configure the listener
$ Netca &
Note the identity of the current user
Configuration Assistant oracle 1st Interfaces
Configuration Assistant oracle 2nd Interfaces
Configuration Assistant oracle 3rd Interfaces
Configuration Assistant oracle 4th Interfaces
Configuration Assistant oracle 5th Interfaces
Configuration Assistant oracle 6th Interfaces
Configuration Assistant oracle 7th Interfaces
Configuration Assistant oracle 8th Interfaces
The database has not been configured successfully. Next we will use dbca to configure the database from the beginning.
$ Dbca
Database configuration Assistant 1st Interfaces
Database configuration Assistant 2nd Interfaces
Database configuration Assistant 3rd Interfaces
Database configuration Assistant 4th Interfaces
Because we have defined the database name as secooler in the environment variable of oracle users, we also need to use the sid: export ORACLE_SID = secooler set in the global database name here. bash_profil
Database configuration Assistant 5th Interfaces
The em configuration can be found that no error occurs when you configure em after the listener is created.
Database configuration Assistant 6th Interfaces
Set a password for an oracle built-in account
Database configuration Assistant 7th Interfaces
Database configuration Assistant 8th Interfaces
Database configuration Assistant 9th Interfaces
Database configuration Assistant 10th Interfaces
You also need to set the character set in step 1.
Database configuration Assistant 11th Interfaces
In step 1, we can see three types of files in the oracle database: control files, data files, and redo log files.
$ Cd $ ORACLE_BASE/oradata/sccooler
$ Ls-l
Total usage 1599816
-Rw-r ----- 1 oracle oinstall 9748480 January 6 17:52 control01.ctl
-Rw-r ----- 1 oracle oinstall 104865792 January 6 17:33 example01.dbf
-Rw-r ----- 1 oracle oinstall 52429312 January 6 17:52 redo01.log
-Rw-r ----- 1 oracle oinstall 52429312 January 6 17:24 redo02.log
-Rw-r ----- 1 oracle oinstall 52429312 January 6 17:28 redo03.log
-Rw-r ----- 1 oracle oinstall 534781952 January 6 17:52 sysaux01.dbf
-Rw-r ----- 1 oracle oinstall 713039872 January 6 17:52 system01.dbf
-Rw-r ----- 1 oracle oinstall 30416896 January 6 17:30 temp01.dbf
-Rw-r ----- 1 oracle oinstall 110108672 17:52 undotbs01.dbf
-Rw-r ----- 1 oracle oinstall 5251072 January 6 17:33 users01.dbf
The control file ends with. ctl.
The data file ends with. dbf.
Log files end with. log
Database configuration Assistant 12th Interfaces
You can generate a database creation script here.
Database configuration Assistant 13th Interfaces
Database configuration Assistant 14th Interfaces
Creation process
Prompt during creation
Database configuration Assistant 15th Interfaces
Set the password for the following oracle built-in users. The users with blue check boxes are locked users, and the passwords for sys and system users can also be disabled because they have already been set.
So far, the oracle database has been created ...................
View em Port
$ Cat $ ORACLE_HOME/install/portlist. ini
Enterprise Manager Console HTTP port (secooler) = 1158
Enterprise Manager Proxy port (secooler) = 3938
Log on to the test and you can see that the oracle version is:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production