1,、到Oracle官網(wǎng)下載最新版本oracle,,目前是Oracle 11g R2版本,根據(jù)操作系統(tǒng)下載32位或者64位系統(tǒng)
www.oracle.com
2、用filezilla將下載的oracle上傳到Linux的root根目錄,,ftp的22端口傳輸數(shù)據(jù),,設(shè)置如圖

3、連接ftp站點(diǎn),,將下載的oracle數(shù)據(jù)庫上傳至Linux的ROOT目錄下

4,、在root目錄下解壓oracle數(shù)據(jù)庫
命令:unzip linux_11gR2_database_1of2.zip
unzip linux_11gR2_database_2of2.zip
5、系統(tǒng)環(huán)境配置與檢驗(yàn)
檢查下列軟件包是否安裝,,命令rpm -qa |grep 名字,如果已安裝,,標(biāo)記OK,未安裝標(biāo)記--


6、配置用戶和組以及環(huán)境變量
[root@localhost ~]# groupadd oinstall
[root@localhost ~]# groupadd dba
[root@localhost ~]# mkdir -p /u01/oracle
添加一個(gè)oracle用戶,,根目錄是/u01/oracle,主要的組是oinstall和dba
useradd -g oinstall -G dba -d /u01/oracle oracle
[root@localhost ~]# useradd -g oinstall -G dba -d /u01/oracle oracle
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
#將配置文件拷貝到用戶目錄下,,否則會(huì)報(bào)錯(cuò)
[root@localhost ~]# cp /etc/skel/.bash_profile /u01/oracle
[root@localhost ~]# cp /etc/skel/.bashrc /u01/oracle
[root@localhost ~]# cp /etc/skel/.bash_logout /u01/oracle
#設(shè)置oracle密碼
[root@localhost ~]# passwd oracle
Changing password for user oracle.
New password: 123456
BAD PASSWORD: it is too simplistic/systematic
BAD PASSWORD: is too simple
Retype new password: 123456
passwd: all authentication tokens updated successfully.
[root@localhost ~]#
#進(jìn)入根目錄
[root@localhost /]# cd /
[root@localhost /]# ls -l
[root@localhost /]# chown -R oracle:oinstall u01 更改所有者為oracle組為oinstall
[root@localhost /]# ls -l
#檢查nobody是否存在:
[root@localhost /]# id nobody
缺省存在的。如果不存在新建
[root@localhost /]#/usr/sbin/useradd -g nobody
#修改配置文件/etc/sysctl.conf
[root@localhost /]# vi /etc/sysctl.conf
添加如下配置
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
#修改配置文件/etc/security/limits.conf
[root@localhost /]# vim /etc/security/limits.conf
添加如下配置
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
#修改配置文件/etc/pam.d/login
[root@localhost /]# vim /etc/pam.d/login
添加如下配置
session required pam_limits.so
#設(shè)置oracle用戶環(huán)境變量
[root@localhost /]# su - oracle
[oracle@localhost ~]$ pwd
/u01/oracle
[oracle@localhost ~]$ ls -la
total 20
drwxr-xr-x. 2 oracle oinstall 4096 Apr 22 10:42 .
drwxr-xr-x. 3 oracle oinstall 4096 Apr 22 10:32 ..
-rw-r--r--. 1 oracle oinstall 18 Apr 22 10:42 .bash_logout
-rw-r--r--. 1 oracle oinstall 176 Apr 22 10:41 .bash_profile
-rw-r--r--. 1 oracle oinstall 124 Apr 22 10:42 .bashrc
[oracle@localhost ~]$
##修改.bash_profile
添加
ORACLE_BASE=/u01
ORACLE_HOME=$ORACLE_BASE/oracle
ORACLE_SID=wilson
修改PATH為
PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
修改export為
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
#返回root用戶下,,將解壓縮的database拷貝到u01用戶目錄下
[oracle@localhost ~]$ exit
logout
[root@localhost ~]# ls -l
[root@localhost ~]# mv database /u01
##進(jìn)入到u01目錄下,,改變所有者為oracle和組為oinstall
[root@localhost u01]# ls -l
total 8
drwxr-xr-x. 8 root root 4096 Aug 19 2009 database
drwxr-xr-x. 2 oracle oinstall 4096 Apr 22 19:30 oracle
[root@localhost u01]# chown -R oracle:oinstall database/
[root@localhost u01]# ls -l
total 8
drwxr-xr-x. 8 oracle oinstall 4096 Aug 19 2009 database
drwxr-xr-x. 2 oracle oinstall 4096 Apr 22 19:30 oracle
[root@localhost u01]#
已經(jīng)修改完配置,重啟系統(tǒng)后安裝
7,、Oracle圖形界面安裝
7.1 用oracle用戶登錄
7.2 安裝oracle
#進(jìn)入u01/database目錄 cd /u01/database
#運(yùn)行下面命令進(jìn)入圖形界面安裝oracle
[oracle@localhost database]$ ./runInstaller
出現(xiàn)圖形化安裝界面,,
不填寫Email,并取消勾for oracle support,,下一步

