Disclaimer: The system commands described in this article are "#", which indicates the root permission, and "$" indicates the Oracle permission.
1. Install the system
First install the Linux system. According to the recommendations in the official Oracle documentation, when the machine memory is smaller than 1 GB, the swap partition size should be set to twice the memory size, if the memory is larger than 2 GB, the swap partition is set to the same size as the memory.
In fact, the swap partition size setting in Linux is very exquisite. If any reader is interested, refer to my other article, "How to reasonably set the swap partition size in Linux".
During system installation, you must install all Development Kits. We recommend that you do not install SELinux or prohibit SELinux from running in the system after installation. Otherwise, some inexplicable problems may occur.
To prevent garbled characters during Oracle Installation, we recommend that you use English as the system language to install Oracle.
2. system preparation before Oracle Installation
1. Check the required software package
You can use the rpm-qa | grep Software Package keyword command to perform the check. Generally, You need to manually install the following software package:
From RedHat AS5 Disk 1 (32 Bit)
# Rpm-uv h setarch-2 *
# Rpm-Uvh make-3 *
# Rpm-uv h glibc-2 *
# Rpm-uv h libaio-0 *
From RedHat AS5 Disk 2 (32 Bit)
# Rpm-Uvh compat-libstdc-33-3 *
# Rpm-uv h compat-gcc-34-3 *
# Rpm-uv h compat-gcc-34-c-3 *
# Rpm-uv h gcc-4 *
# Rpm-uv h libXp-1 *
From RedHat AS5 Disk 3 (32 Bit)
# Rpm-uv h openmotif-2 *
# Rpm-uv h compat-db-4 *
If you use a DVD to install media, it is very convenient.
2. Modify the Linux release version
Since RedHat Enterprise Linux 5 was not released when Oracle 10 Gb was released, Oracle 10 Gb did not confirm support for RedHat Enterprise Linux 5, we have two ways to make Oracle 10 Gb support for RedHat Enterprise Linux 5.
Method 1:
We need to manually modify the Linux release notes so that Oracle 10 Gb supports RedHat Enterprise Linux 5.
Edit the/etc/redhat-release file
# Vi/etc/redhat-release
Change Red Hat Enterprise Linux Server release 5 (Tikanga) to Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
Method 2:
In addition, the article said that modifying the content of the install/oraparam. ini file in the Oracle installation package can also enable Oracle 10 Gb to support RedHat Enterprise Linux 5. The modification method is as follows:
# Vi install/oraparam. ini
Add redhat-5 in the Certified Versions Section
# [Certified Versions]
Linux = redhat-3, SUSE-9, redhat-4, redhat-5, UnitedLinux-1.0, asianux-1]
Add more
Linux-redhat-5.0-optional
TEMP_SPACE = 80
SWAP_SPACE = 150
MIN_DISPLAY_COLORS = 256
After my tests, I found that method 2 can pass the system detection process before installation, but the system support detection fails during installation. I don't know if I have set a problem, hope you can give me some tips.
3. Modify system kernel parameters
# Vi/etc/sysctl. conf
Kernel. shmall = 2097152 // This parameter indicates the total amount of shared memory that the system can use at one time (in page ). The default value is 2097152. You do not need to modify kernel. shmmax = 2147483648 // This parameter 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 // This kernel Parameter is used to set the maximum number of shared memory segments within the system range. The default value of this parameter is 4096. Usually no need to change
Kernel. sem = 250 32000 100 128 // indicates the set semaphore
Fs. file-max = 65536 // indicates the maximum number of file handles. File handle setting indicates the number of files that can be opened in linux
Net. ipv4.ip _ local_port_range = 1024 65000
Net. core. rmem_default = 262144 // default Receiving Window Size
Net. core. rmem_max = 262144 // 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
After modifying the kernel parameters, run the following command to make the new settings take effect.
#/Sbin/sysctl-p
4. Create Oracle users, groups, and installation Directories
Here I will only discuss the single-host environment, regardless of the configuration of the RAC environment. In the future, I will write a special article on how to configure the Oracle RAC environment.
(1) Create an Oracle user group
# Groupadd oinstall
# Groupadd dba
(2) create an Oracle user
# Useradd-m-g oinstall-G dba oracle
(3) set the Oracle user password
# Passwd oracle
(4) Create an Oracle installation directory and a data storage directory
# Mkdir-p/DBSoftware/app/oracle
# Mkdir-p/DBData/oradata
(5) modify directory permissions
# Chown-R oracle: oinstall/DBSoftware/app/oracle // DBData/oradata/
# Chmod-R 755/DBSoftware/app/oracle // DBData/oradata/
5. Add the following content to/etc/security/limits. conf.
# Vi/etc/security/limits. conf
Oracle soft nproc 2047
Hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536
6. Add the following content to/etc/pam. d/login.
# Vi/etc/pam. d/login
Session required/lib/security/pam_limits.so
Session required pam_limits.so
7. Add the following content to/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
8. configure a Linux host
Check whether the localhost record (pointing to 127.0.0.1) exists in the/etc/hosts file. If it does not exist, some problems may occur when configuring the Oracle listener later, resulting in failure to start the listener, manually add this record here.
9. Configure oracle user environment variables
# Su-oracle
$ Vi ~ /. Bash_profile
Add the following content:
Export ORACLE_BASE =/DBSoftware/app/oracle // The Oracle installation folder created above
Export ORACLE_SID = orcl
Export ORACLE_HOME = $ ORACLE_BASE/product/10.2.0/db_1
Export PATH = $ PATH: $ ORACLE_HOME/bin
Export LD_LIBARY_PATH = $ ORACLE_HOME/lib
Export PATH
Umask 022
Save and run the following command to make the settings take effect:
$ Source ~ /. Bash_profile
3. install and configure Oracle
1. decompress the Installation File
The Oracle Installation Package has the following formats:
(1) zip
It is best to decompress this format by directly using the unzip command file name.
(2) cpio.gz
There are several decompression methods for this format
A. # zcat XXXX.cpio.gz | cpio-idmv
B. # gunzip XXXX.cpio.gz decompress the XXXX. cpio file and then # cpio-idvm & lt; XXXX. cpio
After decompression, set the oracle account to operate on the directory where the installation file is located
Chown-R oracle: directory of the oinstall Installation File
2. Use the oracle account to enter the directory where the installation file is located. Run the following command to view the installation interface:
$./RunInstaller
If you cannot see the installation interface, run the following command in the root account before running the installation program:
# Export DISPLAY =: 0.0
# Xhost +
$./RunInstaller
After the installation interface appears, follow the prompts to make relevant settings. I recommend that you do not create a database during the installation process and only install the program, listen to and create a database, and perform related operations after installation.
During installation, you must use the root permission to execute two scripts.
3. After the installation is complete, modify the content in the/etc/redhat-release file back to Red Hat Enterprise Linux Server release 5 (Tikanga)
4. Create listeners and databases
(1) create a listener
Use the net configuration assistant provided by Oracle to create a TNS Listener
$ Netca
Basically, you can continue to run Next. Of course, you can also modify the TNS listening port number during this period.
After creating a TNS Listener, run the following command to check the listener:
# Netstat-atln check whether the listening port is enabled
$ Lsnrctl status check the TNS listening status
After the listener has been successfully started, you can execute Database Configure Assistant to create a Database. Run the following command:
$ Dbca
During database creation, we recommend that you set the character set of the database to a Unicode UTF-8 to prevent garbled characters.