標籤:
開啟VMware
選擇稍後安裝
自訂安裝
小生安裝的是64位的Centos
給虛擬機器設定名稱和安裝位置
設定虛擬機器打處理器並分配記憶體(oracle12G我建議記憶體為2G以上)
網路類型選擇僅主機模式
按推薦來,建立新的虛擬磁碟
磁碟大小設為40G,不要太小,會有錯誤。指定磁碟檔案路徑
選擇自訂硬體,將Centos ISO鏡像檔案掛載上
啟動虛擬機器,進入Centos安裝介面
跳過檢測
選擇英文
鍵盤格式為英文
選擇YES,清空資料
點擊Configure Network
設定System eth0,可參考自己的主機(ipconfig)
上海時間
設定root密碼
將Review。。選上
刪除重建
添加/boot
添加swap分區
剩餘空間給根/
預設
選擇自己要安裝的一些包!
開發工具一類
漫長的等待
安裝完,重啟
按引導來
不設定使用者
將Kdump去掉。設定VMnet1的網路設定下(仔細看下)
上傳oracle安裝包
Ip設定為靜態
[[email protected] ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
UUID=a479bd38-0b09-4afb-9cb5-2932caf4a5ac
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
HWADDR=00:0C:29:F9:14:8A
IPADDR=192.168.10.88
PREFIX=24
GATEWAY=192.168.10.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
停止ipv6服務,禁止ipv6開機啟動
[[email protected]t ~]# service ip6tables stop
[[email protected] ~]# chkconfig ip6tables off
[[email protected] ~]# service network restart
設定主機名稱為oracledb
[[email protected] ~]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=oracledb
GATEWAY=192.168.10.1
[[email protected] ~]# vi /etc/hosts
127.0.0.1 localhost oracledb localhost4 localhost4.localdomain4
::1 localhost oracledb localhost6 localhost6.localdomain6
192.168.10.88 oracledb
[[email protected] ~]# reboot
檢查依賴包
binutils-2.20.51.0.2-5.11.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
gcc-4.4.4-13.el6 (x86_64)
gcc-c++-4.4.4-13.el6 (x86_64)
glibc-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (x86_64)
ksh
libgcc-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (x86_64)
libstdc++-devel-4.4.4-13.el6 (x86_64)
libaio-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6 (x86_64)
make-3.81-19.el6
sysstat-9.0.4-11.el6 (x86_64)
檢查存在
[[email protected] ~]# rpm -qa binutils*
安裝
掛載centos鏡像
[[email protected] ~]# mount
/dev/sda3 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)
/dev/sr0 on /media/CentOS_6.5_Final
[[email protected] ~]# cd /media/CentOS_6.5_Final/Packages/
[[email protected] Packages]# ls compat-lib*
compat-libcap1-1.10-1.i686.rpm compat-libgfortran-41-4.1.2-39.el6.i686.rpm compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm
compat-libcap1-1.10-1.x86_64.rpm compat-libgfortran-41-4.1.2-39.el6.x86_64.rpm compat-libtermcap-2.0.8-49.el6.i686.rpm
compat-libf2c-34-3.4.6-19.el6.i686.rpm compat-libstdc++-296-2.96-144.el6.i686.rpm compat-libtermcap-2.0.8-49.el6.x86_64.rpm
compat-libf2c-34-3.4.6-19.el6.x86_64.rpm compat-libstdc++-33-3.2.3-69.el6.i686.rpm
[[email protected] Packages]# rpm -ivh compat-libcap1-1.10-1.x86_64.rpm
建立使用者和組
[[email protected] ~]# groupadd oinstall
[[email protected] ~]# groupadd dba
[[email protected] ~]# useradd -g oinstall -G dba oracle
[[email protected] ~]# passwd oracle
建立目錄
[[email protected] ~]# mkdir /u01/app/oracle -p
You have mail in /var/spool/mail/root
[[email protected] ~]# chown -R oracle:oinstall /u01
[[email protected] ~]# chmod -R 775 /u01
修改核心參數
[[email protected] ~]# vi /etc/sysctl.conf
# Controls the maximum shared segment size, in bytes
#kernel.shmmax = 68719476736
# Controls the maximum number of shared memory segments, in pages
#kernel.shmall = 4294967296
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 = 1048576
修改系統資源限制
[[email protected] ~]# vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
[[email protected] ~]# vi /etc/pam.d/login
session required pam_limits.so
[[email protected] ~]# vi /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
關閉防火牆
[[email protected] ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
[[email protected] ~]# chkconfig iptables off
關閉Selinux
[[email protected] ~]# /usr/sbin/sestatus –v
[[email protected] ~]# vi /etc/selinux/config
SELINUX=disabled
設定環境變數
[[email protected] ~]# su - oracle
[[email protected] ~]$ cd
[[email protected] ~]$ vi .bash_profile
umask 022
ORACLE_BASH=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASH/product/11.2.0/db_1
ORACLE_SID=oracledb
PATH=$PATH:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export PATH ORACLE_BASH ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH
[[email protected] ~]$ source .bash_profile
[[email protected] ~]# cp linux.x64_11gR2_database_* /home/oracle/
[[email protected] ~]# chown oracle:oinstall /home/oracle/^Cnux.x64_11gR2_database_2of2.zip
切換到圖形介面安裝!
[[email protected] ~]$ unzip linux.x64_11gR2_database_1of2.zip
[[email protected] ~]$ unzip linux.x64_11gR2_database_2of2.zip
[[email protected] ~]$ ls
[[email protected] ~]$ cd database/
[[email protected] database]$ ls
doc install response rpm runInstaller sshsetup stage welcome.html
[[email protected] database]$./ runInstaller
[[email protected] ~]# sh /u01/app/oraInventory/orainstRoot.sh
[[email protected] ~]# sh /u01/app/oracle/product/11.2.0/db_1/root.sh
建立監聽服務(充當oracle伺服器,讓別的oracle用戶端串連本oracle伺服器)
啟動資料庫,和監聽
1.#su - oracle 切換到oracle使用者且切換到它的環境
2.$lsnrctl status 查看監聽及資料庫狀態
3.$lsnrctl start 啟動監聽
4.$sqlplus / as sysdba 以DBA身份進入sqlplus
5.SQL>startup 啟動db
配置本網服務名(充當oracle用戶端,串連別的oracle伺服器)
沒有通過。退出
修改/u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora。將hostname修改為oracledb。
重啟整個虛擬機器。
重新走。啟動監聽,啟動資料庫。走到相應步驟,然後執行SQL> alter system register;
使用者名稱system 密碼 oracle
解鎖scott使用者,密碼是tigger
資料庫就此安裝成功!
小生不才這資料庫安裝了周末兩天才安裝成功,期間遇到了各種的問題比如磁碟空間,Kdump空間不足,設定許可權等問題,不過高興地是終於安裝成功了。接下來終於可以開始oracle的學習了!
在VMware安裝Centos再安裝Oracle資料庫(個人學習使用)