Home Database Mysql Tutorial CentOS 5.6安装Oracle 10.2.0.1.0

CentOS 5.6安装Oracle 10.2.0.1.0

Jun 07, 2016 pm 05:08 PM

心理准备: 1. 当我第一次在Linux上安装Oracle的时候,我感觉好麻烦,结果第一次没装到一半就放弃了,因为习惯了Window的界面下

心理准备:

1.   当我第一次在Linux上安装Oracle的时候,我感觉好麻烦,结果第一次没装到一半就放弃了,因为习惯了Window的界面下一步,现在想想其实挺简单的,耐心点做完就好了。

2.   软件的下载,百度一下就有,我就不重复了。

3.   Linux的机子在自己练习的时候,都是虚拟机,操作系统,RedHat,CentOS,随便。


装前准备:
软件:oracle 10.2 for linux edition(32bit)
硬件:
        内存:    最小512M(命令:grep MemTotal /proc/meminfo)
        Swap内存:两倍内存(1G)(命令:grep SwapTotal /proc/meminfo)
        硬盘空间:/tmp目录400M空间(命令:df -k /tmp),安装目录1.5G至3.5G,取决于版本(命令:df –k)。
        操作系统:Red Hat Enterprise Linux AS/ES 3.0 (Update 4 or later),Red Hat Linux 4.0,SUSE Linux Enterprise Server 9.0 with SP 2 or later,Asianux 1.0,Asianux 2.0(命令:cat /etc/issue)
        确定内核最低版本:
Red Hat Enterprise Linux 3.0 and Asianux 1.0:2.4.21-27.EL
Red Hat Enterprise Linux 4.0 and Asianux 2.0:2.6.9-5.EL
SUSE Linux Enterprise Server 9.0:2.6.5-7.201
(命令:# uname –r)

  必装的软件安装包:

Red Hat Enterprise Linux 3.0 and Asianux 1.0:
make-3.79.1
gcc-3.2.3-34
glibc-2.3.2-95.20
compat-db-4.0.14-5
compat-gcc-7.3-2.96.128
compat-gcc-c++-7.3-2.96.128
compat-libstdc++-7.3-2.96.128
compat-libstdc++-devel-7.3-2.96.128
openmotif21-2.1.30-8
setarch-1.3-1


Red Hat Enterprise Linux 4.0 and Asianux 2.0:
binutils-2.15.92.0.2-13.EL4
compat-db-4.1.25-9
compat-libstdc++-296-2.96-132.7.2
control-center-2.8.0-12
gcc-3.4.3-22.1.EL4
gcc-c++-3.4.3-22.1.EL44
glibc-2.3.4-2.9
glibc-common-2.3.4-2.9
gnome-libs-1.4.1.2.90-44.1(光盘中没有找到,没装没发现有影响)
libstdc++-3.4.3-22.1
libstdc++-devel-3.4.3-22.1
make-3.80-5
pdksh-5.2.14-30
sysstat-5.0.5-1
xscreensaver-4.18-5.rhel4.2(光盘中没有找到,没装没发现有影响)
setarch-1.6-1


SUSE Linux Enterprise Server 9:
binutils-2.15.90.0.1.1-32.5
gcc-3.3.3-43.24
gcc-c++-3.3.3-43.24
glibc-2.3.3-98.28
gnome-libs-1.4.1.7-671.1
libstdc++-3.3.3-43.24
libstdc++-devel-3.3.3-43.24
make-3.80-184.1
pdksh-5.2.14-780.1
sysstat-5.0.1-35.1
xscreensaver-4.16-2.6

可以使用以下命令检查:
       rpm -q package_name
      注意这里的package_name不带任何版本号,例如检查make-3.79
     rpm -q make
      如果以上软件没有安装,请安装. 启动xwindow,打开 应用程序/系统设置/添加删除程序
如果没有,运行包安装就好了
       命令:rpm -ivh libaio-0.3.102-1.i386.rpm


安装过程:
1.建立用户与组。
需要的用户是oracle,组是dba,oinstall
首先查看oraInst.loc文件是否存在,这个是oracle创建时产生。
查看命令:# more /etc/oraInst.loc
如果有列出,则说明已经存在,如:
inventory_loc=/u01/app/oracle
inst_group=oinstall
如果路径设置不正确,可以修改相关路径信息。
如果不存在,则使用以下命令:
# /usr/sbin/groupadd oinstall
# /usr/sbin/groupadd dba
查看oracle用户是否存在,
命令:# id oracle,如果存在,出现类似内容:
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba)
存在,但是不属于额定的两个群组,可以使用修改,,命令如下:
# /usr/sbin/usermod -g oinstall -G dba[,oper] oracle
(-g 是主组,-G是副组,一个用户可以属于不同的组)
如果不存在,创建命令如下:
命令:# /usr/sbin/useradd -g oinstall -G dba oracle
# passwd oracle


