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

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)

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.

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.

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.

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.

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.

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.

Explain different types of MySQL indexes (B-Tree, Hash, Full-text, Spatial). Explain different types of MySQL indexes (B-Tree, Hash, Full-text, Spatial). Apr 02, 2025 pm 07:05 PM

MySQL supports four index types: B-Tree, Hash, Full-text, and Spatial. 1.B-Tree index is suitable for equal value search, range query and sorting. 2. Hash index is suitable for equal value searches, but does not support range query and sorting. 3. Full-text index is used for full-text search and is suitable for processing large amounts of text data. 4. Spatial index is used for geospatial data query and is suitable for GIS applications.

See all articles