linux下安裝oracle 10g

←手機掃碼閱讀     火星人 @ 2014-03-08 , reply:0

1、安裝環境:

Linux企業版5.4,內存不小於1G,硬碟大於8G,在本環境中linux的地址192.168.1.80.oracle版本:10g 安裝步驟: 2、修改hosts文件: [root@Eleven ~]# hostname Eleven.localdomain [root@Eleven ~]# vim /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 Eleven.localdomain localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 192.168.1.80 Eleven.localdomain 3、以root登錄,掛載linux iso文件: [root@Eleven ~]# mkdir /mnt/cdrom [root@Eleven ~]# mount /dev/cdrom /mnt/cdrom/ 4

、檢查所需的軟體包是否安裝,如果還沒安裝,則需安裝: sudo-1.6.9p17-5.el5.i386.rpm binutils-2.17.50.0.6-12.el5.i386.rpm compat-db-4.2.52-5.1.i386.rpm compat-libstdc -296-2.96-138.i386.rpm control-center-2.16.0-16.el5.i386.rpm gcc-4.1.2-46.el5.i386.rpm gcc-c -4.1.2-46.el5.i386.rpm glibc-2.5-42.i386.rpm glibc-common-2.5-42.i386.rpm libstdc -4.1.2-46.el5.i386.rpm libstdc -devel-4.1.2-46.el5.i386.rpm make-3.81-3.el5.i386.rpm pdksh-5.2.14-36.el5.i386.rpm sysstat-7.0.2-3.el5.i386.rpm setarch-2.0-1.1.i386.rpm libXp-1.0.0-8.1.el5.i386.rpm(此軟體包如不安裝下面一步將無法進行) 以上軟體包都在系統光碟的Server的倉庫里,因在此使用的是linux5.4光碟,不同的光碟鏡像這些軟體包的版本可能不相同.

5、創建所需的用戶和組: [root@Eleven Server]# groupadd dba [root@Eleven Server]# groupadd oinstall [root@Eleven Server]# groupadd oper [root@Eleven Server]# useradd -g oinstall -G dba,oper oracle 給用戶oracle設置密碼,這裡將密碼設為oracle: [root@Eleven Server]# passwd oracle Changing password for user oracle. New UNIX password: BAD PASSWORD: it is based on a dictionary word Retype new UNIX password: 6 [root@Eleven Server]# vim /etc/sysctl.conf 加入下面的內容: kernel.shmall = 2097152 kernel.shmmax = 2147483648 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 65536

net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default = 1048576 net.core.rmem_max = 1048576 net.core.wmem_default = 262144 net.core.wmem_max = 262144 7 [root@Eleven Server]# vim /etc/security/limits.conf 添加下面的內容: oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 8 [root@Eleven Server]# vim /etc/pam.d/login 添加下面的內容: session required /lib/security/pam_limits.so session required pam_limits.so 9

[root@Eleven Server]# vim /etc/profile 添加下面的內容: if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi 10、創建相應的文件並修改其許可權值: [root@Eleven Server]# mkdir -p /u01/app/oracle [root@Eleven Server]# chown -R oracle:oinstall /u01/app/oracle [root@Eleven Server]# chmod -R 775 /u01/app/oracle/ [root@Eleven Server]# mkdir /u01/flash_recovery_area [root@Eleven Server]# chown oracle:oinstall /u01/flash_recovery_area/ [root@Eleven Server]# chmod 775 /u01/flash_recovery_area/ 11、切換至oracle用戶:

[root@Eleven Server]# su - oracle [oracle@Eleven ~]$ vim .bash_profile 添加下面的內容: export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/app/oracle/product/10.2.0 export ORACLE_SID=eleven # ORACLE_SID是自己命名的,建議用小寫,且不超過8個字 12 [oracle@Eleven ~]$ . .bash_profile [oracle@Eleven ~]$ env | grep ORA ORACLE_SID=eleven ORACLE_BASE=/u01/app/oracle ORACLE_HOME=/u01/app/oracle/product/10.2.0 13、測試圖形界面(此步驟需到VM中的圖形界面中去操作): 切換至oracle用戶下: 執行xclock 如出現如下錯誤:

則需在管理員下執行xhost local:oracle

然後再在oracle用戶下執行:xclock:

14、將oracle的安裝光碟掛載到linux系統中:

