I am an absolute newbie for Linux, but today I have a job to set up automatic data backup for an Oracle server installed on Linux. This is probably only one job, only one thing, will certainly be forgotten after a long time, so the entire installation and configuration process is recorded for the next time you need to refer.
I installed Linux on Vmware. I installed it about a month ago. I didn't remember it at the time. Now I forget how it was installed.
Oracle can be downloaded from its official website. I downloaded Oracle 11g (11.2.0.1.0) for Linux x86 at http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-linuxsoft-085393.html. There are two files, respectively linux_11gr2_database_1of2.zipand linux_11gr2_database5of2.zip.
After downloading the file, upload it to Linux. I use the SSH Secure File Transfer to transfer it.
1. Before installing Oracle, you need to install some necessary. I'm referring to http://www.liusuping.com/ubuntu-linux/redhat-linux-oracle-11g-r2.html.
Some of the prerequisites may have been installed before, so before installation, use rpm-Qa | grep XXX to check whether the installation is complete. For example, to install elfutils-libelf-devel, run the following command:
- [Root @ localhost server] # rpm-Qa | grep elfutils-libelf-devel
If you have already installed the tool, the following message is displayed:
- [Root @ localhost server] # rpm-Qa | grep elfutils-libelf-devel
- Elfutils-libelf-devel-Static-0.125-3. EL5
- Elfutils-libelf-devel-0.125-3.el5
We can see that we do not need to write the full name of the package after grep.
If it is not installed, there is no prompt. Run the following command to install it.
- [root @ localhost server] # rpm-IVH elfutils-libelf-devel *
- warning: elfutils-libelf-devel-0.125-3.el5.i386.rpm: Header V3 DSA Signature: nokey, key ID 37017186
- preparing... ######################################## ### [1, 100%]
- 1: elfutils-libelf-devel-s ################################# ######### [50%]
- 2: elfutils-libelf-devel ################################### ######## [1, 100%]
- [root @ localhost server] # rpm-Qa | grep elfutils-libelf-devel
- elfutils-libelf-devel--0.125-3. EL5
- elfutils-libelf-devel-0.125-3.el5
This * is a wildcard, that is, we do not need to write it completely, it will find it by itself. However, you must put the Linux installation CD in wmware and then CD it to the media/CD name/Server Directory to find the package.
The package to be installed is as follows:
-
- Binutils-2.17.50.0.6
-
- Compat-libstdc ++-33-3.2.3
-
- Elfutils-libelf-0.125
-
- Elfutils-libelf-devel-0.125
-
- Elfutils-libelf-devel-Static-0.125
-
- Gcc-4.1.2
-
- Gcc-C ++-4.1.2
-
- Glibc-2.5-24
-
- Glibc-common-2.5
-
- Glibc-devel-2.5
- Glibc-headers-2.5
-
- Kernel-headers-2.6.18
-
- Ksh-20060214
-
- Libaio-0.3.106
-
- Libaio-devel-0.3.106?
-
- Libgcc-4.1.2
-
- Libgomp-4.1.2
-
- Libstdc ++-4.1.2?
-
- Libstdc +-devel-4.1.2
-
- Make-3.81
-
- Sysstat-7.0.2
-
- UnixODBC-2.2.11
- UnixODBC-devel-2.2.11
I'm in anotherArticleSee these packages are a little different, some articles will be a few more, some will be a little less. At the moment, we don't have to worry about what we need.
Since I want to install Oracle 11g and rhel5, I don't need to change the system version when installing 10 in some articles.
2. Create a user
- #/Usr/sbin/groupadd oinstall
- #/Usr/sbin/groupadd DBA
- #/Usr/sbin/useradd-G oinstall-g dba Oracle
- # Passwd Oracle
When the last command is run, a prompt is displayed. Let's enter the password of the Oracle user.
3. Modify system parameters
Run the VI command to modify/etc/sysctl. conf and add the following parameters:
- 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 = 1048586
Run the VI command to modify/etc/security/limits. confi and add the following parameters:
- Oracle soft nproc 2047
- Hard nproc 16384
- Oracle soft nofile 1024
- Oracle hard nofile 65536
Modify/etc/PAM. d/login and add:
- Session required pam_limits.so
Modify/etc/profile and add:
-
- If[$ User ="Oracle"]; Then
-
- If[$ Shell ="/Bin/KSh"]; Then
- Ulimit-P 16384
-
- Ulimit-N 65536
-
- Else
-
- Ulimit-u 16384-N 65536
-
- Fi
-
- Fi
Installation Directory Configuration:
- # Mkdir-P/u01/
- # Chown-r ORACLE: oinstall/u01/
- # Chmod-r 775/u01/
Then run the su Oracle command to switch to the Oracle user, and then modify the user variable. bash_profile file:
- [Oracle @ localhost ~] $ VI. bash_profile
Add the following content:
- Export oracle_base =/u01/APP
- Export ORACLE_HOME = $ oracle_base/Oracle
- Export oracle_sid = liusuping
- Export Path = $ ORACLE_HOME/bin: $ path: $ home/bin
Log out of the root account, log on to Oracle, and start the graphical interface.
Go to the folder where the two zip packages of Oracle are downloaded. My directory is/usr/tools/oracle. Decompress these two zip packages, for example:
Decompress both packages, uncompress them to the same directory, and then run./runinstaller. After a while, the Oracle Installation Wizard is displayed, for example:
However, there seems to be some problems with the display of this wizard. The following "Next" button cannot be clicked. It should be about resolution. Just install a VMware tool.
It is not easy to install VMware tool. It will not be written here.
After wmware tool is installed and Linux is restarted, the resolution can be adjusted. After the adjustment, the Oracle Installation interface will not flash. But installProgramWhen checking the system, the system reports an error of insufficient memory and swap space. Memory shortage is a good solution. Just add some memory, but to increase the swap space, you need Linux commands.
Refer to http://lanlfeng.blog.51cto.com/337014/123130. execute the following command as follows:
- DdIf=/Dev/Zero of =/opt/image/swap BS = 1024 COUNT = 2048000
- Mkswap/opt/image/swap
- Swapon/opt/image/swap
Run the free-M command to check whether the existing swap zone has become larger.
- [Root @ localhost ~] # Free-m
- Total used free shared buffers cached
- Mem: 1434 1140 293 0 43 848
- -/+ Buffers/cache: 247 1186
- Swap: 3983 0 3983
Then re-run the Oracle Installation program and check that: