1、安裝OEL 5.6html
2、安裝VMware Tools linux
1) 選擇菜單裏的VM選項,裏面有一個子選項是installVMware Tools,選擇它。c++
2) 回到操做系統,將光驅掛載到/mnt 下數據庫
[root@tyger~]# mount /dev/cdrom /mntbash
mount:block device /dev/cdrom is write-protected, mounting read-onlycookie
[root@tyger~]#oracle
3) 解壓安裝tools壓縮包app
[root@tyger~]# pwddom
/rootssh
[root@tyger~]# tar -xzvf /mnt/VMwareTools-9.2.0-799703.tar.gz
……
[root@tyger~]# ls
anaconda-ks.cfg Desktop install.log install.log.syslog vmware-tools-distrib
[root@tyger~]# cd vmware-tools-distrib/
[root@tygervmware-tools-distrib]# ls
bin doc etc FILES INSTALL installer lib vmware-install.pl
[root@tygervmware-tools-distrib]# ./vmware-install.pl
回車
回車
回車
……
3、關閉一些不是必需的服務(本身練習階段)
service NetworkManager stop
service acpid stop
service anacron stop
service apmd stop
service atd stop
service auditd stop
service autofs stop
service avahi-daemon stop
service avahi-dnsconfd stop
service bluetooth stop
service conman stop
service cpuspeed stop
service cups stop
service dnsmasq stop
service dund stop
service firstboot stop
service gpm stop
service haldaemon stop
service hidd stop
service ip6tables stop
service ipmi stop
service ipmievd stop
service iptables stop
service irda stop
service irqbalance stop
service kdump stop
service kudzu stop
service mcstrans stop
service mdmpd stop
service microcode_ctl stop
service netconsole stop
service netfs stop
service netplugd stop
service nfs stop
service nfslock stop
service nscd stop
service ntpd stop
service pand stop
service pcscd stop
service portmap stop
service psacct stop
service rawdevices stop
service rdisc stop
service readahead_early stop
service readahead_later stop
service restorecond stop
service rhnsd stop
service rpcgssd stop
service rpcidmapd stop
service rpcsvcgssd stop
service saslauthd stop
service sendmail stop
service setroubleshoot stop
service smartd stop
service vncserver stop
service wdaemon stop
service winbind stop
service wpa_supplicant stop
service xfs stop
service xinetd stop
service ypbind stop
service yum-updatesd stop
4、設置不是必需的服務開機不啓動
chkconfig NetworkManager off
chkconfig acpid off
chkconfig anacron off
chkconfig apmd off
chkconfig atd off
chkconfig auditd off
chkconfig autofs off
chkconfig avahi-daemon off
chkconfig avahi-dnsconfd off
chkconfig bluetooth off
chkconfig conman off
chkconfig cpuspeed off
chkconfig cups off
chkconfig dnsmasq off
chkconfig dund off
chkconfig firstboot off
chkconfig gpm off
chkconfig haldaemon off
chkconfig hidd off
chkconfig ip6tables off
chkconfig ipmi off
chkconfig ipmievd off
chkconfig iptables off
chkconfig irda off
chkconfig isdn off
chkconfig irqbalance off
chkconfig kdump off
chkconfig kudzu off
chkconfig mcstrans off
chkconfig mdmpd off
chkconfig microcode_ctl off
chkconfig netconsole off
chkconfig netfs off
chkconfig netplugd off
chkconfig nfs off
chkconfig nfslock off
chkconfig nscd off
chkconfig ntpd off
chkconfig pand off
chkconfig pcscd off
chkconfig portmap off
chkconfig psacct off
chkconfig rawdevices off
chkconfig rdisc off
chkconfig readahead_early off
chkconfig readahead_later off
chkconfig restorecond off
chkconfig rhnsd off
chkconfig rpcgssd off
chkconfig rpcidmapd off
chkconfig rpcsvcgssd off
chkconfig saslauthd off
chkconfig sendmail off
chkconfig setroubleshoot off
chkconfig smartd off
chkconfig vncserver off
chkconfig wdaemon off
chkconfig winbind off
chkconfig wpa_supplicant off
chkconfig xfs off
chkconfig xinetd off
chkconfig ypbind off
chkconfig yum-updatesd off
5、改動版本號支持
通過oracle驗證的redhat操做系統版本號最高爲4,4之後的版本號都沒有通過oracle驗證。沒有驗證的版本號假設不改動的話,是沒法安裝的。
[root@tyger ~]# vi /etc/redhat-release
Red Hat Enterprise Linux Server release 5.6 (Tikanga) |
改成
Red Hat Enterprise Linux Server release 4.6 (Tikanga) |
[root@tyger ~]# cat/etc/redhat-release
cat /etc/redhat-release
Red Hat Enterprise LinuxServer release 4.6 (Tikanga)
6、YUM安裝軟件包
用YUM的工具來安裝所需軟件包(先將OEL5.6安裝鏡像文件載入到虛擬機光驅中)
[root@tyger ~]# mount /dev/cdrom /mnt
mount: block device /dev/cdrom is write-protected,mounting read-only
[root@tyger ~]#
[root@tyger ~]# vi/etc/yum.repos.d/public-yum-el5.repo
[root@tyger ~]#
[oel5] name = Enterprise Linux 5.6 DVD baseurl=file:///mnt/Server/ gpgcheck=0 enabled=1 |
[root@tyger etc]#
[root@tyger etc]# yum install oracle-validated
……略……
Total download size: 36 M
Is this ok [y/N]:y
Downloading Packages:
--------------------------------------------------------------------------
Total 1.8GB/s | 36 MB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : unixODBC 1/18
Installing : libXp 2/18
Installing : sysstat 3/18
Installing : compat-db 4/18
Installing : gdb 5/18
Installing :kernel-headers 6/18
Installing :glibc-headers 7/18
Installing : glibc-devel 8/18
Installing :libstdc++-devel 9/18
Installing :unixODBC-devel 10/18
Installing : libaio-devel 11/18
Installing :compat-gcc-34 12/18
Installing : gcc 13/18
Installing : gcc-c++ 14/18
Installing :compat-gcc-34-c++ 15/18
Installing :elfutils-libelf-devel 16/18
Installing : elfutils-libelf-devel-static 17/18
Installing :oracle-validated 18/18
Installed:
oracle-validated.i386 0:1.0.0-24.el5
Dependency Installed:
compat-db.i386 0:4.2.52-5.1
compat-gcc-34.i386 0:3.4.6-4.1
compat-gcc-34-c++.i386 0:3.4.6-4.1
elfutils-libelf-devel.i3860:0.137-3.el5
elfutils-libelf-devel-static.i386 0:0.137-3.el5
gcc.i3860:4.1.2-50.el5
gcc-c++.i386 0:4.1.2-50.el5
gdb.i3860:7.0.1-32.el5
glibc-devel.i386 0:2.5-58
glibc-headers.i386 0:2.5-58
kernel-headers.i386 0:2.6.18-238.el5
libXp.i3860:1.0.0-8.1.el5
libaio-devel.i386 0:0.3.106-5
libstdc++-devel.i386 0:4.1.2-50.el5
sysstat.i386 0:7.0.2-3.el5_5.1
unixODBC.i386 0:2.2.11-7.1
unixODBC-devel.i386 0:2.2.11-7.1
Complete!
[root@tyger ~]#
1.1. 改動/etc/sysctl.conf文件
在安裝oracle軟件的驗證步驟,會明白的告訴你如下的設置,因此,咱們可以提早將其改之,假設有興趣的同窗,可以先安裝,驗證的時候,再改也是同樣的。
[root@tyger soft]# vi/etc/sysctl.conf
將 net.ipv4.ip_local_port_range = 9000 65500 改成 net.ipv4.ip_local_port_range = 1024 65000 |
--使上面改動生效
[root@tyger soft]#/sbin/sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter= 2
net.ipv4.conf.default.accept_source_route= 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies =1
fs.file-max = 6815744
kernel.msgmni = 2878
kernel.msgmax = 8192
kernel.msgmnb = 65536
kernel.sem = 250 32000100 142
kernel.shmmni = 4096
kernel.shmall =1073741824
kernel.shmmax =4294967295
kernel.sysrq = 1
net.core.rmem_default =262144
net.core.rmem_max =4194304
net.core.wmem_default =262144
net.core.wmem_max =1048576
fs.aio-max-nr = 3145728
net.ipv4.ip_local_port_range= 1024 65000
vm.min_free_kbytes =51200
[root@tyger soft]#
1) 改動oracle用戶的password(咱們使用YUM安裝了相關的程序包的同一時候,也爲咱們建立了Oracle帳戶和相關的組)
[root@tyger ~]# passwdoracle
Changing password foruser oracle.
New UNIX password:
BAD PASSWORD: it is basedon a dictionary word
Retype new UNIX password:
passwd: allauthentication tokens updated successfully.
2) 建立相關文件夾並賦權
[root@tyger ~]# mkdir/soft
[root@tyger ~]# chown -Roracle:oinstall /soft
[root@tyger ~]# chmod -R755 /soft
[root@comu ~]# mkdir -p/u01/app/oracle
[root@tyger ~]# chown -Roracle:oinstall /u01
[root@tyger ~]# chmod -R755 /u01
1.3. 主機名及IP的設定
[root@tyger ~]# vi/etc/hosts
# Do not remove thefollowing line, or various programs
# that require networkfunctionality will fail.
127.0.0.1 tygerlocalhost.localdomain localhost (注意:本行的tyger要刪除,因爲如下添加的一行已經存在了)
::1 localhost6.localdomain6 localhost6
192.168.1.32 tyger
(注:添加此行,因爲在安裝的過程當中,oracle會依據ip地址去作一些操做,假設此處沒有計算機的ip地址及計算機名,則在驗證的過程當中會有警告)
1.4. 設置oracle用戶環境變量
[root@tyger ~]# su -oracle
[oracle@tyger ~]$
[oracle@tyger ~]$ vi.bash_profile
注:在文件的最下方添加例如如下內容 export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 export ORACLE_SID=ORCL export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib |
改動完畢,使其改動生效,例如如下:
[oracle@tyger ~]$ ..bash_profile
[oracle@tyger ~]$
或者
[oracle@tyger ~]$ source.bash_profile
[oracle@tyger ~]$
再或者註銷又一次登陸
注:
ORACLE_BASE:oracle產品基文件夾
ORACLE_HOME:數據庫產品文件夾一般狀況下HOME文件夾是BASE的子文件夾
ORACLE_SID:操做系統和oracle實例關聯的紐帶
PATH:將安裝後的oracle命令追加到運行搜索路徑
LD_LIBRARY_PATH:動態庫的位置
1.5. 上傳oracle安裝介質
(經過工具ssh進行上傳)
一、 鏈接ssh得先配置一下你的linux
① VM-----settings------NetworkAdapter
設置爲host-only模式 Devicestatus中的都勾選
OK
② Edit------VirtualNetwork Editor-----
設置VMnet1 爲host-only且將Subnet IP設置與你linuxIP地址在同一個網段(個人IP:192.168.12.70因此我設置爲:192.168.12.0)
====================================================
補充:假設你不知道你的liunxIP地址你可以打開一個終端查一下
[root@tyger ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:2A:24:66
inet addr:192.168.12.70 Bcast:192.168.12.255 Mask:255.255.255.0
inet6 addr:fe80::20c:29ff:fe2a:2466/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3030 errors:0 dropped:0overruns:0 frame:0
TX packets:1739 errors:0 dropped:0overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:302428 (295.3 KiB) TX bytes:274398 (267.9 KiB)
Interrupt:67 Base address:0x2024
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1026 errors:0 dropped:0overruns:0 frame:0
TX packets:1026 errors:0 dropped:0overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1359652 (1.2 MiB) TX bytes:1359652 (1.2 MiB)
[root@tyger ~]#
============================================================================
OK
二、 鏈接SSH上傳文件10201_database_linux32到linux的 /soft 文件夾下
上傳完畢
1) 解壓剛剛上傳文件
[root@tyger ~]# xhost +
access control disabled,clients can connect from any host
[root@tyger ~]# su -oracle
[oracle@tyger ~]$ cd/soft
[oracle@tyger soft]$ ls
10201_database_linux32.zip linux-oracle-needed-software
[oracle@tyger soft]$unzip 10201_database_linux32.zip
…………
inflating:database/stage/oracle.server.10_2_0_1_0_dep_default.properties
inflating:database/stage/oracle.server.10_2_0_1_0_1120187896411.bak
inflating: database/stage/fastcopy.xml
inflating: database/welcome.html
[oracle@tyger soft]$
[oracle@tyger soft]$ ls
10201_database_linux32.zip database linux-oracle-needed-software
2) 開始安裝oracle軟件(啓動圖形化界面)
[oracle@tyger soft]$ cddatabase/
[oracle@tyger database]$ls
doc install response runInstaller stage welcome.html
[oracle@tyger database]$ ./runInstaller
3) 如下開始就跟着圖片作,剛開始不需要管因爲什麼,僅僅知道怎麼作。
Next
Next
Next
出現如下時是本身主動加入的,和設置環境變量是同樣的
Next
可以看到全部經過,perfect!!!
Next
選擇Install database Software only 就好,以後咱們會建立數據庫
Next
此時可以總體看一下你的配置信息,接下去就要開始安裝oracle數據庫軟件了
Install…….
手下留情!!!!!
此時會彈出兩個需要運行的腳本文件,仍是打開一個新的終端運行了吧,要不還得本身去找腳本運行,
[root@tyger ~]#/u01/app/oracle/oraInventory/orainstRoot.sh
Changing permissions of/u01/app/oracle/oraInventory to 770.
Changing groupname of /u01/app/oracle/oraInventoryto oinstall.
The execution of the script is complete
[root@tyger ~]#/u01/app/oracle/product/10.2.0/root.sh
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/10.2.0
Enter the full pathname of the local bin directory:[/usr/local/bin]:
Copyingdbhome to /usr/local/bin ...
Copyingoraenv to /usr/local/bin ...
Copyingcoraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file asneeded by
Database Configuration Assistant when a database iscreated
Finished running generic part of root.sh script.
Now product-specific root actions will beperformed.
[root@tyger ~]#
OK……
EXIT
Yes
1.7. 建立oracle數據庫
接着開始用圖形化界面建立oracle數據庫(DBCA)
[oracle@tyger ~]$ dbca
-bash: dbca: command not found
假設出現上面的問題,是因爲設置環境變量的有問題
[oracle@tyger ~]$ vi .bash_profile
將路徑:
exportORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
改成
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0
改動完畢,使其改動生效,例如如下:
[oracle@tyger ~]$ ..bash_profile
[oracle@tyger ~]$
或者
[oracle@tyger ~]$ source.bash_profile
[oracle@tyger ~]$
再或者註銷又一次登陸
準備工做作好了,好了……開始圖形化界面
[oracle@tyger ~]$ dbca
Next
…
Next
…
Next
…
輸入你的Global Database Name (全局數據庫名稱),如下的SID會本身主動補全,這個SID必定要和你設置環境變量的SID一樣。
環境變量的SID設置例如如下:
export ORACLE_SID=ORCL
next
接下來這個界面問你是否要安裝oracle的EM ,這裏可以不安裝,到後來咱們學習本身手動安裝EM(oracle的一個圖形化界面管理工具)
你可以建立完數據庫,接着配置EM,要問怎麼辦,給你網址你懂得~~
我本身總結的 tyger tyger tyger ~~~~~~~~~~~~~~~~~~
http://blog.csdn.net/wanghui5767260/article/details/15506419
NEXT
這裏統一設置password爲:oracle
Next
..
Next
..
Next
….
僅僅有選中後,數據庫安裝時纔會將SCOTT、HR等用戶建立上,不然是沒有此用戶的。另注意,默認狀況下,這些用戶都是鎖定的,需要人工解鎖。
1.71_內存、塊大小、字符集、鏈接模式設置
1) 內存,可以分配百分比,也可以手工指定SGA和PGA的大小
2) 數據庫默認塊大小
3) 字符集設置,可以採用默認的(默認字符集是什麼跟操做系統有關係),也可以使用UTF8或者選擇你指定的字符集
4) 鏈接模式,選擇,專用模式
1.72_確認數據庫存儲信息,下一步
1.73_默認僅僅有建立數據庫是選中狀態
可以將咱們眼下所有建立的步驟保存爲模板,同一時候也可以將這些步驟保存爲腳本
1.74_所有安裝的組件
1.75_點擊OK後,首先彈出模板保存成功對話框
1.76_而後彈出,腳本保存成功對話框
1.77_點擊OK,開始建立數據庫
依據機器的狀況不一樣,時間也有所差別,請慢慢等待
1.78_點擊EXIT,安裝完畢