oracle Linux 6.3 安裝 oracle11g安裝過程詳解

oracle Linux 6.3  安裝oracle11g安裝過程詳解


好久沒有寫帖子了,今天終於按耐不住了!

先給講故事:這前幾天我的電腦突然黑屏了,用了好多年了也該換了。由於Tinkpad太貴了但是我又對其情有獨鍾,於是我就在58上看中了是二手的IBM說是T420 什麼I7配置8G內存,由於我太想要了因爲價格還好於是就讓在北京的朋友幫忙代收;事前我給他了兩個軟件來驗貨;誰想到他沒有用我給的魯大師,圖方便就用自帶的誰想都已經被高手改過了。都已經這樣了咱也不能怪人家吧。

拿到手裏我進行了全面檢測原來就是T43翻新的內存512 cpu tm750 唉虧死掉。那賣家早已不見蹤影。

買了就買了吧,我吧我自己電腦修好先用這等工作了在去入手白富美吧。


雖然被騙了但是我也不能吧這點那浪費了呀,於是我花費30元買了個cpu tm770(780性價比太低) 內存加了1g。配置總算是馬馬虎虎了。我就用這臺電腦來操練linux系統和oracle數據庫吧。


前期準備:

下載操作系統(oracle linux 6):這個操作系統是oracle官方提供的是基於red hat 6進行修改的。集成了oracle數據庫所需的包比較方便。

下載oracle11g安裝包在官網下載的是兩個文件。我下載的linxu企業版x86


開始安裝數據庫:

1.在linux root帳號下創建oinstall,dba 用戶組 創建oracle用戶並添加到創建的組中設置數據庫密碼:orcl(我的)

[root@ydcun 桌面]# groupadd oinstall
[root@ydcun 桌面]# groupadd dba
[root@ydcun 桌面]# useradd -g oinstall -g dba oracle
[root@ydcun 桌面]# passwd oracle
更改用戶 oracle 的密碼 。
新的 密碼:
無效的密碼: 過短
無效的密碼: 過於簡單
重新輸入新的 密碼:
passwd: 所有的身份驗證令牌已經成功更新。

2.關閉防火牆

[root@ydcun 桌面]# service iptables stop
iptables:清除防火牆規則:                                 [確定]
iptables:將鏈設置爲政策 ACCEPT:filter                    [確定]
iptables:正在卸載模塊:                                   [確定]

3.在root賬戶下對/home/oracle 中的.bash_profile 文件進行修改

[root@ydcun 桌面]# cd /home
[root@ydcun home]# ls
oracle  ydcun
[root@ydcun home]# ls -a
.  ..  oracle  ydcun
[root@ydcun home]# cd oracle
[root@ydcun oracle]# ls -a
.   .bash_logout   .bash_profile.swo  .bashrc  .mozilla
..  .bash_profile  .bash_profile.swp  .gnome2
[root@ydcun oracle]# vim .bash_profile

在末尾添加如下內容

export ORACLE_SID=orcl
export ORACLE_BASE=/u01 
export ORACLE_HOME=/u01/oracle
export PATH=$ORACLE_HOME/bin:$PATH

orcl是以後數據庫實例的sid u01爲oracle 基本地址  /u01/oracle是數據home
這兩個目錄用root帳號創建並將權限付給oracle用戶

[root@ydcun oracle]# mkdir /u01
[root@ydcun oracle]# mkdir /u01/oracle
[root@ydcun oracle]# chown -R oracle.oinstall /u01


4.修改/etc/sysctl.conf文件 在末尾加上如下內容

[root@ydcun oracle]# vim /etc/sysctl.conf
kernel.shmall = 2097152
kernel.shmall = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 1048576
net.core.wmem_max = 1048576<span style="font-family:Arial,Helvetica,sans-serif;">
</span>


修改後刷新文件使其配置生效

[root@ydcun oracle]# sysctl -p


5.修改hosts文件

[root@ydcun oracle]# vim /etc/hosts

在hosts文件中添加一行  127.0.0.1    主機名


6.將下載好的兩個數據庫文件間用unzip命令進行解壓在oracle用戶下解壓

[oracle@ydcun oracle]# unzip wenjianming.zip

7.運行解壓文件加中的安裝程序

