Cenos 安裝oracle

配置 yum

https://blog.csdn.net/liu_shi_jun/article/details/77986493

安裝圖形化

yum groupinstall "GNOME Desktop" "Graphical Administration Tools"

ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target

startx

一、安裝Oracle前準(zhǔn)備

1.創(chuàng)建運(yùn)行oracle數(shù)據(jù)庫的系統(tǒng)用戶和用戶組

[humf@localhost ~]$ su root  #切換到root

Password:

[root@localhost sonny]# groupadd oinstall  #創(chuàng)建用戶組oinstall

[root@localhost sonny]# groupadd dba  #創(chuàng)建用戶組dba

[root@localhost sonny]# useradd -g oinstall -g dba -m oracle  #創(chuàng)建oracle用戶,并加入到oinstall和dba用戶組

[root@localhost sonny]# passwd oracle  #設(shè)置用戶oracle的登陸密碼低葫,不設(shè)置密碼,在CentOS的圖形登陸界面沒法登陸

Changing password for user oracle.

New password: Admin123456789# 密碼

BAD PASSWORD: The password is shorter than 8 characters

Retype new password: Admin123456789# 確認(rèn)密碼

passwd: all authentication tokens updated successfully.

[root@localhost sonny]# id oracle # 查看新建的oracle用戶

uid=1001(oracle) gid=1002(dba) groups=1002(dba)

[root@localhost sonny]#

2.修改操作系統(tǒng)核心參數(shù)

在Root用戶下執(zhí)行以下步驟:

1)修改用戶的SHELL的限制殿雪,修改/etc/security/limits.conf文件

輸入命令:vi /etc/security/limits.conf,按i鍵進(jìn)入編輯模式锋爪,將下列內(nèi)容加入該文件丙曙。

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

編輯完成后按Esc鍵爸业,輸入“:wq”存盤退出

2)修改/etc/pam.d/login 文件,輸入命令:vi /etc/pam.d/login亏镰,按i鍵進(jìn)入編輯模式扯旷,將下列內(nèi)容加入該文件。

session required /lib/security/pam_limits.so

session required pam_limits.so

編輯完成后按Esc鍵索抓,輸入“:wq”存盤退出

3)修改linux內(nèi)核钧忽,修改/etc/sysctl.conf文件,輸入命令: vi /etc/sysctl.conf 逼肯,按i鍵進(jìn)入編輯模式耸黑,將下列內(nèi)容加入該文件

fs.file-max = 6815744

fs.aio-max-nr = 1048576

kernel.shmall = 2097152

kernel.shmmax = 2147483648

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default = 4194304

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048576

編輯完成后按Esc鍵,輸入“:wq”存盤退出

4)要使 /etc/sysctl.conf 更改立即生效篮幢,執(zhí)行以下命令大刊。 輸入:sysctl -p 顯示如下:

linux:~ # sysctl -p

net.ipv4.icmp_echo_ignore_broadcasts = 1

net.ipv4.conf.all.rp_filter = 1

fs.file-max = 6815744

fs.aio-max-nr = 1048576

kernel.shmall = 2097152

kernel.shmmax = 2147483648

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default = 4194304

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048576

5)編輯 /etc/profile ,輸入命令:vi /etc/profile三椿,按i鍵進(jìn)入編輯模式缺菌,將下列內(nèi)容加入該文件。

if [ $USER = "oracle" ]; then

if [ $SHELL = "/bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

fi

編輯完成后按Esc鍵搜锰,輸入“:wq”存盤退出

6)創(chuàng)建數(shù)據(jù)庫軟件目錄和數(shù)據(jù)文件存放目錄伴郁,目錄的位置,根據(jù)自己的情況來定蛋叼,注意磁盤空間即可焊傅,這里我把其放到oracle用戶下,例如:

輸入命令:

mkdir /home/oracle/app

mkdir /home/oracle/app/oracle

mkdir /home/oracle/app/oradata

mkdir /home/oracle/app/oracle/product

7)更改目錄屬主為Oracle用戶所有,輸入命令:

chown -R oracle:oinstall /home/oracle/app

8)配置oracle用戶的環(huán)境變量鸦列,首先,切換到新創(chuàng)建的oracle用戶下,

輸入:su – oracle 鹏倘,然后直接在輸入 : vi .bash_profile

按i編輯 .bash_profile,進(jìn)入編輯模式薯嗤,增加以下內(nèi)容:

export ORACLE_BASE=/home/oracle/app

export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1

export ORACLE_SID=orcl

export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

編輯完成后按Esc鍵,輸入“:wq”存盤退出

