Ubuntu12.04(32位)安装Oracle 11g(32位)全过程
Ubuntu12.04 ( 32 位)安装 Oracle11g ( 32 位)全过程 1. 将系统更新到最新: sudo apt-get update sudo apt-get dist-upgrade 2. 安装 Oracle 所需的依赖包: sudo apt-get install automake sudo apt-get install autotools-dev sudo apt-get install b
Ubuntu12.04(32位)安装Oracle11g(32位)全过程
1.将系统更新到最新:
sudo apt-get update
sudo apt-get dist-upgrade
2.安装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-1libodbcinstq4-1:i386
sudo apt-get install libpth-dev
sudo apt-get install libpthread-stubs0
sudo apt-get installlibpthread-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 installsysstat
sudo apt-get install unixodbc
sudo apt-get installunixodbc-dev
sudo apt-get install unzip
sudo apt-get installx11-utils
sudo apt-get install zlibc
很多都是Ubuntu已经自带的了,谨慎起见都执行一遍吧。
3.检查系统变量
/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
4.添加对当前用户(假如用户名是zhs)用户的内核限制在/etc/security/limits.conf文件中增加以下数据
zhs soft nproc 2047
zhs hard nproc 16384
zhs soft nofile 1024
zhs hard nofile 65536
zhs soft stack 10240
5.查看/etc/pam.d/login,增加以下行(有了就不用增加了):
session required pam_limits.so
同样检查/etc/pam.d/su,没有以下行就自己加上:
session required pam_limits.so
6.创建需要的文件夹(用于安装oracle)并设置其所有权:
sudo mkdir -p /opt/oracle
sudo mkdir -p /opt/oraInventory
sudo chown -R zhs:zhs /opt/oracle
sudo chown -R zhs:zhs /opt/oraInventory
后两步中,第一个zhs代表当前用户,第二个zhs代表当前用户所在的组,linux用户通常属于好几个组,其中有一个组名和用户名相同。这两步可能可以不用执行,因为那两个目录本身就是zhs创建的。
7.安装JRE环境
如果Ubuntu上没安装JRE的话,需要安装JRE(我这里直接安装了JDK,以JDK为例):
到Oracle官网下载JDK6(考虑到兼容性问题,安装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目录下即可。(如果没有权限,就使用sudochmod 777获取权限再复制)
配置JDK的环境变量,使用编辑器打开主文件夹下的.bashrc配置文件(隐藏),向其中加入如下内容:
#JDK
JAVA_HOME=/usr/lib/jdk/jdk1.6.0_45
JRE_HOME=${JAVA_HOME}/jre
export ANDROID_JAVA_HOME=$JAVA_HOME
export CLASSPATH=.:${JAVA_HOME}/lib:$JRE_HOME/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export JAVA_HOME;
export JRE_HOME;
export CLASSPATH;
HOME_BIN=~/bin/
export PATH=${PATH}:${JAVA_PATH}:${HOME_BIN};
注意核对一下目录结构是不是正确的。
接着使新设的环境变量生效,在终端执行命令:source.bashrc
最后验证JDK是否安装正确:
java -version
出现了JDK版本信息就表示正确了。
8.为Oracle配置环境变量。同样在主文件夹下的.bashrc配置文件中加入如下内容:
#Oracle
#这个写刚刚创建的文件夹
export ORACLE_BASE=/opt/oracle
#这个后面可以随便填写
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
#数据库的sid
export ORACLE_SID=orcl
export ORACLE_UNQNAME=orcl
#默认字符集
export NLS_LANG=.AL32UTF8
#环境变量
export PATH=${PATH}:${ORACLE_HOME}/bin/;
接着使新设的环境变量生效,在终端执行命令:source.bashrc
9.oracle本身并不支持ubuntu来安装,所以要进行欺骗oracle的安装程序(sudo执行):
ln -s /etc /etc/rc.d
ln -s /lib/i386-linux-gnu/libgcc_s.so.1 /lib/
ln -s /usr/bin/awk /bin/awk
ln -s /usr/bin/basename /bin/basename
ln -s /usr/bin/rpm /bin/rpm
ln -s /usr/lib/i386-linux-gnu/libpthread_nonshared.a/usr/lib/libpthread_nonshared.a
ln -s /usr/lib/i386-linux-gnu/libc_nonshared.a/usr/lib/libc_nonshared.a
ln -s /usr/lib/i386-linux-gnu/libstdc++.so.6 /lib/
ln -s /usr/lib/i386-linux-gnu/libstdc++.so.6 /usr/lib/
ln -s /usr/lib/i386-linux-gnu/libstdc++.so.5 /lib/
ln -s /usr/lib/i386-linux-gnu/libstdc++.so.5 /usr/lib/
sudo touch /etc/redhat-release
sudo echo ‘Red Hat Linux release 5’> /etc/redhat-release
因为Ubuntu将某些库文件根据32位系统和64位系统分别存放了,但Oracle只认/usr/lib和/lib目录,所以需要进行上面的软链接。
10.下载32位(x86)的Oraclefor Linux安装程序,解压后得到database文件夹
11.在终端设置语言环境
export LANG=en_US或者exportLANG=zh_CN.gbk
这一步如果不设的话,Oracle安装程序的启动界面可能会出现乱码。
12.为database文件夹下的runInstaller文件赋予可执行权限:
sudo chmod 777 runInstaller
跳转到database目录,在终端下执行:
./runInstaller
13.出现填写电邮地址的界面,电邮地址不要填写且复选框不要勾选,点击“下一步”按钮。弹出带叉号标志的提示点击“YES”按钮后就可进入下一步。
14.剩下的过程基本上很顺利了,只需要设置一下密码就行了,其他的设置都在启动安装程序前完成了,不要进行改动!
15.图形界面下进行依赖检查的时候会列出很多依赖检查失败了,无法进入下一步了,此时选中右上角的“忽略所有”就可以进入下一步了。
16.安装的过程会出现两个错误(接近70%的时候)
第一个错误:
Errorin invoking target 'agent nmhs' of makefile'opt/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk'. See'/opt/oraInventory/logs/installActions2014-08-09_03-15-56AM.log' fordetails.
解决方法:
打开一个新的终端,输入如下命令:
sed-i 's/^\(\s*\$(MK_EMAGENT_NMECTL)\)\s*$/\1 -lnnz11/g'$ORACLE_HOME/sysman/lib/ins_emagent.mk
然后在图形界面点击‘Retry’就能继续安装了。
第二个错误:
Errorin invoking target 'all_no_orcl' of makefile'/opt/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk'. See'/opt/oraInventory/logs/installActions2014-08-09_03-16-32AM.log' fordetails.
解决方法:
在新终端中输入如下四个命令:
sed-i 's/^\(TNSLSNR_LINKLINE.*\$(TNSLSNR_OFILES)\) \(\$(LINKTTLIBS)\)/\1-Wl,--no-as-needed \2/g' $ORACLE_HOME/network/lib/env_network.mk
sed-i 's/^\(ORACLE_LINKLINE.*\$(ORACLE_LINKER)\) \(\$(PL_FLAGS)\)/\1-Wl,--no-as-needed \2/g' $ORACLE_HOME/rdbms/lib/env_rdbms.mk
sed-i 's/^\(\$LD \$LD_RUNTIME\) \(\$LD_OPT\)/\1 -Wl,--no-as-needed \2/g'$ORACLE_HOME/bin/genorasdksh
sed-i 's/^\(\s*\)\(\$(OCRLIBS_DEFAULT)\)/\1 -Wl,--no-as-needed \2/g'$ORACLE_HOME/srvm/lib/ins_srvm.mk
然后在图形界面点击‘Retry’就能继续安装了。
下面的安装过程就没有什么问题了。
17.最后应该就顺利完成了,按照安装程序提示最后执行两个脚本:
sudo /opt/oraInventory/orainstRoot.sh
sudo /opt/oracle/product/11.2.0/dbhome_1/root.sh
就完成了全部的安装。
注:本人用ubuntu12.04和12.10,按照此方法装oracle都成功了
参考资料:http://blog.csdn.net/idber/article/details/9039857

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

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

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

Solutions to Oracle cannot be opened include: 1. Start the database service; 2. Start the listener; 3. Check port conflicts; 4. Set environment variables correctly; 5. Make sure the firewall or antivirus software does not block the connection; 6. Check whether the server is closed; 7. Use RMAN to recover corrupt files; 8. Check whether the TNS service name is correct; 9. Check network connection; 10. Reinstall Oracle software.

The method to solve the Oracle cursor closure problem includes: explicitly closing the cursor using the CLOSE statement. Declare the cursor in the FOR UPDATE clause so that it automatically closes after the scope is ended. Declare the cursor in the USING clause so that it automatically closes when the associated PL/SQL variable is closed. Use exception handling to ensure that the cursor is closed in any exception situation. Use the connection pool to automatically close the cursor. Disable automatic submission and delay cursor closing.

In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.

To stop an Oracle database, perform the following steps: 1. Connect to the database; 2. Shutdown immediately; 3. Shutdown abort completely.

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

When Oracle log files are full, the following solutions can be adopted: 1) Clean old log files; 2) Increase the log file size; 3) Increase the log file group; 4) Set up automatic log management; 5) Reinitialize the database. Before implementing any solution, it is recommended to back up the database to prevent data loss.

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

SQL statements can be created and executed based on runtime input by using Oracle's dynamic SQL. The steps include: preparing an empty string variable to store dynamically generated SQL statements. Use the EXECUTE IMMEDIATE or PREPARE statement to compile and execute dynamic SQL statements. Use bind variable to pass user input or other dynamic values to dynamic SQL. Use EXECUTE IMMEDIATE or EXECUTE to execute dynamic SQL statements.
