CentOS installation Oracle 11g full diagram

Source: Internet
Author: User
Tags oracle database installation set set dedicated server

Abstract: Description: Linux server operating system: CentOS 5.8 32-bit (Note: separate partition / data used to install oracle database when installing the system) Linux server IP address: 192.168.21.150 Oracle database version: linux_11gR2_database Wind...

 
Description:

Linux server operating system: CentOS 5.8 32-bit (Note: separate partition / data used to install the oracle database when the system is installed)

Linux server IP address: 192.168.21.150

Oracle database version: linux_11gR2_database

Windows client system: Windows Xp

Specific operations:

First, install the graphical interface X Window on the Linux server.

1, install the graphical interface server program X Window on Linux

Yum groupinstall "X Window System" #Install X Window



2, vi /etc/gdm/custom.conf #configuration, modify the following code



[security]

AllowRemoteRoot=true

[xdmcp]

Port=177

Enable=1

:wq! #Save exit

3, vi /etc/inittab #edit



Id:5:initdefault: #改3 is 5

:wq! #Save exit

4, vi /etc/sysconfig/iptables # Edit, add the following code to open the firewall UDP port 177


-A RH-Firewall-1-INPUT -m state –state NEW -m udp -p udp –dport 177 -j ACCEPT

:wq! #Save exit

Service iptables restart #restart

Gdm-restart #restart

Shutdown -r now #restart the system

Second, install Xmanager on the Windows client system

1. Download and install Xmanager Enterprise 3

Http://www.onlinedown.net/soft/32684.htm #英语原版

Http://www.downxia.com/downinfo/19164.html #汉化包

2. After downloading the installation software, open Xmanager Enterprise


3, then open Xbrowser, as shown below:

In the address bar, enter 192.168.21.150 to go to the following interface



Enter the username root, enter the password, click Ok, the following interface will appear



login successful!

Third, prepare the Oracle database before the Linux server operating system installation

1. Download Oracle 11g R2 Linux version

http://download.oracle.com/otn/linux/oracle11g/R2/linux_11gR2_database_1of2.zip #Download address

http://download.oracle.com/otn/linux/oracle11g/R2/linux_11gR2_database_2of2.zip

Note: Oracle 11g R2 Linux version has two compressed files, all need to be downloaded (you need to register before downloading)

After the download is complete, upload the two compressed files to the /usr/local/src directory of the Linux server through WinSCP and other tools, as shown in the following figure:



2, create an oracle database installation directory on the Linux server

Mkdir -p /data/oracle #oracledatabase installation directory

Mkdir -p /data/oraInventory #oracledatabase configuration file directory

Mkdir -p /data/database #oracle database package decompression directory

3, create a system user and user group running the oracle database

Groupadd oinstall #Create user group oinstall

Groupadd dba #Create user group dba

Useradd -g oinstall -g dba -m oracle #Create user oracle and join oinstall and dba user groups

Passwd oracle #Set the login password of user oracle, enter the password twice according to the prompt

Chown -R oracle:oinstall /data/oracle #Set the directory owner to the oracle user of the oinstall user group

Chown -R oracle:oinstall /data/oraInventory

Chown -R oracle:oinstall /data/database



4, modify the operating system logo (Oracle does not support CentOS system installation by default)

Vi /etc/redhat-release #edit

Put: CentOS release 5.8 (Final)

Modified as: redhat-4

:wq! #Save exit

5, set the system kernel parameters

Vi /etc/sysctl.conf #edit, add the following code at the end

Net.ipv4.icmp_echo_ignore_broadcasts = 1

Net.ipv4.conf.all.rp_filter = 1

Fs.file-max = 6815744 #Set the maximum number of open files

Fs.aio-max-nr = 1048576

Kernel.shmall = 2097152 #Total memory, 8G memory setting: 2097152*4k/1024/1024

Kernel.shmmax = 2147483648 #Maximum shared memory segment size

Kernel.shmmni = 4096 #Maximum number of shared memory on the entire system

