CentOS系統上安裝配置Oracle資料庫的詳細教程_oracle

來源:互聯網
上載者:User

一.基本配置  

1.硬碟剩餘空間:10G以上
    雖然Oracle 10g的安裝檔案只有800多MB,但安裝後的oracle+oraInventory目錄會用差不多4G空間,再加上安裝時Oracle產生的臨時檔案(/tmp目錄需要至少400MB)。
2.記憶體1.5G以上
    官方文檔說512M記憶體也可以安裝。為了避免不必要的麻煩,請把記憶體加多一些。
3.Swap交換區2G

二.CenOS6 上安裝Oracle 10g

1.準備安裝
在安裝Oracle之前執行以下命令:

yum install yum-fastestmirror -yyum install compat-db*yum install compat-libc*yum install compat-gcc*yum install libXp.so.6yum install libc-*yum install libaio*yum install openmotifyum install glibc-devel*yum install libgcc*yum install gnome-lib* 

2.安裝包解壓

[root@localhost ~]# cpio -idmv > 10201_database_linux_x86_64.cpio

3.建立 Oracle 組和使用者帳戶
建立用於安裝和維護Oracle 10g 軟體的賬戶。使用者帳戶將稱為oracle,而組將稱為oracleinstall和oracle。以root使用者身份執行以下命令:

[root@localhost ~]# groupadd oracleinstall[root@localhost ~]# groupadd oracle[root@localhost ~]# useradd -m -g oracleinstall-G oracle oracle[root@localhost ~]# id oracleuid=501(oracle) gid=501(oracleinstall) groups=501(oracleinstall),502(oracle)

設定oracle帳戶的口令

[root@localhost ~]# passwd oracleChanging password for user oracle.New password:Retype new password:passwd:all authentication tokens updated successfully.

4.建立目錄
建立Oracle 10g及其資料庫檔案的目錄,以root使用者身份執行以下命令:

[root@localhost ~]# mkdir -p /oracledata/oracle[root@localhost ~]# mkdir -p /oracledata/oradata[root@localhost ~]# chown -R oracle:oracleinstall /oracledata/oracle /oracledata/oradata[root@localhost ~]# chmod -R 775 /oracledata/oracle /oracledata/oradata 

5.修改核心參數
安裝Oracle 10g需修改核心參數,否則安裝檢測時會報Failed,甚至導致安裝時出現Error。以root身份執行以下命令:

cat >> /etc/sysctl.conf <<EOFkernel.shmall = 2097152kernel.shmmax = 2147483648kernel.shmmni = 4096kernel.sem = 250 32000 100 128fs.file-max = 65536net.ipv4.ip_local_port_range = 1024 65000net.core.rmem_default = 262144net.core.rmem_max = 262144net.core.wmem_default = 262144net.core.wmem_max = 262144EOF

如果檢查沒有問題後,即可以開始裝Oralce 10g。

6.安裝Oracle 10g
(1)先以oracle使用者身份登陸XWindow。因為oracle安裝會彈出介面讓你配置,如果使用putty登陸安裝的話,你是沒有辦法操作彈出框的,所以一定要登入XWindow,然後在Terminal裡啟動安裝程式。

(2)如果你的系統語言為中文,請把他設定為英文,否則安裝的時候會出現亂碼。

(3)Terminal中啟動Oracle 10g安裝程式:

[oracle@www/]$ ./Oracle/database/runInstaller

 

如果一切正常,介面會彈出如下對話方塊:
 
如果在Terminal啟動runInstaller時遇到“Checking operating system version: must be redhat-2.1, redhat-3, SuSE-9, SuSE-8 or UnitedLinux-1.0 Failed ”這種問題,表明oracle不能識別你的系統核心,這個問題可以通過修改核心設定檔解決,如下:

cat > /etc/redhat-release << EOFRed Hat Enterprise Linux AS release 3 (Taroon)EOF 

7.Oracle 10g安裝配置
修改Oralce Home Localtion,填寫database password後,按“Next”。如圖:

8.資料庫配置
修改Inventory directory,Specify Operating System group name選:oracleinstall,然後“Next”,如圖:

9.Oracle安裝前檢查
檢查一下有什麼不符合安裝要求,看是否需要修改配置,如果按照上面步驟下來,這裡的warning應該為0,然後“Next”。如果有警告可以搜下是什麼問題。
10.Install Oracle 10g
直接按“Install”。在軟體安裝完成之後,會自動進行Configuration Assistant的配置。
11.以root許可權運行指令碼
當iSQL*Plus Configuration Assistant配置完成時,會彈出一下框,裡面有兩個Srcipt需要你用root許可權運行。
在Terminel中以root許可權執行以上兩個指令碼:

[root@www oradata]# ./orainstRoot.shChanging permissions of /oracledata/oradata to 770.Changing groupname of /oracledata/oradata to oracleinstall.The execution of the script is complete[root@www oracle]# ./root.shRunning Oracle10 root.sh script...The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /oracledata/oracleEnter 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 byDatabase Configuration Assistant when a database is createdFinished running generic part of root.sh script.Now product-specific root actions will be performed.

然後按介面中的“OK”。
至此Oracle 10g安裝完成。按“Exit”退出安裝。

三、一些常見的錯誤
1.[INS-06101] IP address of localhost could not be determined
圖如下:

解決方案:是因為你的主機名稱與IP地址不一至,在/etc/hosts檔案對應就行了

    vim /etc/hosts     IP地址 主機名稱

2.at Oracle.install.ivwdb.dirver.DBinstaller.main(DBinstaller.java:132)
圖如下:

解決方案:在root使用者終端下執行xhost +就行了
3.Error in invoking target 'client_sharedlib' of makefile '/oracle/u01/app/oracle/product/10.2.0/db_1/network/lib/ins_net_client.mk'
圖如下:

解決方案:查看oracle是多少位的系統,一般32位系統裝32位oracle軟體,64位系統可以裝32位和64位的oracle。開啟下載oracle的軟體包,裡面有一個網頁,開啟那個網頁就可以看到。
4.查看監聽(lsnrctl)或者是命令(sqlplus)提示:

 -bash: lsnrctl: command not found

圖如下:

解決方案:尋找oracle的命令安裝目錄,我的是(/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin)添加到環境變數中。

vim ~/.bash_profile 

   --是oracle使用者根目錄的檔案,修改這一行

    export PATH=$PATH:/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin
source ~/.bash_profile 

     --設定檔生效

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.