參數(shù) | 值 |
---|---|
Oracle base | /d01/app/oracle |
Software location | /d01/app/oracle/product/12102/dbhome_1 |
DATAFILEDESTINATION | /d02/oradata |
RECOVERYAREADESTINATION | /d02/fast_recovery_area |
Global database name | gorcl12c |
SID | orcl12c |
2 掛載磁盤
fdisk -l # 查看實例上的數(shù)據(jù)盤 fdisk -u /dev/vdb # 分區(qū)數(shù)據(jù)盤 # np1..w fdisk -lu /dev/vdb # 查看新分區(qū) mkfs.ext4 /dev/vdb1 cp /etc/fstab /etc/fstab.bak echo /dev/vdb1 /mnt ext4 defaults 0 0 >> /etc/fstab cat /etc/fstab mkdir /u01 mount /dev/vdb1 /u01 df -h
3 掛載SWAP
### ORACLE需要內(nèi)存的1/4作為swap,確認存在swap,如果有的話swapoff /swapfile swapon -s # 確認硬盤空間 df -hal # 創(chuàng)建swap文件1024 * 16 = 16384 = 16GB(實際創(chuàng)建的時候多一點16384) dd if=/dev/zero of=/swapfile bs=16386 count=1024k # 格式化 mkswap /swapfile chmod 0600 /swapfile # 激活swap swapon /swapfile # 確認存在swap swapon -s
4 系統(tǒng)環(huán)境配置
系統(tǒng)配置
### ORACLE需要內(nèi)存的1/4作為swap,確認存在swap,如果有的話swapoff /swapfile swapon -s # 確認硬盤空間 df -hal # 創(chuàng)建swap文件1024 * 16 = 16384 = 16GB(實際創(chuàng)建的時候多一點16384) dd if=/dev/zero of=/swapfile bs=16386 count=1024k # 格式化 mkswap /swapfile chmod 0600 /swapfile # 激活swap swapon /swapfile # 確認存在swap swapon -s
ORACLE用戶環(huán)境變量
su - oracle vim ~/.bash_profile ORACLE_BASE=/d01/app/oracle ORACLE_HOME=$ORACLE_BASE/product/12102/dbhome_1 ORACLE_SID=orcl12c PATH=$PATH:$ORACLE_HOME/bin export ORACLE_BASE ORACLE_HOME ORACLE_SIDPATH ORACLE_SID
5 圖形化界面配置踩坑
安裝圖形化依賴與桌面系統(tǒng)
$ yum groupinstall "X Window System" # 確認available里面的gnome名稱,下一步使用 $ yum grouplist # 安裝gnome $ yum groupinstall "GNOME Desktop" #進入圖形界面 $ startx
root下執(zhí)行xdpyinfo,記錄連接字符
$ xdpyinfo | grep name name of display: :0
root下執(zhí)行(重要),默認xwindow不允許別的用戶連接
$ xhost +
oracle下執(zhí)行dpyinfo
$ export DISPLAY=:0 xdpyinfo ... # 正常顯示 ...
這個步驟完成
5 圖形化安裝
database/runInstaller
6 圖形化創(chuàng)建數(shù)據(jù)庫
dbca
7 圖形化配置listener tns連接數(shù)據(jù)庫
參考這篇文章配置
https://www.jb51.net/article/170289.htm
sqlplus sys/oracle@hostname:1521/orcl12c as sysdba sqlplus sys/oracle@tnsname as sysdba
8 啟動數(shù)據(jù)庫
select status from v$instance; startup nomount alter database mount; alter database open;
以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。