Kernel.sem = 250 32000 100 128

Net.ipv4.ip_local_port_range = 9000 65500 #Available IPv4 port range

Net.core.rmem_default = 262144

Net.core.rmem_max= 4194304

Net.core.wmem_default= 262144

Net.core.wmem_max= 1048576

:wq! #Save exit

Sysctl -p # makes the configuration take effect immediately

6, set oracle user restrictions, improve software performance

Vi /etc/security/limits.conf #Add the following code at the end

Oracle soft nproc 2047

Oracle hard nproc 16384

Oracle soft nofile 1024

Oracle hard nofile 65536

:wq! #Save exit

7, configure the user environment

Vi /home/oracle/.bash_profile #Add the following code at the end

Export ORACLE_BASE=/data/oracle #oracle database installation directory

Export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 #oracledatabase path

Export ORACLE_SID=orcl #oracleStart database instance name

Export ORACLE_TERM=xterm #xtermwindow mode installation

Export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH #Add system environment variables

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib #Add system environment variables

Export # Prevent garbled during installation

Export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK #Set the Oracle client character set, which must be consistent with the character set set during Oracle installation, such as: ZHS16GBK, otherwise the data import and export Chinese garbled problem

:wq! #Save exit

Source .bash_profile # Make the settings take effect immediately

8, close SELINX

Vi /etc/selinux/config #Edit configuration file

#SELINUX=enforcing #Comment out

#SELINUXTYPE=targeted #Comment out

SELINUX=disabled #增

:wq! #Save exit

9, configure the firewall to open port 1521

Vi /etc/sysconfig/iptables #Edit the firewall configuration file, add the following

-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 1521 -j ACCEPT

/etc/init.d/iptables restart # Restart the firewall to make the configuration take effect

10, extract the oracle compressed file to the decompression directory

Cd /usr/local/src #Enter directory

Unzip linux_11gR2_database_1of2.zip -d /data/database #Unpack

Unzip linux_11gR2_database_2of2.zip -d /data/database #uncompress

Chown -R oracle:oinstall /data/database/database

11, the package required to install the oracle database

Yum install gcc* gcc-* gcc-c++-* glibc-devel-* glibc-headers-* compat-libstdc* libstdc* elfutils-libelf-devel* libaio-devel* sysstat* unixODBC-* pdksh-*

Fourth, install oracle

1. Run Xmanager on the Windows client and log in to the X window of the Linux server, as shown below:


2, switch to the oracle user

Xhost +

Su – oracle

Export DISPLAY=:0.0 # Use the w command to view and fill in the results displayed by your system.

Cd /data/database/database #Enter the installation package directory

./runInstaller #Install, the following interface appears

Bubuko.com, cloth buckle

Wait patiently for a while, the following interface appears

Bubuko.com, cloth buckle

Emial: No need to fill in by default

Cancel: "I want to receive security updates via My Oracle Support", do not receive updates, click Next



Prompt if you do not receive security update notifications, choose Yes

Next



Select the second item, only install the database software

Next


Select the first item, single instance database installation

Next



Language option, default English

Next


Choose the first item: Enterprise Edition

Next



Oracle database base directory: /data/oracle

Oracle software installation location: /data/oracle/product/11.2.0/db_1

Next



Oracle configuration file directory: /data/oraInventory

Nex


Oracle database runtime group, the default is

Next



Perform pre-installation system environmental monitoring
Note: If there is an item that has not been monitored, please make the corresponding modifications according to the prompts, know that the monitoring has passed, otherwise you cannot proceed with the next step.

After all monitoring is passed, click Cancel



List oracle installation list

Select Cancel and the following interface appears.



Installing, please be patient



Click OK



Until the installation is complete, click Close

Fifth, configure the listener (you must first configure before creating the database)

Continue to run Xmanager on the Windows client and log in to the X window of the Linux server.

Su – oracle #Switch to oracle user

Netca #Configure listener command, the following interface appears



