How to install Oracle 10g on CentOS 6.6 _ x64

Source: Internet
Author: User

How to install Oracle 10g on CentOS 6.6 _ x64

The CentOS 6.6 system used in this experiment. The database is Oracle 10 Gb.

Centos: CentOS-6.6_X64-bin-DVD1.iso

Oracle Database Version: 10201_database_linux_x86_64.cpio.gz

To install the Oracle database, destoop must be installed in Linux. Otherwise, the Oracle database cannot be installed.

1. Install the installation package required by oracle

Yum-y install binutilscompat-libstdc ++-33 compat-libstdc ++-33. i686 elfutils-libelfelfutils-libelf-devel gcc-c ++ glibc. i686 glibc-common glibc-develglibc-devel.i686 glibc-headers ksh libaio. i686 libaio-devellibaio-devel.i686 libgcc. i686 libstdc ++. i686 libstdc ++-develmake sysstat

Finally, you must install libXp Library. Otherwise, a java Exception occurs during Oracle installation.

Yum install libXp libXt. i686 libXtst. i686

Some packages are 64. Some packages are 32.

2. modify the configuration file required by the linux System

We do not recommend that you install Oracle databases on the Super User root. We recommend that you add another user, oracle, to the linux system. However, before adding this user, we also need to set some system kernel parameters for this user.

Use the Vi editor to add the following parameters at the end of the/etc/sysctl. conf file:

-----------------------------------------------------------

Kernel. shmall = 2097152 # indicates the total amount of shared memory that can be used by the system at one time (in the unit of pages ).

Kernel. shmmax = 2147483648 # defines the maximum size of the shared memory segment (in bytes ). The default value is 32 M. For oracle, the default value is too low and is usually set to 2G.

Kernel. shmmni = 4096 # used to set the maximum number of shared memory segments within the system. The default value of this parameter is 4096.

Kernel. sem = 250 32000 100 128 # indicates the set semaphore

Net. ipv4.ip _ local_port_range = 1024 65000 # maximum number of local ports

Net. core. rmem_default = 4194304 # default Receiving Window Size

Net. core. rmem_max = 4194304 # maximum size of the Receiving Window

Net. core. wmem_default = 262144 # default sending window size

Net. core. wmem_max = 262144 # maximum size of the sending window

----------------------------------------------------------

[Root @ CentOS6 ~] #/Sbin/sysctl-p # The execution takes effect

Edit the/etc/security/limits. conf file to set system resource limits. In the future, if the oracle user installs the oracle database, the system administrator needs to add the following parameters to limits. conf.

# Vi/etc/security/limits. conf

Add the following four lines:

Oracle soft nproc 2047

Hard nproc 16384

Oracle soft nofile 1024

Oracle hard nofile 65536

Add the following parameters to edit the/etc/pam. d/login file:

# Vi/etc/pam. d/login

Session required/lib/security/pam_limits.so

Session required pam_limits.so

Note:

The etc directory contains the pam. d directory and a login subdirectory under the pam. d directory. Etc refers to the system configuration file directory, pam. d Refers to verify the login configuration, and login refers to the login configuration file. In short, it is the login configuration file of the linux operating system.

3. Create a user name and user group

Only the single host environment is discussed here, regardless of the configuration of the RAC environment. Run the following command to add the users and groups required for oracle installation.

3.1 create a group oinstall

# Groupadd oinstall

3.2 Create a group dba

# Groupadd dba

3.3 creating a user oracle will join the oinstall and dba groups and Test

# Useradd-g oinstall-G dba oracle

3.4 create a new oracle Password

# Passwd 123456

4. Modify/etc/profile and shell limits of the user.

Add the following code to the profile file:

If [$ USER = "oracle"]; then

If [$ SHELL = "/bin/ksh"]; then

Ulimit-p16384

Ulimit-n65536

Else

Ulimit-u16384-n 65536

Fi

Fi

5. Modify the Linux release version

Since CentOS6.6 was not released when Oracle10g was released, Oracle10g did not confirm support for CentOS6.6. You need to modify the relevant files so that Oracle10g supports CentOS 6.

We need to manually modify the Linux release notes so that Oracle 10 Gb supports CentOS6.5.

Edit the/etc/RedHat-release file

# Vim/etc/redhat-release