[oracle@ydcun 桌面]$ cd /home/oracle
[oracle@ydcun ~]$ ll
總用量 60
-rw-r-----. 1 oracle dba 15558 11月 23 19:43 config.html
drwxr-xr-x. 8 oracle dba  4096 8月  19 2009 database
drwxr-xr-x. 3 oracle dba  4096 11月 23 17:42 oradiag_oracle
drwxr-xr-x. 2 oracle dba  4096 11月 23 11:04 zysong
drwxr-xr-x. 2 oracle dba  4096 11月 23 00:17 公共的
drwxr-xr-x. 2 oracle dba  4096 11月 23 00:17 模板
drwxr-xr-x. 2 oracle dba  4096 11月 23 00:17 視頻
drwxr-xr-x. 2 oracle dba  4096 11月 23 00:17 圖片
drwxr-xr-x. 2 oracle dba  4096 11月 23 00:17 文檔
drwxr-xr-x. 2 oracle dba  4096 11月 23 00:17 下載
drwxr-xr-x. 2 oracle dba  4096 11月 23 00:17 音樂
drwxr-xr-x. 2 oracle dba  4096 11月 24 01:03 桌面
[oracle@ydcun ~]$ cd database
[oracle@ydcun database]$ ls
doc  install  response  rpm  runInstaller  sshsetup  stage  welcome.html
[oracle@ydcun database]$ ./runInstaller

如果出來的界面是有中文亂碼就去去下載字庫安裝上重新運行就解決了,或者是在命令行中臨時講環境變量進行修改

1.下載字體(將字體拷貝到/usr/share/fonts/zh_CN/TrueType/zysong.ttf)之後雙擊進入安裝

2.修改環境變量用英文臨時的命令行關閉後失效

export LANG=en

3.之後就和win下安裝一樣的了。

4.在安裝玩oracle軟件後我們開始創建oracle實例

5.在安裝過程成會有一些檢查環境檢查,對應的具體數字會啊在操作系統中不一樣(對應的參數就是第四步驟中的參數名與參數至)

4.修改/etc/sysctl.conf文件 在末尾加上如下內容

[root@ydcun oracle]# vim /etc/sysctl.conf

kernel.shmall = 2097152
kernel.shmall = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
 net.core.wmem_default = 1048576
net.core.wmem_max = 1048576




打開創建oracle實例的工具dbca(database configuration assistant)

[oracle@ydcun 桌面]$ dbca

打開創建監聽的工具

創建監聽
[oracle@ydcun 桌面]$ netmgr

進入監聽
[oracle@ydcun 桌面]$ lsnrctl 

LSNRCTL> start

或者

[oracle@ydcun 桌面]$ lsnrctl start
[oracle@ydcun 桌面]$ lsnrctl stop
[oracle@ydcun 桌面]$ lsnrctl status



通過上面一系列的操作就順利裝上了oracle


oracle 的開啓和關閉


[oracle@ydcun 桌面]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Sun Nov 24 01:33:46 2013

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

SQL> conn /as sysdba
Connected to an idle instance.
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  631914496 bytes
Fixed Size		    1338364 bytes
Variable Size		  419431428 bytes
Database Buffers	  205520896 bytes
Redo Buffers		    5623808 bytes
Database mounted.
Database opened.
SQL> exit;
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ydcun 桌面]$ lsnrctl

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 24-NOV-2013 01:36:31

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> start
TNS-01106: Listener using listener name LISTENER has already been started
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ydcun.ibm.com.cn)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                23-NOV-2013 23:59:42
Uptime                    0 days 1 hr. 37 min. 25 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/oracle/network/admin/listener.ora
Listener Log File         /u01/diag/tnslsnr/ydcun/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ydcun.ibm.com.cn)(PORT=1521)))
Services Summary...
Service "orcl" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL> 

SQL> col tablespace_name for a15
SQL> select tablespace_name,block_size,status,contents,logging from dba_tablespaces;

TABLESPACE_NAME BLOCK_SIZE STATUS    CONTENTS  LOGGING
--------------- ---------- --------- --------- ---------
SYSTEM		      8192 ONLINE    PERMANENT LOGGING
SYSAUX		      8192 ONLINE    PERMANENT LOGGING
UNDOTBS1	      8192 ONLINE    UNDO      LOGGING
TEMP		      8192 ONLINE    TEMPORARY NOLOGGING
USERS		      8192 ONLINE    PERMANENT LOGGING

SQL> 


通過這樣的步驟我們就完成了linuxoracle 操作系統上安裝oracle 


http:blog.csnd.net/ydcun和大家一起交流溝通!


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章