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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

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)

Hot Topics

Java Tutorial
1662
14
PHP Tutorial
1262
29
C# Tutorial
1234
24
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.

Can mysql and mariadb coexist Can mysql and mariadb coexist Apr 08, 2025 pm 02:27 PM

MySQL and MariaDB can coexist, but need to be configured with caution. The key is to allocate different port numbers and data directories to each database, and adjust parameters such as memory allocation and cache size. Connection pooling, application configuration, and version differences also need to be considered and need to be carefully tested and planned to avoid pitfalls. Running two databases simultaneously can cause performance problems in situations where resources are limited.

MySQL: Simple Concepts for Easy Learning MySQL: Simple Concepts for Easy Learning Apr 10, 2025 am 09:29 AM

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

Laravel Eloquent ORM in Bangla partial model search) Laravel Eloquent ORM in Bangla partial model search) Apr 08, 2025 pm 02:06 PM

LaravelEloquent Model Retrieval: Easily obtaining database data EloquentORM provides a concise and easy-to-understand way to operate the database. This article will introduce various Eloquent model search techniques in detail to help you obtain data from the database efficiently. 1. Get all records. Use the all() method to get all records in the database table: useApp\Models\Post;$posts=Post::all(); This will return a collection. You can access data using foreach loop or other collection methods: foreach($postsas$post){echo$post->

RDS MySQL integration with Redshift zero ETL RDS MySQL integration with Redshift zero ETL Apr 08, 2025 pm 07:06 PM

Data Integration Simplification: AmazonRDSMySQL and Redshift's zero ETL integration Efficient data integration is at the heart of a data-driven organization. Traditional ETL (extract, convert, load) processes are complex and time-consuming, especially when integrating databases (such as AmazonRDSMySQL) with data warehouses (such as Redshift). However, AWS provides zero ETL integration solutions that have completely changed this situation, providing a simplified, near-real-time solution for data migration from RDSMySQL to Redshift. This article will dive into RDSMySQL zero ETL integration with Redshift, explaining how it works and the advantages it brings to data engineers and developers.

The relationship between mysql user and database The relationship between mysql user and database Apr 08, 2025 pm 07:15 PM

In MySQL database, the relationship between the user and the database is defined by permissions and tables. The user has a username and password to access the database. Permissions are granted through the GRANT command, while the table is created by the CREATE TABLE command. To establish a relationship between a user and a database, you need to create a database, create a user, and then grant permissions.

MySQL: The Ease of Data Management for Beginners MySQL: The Ease of Data Management for Beginners Apr 09, 2025 am 12:07 AM

MySQL is suitable for beginners because it is simple to install, powerful and easy to manage data. 1. Simple installation and configuration, suitable for a variety of operating systems. 2. Support basic operations such as creating databases and tables, inserting, querying, updating and deleting data. 3. Provide advanced functions such as JOIN operations and subqueries. 4. Performance can be improved through indexing, query optimization and table partitioning. 5. Support backup, recovery and security measures to ensure data security and consistency.

See all articles