[oracle@Eleven ~]$ exit [root@Eleven Server]# cd [root@Eleven ~]# umount /mnt/cdrom/ [root@Eleven ~]# mount /dev/cdrom /mnt/cdrom/ [root@Eleven ~]# su - oracle [oracle@Eleven ~]$ ll /mnt/cdrom/ total 2 dr-xr-xr-x 1 root root 2048 Jul 2 2005 database 15、安裝 [oracle@Eleven ~]$ cd / [oracle@Eleven /]$ /mnt/cdrom/database/runInstalle

下面看到安裝的進度界面:

16

、創建JianTingQi

先配置.bash_profile [oracle@Eleven /]$ cd [oracle@Eleven ~]$ vim .bash_profile 添加下面的內容: export PATH=$ORACLE_HOME/bin:$PATH [oracle@Eleven ~]$ . .bash_profile [oracle@Eleven ~]$ lsnrctl status LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 16-MAR-2012 03:34:40 Copyright (c) 1991, 2005, Oracle. All rights reserved. Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error TNS-00511: No listener Linux Error: 111: Connection refused [oracle@Eleven ~]$ netca

下面直接單擊next即可,

下面還是直接選擇next即可,直到結束.

再次查看狀態:

[oracle@Eleven ~]$ lsnrctl status LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 16-MAR-2012 03:49:20 Copyright (c) 1991, 2005, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=Eleven.localdomain)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production Start Date 16-MAR-2012 03:42:25 Uptime 0 days 0 hr. 6 min. 54 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/oracle/product/10.2.0/network/admin/listener.ora Listener Log File /u01/app/oracle/product/10.2.0/network/log/listener.log Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Eleven.localdomain)(PORT=1521)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0))) Services Summary... Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service... The command completed successfully 17、建庫 [oracle@Eleven ~]$ dbca 出現圖形界面直接選擇next

顯示安裝庫的進度:

安裝好后測試:

[oracle@Eleven ~]$ sqlplus SQL*Plus: Release 10.2.0.1.0 - Production on Fri Mar 16 04:11:13 2012 Copyright (c) 1982, 2005, Oracle. All rights reserved. Enter user-name: sys as sysdba Enter password: Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options

SQL> select * from scott.emp; EMPNO ENAME JOB MGR HIREDATE SAL COMM ---------- ---------- --------- ---------- --------- ---------- ---------- DEPTNO ---------- 7369 SMITH CLERK 7902 17-DEC-80 800 20 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30 7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30 EMPNO ENAME JOB MGR HIREDATE SAL COMM ---------- ---------- --------- ---------- --------- ---------- ---------- DEPTNO ---------- 7566 JONES MANAGER 7839 02-APR-81 2975 20 7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30 7698 BLAKE MANAGER 7839 01-MAY-81 2850

30 EMPNO ENAME JOB MGR HIREDATE SAL COMM ---------- ---------- --------- ---------- --------- ---------- ---------- DEPTNO ---------- 7782 CLARK MANAGER 7839 09-JUN-81 2450 10 7788 SCOTT ANALYST 7566 19-APR-87 3000 20 7839 KING PRESIDENT 17-NOV-81 5000 10 EMPNO ENAME JOB MGR HIREDATE SAL COMM ---------- ---------- --------- ---------- --------- ---------- ---------- DEPTNO ---------- 7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30 7876 ADAMS CLERK 7788 23-MAY-87 1100 20 7900 JAMES CLERK 7698 03-DEC-81 950

30 EMPNO ENAME JOB MGR HIREDATE SAL COMM ---------- ---------- --------- ---------- --------- ---------- ---------- DEPTNO ---------- 7902 FORD ANALYST 7566 03-DEC-81 3000 20 7934 MILLER CLERK 7782 23-JAN-82 1300 10 14 rows selected. 可知oracle已成功安裝在linux上了; 也可以通過瀏覽器訪問管理: 在瀏覽器中輸入:http://192.168.1.80:1158/em

輸入用戶名sys和密碼,連接身份選擇SYSDBA

(注意在顯示此界面之前需先授權,方法單價瀏覽器的右下角的授權按鈕)

至此oracle已成功安裝在linux上了; 補充: Oracle 10g的g是"Grid"縮寫,支持網格計算,即,多台結點伺服器利用高速網路組成一個虛擬的高性能伺服器,負載在整個網格中均衡(Load Balance),按需增刪結點,避免單點故障(Single Point of Faliure).

本文出自 「朱超博」 博客,請務必保留此出處http://zhuchaobo.blog.51cto.com/4393935/867531





[火星人 ] linux下安裝oracle 10g已經有353次圍觀

http://coctec.com/docs/linux/show-post-45950.html