標籤

4GL (1) 人才發展 (10) 人物 (3) 太陽能 (4) 心理 (3) 心靈 (10) 文學 (31) 生活常識 (14) 光學 (1) 名句 (10) 即時通訊軟體 (2) 奇狐 (2) 爬蟲 (1) 音樂 (2) 產業 (5) 郭語錄 (3) 無聊 (3) 統計 (4) 新聞 (1) 經濟學 (1) 經營管理 (42) 解析度 (1) 遊戲 (5) 電學 (1) 網管 (10) 廣告 (1) 數學 (1) 機率 (1) 雜趣 (1) 證券 (4) 證券期貨 (1) ABAP (15) AD (1) agentflow (4) AJAX (1) Android (1) AnyChart (1) Apache (14) BASIS (4) BDL (1) C# (1) Church (1) CIE (1) CO (38) Converter (1) cron (1) CSS (23) DMS (1) DVD (1) Eclipse (1) English (1) excel (5) Exchange (4) Failover (1) Fedora (1) FI (57) File Transfer (1) Firefox (3) FM (2) fourjs (1) Genero (1) gladiatus (1) google (1) Google Maps API (2) grep (1) Grub (1) HR (2) html (23) HTS (8) IE (1) IE 8 (1) IIS (1) IMAP (3) Internet Explorer (1) java (4) JavaScript (22) jQuery (6) JSON (1) K3b (1) ldd (1) LED (3) Linux (117) Linux Mint (4) Load Balance (1) Microsoft (2) MIS (2) MM (51) MSSQL (1) MySQL (27) Network (1) NFS (1) Office (1) OpenSSL (1) Oracle (126) Outlook (3) PDF (6) Perl (60) PHP (33) PL/SQL (1) PL/SQL Developer (1) PM (3) Postfix (2) postfwd (1) PostgreSQL (1) PP (50) python (5) QM (1) Red Hat (4) Reporting Service (28) ruby (11) SAP (234) scp (1) SD (16) sed (1) Selenium (3) Selenium-WebDriver (5) shell (5) SQL (4) SQL server (8) sqlplus (1) SQuirreL SQL Client (1) SSH (2) SWOT (3) Symantec (2) T-SQL (7) Tera Term (2) tip (1) tiptop (24) Tomcat (6) Trouble Shooting (1) Tuning (5) Ubuntu (37) ufw (1) utf-8 (1) VIM (11) Virtual Machine (2) VirtualBox (1) vnc (3) Web Service (2) wget (1) Windows (19) Windows (1) WM (6) Xvfb (2) youtube (1) yum (2)

2013年7月8日 星期一

於 Oracle Linux 6.3 中安裝 Oracle Database 11gR2

http://www.oracle-base.com/articles/linux/oracle-linux-6-installation.php

Oracle Linux 6 Installation

This article provides a pictorial guide for performing a default installation of Oracle Linux 6.

Basic Installation

  1. Boot from the DVD. At the boot screen, press the "Enter" key.
    Boot
  2. Press the "tab" key to move focus to the "Skip" key, then press the "Enter" key to continue.
    Test Media
  3. On the "Welcome" screen, click the "Next" button.
    Welcome
  4. Select the appropriate language, then click the "Next" button.
    Language
  5. Select the relevant keyboard setting, then click the "Next" button.
    Keyboard
  6. Select the storage option necessary for the installation, then click the "Next" button.
    Storage
  7. Click the "Re-initialize all" button on the disk initialization warning dialog.
    Disk Partitioning Warning
  8. Enter a fully qualified host name, then click the "Configure Network" button.
    Hostname
  9. Highlight the relevant connection and click the "Edit" button.
    Network Connection
  10. Check the "Connect automatically" checkbox. If you are not using DHCP, click on the "IPv4 Settings" tab, set the method to "Manual", click the "Add" button and enter the appropriate network details. When you are happy with the details, click the "Apply" and "Close" buttons to return to the host name screen, then click the "Forward" button.
    Editing System eth0
  11. Select the relevant time zone by clicking on your nearest city on the map. Click on the "Next" button to proceed.
    Time Zone
  12. Enter a root password for the server, then click the "Next" button to proceed.
    Root Password
  13. Check the partitioning type you require. If you want to amend the default partitioning layout, check the "Review and modify partitioning layout" option. Click the "Next" button.
    Disk Partitioning
  14. The installer will list the default partitioning scheme for your size disk. Amend them as required and click the "Next" button, then the "Format" and "Write changes to disk" buttons on the following dialogs.
    Disk Setup
  15. Accept the boot loader settings by clicking the "Next" button.
    Boot Loader
  16. Accept the "Basic Server" installation and check the "Customize now" option, then click the "Next" button.
    Package Installation Defaults
  17. The "Package Group Selection" screen allows you to select the required package groups, and individual packages within the details section. When you've made your selection, click the "Next" button. If you want the server to have a regular gnome desktop you need to include the following package groups from the "Desktops" section:

    • Desktops
    • Desktop
    • Desktop Platform
    • Fonts
    • General Purpose Desktop
    • Graphical Administration Tools
    • X Windows System
    Package Group Selection
  18. Wait for the installation to complete.
    Installing Packages
  19. Click the "Reboot" button to complete the installation.
    Congratulations
  20. On the "Welcome" screen, click the "Forward" button.
    Welcome
  21. Accept the license agreement and click the "Forward" button.
    License Agreement
  22. Pick the desired ULN Registration option, then click the "Forward" button. In this case we will pick the register later option.
    Software Updates
  23. Click the "No thanks, I'll connect later." button.
    Software Updates Confirm
  24. Finish the software updates setup by clicking the "Forward" button.
    Software Updates Finish
  25. Enter the details for system user, then click the "Forward" button.
    System User
  26. Adjust the Date and Time settings if necessary, and click the "Forward" Button.
    Date Time
  27. Accept the default setting on the Kdump screen by clicking the "Finish" button.
    Kdump
  28. Next, you are presented with the login screen. Log in by clicking on the user on the login screen.
    Login
  29. Once logged in, you are ready to use the desktop.
    Desktop

