在Linux系统下安装oracle是一件令人头疼的事情,其复杂程度远远超过安装Linux操作系统本身。如果能够进行成功的安装oracle,那么同
在Linux系统下安装Oracle是一件令人头疼的事情,其复杂程度远远超过安装Linux操作系统本身。如果能够进行成功的安装oracle,那么同时也就顺便掌握了Linux一些技术。本文介绍在RedHat Linux下安装oracle 10g 的方法。在这里说明一下,Oracle 10g的g是grid 的缩写,意为网格,目前较为前沿的网络计算技术。
Oracle 10g 对软硬件的要求都非常的高,所以要玩转的话的花不少银子。首先来看看它对硬件的要求:内存512兆(建议1G),cpu 主频2.0G以上,硬盘转速7200转以上(建议使用scsi硬盘),依此条件,我看买台服务器才行。其次是软件要求:在oracle 官方的文档里,对于x86系列支持的操作系统只有3种(radhat ES/AS 2.1(x86),redhat ES/AS 3(x86),unitedlinux1.0(x86) ),如果只有redhat 9也是可以安装的,不过要麻烦一点点。当然oracle 10g需要更多的软件模块才能进行安装,这些软件模块我将在后面逐一说明。在本例中,使用RedHat ES 3(x86)作为操作平台,并且安装了xwindow。
接下来,我们检查是否符合oracle 10g 的安装要求,以表格的形式列出。首先是硬件情况。以root登录系统,并且启动x-window.如果用下表命令输出的值大于或等于建议值,请
检查项目 命令/方法 建议值
内存 #grep MemTotal /proc/meminfo 512MB
交换分区 #grep SwapTotal /proc/meminfo 1GB
/tmp目录空闲区 #df –k /tmp 400MB
硬盘空闲空间 #df -k 4GB
继续往下,,检查软件需求。对redhat ES 3(x86),需要如下的软件包:
· Gnu gcc package, gcc-3.2.3-2 or 更高
下面的包也必须被安装:· make-3.79· binutils-2.11· openmotif-2.2.2-16· setarch-1.3-1 · compat-db-4.0.14.5· compat-gcc-7.3-2.96.122· compat-gcc-c -7.3-2.96.122· compat-libstdc -7.3-2.96.122· compat-libstdc -devel-7.3-2.96.122
为了保证系统满足需求,执行下面的步骤检查安装的linux版本和安装的套件。
检查项目 命令/方法 建议值
Linux 版本 #cat /etc/issue ES 3
已安装的包 #rpm -q package_name 安装所需包(上表所列)
到这里我们已经全面的检查了安装oracle 10g所要求的软硬件环境,接着我们就要为安装创建组和用户。
下面的组和用户必须存在
The oinstall group (the oracle inventory group)
The dba group (the OSDBA group)
The oracle user (the oracle owner)
如果上面的组和用户不存在,用下面的步骤创建它们。(1)先查看这些组和用户是否存在:
#grep oinstall /etc/group
#grep dba /etc/group
(2)创建安装oracle 所需的组和用户
#groupadd osintall
#groupadd dba
#useradd –g oinstall –G dba oracle 检查一下oracle 是否属于组 oinstall 和 dba (#id oracle) 再给oracle 设置一个用户口令 #passwd oracle 输入两次密码。
创建安装所需的目录 /u01/app/oracle (the oracle base directory), /u02/oradata (an optional default directory ),用下表的命令形式创建它.然后改变它的目录权限。
创建目录 更改权限
#mkdir –p /u01/app/oracle #chown –R oracle:Oinstall /u01/app/oracle /u02/oradata
#mkdir –p /u02/oradata #chmod –R 755 /u01/app/oracle /u02/oradata
配置内核参数,下表是oracle 推荐的内核参数值,请参考。
Parameter Value File
semmslsemmnssemopmsemmni 25032000100128 /proc/sys/kernel/sem
shmall 2097152 /proc/sys/kernel/shmall
shmmax Half the size of physical memory /proc/sys/kernel/shmmax
shmmni 4096 /proc/sys/kernel/shmmni
file-max 65536 /proc/sys/fs/file-max
ip_local_port_range 1024 65000 /proc/sys/net/ipv4/ip_local_port_range
确保当前的参数值大于或等于上表所列。那么怎样查看这些参数值呢?用命令 #/sbin/sysctl –a | grep
,例如查看semmsl,用 #/sbin/sysctl -a | grep sem,余下的与此类似。逐个察看这些参数值,如果参数值不满足要求,就需要修改它们。请完成下面这些步骤
a.用文本编辑器,创建或者编辑/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
b.改变当前内核参数的值,用命令 #/sbin/sysctl –p 来实现。
为了提高在linux系统上运行软件的性能,必须对oracle用户设置下列shell 限定。
Shell Limit Item in limits.conf Hard Limit
Maximum number of open file descriptors nofile 65536
Maximum number of processes available to a single user nproc 16384
现在创建这些限定:
1. 加入下面的行到文件/etc/security/limits.conf
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536
2. 加入下面的行到文件/etc/pam.d/login ,假如它不存在的话
session required /lib/security/pam_limits.so
3.根据oracle 用户的默认shell,对默认 shell start-up文件作如下改变,如果是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