Change CentOS release 6.5 (Final) to redhat 4.

6. Create an oracle installation folder and a data storage directory

Mkdir-p/u01/app/oracle

6.1 modify the user and group of the/u01/app/oracle directory to the oracle and oinstall groups.

View users and groups in the current oracle Directory: ls-la | grep oracle

Modify oracle directory users and groups:

Chown-R oracle: oinstall/u01/app/oracle

6.2 modify the directory permissions of/u01/app/oracle to enable the oinstall group to read and write the/u01/app/oracle directory.

Run the following command:

Chmod-R 775/u01/app/oracle

7. Configure oracle user environment variables

Open cd/home/oracle and use Vi to edit. bash_profile. For example:

Modify and add the following content:

Export TMP =/tmp;

Export TMPDIR = $ TMP;

Export ORACLE_BASE =/u01/app/oracle;

Export ORACLE_HOME = $ ORACLE_BASE/product/10.2.0/db_1;

Export ORACLE_SID = orcl;

Export ORACLE_TERM = xterm;

Export PATH =/usr/sbin: $ PATH;

Export PATH = $ ORACLE_HOME/bin: $ PATH;

Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/lib;

Export CLASSPATH = $ ORACLE_HOME/JRE: $ ORACLE_HOME/jlib: $ ORACLE_HOME/rdbms/jlib;

Save and run the following command to make the settings take effect:

Source/home/oracle/. bash_profile

8. Install and set Oracle

8.1 decompress the Installation File

Save the downloaded package to the/uo1/app/oracle folder where oracle is to be installed:

Decompress the file and run the following command:

# Gunzip 10201_database_linux_x86_64.cpio.gz

# Cpio-idmv <10201_database_linux_x86_64.cpio

After decompression, the database folder is displayed in the same folder.

Currently, the owner and user group of the database folder are root. Now we need to update it:

# Chown-R oracle: oinstall/u01/app/oracle/database

8.2 install the oracle database

After extracting the oracle installation package, we need to log out of the root user, log on to the Oracle user, and then use the user to install oracle.

On the terminal, go to the/u01/app/oracle/database directory:

Prepare to install the database. If your centos is a Chinese environment, Chinese characters may be garbled during installation. Run the following command. Temporarily enable the system to be in English:

Export LC_ALL = en_US.UTF-8

Then run the following command to install it:

./RunInstaller

 

This interface is displayed, and the installation is successful.

If we have no other requirements, we can install the software step by step as instructed by the software.

However, if you use it, suddenly one day you will find out. When you import databases (including Chinese characters) from other servers to the oracle database, garbled characters are displayed, you will cry.

As prompted, the oracle database character set to be installed is the English character set rather than the Chinese character set.

Some may also say that I can install the oracle database and then modify the Chinese character set. Haha, I will smile. In the end, you will find that even if you modify the character set of the database through SQL statements, the Chinese characters in the database are still garbled!

But you will also find that in windows, you can use SQL statements to modify character sets!

In Linux, we only need to select Advanced installation, such:

Note: Modify the storage directory.

Is the directory where the certificate is stored.

Select the database type to be installed and the language supported by oracle. Here, select Enterprise Edition. The language is English and simplified Chinese.

Specify the oracle environment variables and installation path. Because we have already declared it in. bash_profile, it will be automatically filled here.

Oracle began to check before installation.

Check to find one warning and one requirement. view the log to find

---- Warning

Expectedresult: 2214 MB

ActualResult: 0 MB

Checkcomplete. The overall result of this check is: Failed <

Problem: The system does not have the required swap space.

Recommendation: Make more swap space available to perform the install.

Based on the current disk size, it is found that the root directory (24 GB) has sufficient disk space,

# Create a swap partition folder in the root directory to open up swap Areas

[Root @ CentOS6oracle] # cd/

[Root @ CentOS6/] # mkdir swapimage

[Root @ CentOS6/] # cd/swapimage

# Use the dd command to add a 2 GB file under the/swapimage File

[Root @ CentOS6swapimage] # dd if =/dev/zero of =/swapimage/swap bs = 1024 count = 2500000

2500000 + 0 records in

2500000 + 0 records out

2560000000 bytes (2.6 GB) copied, 77.0965 s, 33.2 MB/s

# Check the disk space. You can find that 2.6 GB is missing in the root directory.

[Root @ CentOS6swapimage] # df-hl

Filesystem Size Used Avail Use % Mounted on

/Dev/sda3 30G 7.0G 22G 25%/

Tmpfs 740 M 80 K 740 M 1%/dev/shm

/Dev/sda1 194 M 25 M 160 M 14%/boot

/Dev/sda2 20G 1.5G 17G 8%/u01

# Use mkswap to format/swapimage/swap files into virtual memory files

[Root @ CentOS6swapimage] # mkswap/swapimage/swap

Mkswap:/swapimage/swap: warning: don't erase bootbits sectors

On whole disk. Use-f to force.

Setting upswapspace version 1, size = 2499996 KiB

No label, UUID = ec52720f-bc50-4e56-9dbf-05cbcd56c583

# Vi/etc/fstab -- Add the following line and load it automatically after the system starts.

Add:

/Swapimage/swap defaults 0 0

[Root @ CentOS6swapimage] # free-m

Total used free shared buffers cached

Mem: 1478 1443 34 0 13 820

-/+ Buffers/cache: 609 868

Swap: 0 0 0

# Enable swap Addition

[Root @ CentOS6swapimage] # swapon/swapimage/swap

[Root @ CentOS6swapimage] # free-m

Total used free shared buffers cached

Mem: 1478 1445 32 0 13 820

-/+ Buffers/cache: 611 866

Swap: 2441 0 2441

---- Requirement

CheckingNetwork Configuration requirements...

Checkcomplete. The overall result of this check is: Not executed <

Recommendation: Oracle supports installations on systems with DHCP-assigned public IP addresses. however, the primary network interface on thesystem shocould be configured with a static IP address in order for the OracleSoftware to function properly. see theInstallation Guide

Solution:

[Root @ CentOS6swapimage] # cat/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE = eth0

ONBOOT = yes

BOOTPROTO = dhcp

# IPADDR = 192.168.18.8

# NETMASK = 255.255.255.0

# GATEWAY = 192.168.18.1

Modify/etc/sysconfig/network-scripts/ifcfg-eth0

[Root @ CentOS6swapimage] # vi/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE = eth0

ONBOOT = yes

BOOTPROTO = static

IPADDR = 192.168.150.128

NETMASK = 255.255.255.0

GATEWAY = 192.168.150.1

~

"/Etc/sysconfig/network-scripts/ifcfg-eth0" 7L, Objective C written

Enable Nic settings to take effect immediately:

[Root @ CentOS6swapimage] #/etc/init. d/network restart

Shuttingdown interface eth0: Device state: 3 (disconnected)

[OK]

Shuttingdown loopback interface: [OK]

Bringing uploopback interface: [OK]

Bringing upinterface eth0: Active connection state: activated

Activeconnection path:/org/freedesktop/NetworkManager/ActiveConnection/2

[OK]

[Root @ CentOS6 ~] # Vi/etc/hosts

#127.0.0.1 localhost CentOS6.5-32 localhost4localhost4. localdomain4 Note: Comment out this

192.168.150.128CentOS6.5-32

Click "Retry" after the OK configuration is complete "!

Select Configuration options. There are three options: Create a database, Configure Automatic Storage Management, and only install data software.

Select the first item here to create a database. After creating a database, we do not have to execute "dbca" to create a database.

Select the created database mode. Here we select the first general purpose. Because there are a lot of SGA behind "Advanced", you can set the file system on your own.

Specifies the default SID of the oracle database. The specified character set is the character set used by the Library, and the Chinese character is simplified Chinesezhs16gbk. If the character set is incorrect, it may cause garbled data in the future. Create databasewithsample schemas (an existing mode for database creation) is not required ).

Configure and select database management options


Configure the data file storage location of the database

Configure Database Backup recovery options

Configure database-related user passwords

The installation overview is displayed, and the related configuration is confirmed again.


Start Database Installation

Start a new terminal, su to root. Execute the two required scripts in sequence.

/U01/app/oracle/oraInventory/orainstRoot. sh

/U01/app/oracle/product/10.2.0/db_1/root. sh

The oracle database has been installed.

View the database status:

SQL> select instance_name, status fromv $ instance;

INSTANCE_NAME STATUS

Orcl OPEN

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.