Ubuntu 12.04(32位)安装Oracle 11g(32位)全过程以及几乎所有问题的解决办法
这两天在Ubuntu上安装Oracle把人折腾毁了,即使照着网上的教程来,还是出了很多问题。好在最后终于搞定了。写出来总结一下,免得
这两天在Ubuntu上安装Oracle把人折腾毁了,即使照着网上的教程来,还是出了很多问题。好在最后终于搞定了。写出来总结一下,免得以后忘了。
标题注明32位是因为网上教程几乎全是以64位安装为例的,32位系统下照着做是绝对会安装失败的。
出现的问题主要有两方面,一个是安装过程中出现的,另一个是安装完成后出现的。
安装过程(主要过程就直接copy别人的教程了)及问题:
1.将系统更新到最新:
sudo apt-get update
sudo apt-get dist-upgrade
2.如果使用的Ubuntu不是桌面版(如Ubuntu server),由于Oracle安装需要用到图形界面,所以需要安装桌面程序:
sudo apt-get install gnome-core
相信很多都是使用的桌面版,那么这个步骤就不需要了。
3. 安装Oracle所需的依赖包:
sudo apt-get install automake
sudo apt-get install autotools-dev
sudo apt-get install binutils
sudo apt-get install bzip2
sudo apt-get install elfutils
sudo apt-get install expat
sudo apt-get install gawk
sudo apt-get install gcc
sudo apt-get install gcc-multilib
sudo apt-get install g++-multilib
sudo apt-get install ia32-libs
sudo apt-get install ksh
sudo apt-get install less
sudo apt-get install lesstif2
sudo apt-get install lesstif2-dev
sudo apt-get install lib32z1
sudo apt-get install libaio1
sudo apt-get install libaio-dev
sudo apt-get install libc6-dev
sudo apt-get install libc6-dev-i386
sudo apt-get install libc6-i386
sudo apt-get install libelf-dev
sudo apt-get install libltdl-dev
sudo apt-get install libmotif4
sudo apt-get install libodbcinstq4-1 libodbcinstq4-1:i386
sudo apt-get install libpth-dev
sudo apt-get install libpthread-stubs0
sudo apt-get install libpthread-stubs0-dev
sudo apt-get install libstdc++5
sudo apt-get install lsb-cxx
sudo apt-get install make
sudo apt-get install openssh-server
sudo apt-get install pdksh
sudo apt-get install rlwrap
sudo apt-get install rpm
sudo apt-get install sysstat
sudo apt-get install unixodbc
sudo apt-get install unixodbc-dev
sudo apt-get install unzip
sudo apt-get install x11-utils
sudo apt-get install zlibc
很多都是Ubuntu自带的了,谨慎6起见都执行一遍吧。
4.创建用户(此步可省略,直接使用当前的用户即可,下面的安装过程都是以不执行这一步为准的)
sudo groupadd oinstall
sudo groupadd dba
sudo useradd -g oinstall -G dba -d /opt/oracle -s /bin/bash oracle
sudo passwd oracle
5.检查系统变量
/sbin/sysctl -a | grep sem
/sbin/sysctl -a | grep shm
/sbin/sysctl -a | grep file-max
/sbin/sysctl -a | grep aio-max
/sbin/sysctl -a | grep ip_local_port_range
/sbin/sysctl -a | grep rmem_default
/sbin/sysctl -a | grep rmem_max
/sbin/sysctl -a | grep wmem_default
/sbin/sysctl -a | grep wmem_max
然后根据上面命令中得到的参数值在/etc/sysctl.conf中增加对应数据,比如:
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152kernel.shmmax = 536870912
kernel.shmmni = 4096kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
运行一下命令更新内核参数:
sysctl –p
6.添加对oracle用户的内核限制在 /etc/security/limits.conf 文件中增加以下数据
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
其中oracle是在第四步中创建的用户,跳过第四步的话就写当前用户
7.查看/etc/pam.d/login,增加以下行(有了就不用增加了):
session required pam_limits.so
同样检查/etc/pam.d/su,没有以下行就自己加上:
session required pam_limits.so
7.创建需要的文件夹(用于安装oracle)并设置其所有权:
mkdir -p /opt/oracle
mkdir -p /opt/oraInventory
chown -R oracle:oinstall /opt/oracle
chown -R oracle:oinstall /opt/oraInventory
同样,如果跳过了第四步,那就将所有权设置命令中的用户oracle和组oinstall改为自己当前用户和组(通常二者是一样的),当然这时也可以不执行这两个chown命令,本来目录创建者就是所有者了。另外,需要root权限执行这些命令(sudo,下同)
8.如果Ubuntu上没安装JRE的话,需要安装JRE(我这里直接安装了JDK,以JDK为例):
到Oracle官网下载JDK6(最新为7,考虑到兼容性问题,安装6):
下载jdk-6u45-linux-i586.bin这个文件。放到主文件夹(home目录)下,进入终端:
$sudo chmod 777 jdk-6u37-linux-x64.bin // 将文件赋予运行权限
$sudo -s ./jdk-6u37-linux-x64.bin /usr/lib/jdk //将JDK安装到/usr/lib/jdk 目录下。
注意:最后安装完成后可能安装到了主文件夹下了,这是使用命令将其全部复制到/usr/lib/jdk目录下即可。(如果没有权限,就使用sudo chmod 777获取权限再复制)
配置JDK的环境变量,使用编辑器打开主文件夹下的.bashrc配置文件(隐藏),向其中加入如下内容:

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

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

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

Hot Topics



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.

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

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]

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

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

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.

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.

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.