MySQL index cardinality has a significant impact on query performance: 1. High cardinality index can more effectively narrow the data range and improve query efficiency; 2. Low cardinality index may lead to full table scanning and reduce query performance; 3. In joint index, high cardinality sequences should be placed in front to optimize query.

The MySQL learning path includes basic knowledge, core concepts, usage examples, and optimization techniques. 1) Understand basic concepts such as tables, rows, columns, and SQL queries. 2) Learn the definition, working principles and advantages of MySQL. 3) Master basic CRUD operations and advanced usage, such as indexes and stored procedures. 4) Familiar with common error debugging and performance optimization suggestions, such as rational use of indexes and optimization queries. Through these steps, you will have a full grasp of the use and optimization of MySQL.

MySQL's real-world applications include basic database design and complex query optimization. 1) Basic usage: used to store and manage user data, such as inserting, querying, updating and deleting user information. 2) Advanced usage: Handle complex business logic, such as order and inventory management of e-commerce platforms. 3) Performance optimization: Improve performance by rationally using indexes, partition tables and query caches.

SQL commands in MySQL can be divided into categories such as DDL, DML, DQL, DCL, etc., and are used to create, modify, delete databases and tables, insert, update, delete data, and perform complex query operations. 1. Basic usage includes CREATETABLE creation table, INSERTINTO insert data, and SELECT query data. 2. Advanced usage involves JOIN for table joins, subqueries and GROUPBY for data aggregation. 3. Common errors such as syntax errors, data type mismatch and permission problems can be debugged through syntax checking, data type conversion and permission management. 4. Performance optimization suggestions include using indexes, avoiding full table scanning, optimizing JOIN operations and using transactions to ensure data consistency.

InnoDB achieves atomicity through undolog, consistency and isolation through locking mechanism and MVCC, and persistence through redolog. 1) Atomicity: Use undolog to record the original data to ensure that the transaction can be rolled back. 2) Consistency: Ensure the data consistency through row-level locking and MVCC. 3) Isolation: Supports multiple isolation levels, and REPEATABLEREAD is used by default. 4) Persistence: Use redolog to record modifications to ensure that data is saved for a long time.

MySQL's position in databases and programming is very important. It is an open source relational database management system that is widely used in various application scenarios. 1) MySQL provides efficient data storage, organization and retrieval functions, supporting Web, mobile and enterprise-level systems. 2) It uses a client-server architecture, supports multiple storage engines and index optimization. 3) Basic usages include creating tables and inserting data, and advanced usages involve multi-table JOINs and complex queries. 4) Frequently asked questions such as SQL syntax errors and performance issues can be debugged through the EXPLAIN command and slow query log. 5) Performance optimization methods include rational use of indexes, optimized query and use of caches. Best practices include using transactions and PreparedStatemen

MySQL is suitable for small and large enterprises. 1) Small businesses can use MySQL for basic data management, such as storing customer information. 2) Large enterprises can use MySQL to process massive data and complex business logic to optimize query performance and transaction processing.

InnoDB effectively prevents phantom reading through Next-KeyLocking mechanism. 1) Next-KeyLocking combines row lock and gap lock to lock records and their gaps to prevent new records from being inserted. 2) In practical applications, by optimizing query and adjusting isolation levels, lock competition can be reduced and concurrency performance can be improved.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Zend Studio 13.0.1
Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Mac version
God-level code editing software (SublimeText3)

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft