Home Database Mysql Tutorial Redhat Enterprise Linux 5.6下安装Oracle 10g

Redhat Enterprise Linux 5.6下安装Oracle 10g

Jun 07, 2016 pm 05:04 PM

注:所用Oracle版本为10g,所用Linux版本为RedHat Enterprise Linux 5.61、 检查系统是否已经安装了oracle需要的文件包rpm -q gc

注:所用Oracle版本为10g,所用Linux版本为RedHat Enterprise Linux 5.6

1、  检查系统是否已经安装了oracle需要的文件包

rpm -q gcc make binutils openmotif setarch compat-db compat-gcc compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel libXp

由于缺失的包之间有严格的依赖关系,所以必须按照如下顺序安装缺失的包
rpm -Uvh compat-db-4*
rpm -Uvh libaio-0*
rpm -Uvh compat-libstdc++-33-3*
rpm -Uvh glibc-headers-2.5-12.i386.rpm
rpm -Uvh glibc-devel-2.5-12.i386.rpm
rpm -Uvh compat-gcc-34-3*
rpm -Uvh compat-gcc-34-c++-3*
rpm -Uvh libXp-1*
rpm -Uvh openmotif-2*
rpm -Uvh gcc-4*
rpm -Uvh glibc-2.5-12.i686.rpm
rpm -Uvh libgomp-4.1.1-52.el5.i386.rpm
rpm -Uvh gcc-4.1.1-52.el5.i386.rpm
安装完成后仍然提示部分包没有安装,,不过不影响使用
package compat-gcc is not installed
package compat-gcc-c++ is not installed
package compat-libstdc++ is not installed
package compat-libstdc++-devel is not installed

2、  增加Oracle安装和使用的用户
(1) 新增组和用户
groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba oracle
passwd oracle
(2) 创建Oracle的安装目录,并把权限付给oracle用户,其实创建用户后就已经有该文件了
mkdir -p /home/oracle/  (以递归的方式创建文件夹)
chown -R oracle:oinstall /home/oracle
chmod -R 775 /home/oracle

3、  修改配置文件
(1) /etc/sysctl.conf  行末添加以下内容,已有的修改
kernel.shmmni = 4096
# semaphors: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144


运行下面的命令使得内核参数生效
/sbin/sysctl -p

(2) /etc/security/limits.conf  行末添加以下内容
#use for oracle
#* soft nproc 2047
#* hard nproc 16384
#* soft nofile 1024
#* hard nofile 65536

(3) /etc/pam.d/login  行末添加以下内容
session required pam_limits.so

(4) /etc/selinux/config
更改 SELINUX=disabled 关闭防火墙,必须的

(5) bash_profile 在创建用户后在用户的目录下有一个.bash_profile(使用Oracle用户)
并在文件中增加如下内容
(ORACLE_BASE是最重要的,他代表Oracle的安装路径)
(在安装时就可以创建数据库,如果安装完毕重启,则再启动监听时无法启动,则要注意ORACLE_HOME在数据库安装后要根据实际路径进行修改)

ORACLE_BASE=/home/oracle/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
ORACLE_SID=orcl
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH

 

还有一个参数:NLS_LANG 为数据库的字符集,为了保证数据库能够输入输出用户所在地区的正确的语言文字(如简体中文),需要在这里把字符集设为american_america.ZHS16GB  K,其中american_america为英文字符集,ZHS16GBK为中文字符集。

注意很多安装Oracle失败的情况都是因为环境变量没有配置正确,环境变量的配置直接影响到以后Oracle10g的安装和配置,在配置的时候要尤为小心!  

(6) 修改hosts文件
编辑 /etc/hosts。文件应当包含类似以下的文本:
127.0.0.1      localhost.localdomain    localhost  (将此注销)
192.168.203.11 stctestbox01.us.oracle.com stctestbox01(填写此处的IP)

更改修改/etc/redhat-release文件,因为Oracle10g数据库暂不支持RHEL5:
# vi /etc/redhat-release
# Red Hat Enterprise Linux Server release 5.6 (Tikanga)
redhat-4

安装完后改回来。

4、  切换到root权限,安装oracle

 

设置DISPLAY变量

DISPLAY变量,这个变量用于告诉系统屏幕的图  形将输出到什么位置,默认情况下是本机(export DISPLAY=:0.0);如果使用虚拟x-windows进行安装,则在这里指  明远程终端的显示情况,比如远程终端的IP地址是100.100.100.149,则DISPLAY的变量应  设为“100.100.100.149:0”后面的“:0”表示该终端的第一个显示器。 

 

xhost + (启用x-window)

xhost控制什么人可以访问当前主机上的增强 X-Windows。

xhost + 是使所有用户都能访问Xserver.

xhost + ip使ip上的用户能够访问Xserver.

xhost + nis:user@domain使domain上的nis用户user能够访问

xhost + inet:user@domain使domain上的inet用户能够访问

xhost 命令添加或删除 X 服务器接受连接的机器列表上的主机名。

 

解压(使用Oracle用户)
unzip 10201_database_linux32.zip -d /tmp/oracle


改权限
chown oracle /tmp/oracle
chmod -R  755 /tmp/oracle
su -oracle
到根目录下:./runInstaller
(如果安装时不创建数据库,可以在Oracle_HOME/bin 下运行 dbca 来创建和管理数据库)

注意:在安装包时请一条一条的执行命令。我发现在直接执行全部命令后中间的某条命令 会报错,说有依赖关系。这个时候你可以在安装包时加参数 --nodeps 就可以了。

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 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)

Explain InnoDB Full-Text Search capabilities. Explain InnoDB Full-Text Search capabilities. Apr 02, 2025 pm 06:09 PM

InnoDB's full-text search capabilities are very powerful, which can significantly improve database query efficiency and ability to process large amounts of text data. 1) InnoDB implements full-text search through inverted indexing, supporting basic and advanced search queries. 2) Use MATCH and AGAINST keywords to search, support Boolean mode and phrase search. 3) Optimization methods include using word segmentation technology, periodic rebuilding of indexes and adjusting cache size to improve performance and accuracy.

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.

When might a full table scan be faster than using an index in MySQL? When might a full table scan be faster than using an index in MySQL? Apr 09, 2025 am 12:05 AM

Full table scanning may be faster in MySQL than using indexes. Specific cases include: 1) the data volume is small; 2) when the query returns a large amount of data; 3) when the index column is not highly selective; 4) when the complex query. By analyzing query plans, optimizing indexes, avoiding over-index and regularly maintaining tables, you can make the best choices in practical applications.

Can I install mysql on Windows 7 Can I install mysql on Windows 7 Apr 08, 2025 pm 03:21 PM

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

Difference between clustered index and non-clustered index (secondary index) in InnoDB. Difference between clustered index and non-clustered index (secondary index) in InnoDB. Apr 02, 2025 pm 06:25 PM

The difference between clustered index and non-clustered index is: 1. Clustered index stores data rows in the index structure, which is suitable for querying by primary key and range. 2. The non-clustered index stores index key values ​​and pointers to data rows, and is suitable for non-primary key column queries.

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]

How do you handle large datasets in MySQL? How do you handle large datasets in MySQL? Mar 21, 2025 pm 12:15 PM

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

How do you drop a table in MySQL using the DROP TABLE statement? How do you drop a table in MySQL using the DROP TABLE statement? Mar 19, 2025 pm 03:52 PM

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

See all articles