選擇install database software only ,,下一步

選擇single instance database installation,下一步

語言默認(rèn),,點(diǎn)擊下一步

選擇企業(yè)版本enterparise,點(diǎn)擊下一步

默認(rèn),,選擇下一步,,出現(xiàn)提示,點(diǎn)擊yes


彈出如下界面,,需要用putty登錄root用戶,,創(chuàng)建oraInventory目錄,然后點(diǎn)擊下一步,,
[root@localhost ~]# mkdir /oraInventory
[root@localhost ~]# cd /
[root@localhost /]# ls -l
[root@localhost /]# chown -R oracle:oinstall oraInventory

默認(rèn),,下一步

性能檢測,由于虛擬機(jī)配置低,,需要勾選ignore all,,下一步
生產(chǎn)配置匯總,點(diǎn)擊Finish

進(jìn)行安裝

到最后,,彈出執(zhí)行腳本的問題,,用putty登錄root用戶,執(zhí)行如下文件
[root@localhost ~]# /oraInventory/orainstRoot.sh
[root@localhost ~]# /u01/oracle/root.sh 有提示按回車默認(rèn)
然后點(diǎn)擊ok

安裝完成

8、配置監(jiān)聽器listener
#輸入netca
[oracle@localhost database]$ netca
彈出的圖形化界面選擇next

選擇add,,next

默認(rèn),,next

默認(rèn),next

默認(rèn),,next

默認(rèn),,next

默認(rèn),next

選擇finish

查看Listener是否配置成功
ps -ef
可以看到如下進(jìn)程
9465 1 0 21:58 ? 00:00:00 /u01/oracle/bin/tnslsnr LISTENER
9,、創(chuàng)建配置數(shù)據(jù)庫
[oracle@localhost database]$ dbca
彈出圖形界面,,next

next

next

在Global Database Name和SID都填寫wilson

next

選擇use the same administrative password for all account, password 123456

yes

next

next

勾選sample schemas,next

選擇character sets選項(xiàng)卡,,選擇use unicode(AL32UTF8)

next

finish

ok

創(chuàng)建數(shù)據(jù)庫

完成

10,、配置啟動(dòng)不進(jìn)入圖形界面
vim /etc/inittab
將id:5:initdefault: 改成id:3:initdefault:
保存退出,重啟系統(tǒng)
11,、遠(yuǎn)程登錄數(shù)據(jù)庫
putty oracle
#進(jìn)入數(shù)據(jù)庫模式
[oracle@localhost /]$ sqlplus /nolog
#啟動(dòng)數(shù)據(jù)庫
SQL>startup
#已dba身份連接數(shù)據(jù)庫
SQL> conn / as sysdba
#測試,,創(chuàng)建一個(gè)表
SQL> create table testUser(id integer,name char(10));
Table created.
SQL>
#插入一條數(shù)據(jù)
SQL> insert into testUser values(0,'Jack');
1 row created.
SQL>
#提交以下
SQL> commit;
Commit complete.
#輸出表
SQL> select * from testUser;
ID NAME
---------- ----------
0 Jack
#關(guān)閉數(shù)據(jù)庫
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
#退出
SQL>quit
本文出自 “平哥_Jason” 博客,請務(wù)必保留此出處http://jasonliping.blog.51cto.com/471157/1399939
|