<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    在ubuntu 8.04下安裝Oracle 11g方法

    項目要求使用Oracle,據(jù)說安裝方式比較繁復,網(wǎng)上搜到兩篇文章,先備著,準備日后按圖索驥。
    第一篇
    地址:http://forum.ubuntu.org.cn/viewtopic.php?f=44&t=136860

    在ubuntu 8.04下安裝Oracle 11g
    本文是參考了:http://hi.baidu.com/wuxicn/blog/item/0cfdc24ac5ae372609f7ef94.html"文章,是翻譯下面的這篇文章的。我主要參考的是中文的,我只是在實際操作中做了一點小小的修改,在此表示感謝!紫色為我的注釋。
    原文是英文,地址是:
    http://www.pythian.com/blogs/968/instal ... ardy-heron,(轉載注明出處,謝謝!! )
    共9步:

    Step 1
    下載和安裝 Ubuntu 8.04 Hardy Heron (x86-32位) 版。略。

    Step 2
    下載Oracle 11g: Download Oracle 11g for Linux (x86, 32-bit).
    現(xiàn)不要急著解壓,一會我會告訴你解壓在哪的。

    Step 3
    修改X server 的默認設置,點菜單的System -> Administration -> Login Window(系統(tǒng)->管理->登錄窗口),選擇“Security(安全)”選項卡,取消“Deny TCP connections to the Xserver(拒絕TCP連接到X服務器)”的勾,重啟Xserver(或者重啟系統(tǒng))。然后在終端輸入:
    user@hardy:~$ xhost +127.0.0.1
    127.0.0.1 being added to access control list
    Step 4
    打開終端,轉換為超級用戶:(注意,這里用sudo su -而不是sudo -s是有原因的:sudo su - 將用戶轉換為超級用戶,并新起一個會話(空的會話),而不是像sudo -s那樣將當前會話傳遞個新的超級用戶,減少環(huán)境變量可能造成的影響和危害。
    user@hardy:~$ sudo su -
    [sudo] password for user:
    root@hardy:~# apt-get update
    ...
    root@hardy:~# apt-get dist-upgrade
    ...
    root@hardy:~# reboot
    Step 5
    用apt安裝一些必要的工具:

    user@hardy:~$ sudo su -
    [sudo] password for user:
    root@hardy:~# apt-get install build-essential libaio1 gawk ksh libmotif3 alien libtool lsb-rpm
    ...
    root@hardy:~#
    Step 6
    在裝完那些工具以后,我們需要做的就是修改一些Ubuntu的/bin/sh的默認連接,千萬不要略過這一步,否則安裝的時候會出現(xiàn)很多錯誤。
    root@hardy:~# cd /bin
    root@hardy:/bin# ls -l /bin/sh
    lrwxrwxrwx 1 root root 4 2008-04-28 19:59 /bin/sh -> dash
    root@hardy:/bin# ln -sf bash /bin/sh
    root@hardy:/bin# ls -l /bin/sh
    lrwxrwxrwx 1 root root 4 2008-05-01 22:51 /bin/sh -> bash
    如果你想知道為什么Ubuntu用dash作為默認的shell,看這個:a detailed explanation of why dash is the default system shell 。
    Step 7
    增加用戶和組,并修改一些配置。這一步很重要!如果不是很有把握,不要隨便改。(為了便于解釋,增加了行號):
    01 root@hardy:/bin# cd
    02 root@hardy:~# pwd
    /root
    04 root@hardy:~# addgroup oinstall
    Adding group `oinstall' (GID 1001) ...
    Done.
    07 root@hardy:~# addgroup dba
    Adding group `dba' (GID 1002) ...
    Done.
    10 root@hardy:~# addgroup nobody
    Adding group `nobody' (GID 1003) ...
    Done.
    13 root@hardy:~# usermod -g nobody nobody
    14 root@hardy:~# useradd -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle
    15 root@hardy:~# mkdir /home/oracle
    16 root@hardy:~# chown -R oracle:dba /home/oracle
    17 root@hardy:~# ln -s /usr/bin/awk /bin/awk
    18 root@hardy:~# ln -s /usr/bin/rpm /bin/rpm
    19 root@hardy:~# ln -s /usr/bin/basename /bin/basename
    20 root@hardy:~# mkdir /etc/rc.d
    21 root@hardy:~# for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done
    22 root@hardy:~# mkdir -p /u01/app/oracle
    23 root@hardy:~# chown -R oracle:dba /u01
    24 root@hardy:~#
    Lines 04-12: 增加我們需要的用戶和組
    Line 13: 讓nobody用戶的組變?yōu)閚obody,這樣Oracle的安裝程序不會出問題。Ubuntu默認nobody的組是nogroup。
    Lines 14-18: 創(chuàng)建一個oracle用戶。注意,oracle用戶的HOME目錄不要與ORACLE_HOME相同。
    Lines 19-23: 創(chuàng)建一些Oracle安裝程序需要的工具的連接。因為Oracle安裝程序是為Red Hat準備的,所以有些工具的位置和Ubuntu不一樣。
    Finally, on lines 24-25 創(chuàng)建ORACLE_BASE目錄。
    Step 8
    修改一些系統(tǒng)默認值。這些修改將會增加系統(tǒng)文件描述符的數(shù)量、增加共享內存大小和修改一些網(wǎng)絡子系統(tǒng)參數(shù)。這些修改是否會對你的系統(tǒng)帶來影響我就不得而知了。將下面這些增加到/etc/sysctl.conf文件的末尾:
    fs.file-max = 65535
    kernel.shmall = 2097152
    kernel.shmmax = 2147483648
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    net.ipv4.ip_local_port_range = 1024 65535
    net.core.rmem_default = 1048576
    net.core.rmem_max = 1048576
    net.core.wmem_default = 262144
    net.core.wmem_max = 262144
    再增加下面這些到/etc/security/limits.conf文件末尾:

    oracle soft nproc 2047
    oracle hard nproc 16383
    oracle soft nofile 1023
    oracle hard nofile 65535
    為了強制使用剛才我們增加的東西,我們再增加下面這些到/etc/pam.d/login文件末尾:

    session required /lib/security/pam_limits.so
    session required pam_limits.so
    然后通過命令:sysctl -p 讓剛才增加的東西生效:

    root@hardy:~# sysctl -p
    kernel.printk = 4 4 1 7
    kernel.maps_protect = 1
    fs.inotify.max_user_watches = 524288
    vm.mmap_min_addr = 65536
    net.ipv4.conf.default.rp_filter = 1
    net.ipv4.conf.all.rp_filter = 1
    fs.file-max = 65535
    kernel.shmall = 2097152
    kernel.shmmax = 2147483648
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    net.ipv4.ip_local_port_range = 1024 65535
    net.core.rmem_default = 1048576
    net.core.rmem_max = 1048576
    net.core.wmem_default = 262144
    net.core.wmem_max = 262144
    root@hardy:~#
    Step 9
    現(xiàn)在我們將剛才下載的oracle11g的安裝包解壓到/home/oracle/install/目錄下。然后進入目錄,設置DISPLAY參數(shù),開始安裝:

    root@hardy:~# cd /home/oracle
    root@hardy:/home/oracle# chown -R oracle:dba install

    用oracle用戶登陸,(不然會出安裝界面出不來)
    oracle@hardy:~$ export DISPLAY=127.0.0.1:0.0
    oracle@hardy:~$ pwd
    /home/oracle
    oracle@hardy:~$ ls -l
    total 4
    drwxr-xr-x 6 oracle dba 4096 2007-09-18 18:50 install
    oracle@hardy:~$ cd install
    oracle@hardy:~/install$ ls -l
    total 28
    drwxr-xr-x 11 oracle dba 4096 2007-08-06 16:02 doc
    drwxr-xr-x 5 oracle dba 4096 2007-08-03 13:28 install
    drwxr-xr-x 2 oracle dba 4096 2007-09-18 18:52 response
    -rwxr-xr-x 1 oracle dba 2911 2007-08-03 13:28 runInstaller
    drwxr-xr-x 14 oracle dba 4096 2007-08-03 13:27 stage
    -rw-r--r-- 1 oracle dba 4835 2007-08-06 18:19 welcome.html
    oracle@hardy:~/install$ ./runInstaller -ignoreSysPrereqs
    輸入完上面命令后,就進入了Oracle 的同一安裝程序了(OUI),不要急,繼續(xù)按照本文一步一步的通過安裝:
    注意:OUI安裝完后,并不是真正完全安裝完成,還需要就行最后的收尾工作(在最后有),而且這是必須做的工作!


    點(Next)下一步。


    修改“Specify Operating System group name:”為:"dba",然后點"Next".


    按照上圖設置,點下一步。


    選擇"Enterprise Edition",然后下一步。


    安圖設置,下一步。


    繼續(xù)下一步。


    等待系統(tǒng)檢查,不要擔心有錯誤和警告。


    將檢查到的所有非“Succeeded”的都打上勾,下一步。


    ,下一步。在這一步選"Create a Database"來安裝數(shù)據(jù)庫。([color=red]原文是通過netca建立監(jiān)聽,dbca建庫,我第一次也是這樣做的,dbca建庫時會報錯,因為ubutunbu 不支持RPM包)。[/color]

    將所有組都設為:dba,下一步。

    現(xiàn)在可以點“Install”了:)時間比較長。


    到了這一步不要記著點“OK”,需要做下面操作:(另起一個終端,用sudo su - 轉為超級用戶)

    root@hardy:~# /u01/app/oraInventory/orainstRoot.sh
    Changing permissions of /u01/app/oraInventory to 770.
    Changing groupname of /u01/app/oraInventory to dba.
    The execution of the script is complete
    root@hardy:~# /u01/app/oracle/product/11.1.0/db_1/root.sh
    Running Oracle 11g root.sh script...

    The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME= /u01/app/oracle/product/11.1.0/db_1

    Enter the full pathname of the local bin directory: [/usr/local/bin]:
    Copying dbhome to /usr/local/bin ...
    Copying oraenv to /usr/local/bin ...
    Copying coraenv to /usr/local/bin ...

    Creating /etc/oratab file...
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root.sh script.
    Now product-specific root actions will be performed.
    Finished product-specific root actions.
    root@hardy:~#
    好了,這個完成后可以點“OK”了。
    安后點“Exit”退出OUI,現(xiàn)在可以祝賀你,OUI安裝完成了:)但是還是不要急,記住咱們還有收尾工作需要做。
    在/etc/profile文件中加入下面幾句:

    export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1
    export PATH=$PATH:/u01/app/oracle/product/11.1.0/db_1/bin
    創(chuàng)建一個Oracle 11g數(shù)據(jù)庫的啟動腳本,名字可以叫做:oracledb,在/u01/app/oracle/product/11.1.0/db_1/bin下建立文件:oracledb,內容:

    #!/bin/bash
    #
    # /etc/init.d/oracledb
    #
    # Run-level Startup script for the Oracle Listener and Instances
    # It relies on the information on /etc/oratab

    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1
    export ORACLE_OWNR=oracle
    export PATH=$PATH:$ORACLE_HOME/bin

    if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
    then
    echo "Oracle startup: cannot start"
    exit 1
    fi

    case "$1" in
    start)
    # Oracle listener and instance startup
    echo -n "Starting Oracle: "
    su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
    su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
    touch /var/lock/oracle
    echo "OK"
    ;;
    stop)
    # Oracle listener and instance shutdown
    echo -n "Shutdown Oracle: "
    su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
    su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
    rm -f /var/lock/oracle
    echo "OK"
    ;;
    reload|restart)
    $0 stop
    $0 start
    ;;
    *)
    echo "Usage: `basename $0` start|stop|restart|reload"
    exit 1
    esac

    exit 0
    修改腳本為可執(zhí)行的:

    root@hardy:~# chmod a+x /u01/app/oracle/product/11.1.0/db_1/bin/oracledb
    如果你希望開機自動啟動Oracle 11g數(shù)據(jù)庫,那么就作下面的工作:

    root@hardy:~# ln -s /u01/app/oracle/product/11.1.0/db_1/bin/oracledb /etc/init.d/oracledb
    root@hardy:~# sudo sysv-rc-conf --level 2345 oracledb on

    如果沒有sysv-rc-conf命令,就apt-get一個。
    最后,增加你自己的用戶名到dba組:

    root@hardy:~# usermod -G dba -a user
    好了,至此,Oracle 11g就安裝完了。重新登錄后,你就可以使用oracle的命令了。
    (ORACLE_SID=orcl 是你安裝時候設置的值)

    oracle@hardy:~$ export ORACLE_SID=orcl
    oracle@hardy:~$ sqlplus '/as sysdba'

    SQL*Plus: Release 11.1.0.6.0 - Production on Mon May 5 02:39:27 2008

    Copyright (c) 1982, 2007, Oracle. All rights reserved.

    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options

    SQL>connect /as sysdba
    Connected to an idle instance.

    SQL>startup 啟動數(shù)據(jù)庫命令。
    .
    ORACLE instance started.



    Total System Global Area 418484224 bytes

    Fixed Size 1300324 bytes

    Variable Size 281020572 bytes

    Database Buffers 130023424 bytes

    Redo Buffers 6139904 bytes

    Database mounted.

    Database opened.

    oracle@hardy:~$ export ORACLE_SID=orcl
    oracle@hardy:~$ emctl start dbconsole 啟動EM,地址為https://yourip:1158/em/console.這樣你就可以通過IE登陸了。不過界面為亂碼。呵呵!!解決方法自己在網(wǎng)上找吧!!

    如果你看到了上面的結果,證明你的oracle安裝成功了。

    第二篇
    地址:http://www.linuxidc.com/Linux/2008-06/13855.htm

    花了半天時間,在Ubuntu 8.04 LTS上順利安裝Oracle 11G.下面說說大概的步驟.

    1.確保安裝了以下程序:

    sudo apt-get install build-essential libaio1 gawk ksh libmotif3 alien libtool lsb-rpm

    2.

    cd /bin
    ln -sf bash /bin/sh

     

    3.增加用戶和組

    addgroup oinstall
    addgroup dba
    addgroup nobody
    useradd -g oinstall -G dba -p passwd -d /home/oracle -s /bin/bash oracle
    usermod -g nobody nobody

    4.
    mkdir /home/oracle
    chown -R oracle:dba /home/oracle

    ln -s /usr/bin/awk /bin/awk
    ln -s /usr/bin/rpm /bin/rpm
    ln -s /usr/bin/basename /bin/basename

    5.
    mkdir /etc/rc.d
    for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done

    mkdir -p /opt/ora11
    chown -R oracle:dba /opt

    6.編輯/etc/sysctl.conf,增加以下內容:

    fs.file-max = 65535
    kernel.shmall = 2097152
    kernel.shmmax = 2147483648
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    net.ipv4.ip_local_port_range = 1024 65535
    net.core.rmem_default = 1048576
    net.core.rmem_max = 1048576
    net.core.wmem_default = 262144
    net.core.wmem_max = 262144

    7.編輯/etc/security/limits.conf,增加以下內容:

    oracle soft nproc 2047
    oracle hard nproc 16383
    oracle soft nofile 1023
    oracle hard nofile 65535

    8.編輯/etc/pam.d/login,增加以下內容:

    session required /lib/security/pam_limits.so
    session required pam_limits.so

    9.執(zhí)行:

    sysctl -p

    10.

    su - oracle

    以上命令需以root用戶執(zhí)行,接下來切換至oracle用戶.

    11.切換至安裝目錄,開始安裝.我選擇了英語作為安裝時顯示的語言.

    export LANG=en_CN
    ./runInstaller

    12.安裝過程中提示運行以下兩個腳本:

    orainstRoot.sh
    root.sh

    12.安裝過程中檢測到系統(tǒng)未裝有GLIBC環(huán)境,忽略后,未發(fā)現(xiàn)對安裝和運行有多大影響.

    13.切記,安裝時選擇自定義,并且選擇數(shù)據(jù)庫的字符集為 ZHS16GBK!

    因為忘記了這個選項,我只好刪掉數(shù)據(jù)庫,重新建了一個,浪費了半個小時的時間.

    PS.ORACLE 11g好像不支持更改數(shù)據(jù)庫的字符集了...或是我沒有找到正確的方法

    14.安裝完成后,數(shù)據(jù)庫的連接和查詢異常之慢,GOOGLE之,然后嘗試著把網(wǎng)絡的DNS服務器全給刪了,解決.

    15.兩個常用的工具:dbca和netca.



     

    posted on 2009-03-18 10:52 SeesSea 閱讀(539) 評論(0)  編輯  收藏 所屬分類: DB


    只有注冊用戶登錄后才能發(fā)表評論。


    網(wǎng)站導航:
     
    <2009年3月>
    22232425262728
    1234567
    891011121314
    15161718192021
    22232425262728
    2930311234

    導航

    統(tǒng)計

    常用鏈接

    留言簿(2)

    隨筆分類

    隨筆檔案

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚洲AV无码之国产精品| 亚洲人成无码网站| 国产成人免费高清激情视频| 精品无码人妻一区二区免费蜜桃| 久久国产精品成人免费| 人人揉揉香蕉大免费不卡| 国产婷婷成人久久Av免费高清| 三级黄色在线免费观看| 国产成年无码久久久免费| 日韩视频免费在线观看| 99在线观看精品免费99| 100000免费啪啪18免进| 性色av无码免费一区二区三区| 日韩免费无码一区二区视频 | 亚洲成a人无码亚洲成www牛牛| 亚洲伊人久久大香线蕉AV| 亚洲av永久无码精品网址| 黄色免费网址大全| 亚洲黄片手机免费观看| 你好老叔电影观看免费| 99在线观看免费视频| 欧美a级在线现免费观看| 国产成人免费网站在线观看| 亚洲?v无码国产在丝袜线观看| 亚洲桃色AV无码| 亚洲综合日韩中文字幕v在线| 亚洲图片校园春色| 亚洲av无码专区在线电影| 一区二区三区在线免费| 久草免费福利资源站| 97人伦色伦成人免费视频| 亚洲成片观看四虎永久| 亚洲av伊人久久综合密臀性色 | 中文字幕亚洲不卡在线亚瑟| 亚洲AV本道一区二区三区四区| 亚洲精品福利网泷泽萝拉| 亚洲风情亚Aⅴ在线发布| 青青久久精品国产免费看| 一级特黄aa毛片免费观看| 成人毛片免费播放| 在线观看国产区亚洲一区成人 |