- 熱門文章
-
- 杭州市民保保障范圍是什么 主要保險(xiǎn)責(zé)任有二
- 花唄關(guān)了欠的錢可以不還了嗎 花唄未還清可以關(guān)嗎
- 財(cái)報(bào)看世界:2025年消滅大額紙幣?專家發(fā)聲
- 工商銀行信用卡積分在哪里兌換禮品 工行信用卡積分兌換入口
- 中秋節(jié)是幾月幾日,具體是哪一天
- 京東白條額度降低了怎么恢復(fù) 具體問(wèn)題具體分析
- 支付寶網(wǎng)商銀行怎么關(guān)閉 詳細(xì)操作流程介紹
- 農(nóng)村信用社助學(xué)貸款申請(qǐng)需要滿足什么條件 還需要這些資料
- 張家口惠民保保障范圍包括什么 特定高額藥品費(fèi)用也能保
- 建行提前還房貸款流程 還款流程如下
- 熱門標(biāo)簽
-
oracle數(shù)據(jù)庫(kù)教程 oracle數(shù)據(jù)庫(kù)詳解超詳細(xì)
本次實(shí)施內(nèi)容是,oracle單實(shí)例系統(tǒng)文件安裝,操作系統(tǒng)為 CentOS 6.9,數(shù)據(jù)庫(kù)版本 11.2.0.4。
二、oracle 軟件安裝1、以下用 root 賬號(hào)操作
1.1 配置本地 yum 源
Yum(全稱為 Yellow dog Updater, Modified)是一個(gè)在 Fedora 和 RedHat 以及 SUSE、CentOS 中的前端軟件包管理器?;栋芾恚軌驈闹付ǖ姆?wù)器自動(dòng)下載 RPM 包并且安裝,可以自動(dòng)處理依賴性關(guān)系,并且一次安裝所有依賴的軟體包,無(wú)須繁瑣地一次次下載、安裝。
· 掛載鏡像到本地空目錄
[root@heima ~]# mkdir /mnt/cdrom[root@heima ~]# mount -o ro /dev/sr0 /mnt/cdrom· 創(chuàng)建配置文件
[root@heima ~]# cat /etc/yum.repos.d/local.repo[local]name=local yumbaseurl=file:///mnt/cdromenabled=1gpgcheck=0說(shuō)明:如果只配置本地 yum 源,那可以刪除/etc/yum.repos.d/目錄下 Centos 自帶的所有文件,然后自己創(chuàng)建以.repo 結(jié)尾文件即可,內(nèi)容如上。· 創(chuàng)建 yum 緩存
[root@heima ~]# yum clean all[root@heima ~]# yum makecache1.2 安裝所需依賴包[root@heima ~]# yum -y install compat-libstdc++-33 libaio-devel elfutils-libelf-devel
注意:在后面安裝軟件的時(shí)候可以再看需要安裝哪些包,然后裝上就行
1.3 創(chuàng)建用戶組和用戶(具體看要求決定 ID 號(hào))[root@heima ~]# groupadd -g 1000 oinstall[root@heima ~]# groupadd -g 1001 dba[root@heima ~]# useradd -u 1000 -g oinstall -G dba oracle[root@heima ~]# id oracleuid=1000(oracle) gid=1000(oinstall) groups=1000(oinstall),1001(dba)[root@heima ~]# echo oracle|passwd --stdin oracleChanging password for user oracle.passwd: all authentication tokens updated successfully.1.4 創(chuàng)建相應(yīng)數(shù)據(jù)目錄(安裝和數(shù)據(jù)目錄)
[root@heima ~]# mkdir -p /u01/app/{oracle,oradata,oraInventory}[root@heima ~]# chown -R oracle.oinstall /u01/app/[root@heima ~]# chmod -R 775 /u01/app/*1.5 修改 oracle 用戶資源限制
[root@heima ~]# cat >> /etc/security/limits.conf <<EOF> oracle soft nproc 2047> oracle hard nproc 16384> oracle soft nofile 1024> oracle hard nofile 65536> EOF[root@heima ~]# grep 'limit' /etc/pam.d/system-authsession required pam_limits.so1.6 配置系統(tǒng)資源限制(內(nèi)核參數(shù))
[root@heima ~]# cat >> /etc/sysctl.conf << EOFfs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 4294967295kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048586EOF說(shuō)明:以上是參考值,具體值根據(jù)實(shí)際情況進(jìn)行調(diào)整kernel.shmmax = 4294967295 (4G) (需要設(shè)置的比 sga 內(nèi)存大,sga 為物理內(nèi)存內(nèi)存的 80%);如果物理內(nèi)存是 16G,則 sga 可以設(shè)置為 12G,kernel.shmmax = 15032385536(14G)[root@heima ~]# sysctl -p 讓內(nèi)核改變立即生效1.7 配置/etc/hosts 文件
[root@heima ~]# cat /etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain610.1.1.1 heima.itcast.cn heima1.8 關(guān)閉防火墻和 selinux
[root@heima ~]# service iptables stop[root@heima ~]# chkconfig iptables off[root@heima ~]# sed -i '/SELINUX=/cSELINUX=disabled' /etc/selinux/config2、以下用 oracle 賬號(hào)操作
2.1 配置 oracle 用戶 shell 環(huán)境
[root@heima ~]# su - oracle[oracle@heima ~]$ vim .bash_profile文件下面追加以下內(nèi)容:export ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1export ORACLE_SID=ora11gexport PATH=$PATH:$ORACLE_HOME/binexport LD_LIBRARY_PATH=$ORACLE_HOME/dbhome_1/lib:/lib:/usr/lib2.2 安裝 oracle 軟件
· 下載 oracle 軟件并解壓
[oracle@heima ~]$ lsdatabasep13390677_112040_Linux-x86-64_1of7.zipp13390677_112040_Linux-x86-64_2of7.zip· 進(jìn)入到解壓目錄里進(jìn)行安裝
[root@heima ~]# xhost +[oracle@heima ~]$ cd database[oracle@heima ~]$ ./runInstaller錯(cuò)誤提示:
解決辦法:
安裝 VNC 服務(wù),使用 MobaXterm 工具或其他客戶端連接 VNC 服務(wù)端
[root@heima ~]# yum -y install tigervnc-server啟動(dòng)服務(wù):[root@heima ~]# vncserver :1New 'heima.itcast.cn:2 (root)' desktop is heima.itcast.cn:2Starting applications specified in /root/.vnc/xstartupLog file is /root/.vnc/heima.itcast.cn:1.log① 跳過(guò)更新提示
② 選擇只安裝軟件
③ 安裝類型選項(xiàng),選擇單實(shí)例安裝
④ 選擇安裝軟件的語(yǔ)言
⑤ 選擇安裝版本
⑥ 選擇軟件安裝路徑
⑦ 指定相關(guān)文件目錄及組
⑧ 環(huán)境檢查,需要依賴包根據(jù)提示安裝即可
以下包可以忽略,繼續(xù)往下
⑨ 開始安裝
⑩ 在 root 用戶下執(zhí)行兩個(gè)腳本
在 root 用戶下運(yùn)行兩個(gè)腳本的結(jié)果:
執(zhí)行完畢腳本后,點(diǎn)擊 OK,安裝完畢!
三、oracle 數(shù)據(jù)庫(kù)安裝1、運(yùn)行命令:dbca 創(chuàng)建數(shù)據(jù)庫(kù)
[oracle@heima ~]$ dbca2、選擇建庫(kù)類型
3、創(chuàng)建庫(kù)名與實(shí)例名
4、跳過(guò)安裝 OEM
5、設(shè)置密碼
6、指定數(shù)據(jù)庫(kù)安裝目錄(數(shù)據(jù)文件等)
7、開啟歸檔
8、默認(rèn)選項(xiàng)
9、設(shè)置 Oracle 共享內(nèi)存占物理內(nèi)存的 70%~80%
10、設(shè)置 Processes 為 800
11、選擇字符集需注意
12、選擇連接模式
13、日志大小分配 512M
14、記錄建庫(kù)腳本(目錄自定義)
15、開始安裝
四、安裝完畢配置**
[oracle@ esxoradb ~]$ netmgr五、本地訪問(wèn) oracle 數(shù)據(jù)庫(kù)
[oracle@heima admin]$ sqlplus /nologSQL*Plus: Release 11.2.0.4.0 Production on Fri Sep 6 07:03:44 2019Copyright (c) 1982, 2013, Oracle. All rights reserved.SQL> conn sys as sysdba 管理員身份連接數(shù)據(jù)庫(kù)Enter password: 輸入密碼,密碼不顯示Connected.SQL>SQL> select INSTANCE_NAME,VERSION,DATABASE_STATUS from v$instance;INSTANCE_NAME VERSION DATABASE_STATUS---------------- ----------------- -----------------ora11g 11.2.0.4.0 ACTIVE
下一篇:像素?fù)Q算成厘米單位