2.配置内核参数
可以通过命令查看相关的内核参数,如:# /sbin/sysctl -a | grep sem查看sem的相关参数,并可以修改。如果需要大量参数设置,可以直接修改参数文件,用文本方式打开/etc/sysctl.conf文件,把以下参数复制进去,保存退出。(参数仅供参考)
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
如果系统的参数设置的比上述参数值小,则编辑 /etc/sysctl.conf 文件,添加或更改这些参数。完成后,运行以下命令激活更改:
/sbin/sysctl -p


为了提供性能,需对内核的相关参数进行限制,在文件/etc/security/limits.conf中添加以下内容:
oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536

在文件/etc/pam.d/login添加以下内容:
session    required     /lib/security/pam_limits.so
session    required     pam_limits.so
如果是Bourne, Bash, or Korn shell,修改/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
    如果是c shell,则环境变量文件 /etc/csh.login的修改值如下:
    if ( $USER == "oracle" ) then
          limit maxproc 16384
          limit descriptors 65536
    endif


3.创建目录:
以base 目录:使用命令查看是否存在:
# more /var/opt/oracle/oraInst.loc,如果有以下类似内容出现,则说明存在。
inventory_loc=/u01/app/oracle/oraInventory
inst_group=oinstall
如果不存在,使用以下命令创建(软件存放目录):
mkdir -p /u01/oracle
      chown -R oracle:oinstall /u01/oracle
      chmod -R 755 /u01/oracle
(chown是设定目录所属的用户组和用户)
(chmod设定目录的读写权限)
Oracle数据库文件存放目录. 这个可以没有的. 一般设置为/u02/oradata
      mkdir -p /u02/oradata
      chown -R oracle:oinstall /u02/oradata
      chmod -R 755 /u02/oradata
创建相关数据恢复文件目录等
Asm目录组的创建


4.环境变量设置
查看shell类型,命令:#echo $SHELL
切换到oracle用户中,#su - oracle
打开参数文件:vi .bash_profile,删除ORACLE_SID, ORACLE_HOME, or ORACLE_BASE三个设定的内容(避免冲突)。
设定display,命令:$ DISPLAY=local_host:0.0 ; export DISPLAY
local_host:主机名或者ip地址
设定环境变量命令:
$ ORACLE_BASE=/u01/oracle
$ ORACLE_SID=orcl
$ export ORACLE_BASE ORACLE_SID
或者在文件里添加,命令如下:
$su oracle
$vi ~/.bash_profile
修改以下是配置文件的内容
export ORACLE_BASE=/u01
export ORACLE_HOME=/u01/oracle
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$PATH
ESC(退出vi的编辑环境)
:wq(退出vi应用程序并保存修改)
(注:base目录是oracle公司的基础目录,oracle是数据库产品的目录)
确认ORACLE_HOME and TNS_ADMIN 的环境变量不被用户设置
   千万不要因为安装过程中的其他错误,而设置这些值
   Bash shell:
    unset ORACLE_HOME
    unset TNS_ADMIN
 c shell:
  unsetenv ORACLE_HOME
   unsetenv TNS_ADMIN


5.其他设置:
#export TNS_ADMIN=$ORACLE_HOME/network/admin
#export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
#export LANG=AMERICAN_AMERICA.ZHS16GBK
查询相关设定是否正确,可以使用命令以下命令核对:
$ umask
$ env | more

linux

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Reduce the use of MySQL memory in Docker Reduce the use of MySQL memory in Docker Mar 04, 2025 pm 03:52 PM

This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

How to solve the problem of mysql cannot open shared library How to solve the problem of mysql cannot open shared library Mar 04, 2025 pm 04:01 PM

This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

How do you alter a table in MySQL using the ALTER TABLE statement? How do you alter a table in MySQL using the ALTER TABLE statement? Mar 19, 2025 pm 03:51 PM

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Run MySQl in Linux (with/without podman container with phpmyadmin) Run MySQl in Linux (with/without podman container with phpmyadmin) Mar 04, 2025 pm 03:54 PM

This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

What is SQLite? Comprehensive overview What is SQLite? Comprehensive overview Mar 04, 2025 pm 03:55 PM

This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

Running multiple MySQL versions on MacOS: A step-by-step guide Running multiple MySQL versions on MacOS: A step-by-step guide Mar 04, 2025 pm 03:49 PM

This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

How do I configure SSL/TLS encryption for MySQL connections? How do I configure SSL/TLS encryption for MySQL connections? Mar 18, 2025 pm 12:01 PM

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? Mar 21, 2025 pm 06:28 PM

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

See all articles