ps:我的云服務(wù)器沒有防火墻纤泵,如果你們有骆姐,可以關(guān)閉

--關(guān)閉防火墻 CentOS 7.2默認(rèn)使用的是firewall作為防火墻

[humf@localhost /]$ su root

Password:

[root@localhost /]# systemctl status firewalld.service  #查看防火墻狀態(tài),運(yùn)行中

● firewalld.service - firewalld - dynamic firewall daemon

? Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)

? Active: active (running) since Thu 2016-04-07 18:54:29 PDT; 2h 20min ago

Main PID: 802 (firewalld)

? CGroup: /system.slice/firewalld.service

? ? ? ? ? └─802 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

Apr 07 18:54:25 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...

Apr 07 18:54:29 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.

[root@localhost /]# systemctl stop firewalld.service  #關(guān)閉防火墻

[root@localhost /]# systemctl status firewalld.service  #再次查看防火墻狀態(tài)捏题,發(fā)現(xiàn)已關(guān)閉

● firewalld.service - firewalld - dynamic firewall daemon

? Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)

? Active: inactive (dead) since Thu 2016-04-07 21:15:34 PDT; 9s ago

Main PID: 802 (code=exited, status=0/SUCCESS)

Apr 07 18:54:25 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...

Apr 07 18:54:29 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.

Apr 07 21:15:33 localhost systemd[1]: Stopping firewalld - dynamic firewall daemon...

Apr 07 21:15:34 localhost systemd[1]: Stopped firewalld - dynamic firewall daemon.

[root@localhost /]# systemctl disable firewalld.service  #禁止使用防火墻(重啟也是禁止的)

Removed symlink /etc/systemd/system/dbus-org.Fedoraproject.FirewallD1.service.

Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.

[root@localhost /]#

防火墻先禁用玻褪,搞好之后再配置,個人虛擬機(jī)公荧,要毛線防火墻~~

6.關(guān)閉selinux(需重啟生效)

[root@localhost /]# vi /etc/selinux/config

[root@localhost /]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#? ? enforcing - SELinux security policy is enforced.

#? ? permissive - SELinux prints warnings instead of enforcing.

#? ? disabled - No SELinux policy is loaded.

SELINUX=disabled? #此處修改為disabled

# SELINUXTYPE= can take one of three two values:

#? ? targeted - Targeted processes are protected,

#? ? minimum - Modification of targeted policy. Only selected processes are protected.

#? ? mls - Multi Level Security protection.

SELINUXTYPE=targeted

7.安裝oracle數(shù)據(jù)庫所需的軟件包

#yum install gcc* gcc-* gcc-c++-* glibc-devle-* glibc-headers-* compat-libstdc* libstdc* elfutils-libelf-devel*

libaio-devel* sysstat* unixODBC-* pdksh-* make ksh binutils -y

8.

首先將下載的Oracle安裝包復(fù)制到linux中带射,用Xftp工具拷貝。

打開一個終端循狰,運(yùn)行unzip命令解壓oracle安裝文件窟社,如:

輸入命令:

unzip linux.x64_11gR2_database_1of2.zip

unzip linux.x64_11gR2_database_2of2.zip

9.用 oracle 用戶登錄?

進(jìn)入文件路徑? shell 窗口 運(yùn)行? ? runInstaller

10.安裝 券勺。。灿里。

11.ORACLE啟動監(jiān)聽器

(1)切換至oracle安裝用戶(一般為oracle)

su - oracle

(2)啟動監(jiān)聽器

lsnrctl start

(3)停止監(jiān)聽器

lsnrctl stop

(4)啟動測試oracle:

[oracle@oracle ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Fri Jul 27 02:12:12 2012

Copyright (c) 1982, 2009, Oracle. All rights reserved.

SQL> quit

(5)啟動 網(wǎng)頁控制臺

emctl start dbconsole

===============

CentOS7使用firewalld打開關(guān)閉防火墻與端口? 附ORACLE 數(shù)據(jù)庫1158 152端口開啟

1关炼、firewalld的基本使用

啟動: systemctl start firewalld

查看狀態(tài): systemctl status firewalld?

停止: systemctl disable firewalld

禁用: systemctl stop firewalld

2.systemctl是CentOS7的服務(wù)管理工具中主要的工具,它融合之前service和chkconfig的功能于一體匣吊。

啟動一個服務(wù):systemctl start firewalld.service

關(guān)閉一個服務(wù):systemctl stop firewalld.service

重啟一個服務(wù):systemctl restart firewalld.service

顯示一個服務(wù)的狀態(tài):systemctl status firewalld.service

在開機(jī)時(shí)啟用一個服務(wù):systemctl enable firewalld.service

在開機(jī)時(shí)禁用一個服務(wù):systemctl disable firewalld.service

查看服務(wù)是否開機(jī)啟動:systemctl is-enabled firewalld.service

查看已啟動的服務(wù)列表:systemctl list-unit-files|grep enabled

查看啟動失敗的服務(wù)列表:systemctl --failed

3.配置firewalld-cmd

查看版本: firewall-cmd --version

查看幫助: firewall-cmd --help

顯示狀態(tài): firewall-cmd --state

查看所有打開的端口: firewall-cmd --zone=public --list-ports

更新防火墻規(guī)則: firewall-cmd --reload

查看區(qū)域信息:? firewall-cmd --get-active-zones查看指定接口所屬區(qū)域: firewall-cmd --get-zone-of-interface=eth0

拒絕所有包:firewall-cmd --panic-on取消拒絕狀態(tài): firewall-cmd --panic-off查看是否拒絕: firewall-cmd --query-panic 那怎么開啟一個端口呢添加firewall-cmd --zone=public --add-port=80/tcp --permanent? ? (--permanent永久生效儒拂,沒有此參數(shù)重啟后失效)firewall-cmd --zone=public --add-port=1521/tcp --permanent? ? oracle數(shù)據(jù)庫監(jiān)聽端口,目前阿里云新購默認(rèn)這些端口不開放 需要在防火墻添加或者在控制面板放行firewall-cmd --zone=public --add-port=1158/tcp --permanent? ? ? ? ORACLE 數(shù)據(jù)庫EM控制臺端口重新載入firewall-cmd --reload查看firewall-cmd --zone= public --query-port=80/tcp刪除firewall-cmd --zone= public --remove-port=80/tcp --permanent

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末色鸳,一起剝皮案震驚了整個濱河市社痛,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌缕碎,老刑警劉巖褥影,帶你破解...
    沈念sama閱讀 218,036評論 6 506
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異咏雌,居然都是意外死亡凡怎,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,046評論 3 395
  • 文/潘曉璐 我一進(jìn)店門赊抖,熙熙樓的掌柜王于貴愁眉苦臉地迎上來统倒,“玉大人,你說我怎么就攤上這事氛雪》看遥” “怎么了?”我有些...
    開封第一講書人閱讀 164,411評論 0 354
  • 文/不壞的土叔 我叫張陵报亩,是天一觀的道長浴鸿。 經(jīng)常有香客問我,道長弦追,這世上最難降的妖魔是什么岳链? 我笑而不...
    開封第一講書人閱讀 58,622評論 1 293
  • 正文 為了忘掉前任,我火速辦了婚禮劲件,結(jié)果婚禮上掸哑,老公的妹妹穿的比我還像新娘。我一直安慰自己零远,他們只是感情好苗分,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,661評論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著牵辣,像睡著了一般摔癣。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,521評論 1 304
  • 那天供填,我揣著相機(jī)與錄音拐云,去河邊找鬼。 笑死近她,一個胖子當(dāng)著我的面吹牛叉瘩,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播粘捎,決...
    沈念sama閱讀 40,288評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼薇缅,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了攒磨?” 一聲冷哼從身側(cè)響起泳桦,我...
    開封第一講書人閱讀 39,200評論 0 276
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎娩缰,沒想到半個月后灸撰,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,644評論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡拼坎,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,837評論 3 336
  • 正文 我和宋清朗相戀三年浮毯,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片泰鸡。...
    茶點(diǎn)故事閱讀 39,953評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡债蓝,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出盛龄,到底是詐尸還是另有隱情饰迹,我是刑警寧澤,帶...
    沈念sama閱讀 35,673評論 5 346
  • 正文 年R本政府宣布余舶,位于F島的核電站啊鸭,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏匿值。R本人自食惡果不足惜赠制,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,281評論 3 329
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望千扔。 院中可真熱鬧憎妙,春花似錦库正、人聲如沸曲楚。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,889評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽龙誊。三九已至,卻和暖如春喷楣,著一層夾襖步出監(jiān)牢的瞬間趟大,已是汗流浹背鹤树。 一陣腳步聲響...
    開封第一講書人閱讀 33,011評論 1 269
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留逊朽,地道東北人罕伯。 一個月前我還...
    沈念sama閱讀 48,119評論 3 370
  • 正文 我出身青樓,卻偏偏與公主長得像叽讳,于是被迫代替她去往敵國和親追他。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,901評論 2 355

推薦閱讀更多精彩內(nèi)容