Oracle Linux 6 Installation
This article provides a pictorial guide for performing a default installation of Oracle Linux 6.Basic Installation
- Boot from the DVD. At the boot screen, press the "Enter" key.
- Press the "tab" key to move focus to the "Skip" key, then press the "Enter" key to continue.
- On the "Welcome" screen, click the "Next" button.
- Select the appropriate language, then click the "Next" button.
- Select the relevant keyboard setting, then click the "Next" button.
- Select the storage option necessary for the installation, then click the "Next" button.
- Click the "Re-initialize all" button on the disk initialization warning dialog.
- Enter a fully qualified host name, then click the "Configure Network" button.
- Highlight the relevant connection and click the "Edit" button.
- 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.
- Select the relevant time zone by clicking on your nearest city on the map. Click on the "Next" button to proceed.
- Enter a root password for the server, then click the "Next" button to proceed.
- 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.
- 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.
- Accept the boot loader settings by clicking the "Next" button.
- Accept the "Basic Server" installation and check the "Customize now" option, then click the "Next" button.
- 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
- Wait for the installation to complete.
- Click the "Reboot" button to complete the installation.
- On the "Welcome" screen, click the "Forward" button.
- Accept the license agreement and click the "Forward" button.
- Pick the desired ULN Registration option, then click the "Forward" button. In this case we will pick the register later option.
- Click the "No thanks, I'll connect later." button.
- Finish the software updates setup by clicking the "Forward" button.
- Enter the details for system user, then click the "Forward" button.
- Adjust the Date and Time settings if necessary, and click the "Forward" Button.
- Accept the default setting on the Kdump screen by clicking the "Finish" button.
- Next, you are presented with the login screen. Log in by clicking on the user on the login screen.
- Once logged in, you are ready to use the desktop.
Firewall
To turn off the firewall do the following.- Open the "Firewall Configuration" dialog (System > Administration > Firewall).
- Click the "Close" button on the startup dialog and type in the "root" password if requested.
- On the resulting dialog, click the "Disable" button, followed by the "Apply" button on the toolbar.
- Click the "Yes" button on the confirmation dialog.
- Quit the "Firewall Configuration" dialog.
SELinux
Disable SELinux by editing the "/etc/selinux/config" file, making sure the SELINUX flag is set as follows.Once the change is complete, restart the server.SELINUX=disabled
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 的文件資料,但有一些部份沒寫得很清楚的,為了減少有需求朋友的摸索,所以將整個步驟整理一下如下:
- 安裝 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
- 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 主機落入不安全的環境中。 - 下載 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 - 安裝前的環境配置:接著,我們需要再 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
- 編輯 /etc/sysctl.conf ,將下列參數添加進去:
- 準備開始安裝 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 程式,便會開始進行安裝與配置 - 如下圖所示,首先在安裝之前我們可以輸入 Oracle Support 帳號與密碼來做為之後運轉時接收相關安全事件使用,不過這邊我只是做一個練習用的環境就不輸入了,選擇 [ Next ] 跳過時系統會彈跳一個警告視窗,不要理會直接選擇 [YES]就可以進入下一個安裝步驟。
- 如下圖所示,接下來要選擇安裝的模式,預設提供有三種安裝模式,分別為 [ 建立與組態一個資料庫 ( Create and
Configure a database ) ]、[ 僅安裝資料庫軟體 ( Install database software only )
]、[ 升級現存的資料庫 ( Upgrade an existing database )
],在這邊我們選擇第一種安裝模式,進行安裝與組態一個新的資料庫。
接下來,可以依據安裝資料庫的系統環境來選擇安裝的類型,預設提供桌面環境等級與伺服器環境等級,這邊可以依據實際使用的環境來進行挑選。
- 如下圖所示,在完成基本配置之後,接下來我們需要填寫相關安裝環境的資訊,由於我們在步驟5的時候已經將相關路徑配置到bash_profile檔案中了,因此安裝精靈會自己抓取到相對應的路徑配置,我們只需要在底下輸入管理員密碼即可。
接下來在第一次安裝的時候可以指定這台主機某一個路徑來安裝 Inventory 檔案 。
- 如下圖所示,配置完相關安裝路徑之後,安裝精靈會開始檢查套件相依性問題,我們可以將檢查缺少的套件透過 yum 安裝來補齊,這邊比較特別的在於 pdksh 這個套件在 Oracle Linux 6.X 以後就被移除了,可以改裝 ksh 替代,忽略相關訊息即可。
[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 ] 就可以進行下一步驟的安裝與配置。 - 如下圖所示,最後安裝精靈會把剛才的配置整理一個總表讓你確認,確認無誤後直接點選 [ Finish ] 便可以開始進行安裝與配置。
- 經過一段時間的安裝等待之後,如下圖所示,接著我們需要針對相關帳號進行密碼的配置,請點選 [ Password Management ] 進入密碼管理頁面。
接著,將使用者名稱 HR 的 Lock Account 勾選取消,並且配置一組密碼給該使用者。 - 最後如下圖所示,我們必須開啟另外一個視窗以系統管理員 root 登入後,執行 /opt/oraInventory/orainstRoot.sh 與 /opt/oracle/product/11.2.0/db_1/root.sh 腳本檔案,執行完畢後才可以返回這個視窗進行點選 [ OK ] 。
[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. - 完成上述步驟後我們便完成了 Oracle Database Server 的安裝,如下所示。
- 最後,我們得確認一下目前資料庫伺服器的啟動狀態:
[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 有順利運作時,我們可以透過網頁進行連線存取,如下圖所示。
沒有留言:
張貼留言