1.更換apt源
創(chuàng)新互聯(lián)公司堅(jiān)持“要么做到,要么別承諾”的工作理念,服務(wù)領(lǐng)域包括:成都做網(wǎng)站、成都網(wǎng)站設(shè)計(jì)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣等服務(wù),滿足客戶于互聯(lián)網(wǎng)時(shí)代的莎車網(wǎng)站設(shè)計(jì)、移動(dòng)媒體設(shè)計(jì)的需求,幫助企業(yè)找到有效的互聯(lián)網(wǎng)解決方案。努力成為您成熟可靠的網(wǎng)絡(luò)建設(shè)合作伙伴!
cp /etc/apt/sources.list /etc/apt/sources.list.bak vim /etc/apt/sources.list cat /etc/apt/sources.list deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
2.更新系統(tǒng)
apt-get update apt-get dist-upgrade -y init 6 apt-get dist-upgrade -y
3.若ubuntu不是桌面版,則安裝桌面
apt-get install x-window-system-core gnome-core -y
4.安裝oracle依賴包
apt-get -y install alien binutils build-essential cpp-4.4 debhelper g++-4.4 gawk gcc-4.4 gcc-4.4-base gettext html2text lib32z1 lib32ncurses5 lib32bz2-1.0 intltool-debian ksh lib32bz2-dev lib32z1-dev libaio-dev libaio1 libbeecrypt7 libc6 libc6-dev libc6-dev-i386 libelf-dev libelf1 libltdl-dev libltdl7 libmotif4 libodbcinstq4-1 libodbcinstq4-1:i386 libqt4-core libqt4-gui libsqlite3-0 libstdc++5 libstdc++6 libstdc++6-4.4-dev lsb lsb-core lsb-cxx lsb-desktop lsb-graphics lsb-qt4 make odbcinst pax po-debconf rpm rpm-common sysstat unixodbc unixodbc-dev unzip
5.創(chuàng)建用戶和用戶組
addgroup oinstall addgroup dba addgroup nobody usermod -g nobody nobody useradd -g oinstall -G dba -p password -m -d /home/oracle -s /bin/bash oracle chown -R oracle:dba /home/oracle mkdir -p /u01/app/oracle mkdir -p /u01/binaries chown -R oracle:dba /u01
6.設(shè)置oracle用戶密碼及創(chuàng)建redhat標(biāo)識(shí)
echo oracle | passwd --stdin oracle (ubuntu不支持) echo 'Red Hat Linux release 6' | sudo tee -a /etc/redhat-release
7.創(chuàng)建redhat目錄結(jié)構(gòu)
mkdir /usr/lib64 ln -s /etc /etc/rc.d ln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib64/ 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/x86_64-linux-gnu/libc_nonshared.a /usr/lib64/ ln -s /usr/lib/x86_64-linux-gnu/libpthread_nonshared.a /usr/lib64/ ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /lib64/ ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib64/
cp /etc/security/limits.conf /etc/security/limits.conf.original echo "#Oracle 12C shell limits:" | tee -a /etc/security/limits.conf echo "oracle soft nproc 2048" | tee -a /etc/security/limits.conf echo "oracle hard nproc 16384"| tee -a /etc/security/limits.conf echo "oracle soft nofile 1024" | tee -a /etc/security/limits.conf echo "oracle hard nofile 65536" | tee -a /etc/security/limits.conf
echo "#" | tee -a /etc/sysctl.conf echo "# Oracle 12C entries" | tee -a /etc/sysctl.conf echo "fs.aio-max-nr=1048576" | tee -a /etc/sysctl.conf echo "fs.file-max=6815744" | tee -a /etc/sysctl.conf echo "kernel.shmall=2097152" | tee -a /etc/sysctl.conf echo "kernel.shmmni=4096" | tee -a /etc/sysctl.conf echo "kernel.sem=250 32000 100 128" | tee -a /etc/sysctl.conf echo "net.ipv4.ip_local_port_range=9000 65500" | tee -a /etc/sysctl.conf echo "net.core.rmem_default=262144" | tee -a /etc/sysctl.conf echo "net.core.rmem_max=4194304" | tee -a /etc/sysctl.conf echo "net.core.wmem_default=262144" | tee -a /etc/sysctl.conf echo "net.core.wmem_max=1048586" | tee -a /etc/sysctl.conf echo "kernel.shmmax=1073741824" | tee -a /etc/sysctl.conf
sysctl -p #使上面配置生效 mkdir /etc/rc.d ;for i in 0 1 2 3 4 5 6 S ;do sudo ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ;done
安裝VNC服務(wù):
apt-get -y install vnc4server vncpasswd #設(shè)置vnc登錄密碼
---------------------------------
vim /home/oracle/.vnc/xstartup #!/bin/sh export XKL_XMODMAP_DISABLE=1 unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS gnome-panel & gnome-settings-daemon & metacity & nautilus & gnome-terminal & -------------------------------- chmod 777 /root/.vnc/xstartup
#需要將最后一行“x-window-manager &”改為我們自己的Ubuntu圖形界面服務(wù),那么改成什么呢?這就要看你Ubuntu是什么桌面環(huán)境了,Ubuntu有g(shù)nome、KDE、Unity等桌面環(huán)境。
如果是gnome桌面,改成gnome-session &;
如果是KDE桌面,改成startkde &;
如果是Unity桌面,首先去 /usr/share/gnome-session/sessions/下看桌面session的名稱
vncserver :1 #以oracle用戶啟動(dòng)關(guān)閉vnc服務(wù)
vncserver -kill :1
#vnc客戶端下載
https://www.realvnc.com/download/viewer/windows/
為oracle環(huán)境配置變量
vim /home/oracle/.bashrc export ORACLE_BASE=/u01/binaries export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1 export ORACLE_SID=orcl export ORACLE_UNQNAME=orcl export LD_LIBRARY_PATH=$ORACLE_HOME/lib export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK export PATH=${PATH}:${ORACLE_HOME}/bin/;
將OpenJDK更改Oracle JDK
cd /opt tar xf jdk-7u67-linux-x64.tar.gz ln -s jdk1.7.0_67/ /java vim /etc/profile #set java environment export JAVA_HOME=/opt/java export JRE_HOME=/opt/java export CLASSPATH==.:$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
source /etc/profile java -version
8.安裝oracle
cd /u01/binaries/ unzip linuxamd64_12102_database_1of2.zip unzip linuxamd64_12102_database_2of2.zip init 6 #重啟進(jìn)入桌面
以oracle用戶登錄VNC,執(zhí)行下面命令 export DiSPLAY:0.0 xhost +
cd /u01/binaries/database/ ./runInstaller -ignoreSysPrereqs
#配置開機(jī)啟動(dòng)
vim /etc/oratab orcl:/u01/binaries/product/11.2.0/dbhome_1:Y
vim /etc/profile export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1 export ORACLE_OWNR=oracle export PATH=$PATH:$ORACLE_HOME/bin export ORACLE_SID=orcl
vim /etc/rc.local su - oracle -lc "/u01/binaries/product/11.2.0/dbhome_1/bin/dbstart" su - oracle -lc "/u01/binaries/product/11.2.0/dbhome_1/bin/lsnrctl stop"
錯(cuò)誤一:VNC無法打開桌面
解決:配置VNC登錄用戶家目錄中的配置文件
錯(cuò)誤二:java.lang.main classnotfind
解決:為oracle環(huán)境配置變量
vim /home/oracle/.bashrc
export ORACLE_BASE=/u01/binaries
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export ORACLE_UNQNAME=orcl
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK #unicode編碼 無論配置成什么編碼,格式一定要寫對(duì)(language_territory.charset 語言_地域和字符集),否則會(huì)安裝失敗,或者不做配置(沒試過)
export PATH=${PATH}:${ORACLE_HOME}/bin/;
錯(cuò)誤三:提示DISPLAY not set. Please set the DISPLAY and try again。
解決:
export DISPLAY=:0.0
xhost +
執(zhí)行以上命令后,再次切換到oracle用戶執(zhí)行安裝即可。
錯(cuò)誤四:
解決:缺少包
apt-get -y install alien binutils build-essential cpp-4.4 debhelper g++-4.4 gawk gcc-4.4 gcc-4.4-base gettext html2text lib32z1 lib32ncurses5 lib32bz2-1.0 intltool-debian ksh lib32bz2-dev lib32z1-dev libaio-dev libaio1 libbeecrypt7 libc6 libc6-dev libc6-dev-i386 libelf-dev libelf1 libltdl-dev libltdl7 libmotif4 libodbcinstq4-1 libodbcinstq4-1:i386 libqt4-core libqt4-gui libsqlite3-0 libstdc++5 libstdc++6 libstdc++6-4.4-dev lsb lsb-core lsb-cxx lsb-desktop lsb-graphics lsb-qt4 make odbcinst pax po-debconf rpm rpm-common sysstat unixodbc unixodbc-dev unzip
錯(cuò)誤五:提示insufficient disk space on this volume for the selected oracle home
解決:安裝目錄磁盤空間不足
錯(cuò)誤六:無法啟動(dòng)安裝界面,且無報(bào)錯(cuò)信息
解決:
以oracle用戶登錄VNC,執(zhí)行下面命令
export DiSPLAY:0.0
xhost +
錯(cuò)誤七:
解決:
http://www.techienote.com/install-oracle-12c-on-ubuntu/
錯(cuò)誤八:lsnrctl 1070
解決:
vim /etc/profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
export ORACLE_OWNR=oracle
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=orcl