Select the first item: listener configuration

Next



Select the first item: Add

Next



Listener name, default

Next



Protocol configuration, the default TCP can be

Next



Select the first item: use the standard port number 1521

Next



Ask: Is there another listener configured?

Choice: No

Next



The listener configuration is complete, Next


Finish is completed

Create an Oracle database instance orcl

Continue to run Xmanager on the Windows client and log in to the X window of the Linux server.

Su – oracle #Switch to oracle user

Dbca #Start the oracle instance installation interface, as shown below



Next


Select the first item: Create a database

Next



The first item is selected by default: general purpose or transaction processing

Next



System operation and maintenance www.osyunwei.com Warm reminder: qihang01 original content Copyright, reproduced, please indicate the source and the original link

Global database name: orcl

SID: orcl

Next



Default, Next




Password configuration, you can set a different password for each account, you can also set a same password for all accounts

Select the second item: all accounts use the same administrative password

Next



If the password is set too simple and does not meet the complexity requirements of the Oracle password, the above interface will pop up, you can choose Yes, or choose No, then return

Password settings, reset a complex password.



Storage Type: File System

Storage location: use the location of the database file in the template

Next



Default selection: Specify fast recovery area

Next



Quick recovery area size setting, if the remaining space of the system is less than the set value, the above prompt will appear

Next



Default, Next



Switch to resize: Process 300 (can be set according to server configuration)



Switch to character set settings



Select the third item: select from the list of character sets

Choice: ZHS16GBK- GBK 16-bit Simplified Chinese

National character set: AL16UTF16-Unicode UTF-16 Universal character set

Default language: Simplified Chinese

Default area: China



Switch to connection mode, select: dedicated server mode

Next



After all settings are complete, click Finish



Check: Create database

Check: Generate database creation script

Click Finish



System operation and maintenance www.osyunwei.com Warm reminder: qihang01 original content Copyright, reproduced, please indicate the source and the original link

Ok


Note: If the above prompt appears here, you can log in as the root account after the installation is complete, execute the following two commands.

/data/oracle/product/11.2.0/db_1/root.sh

/data/oraInventory/orainstRoot.sh

Generate /etc/oratab file


Creating database



The database is created, click Exit to exit

Seven, start the oracle database

Su – oracle #Switch to oracle user

Sqlplus /nolog #Enter sqlplus

Conn / as sysdba #Log in as super administrator

Startup #Start database instance

Quit #quit

Lsnrctl start #Start listener

Description of startup parameters:

Startup # Without any parameters, start the database instance and open the database, generally choose this startup method

Startup nomount #Start only the database instance, do not open the database, generally used to create a new database

Startup mount #Start the database instance and load the database, but do not open the database, generally used to modify the database name and other management

Eight, close the oracle database

Su – oracle #Switch to oracle user

Lsnrctl stop #Close listener

Sqlplus /nolog #Enter sqlplus

Shutdown immediate #turn off the database instance

Quit #quit

Shutdown parameter description:

Normal #waits all users to disconnect, does not allow new connections after executing the command

Immediate # Waiting for the user to complete the current statement, then disconnect the user, not allowing new users to connect

Transactional #waits the user to disconnect after completing the current transaction, not allowing new users to connect

Abort # forcibly disconnect and close the database directly

The first three methods do not cause a database error. The last method is not recommended for non-special situations.

Generally use shutdown immediate to close the database

Note: If you execute shutdown immediate, ORA-01012: not logged on error

Please execute the following statement first

Ps -ef|grep ora_dbw0_$orcl

Kill -9 pid #pid is the process number

Where orcl is the SID of the database

Nine, set oracle boot

Description: Linux will not be booted after booting by default.

1, su – root #Switch to root user operation

/data/oracle/product/11.2.0/db_1/root.sh #Execute the script and generate the /etc/oratab file

/data/oraInventory/orainstRoot.sh

 2, vi /etc/oratab #edit

Found: $ORACLE_SID: $ORACLE_HOME:<N|Y>:

Cancel the previous # comment and change it to:

Orcl:/data/oracle/product/11.2.0/db_1:Y #orcl is the name of the oracle database instance

:wq! #Save exit

3, vi /data/oracle/product/11.2.0/db_1/bin/dbstart #edit

Found: ORACLE_HOME_LISTNER=$1

Modified to: ORACLE_HOME_LISTNER=$ORACLE_HOME

4, vi /data/oracle/product/11.2.0/db_1/bin/dbshut #edit

Found: ORACLE_HOME_LISTNER=$1

Modified to: ORACLE_HOME_LISTNER=$ORACLE_HOME

5, create an oracle startup script

Vi /etc/init.d/oracle #edit, add the following code
############################################################################# ########
#!/bin/sh
# chkconfig: 0356 99 10
# description: Startup Script for Oracle Databases
# Script path:/etc/init.d/oracle
# Author:www.osyunwei.com by qihang01
#
ORACLE_BASE=/data/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
ORACLE_SID=orcl
PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
Export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
#
ORA_OWNR="oracle"
#
If [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
Then
Echo "Oracle startup: cannot start"
Exit 1
Fi
#
Case "$1" in
Start)
Su – $ORA_OWNR -lc $ORACLE_HOME/bin/dbstart
Echo "Oracle Start Succesful!"
;;
Stop)
#
Su – $ORA_OWNR -lc $ORACLE_HOME/bin/dbshut
Echo "Oracle Stop Succesful!"
;;
Restart)
$0 stop
$0 start
;;
*)
Echo $"Usage: `basename $0` {start|stop|restart}"
Exit 1
Esac
Exit 0
############################################################################# ########

:wq! #Save exit

Chown oracle.oinstall /etc/init.d/oracle #change file owner

Chmod 755 /etc/init.d/oracle #Add execute permission

Ln -s /etc/init.d/oracle /etc/rc3.d/S99oracle #Add system boot level 3 soft link

Ln -s /etc/init.d/oracle /etc/rc5.d/S99oracle #Add system boot level 5 soft link

Ln -s /etc/init.d/oracle /etc/rc0.d/K01oracle #Add system shutdown soft connection

Ln -s /etc/init.d/oracle /etc/rc6.d/K01oracle #Add system restart soft connection

Chkconfig –add oracle #add system service

Chkconfig oracle on #设置boot boot

Remarks: # chkconfig: 0356 99 10

0356: Define run level

99: Boot priority (the higher the number, the later the start)

10: Shutdown stop priority (the smaller the number, the earlier the shutdown)

System operation and maintenance www.osyunwei.com Warm reminder: qihang01 original content Copyright, reproduced, please indicate the source and the original link

6, restore the operating system identification

Vi /etc/redhat-release #edit

Put: redhat-4

Modified as: CentOS release 5.8 (Final)

:wq! #Save exit

7, change the system default startup level is 3

Vi /etc/inittab #edit

Id:3:initdefault: #改5为3

:wq! #Save exit

8, test

Shutdown -r now #restart the system

Service oracle start #start oracle

Service oracle stop #close oracle

/etc/init.d/oracle restart #restart oracle

Su – oracle #Switch to oracle user

Dbstart #start oracle

Dbshut #close oracle

Ps -efw | grep ora #View oracle process

Ps -efw | grep LISTEN | grep -v gre #View oracle port listener

Lsnrctl status #View oracle running status

At this point, the installation of Oracle 11g R2 tutorial under CentOS is completed.

Extended reading:

Use vnc remote connection to install Oracle. If there is an error, you can't start the installation interface. Please do the following!

Log in as root ssh

Vncserver #start vnc

New ‘www:1 (root)‘desk is www:1 # Remember www:1, will be used later!

Export DISPLAY=www:1 #输入

Service vncserver start start vnc

Log in using the vnc client root

Xhost +

Su – oracle #Switch to oracle user

./runInstaller #Execute the installation

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.