Firewall

To turn off the firewall do the following.
  1. Open the "Firewall Configuration" dialog (System > Administration > Firewall).
  2. Click the "Close" button on the startup dialog and type in the "root" password if requested.
  3. On the resulting dialog, click the "Disable" button, followed by the "Apply" button on the toolbar. Firewall
  4. Click the "Yes" button on the confirmation dialog.
  5. Quit the "Firewall Configuration" dialog.

SELinux

Disable SELinux by editing the "/etc/selinux/config" file, making sure the SELINUX flag is set as follows.
SELINUX=disabled
Once the change is complete, restart the server.

http://figaro.neo-info.net/?p=1006

Oracle 這個龐大商業體,從作業系統、開發工具、資料庫 .... 等產品均全部囊擴,優點在於對於要搜尋解決方案的企業體而言是一個十分方便的採用對象,但恐怖的是你所要付出的費用代價也十分高昂。以前在執行 Oracle Database 大多會以 RHEL 或者是 SLES 為主,但自從 Oracle Clone 了 RHEL 自己推出一個 OEL 之後,相信不少用戶應該也都慢慢移轉到 OEL 身上來配置 Oracle Database 環境。在官方文件庫中已經有提供一篇 Oracle Database 11g Release 2 (11.2) Installation On Oracle Linux 6 的文件資料,但有一些部份沒寫得很清楚的,為了減少有需求朋友的摸索,所以將整個步驟整理一下如下:
  1. 安裝 Oracle Linux 6.3:安裝時可以直接挑選 Basic 樣本來進行調配下列項目,確認相關選項都有進行安裝
    • Base System > Base
    • Base System > Client management tools
    • Base System > Compatibility libraries
    • Base System > Hardware monitoring utilities
    • Base System > Large Systems Performance
    • Base System > Network file system client
    • Base System > Performance Tools
    • Base System > Perl Support
    • Servers > Server Platform
    • Servers > System administration tools
    • Desktops > Desktop
    • Desktops > Desktop Platform
    • Desktops > Fonts
    • Desktops > General Purpose Desktop
    • Desktops > Graphical Administration Tools
    • Desktops > Input Methods
    • Desktops > X Window System
    • Development > Additional Development
    • Development > Development Tools
    • Applications > Internet Browser
    挑選後,大概在 1,145 個套件左右,與其它 Linux 環境配置相同,網路、主機名稱、系統使用者帳號部分我就不在多做說明。
  2. Oracle Linux 6.3安裝後的調整:安裝完畢後,預設網路啟用部分會以 NetworkManager 為主,不過既然是伺服器環境,還是切換回傳統網路配置方式比較正確些,操作如下:[ root@OracleDB Desktop ]# service NetworkManager stop ; chkconfig NetworkManager off
    [ root@OracleDB Desktop ]# chkconfig network on ; service network restart在啟動 network 服務時,若是發現預設的網路介面卡沒有正常啟動時,可以透過 setup 組態工具進行網路介面配置,或者直接編輯 /etc/sysconfig/network-scripts/ifcfg-eth0 網路介面卡的組態檔案,並且要注意 ONBOOT 項目是否被設定為 yes。 接著,在 /etc/hosts 中將主機名稱對應配置進去:192.168.1.9     OracleDB.wholan.corp      OracleDB
    最後,依據官方文件說法是建議將 SELinux 與 IPTABLES 關閉,不過這邊筆者會建議使用者將對應埠號與安全規則寫入,會比較好一些,避免 DB 主機落入不安全的環境中。
  3. 下載 Oracle Database 11g R2:完成基礎配置之後,接著可以前往 OTN 下載 for Linux 使用的 Oracle Database 11gR2 套件,一共有兩個檔案分別為:linux.x64_11gR2_databases_1of2.zip
    linux.x64_11gR2_databases_2of2.zip接著,我們要將這兩個壓縮檔解開到目錄內,操作如下:[ root@OracleDB ~ ]# mkdir /tmp/Oracle_install ; cd /tmp/Oracle_install
    [ root@OracleDB Oracle_install ]# unzip ../linux.x64_11gR2_databases_1of2.zip
    [ root@OracleDB Oracle_install ]# unzip ../linux.x64_11gR2_databases_2of2.zip
  4. 安裝前的環境配置:接著,我們需要再 OEL 中調整一些基本環境參數,讓 Oracle Database 運作時會比較順暢,操作如下:
    • 編輯 /etc/sysctl.conf ,將下列參數添加進去:
      fs.suid_dumpable = 1
      fs.aio-max-nr = 1048576
      fs.file-max = 6815744
      kernel.shmall = 2097152
      kernel.shmmax = 536870912
      kernel.shmmni = 4096
      kernel.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 讓配置生效
      [root@OracleDB ~]# sysctl -p
    • 接著,我們需要調整 /etc/security/limits.conf 組態檔案,來改變系統主機資源運用方式
      oracle              soft    nproc   2047
      oracle              hard    nproc   16384
      oracle              soft    nofile  4096
      oracle              hard    nofile  65536
      oracle              soft    stack   10240
    • 最後,在主機內添加 oracle 使用者帳號與相關群組:
      [root@OracleDB ~]# groupadd -g 501 oinstall
      [root@OracleDB ~]# groupadd -g 502 dba
      [root@OracleDB ~]# groupadd -g 503 oper
      [root@OracleDB ~]# groupadd -g 504 asmadmin
      [root@OracleDB ~]# groupadd -g 506 asmdba
      [root@OracleDB ~]# groupadd -g 505 asmoper[root@OracleDB ~]# useradd -u 502 -g oinstall -G dba,asmdba,oper oracle
      [root@OracleDB ~]# passwd oracle
  5. 準備開始安裝 Oracle Database 11gR2安裝時,我們都是採用 oracle 帳號來進行配置,因此筆者預先將安裝的路徑與權限配置完整,操作如下所示:[root@OracleDB ~]# mkdir -p /opt/oracle/product/11.2.0/db_1
    [root@OracleDB ~]#chown -R oracle.oinstall /opt/oracle
    [root@OracleDB ~]# chmod -R 775 /opt/oracle再把相關路徑配置到 oracle 帳號的 .bash_profile 檔案內:
    # Oracle Settings
    export TMP=/tmp
    export TMPDIR=$TMP
    export ORACLE_HOSTNAME=OracleDB
    export ORACLE_UNQNAME=OracleDB
    export ORACLE_BASE=/opt/oracle
    export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
    export ORACLE_SID=orcl
    export PATH=$ORACLE_HOME/bin:$PATH
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
    export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$CLASSPATH
    最後,改用 oracle 使用者登入 Linux 環境中,切換到 /tmp/Oracle_install/database 目錄內,直接執行 ./runInstaller 程式,便會開始進行安裝與配置
  6. 如下圖所示,首先在安裝之前我們可以輸入 Oracle Support 帳號與密碼來做為之後運轉時接收相關安全事件使用,不過這邊我只是做一個練習用的環境就不輸入了,選擇 [ Next ] 跳過時系統會彈跳一個警告視窗,不要理會直接選擇 [YES]就可以進入下一個安裝步驟。 oracle11g-step1 
  7. 如下圖所示,接下來要選擇安裝的模式,預設提供有三種安裝模式,分別為 [ 建立與組態一個資料庫 ( Create and Configure a database ) ]、[ 僅安裝資料庫軟體 ( Install database software only ) ]、[ 升級現存的資料庫 ( Upgrade an existing database ) ],在這邊我們選擇第一種安裝模式,進行安裝與組態一個新的資料庫。 oracle11g-step2接下來,可以依據安裝資料庫的系統環境來選擇安裝的類型,預設提供桌面環境等級與伺服器環境等級,這邊可以依據實際使用的環境來進行挑選。
    oracle11g-step3
  8. 如下圖所示,在完成基本配置之後,接下來我們需要填寫相關安裝環境的資訊,由於我們在步驟5的時候已經將相關路徑配置到bash_profile檔案中了,因此安裝精靈會自己抓取到相對應的路徑配置,我們只需要在底下輸入管理員密碼即可。 oracle11g-step4接下來在第一次安裝的時候可以指定這台主機某一個路徑來安裝 Inventory 檔案 。
    oracle11g-step5
  9. 如下圖所示,配置完相關安裝路徑之後,安裝精靈會開始檢查套件相依性問題,我們可以將檢查缺少的套件透過 yum 安裝來補齊,這邊比較特別的在於 pdksh 這個套件在 Oracle Linux 6.X 以後就被移除了,可以改裝 ksh 替代,忽略相關訊息即可。 oracle11g-step6[root@OracleDB ~]# yum install libaio glibc compat-libstdc++-33 elfutils-libelf-devel libaio-devel libgcc libstdc++ unixODBC unixODBC-devel ksh
    安裝完畢後,可以在上面的畫面中再次點選 [ Check Again ] ,應該會出現有部分軟體還是 Failed 的狀態,這個部分是因為版本問題導致,請直接勾選 [ Ignore All ] 就可以進行下一步驟的安裝與配置。
  10. 如下圖所示,最後安裝精靈會把剛才的配置整理一個總表讓你確認,確認無誤後直接點選 [ Finish ] 便可以開始進行安裝與配置。
    oracle11g-step7oracle11g-step8
  11. 經過一段時間的安裝等待之後,如下圖所示,接著我們需要針對相關帳號進行密碼的配置,請點選 [ Password Management ] 進入密碼管理頁面。 oracle11g-step9oracle11g-step10
    接著,將使用者名稱 HR 的 Lock Account 勾選取消,並且配置一組密碼給該使用者。
  12. 最後如下圖所示,我們必須開啟另外一個視窗以系統管理員 root 登入後,執行 /opt/oraInventory/orainstRoot.sh/opt/oracle/product/11.2.0/db_1/root.sh 腳本檔案,執行完畢後才可以返回這個視窗進行點選 [ OK ] 。
    oracle11g-step11[root@OracleDB ~]# /opt/oraInventory/orainstRoot.sh
    Changing permissions of /opt/oraInventory.
    Adding read,write permissions for group.
    Removing read,write,execute permissions for world. Changing groupname of /opt/oraInventory to oinstall.
    The execution of the script is complete.
    [root@OracleDB ~]# /opt/oracle/product/11.2.0/db_1/root.sh
    Running Oracle 11g root.sh script...
    The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME= /opt/oracle/product/11.2.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.
  13. 完成上述步驟後我們便完成了 Oracle Database Server 的安裝,如下所示。
    oracle11g-step12
  14. 最後,我們得確認一下目前資料庫伺服器的啟動狀態: [oracle@OracleDB ~]$ lsnrctl statusLSNRCTL for Linux: Version 11.2.0.1.0 - Production on 11-MAR-2013 13:48:16
    Copyright (c) 1991, 2009, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
    STATUS of the LISTENER
    ------------------------
    Alias LISTENER
    Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
    Start Date 11-MAR-2013 12:30:39
    Uptime 0 days 1 hr. 17 min. 36 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File /opt/oracle/product/11.2.0/db_1/network/admin/listener.ora
    Listener Log File /opt/oracle/diag/tnslsnr/OracleDB/listener/alert/log.xml
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=OracleDB.wholan.corp)(PORT=1521)))
    Services Summary...
    Service "orcl.wholan.corp" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Service "orclXDB.wholan.corp" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    The command completed successfully
    [oracle@OracleDB ~]$ emctl status dbconsole
    Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
    Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
    https://OracleDB:1158/em/console/aboutApplication
    Oracle Enterprise Manager 11g is running.
    ------------------------------------------------------------------
    Logs are generated in directory /opt/oracle/product/11.2.0/db_1/OracleDB_orcl/sysman/log
    如果 Oracle Enterprise Manager 11g 的 Database Control 有順利運作時,我們可以透過網頁進行連線存取,如下圖所示。
    oracle11g-step13
    oracle11g-step14

沒有留言:

張貼留言