1、系統(tǒng)基本信息
# 2020年12月5日 虛擬機(jī)測(cè)試安裝
host:r6811g
192.168.1.183
192.168.1.1
10.10.10.20
root密碼:123456
oracle: oracle
#時(shí)間
date -s 2019-05-13
date -s 14:15:00
hwclock 查看硬件時(shí)間
#防火墻父能、selinux
service iptables stop
chkconfig iptables off
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
service ntpd stop
chkconfig ntpd off
mv /etc/ntp.conf /etc/ntp.conf.bak
2神凑、配置源-安裝依賴包
#yum源
#有兩種方式:第一、使用163源何吝,經(jīng)過測(cè)試國(guó)內(nèi)163源溉委,centos6已經(jīng)沒有了;第二爱榕、使用光盤作為源
#第一種方式如下:
1.切換到y(tǒng)um源存放目錄
[root@r6811g ~]# cd /etc/yum.repos.d/
2.wget方式下載網(wǎng)易Centos yum源
[root@r6811g yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
3.修改文件名瓣喊,備份自帶redhat源
[root@r6811g yum.repos.d]# mv rhel-source.repo rhel-source.repo.bak
[root@r6811g yum.repos.d]# mv CentOS6-Base-163.repo rhel-source.repo
4.修改repo文件中的版本號(hào)
[root@r6811g yum.repos.d]# sed -i "s;\$releasever;6;g" rhel-source.repo
5.清除原有緩存
[root@r6811g yum.repos.d]# yum clean all
6.獲取yum列表
[root@r6811g yum.repos.d]# yum makecache
#yum安裝 rpm -Uvh * 使用此命令安裝下邊的包
python-urlgrabber-3.9.1-11.el6.noarch.rpm
yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
yum-3.2.29-81.el6.centos.noarch.rpm
yum-updateonboot-1.1.30-40.el6.noarch.rpm
yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
yum-utils-1.1.30-40.el6.noarch.rpm
#依賴包
yum -y install gcc
yum -y install elfutils-libelf-devel
yum -y install gcc-c++
yum -y install libstdc++-devel
yum install -y binutils-* compat-db* compat-db-* control-center* gcc-* gcc-c++-* glibc-* glibc-common-* gnome-libs-* make-* pdksh* sysstat-* xscreensaver-* make-* gdb-6.1post-* glibc-* glibc-common-* glibc-devel-* glibc-devel-* compat-gcc-* compat-gcc-c++-* compat-libstdc++-* compat-libstdc++-devel-* gnome-libs-* libstdc++-* libstdc++-devel-* openmotif-* sysstat-* setarch-* libaio-* libaio-devel-* libXp* libXp-devel* elfutils-libelf-devel* unixODBC-* unixODBC-devel-* compat-libcap1.x86_64 libcap.so.1 sg3_utils
#第二種方式:以光盤為源
df -h #查看光盤掛載路徑
mkdir /yum #創(chuàng)建yum文件夾
cp -r /media/RHEL-6.8\ Server.x86_64/* /yum #將光盤內(nèi)文件拷貝到y(tǒng)um
etc/yum.repos.d #到源配置目錄
touch yum_repo.repo #新建文件
vim yum_repo.repo #編輯文件
#寫入:
[yum_repo]
name=yum_repo
baseurl=file:///yum
enable=1
gpgcheck=1
gpgkey=file:///yum/RPM-GPG-KEY-redhat-release
yum clean all #清理緩存
yum makecache #建立新緩存
yum repolist #查看倉(cāng)庫
#安裝依賴包
yum -y install gcc
yum -y install elfutils-libelf-devel
yum -y install gcc-c++
yum -y install libstdc++-devel
yum install -y binutils-* compat-db* compat-db-* control-center* gcc-* gcc-c++-* glibc-* glibc-common-* gnome-libs-* make-* pdksh* sysstat-* xscreensaver-* make-* gdb-6.1post-* glibc-* glibc-common-* glibc-devel-* glibc-devel-* compat-gcc-* compat-gcc-c++-* compat-libstdc++-* compat-libstdc++-devel-* gnome-libs-* libstdc++-* libstdc++-devel-* openmotif-* sysstat-* setarch-* libaio-* libaio-devel-* libXp* libXp-devel* elfutils-libelf-devel* unixODBC-* unixODBC-devel-* compat-libcap1.x86_64 libcap.so.1 sg3_utils
3、資源限制修改
#修改用戶的shell限制黔酥,新增(在 #End of file 之前)
vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
vi /etc/pam.d/login #新增
session required /lib/security/pam_limits.so
session required pam_limits.so
vi /etc/sysctl.conf #新增
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1054504960
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
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=1048586
sysctl -p #執(zhí)行
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
4藻三、 安裝oracle
#上傳oracle11g安裝包
linux.x64_11gR2_database_1of2.zip
linux.x64_11gR2_database_2of2.zip
#oracle用戶環(huán)境變量
創(chuàng)建用戶,root下執(zhí)行:
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -g oinstall -G dba oracle
passwd oracle #輸入密碼
#創(chuàng)建文件目錄
mkdir /home/oracle/app
mkdir /home/oracle/app/oracle
mkdir /home/oracle/app/oradata
mkdir /home/oracle/app/oracle/product
chown -R oracle:oinstall /home/oracle/app
#環(huán)境變量
su - oracle
vi .bash_profile
新增
export ORACLE_BASE=/home/oracle/app
export ORACLE_HOME=$ORACLE_BASE/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
export PATH=/home/oracle/app/product/11.2.0/dbhome_1/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin
export PATH=$ORACLE_HOME/bin:$PATH
#圖形界面安裝
解壓文件
su - root
cd /home/oracle
unzip /mnt/linux.x64_11gR2_database_1of2.zip #根據(jù)個(gè)人目錄調(diào)整
unzip /mnt/linux.x64_11gR2_database_2of2.zip #根據(jù)個(gè)人目錄調(diào)整
#登陸主機(jī)界面(非遠(yuǎn)程)
su - oracle #最好注銷root跪者,重新用oracle登陸棵帽,否則可能報(bào)錯(cuò)
cd database
./runInstaller
export LANG=en_US.UTF-8 #出現(xiàn)亂碼執(zhí)行
5、圖形界面安裝
image-20200221105320492.png
image-20200221105405058.png
image-20200221105414989.png
image-20200221105423382.png
image-20200221105433586.png
image-20200221105439286.png
image-20200221105444481.png
image-20200221105449109.png
image-20200221105453115.png
image-20200221105457756.png
image-20200221105501776.png
image-20200221105506193.png
image-20200221105510356.png
image-20200221105514712.png
image-20200221105518619.png
image-20200221105522602.png
image-20200221105526535.png
image-20200221105532957.png
image-20200221105536734.png
image-20200221105540785.png
image-20200221105545972.png
image-20200221105550799.png
image-20200221105554684.png
image-20200221105558736.png
image-20200221105605159.png
image-20200221105609479.png