第四章:Oracle12c 数据库在linux环境安装

Posted ✧*꧁一品堂.技术学习笔记꧂*✧.

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了第四章:Oracle12c 数据库在linux环境安装相关的知识,希望对你有一定的参考价值。




一:搭建yum 仓库

对于新手可以参考此文:《Vmware Workstation _linux yum 仓库搭建》、《CentOS7.2 创建本地YUM源和局域网YUM源


1)切换至 yum.repo.d 目录

[root@oracle ~]#  cd /etc/yum.repos.d
[root@oracle yum.repos.d]# ls
packagekit-media.repo  public-yum-ol6.repo
[root@oracle yum.repos.d]# cat 100 public-yum-ol6.repo 
cat: 100: No such file or directory
[public_ol6_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[public_ol6_addons]
name=Oracle Linux $releasever Add ons ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/addons/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_ga_base]
name=Oracle Linux $releasever GA installation media copy ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/0/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_u1_base]
name=Oracle Linux $releasever Update 1 installation media copy ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/1/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_u2_base]
name=Oracle Linux $releasever Update 2 installation media copy ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/2/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_u3_base]
name=Oracle Linux $releasever Update 3 installation media copy ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/3/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_u4_base]
name=Oracle Linux $releasever Update 4 installation media copy ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/4/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_u5_base]
name=Oracle Linux $releasever Update 5 installation media copy ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/5/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_u6_base]
name=Oracle Linux $releasever Update 6 installation media copy ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/6/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_u7_base]
name=Oracle Linux $releasever Update 7 installation media copy ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/7/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_u8_base]
name=Oracle Linux $releasever Update 8 installation media copy ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/8/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_UEK_latest]
name=Latest Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/UEK/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=$uek

[public_ol6_UEKR3_latest]
name=Unbreakable Enterprise Kernel Release 3 for Oracle Linux $releasever ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/UEKR3/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=$uekr3

[public_ol6_UEKR4]
name=Latest Unbreakable Enterprise Kernel Release 4 for Oracle Linux $releasever ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/UEKR4/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=$uekr4

[public_ol6_UEK_base]
name=Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/UEK/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_mysql]
name=MySQL 5.5 for Oracle Linux 6 ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/MySQL/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_gdm_multiseat]
name=Oracle Linux 6 GDM Multiseat ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/gdm_multiseat/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_MySQL56]
name=MySQL 5.6 for Oracle Linux 6 ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/MySQL56/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_MySQL57]
name=MySQL 5.7 for Oracle Linux 6 ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/MySQL57_community/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_ceph10]
name=Ceph Storage for Oracle Linux Release 1.0 - Oracle Linux 6.6 or later ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/ceph10/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_spacewalk20_server]
name=Spacewalk Server 2.0 for Oracle Linux 6 ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/spacewalk20/server/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_spacewalk20_client]
name=Spacewalk Client 2.0 for Oracle Linux 6 ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/spacewalk20/client/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

# the following repositories are only available for x86_64 architecture systems
[public_ol6_ofed_UEK]
name=OFED supporting tool packages for Unbreakable Enterprise Kernel on Oracle Linux 6 ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/ofed_UEK/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0
priority=20

[public_ol6_UEKR4_OFED]
name=OFED supporting tool packages for Unbreakable Enterprise Kernel Release 4 on Oracle Linux 6 ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/UEKR4/OFED/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0
priority=20

[public_ol6_playground_latest]
name=Latest mainline stable kernel for Oracle Linux 6 ($basearch) - Unsupported
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/playground/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_spacewalk22_server]
name=Spacewalk Server 2.2 for Oracle Linux 6 ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/spacewalk22/server/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_spacewalk22_client]
name=Spacewalk Client 2.2 for Oracle Linux 6 ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/spacewalk22/client/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_software_collections]
name=Software Collection Library release 1.2 packages for Oracle Linux 6 (x86_64)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/SoftwareCollections12/x86_64/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_spacewalk24_server]
name=Spacewalk Server 2.4 for Oracle Linux 6 ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/spacewalk24/server/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[public_ol6_spacewalk24_client]
name=Spacewalk Client 2.4 for Oracle Linux 6 ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/spacewalk24/client/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[root@oracle yum.repos.d]# 

2)创建任意名,后缀为.repo 的文件

#查看文件挂载情况
[root@oracle yum.repos.d]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_oracle-lv_root
                       50G  4.2G   43G   9% /
tmpfs                 1.9G  228K  1.9G   1% /dev/shm
/dev/sda1             477M   83M  366M  19% /boot
/dev/mapper/vg_oracle-lv_home
                      955G  288M  906G   1% /home
/dev/sr0              3.8G  3.8G     0 100% /media/OL6.8 x86_64 Disc 1 20160518  #系统光盘默认挂载
[root@oracle yum.repos.d]# 

如果系统没有默认加载linux系统光盘。的挂载方式。

#制作没有挂载的环境。先把 public-yum-ol6.repo  文件名修改修改
[root@oracle yum.repos.d]# ls
packagekit-media.repo  public-yum-ol6.repo
[root@oracle yum.repos.d]# mv public-yum-ol6.repo  public-yum-ol6.repo.bak20181222
[root@oracle yum.repos.d]# ls
packagekit-media.repo  public-yum-ol6.repo.bak20181222
[root@oracle yum.repos.d]# 


[root@oracle yum.repos.d]# vi server.repo
[public_ol6_latest]
name=Oracle Linux ###名称可以任取 
baseurl=file:///mnt/Server ####file:///mnt 本机,网络:http://,ftp:// 
gpgcheck=1 ###验证签名,mdd5 
enabled=1 ####启用yum仓库 
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle ###验证签名 

具体操作如图:如果 yum list  all 显示没有错误,表示yum 环境安装成功了 。

image


TIPS:

执行 yum list all 验证 yum 仓库是否配置好。若开始配置错了,用 yum clean all 清理后,再次执行 yum list all



二:安装所需要的包


方法一:执行该包,会自动安装依赖包,oracle 安装所有者和组,并设置内核设置

yum install oracle-rdbms-server-12cR1-preinstall* -y
####更新sysctl.con配置 
#sysctl -p 
####安装日志 
/var/log/oracle-database-server-12cR2-preinstall/backup/timestamp/orakernel.log


方法二:手动安装依赖包,创建用户和组,并配置内核

1:安装yum 包

image

yum install binutils-* -y
yum install compat-libstdc++-33* -y
yum install coreutils-* -y
yum install elfutils-libelf-* -y
yum install elfutils-libelf-devel-* -y
yum install gcc* -y
yum install gcc-c++-* -y
yum install glibc-* -y
yum install glibc-common-* -y
yum install glibc-devel-* -y
yum install glibc-headers* -y
yum install ksh* -y
yum install libaio* -y
yum install libaio-devel-*
yum install libgcc-* -y
yum install libstdc++-* -y
yum install libstdc++-devel-* -y
yum install make-* -y
yum install sysstat-* -y
yum install unixODBC-* -y
yum install unixODBC-devel* -y
yum install compat-libcap* -y

2:配置资源登录参数

vi /etc/security/limits.conf

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 10240

image

image


3;配置 pam.d 参数

vi /etc/pam.d/login

session required pam_limits.so

image

image


4:资源参数配置



kernel.shmall =

##note:1/2 of physical memory in pages, this will be the value 2097152. See Note 301830.1 for more information. 对于超出8GB系统内存,如共享内存段(shmmax)的最大大小是16G,则所需要共享内存页数(shmall)为16GB/4KB=16777216KB/4KB=4194304(页) 32GB,64GB可以依上述方式类推。


kernel.shmmax =
##note:1/2 of physical memory in bytes. This would be the value 2147483648 for a system with 4GB of physical RAM. (单位字节)

kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
fs.aio-max-nr = 1048576
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
kernel.panic_on_oops=1 ####12c新增加参数








image

image



5:创建用户


# /usr/sbin/groupadd -g 54321 oinstall
# /usr/sbin/groupadd -g 54322 dba 
# /usr/sbin/useradd -u 54321 -g oinstall -G dba oracle

image

image



三.关闭 SELINUX 功能


会自动安装依赖包,oracle 安装所有者和组,并设置内核设置

SELINUX=disabled ####这里设置为 disabled 关闭 SELINUX 


image

[root@oracle yum.repos.d]# service iptables stop 
iptables: Setting chains to policy ACCEPT: filter [  OK  ]
iptables: Flushing firewall rules: [  OK  ]
iptables: Unloading modules: [  OK  ]

[root@oracle yum.repos.d]# chkconfig iptables off
[root@oracle yum.repos.d]# 
[root@oracle yum.repos.d]# 

image



四.修改/etc/hosts  文件

修改前:

image


# vi /etc/hosts


127.0.0.1   localhost   localhost.localdomain
192.168.232.2 oracle oracle.example.com

#Note:三元合一致/etc/hosts 文件解析hostname 指令显示的主机名/etc/sysconfig/network 配置

修改后:

image


五:创建安装目录

[root@oracle ~]# mkdir -p /u01/app/oracle ###创建目录
[root@oracle ~]# chown -R oracle:oinstall /u01/app/oracle ###目录所属
root@oracle ~]# chmod -R 775 /u01/ ###授权
root@oracle ~]# chmod -R 775 /u01/app/ ###授权
[root@oracle ~]# chmod -R 775 /u01/app/oracle ###授权

image




六:配置环境变量



image

image

[oracle@oracle ~]$ vi .bash_profile


export ORACLE_SID=orcl
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
export UMASK=022

export ORACLE_TERM=xterm
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export CLASSPATH=$ORACLE_HOME/JRE:ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib


image

[oracle@oracle ~]$ source /home/oracle/.bash_profile






七:安装数据库软件


1:上传压缩包

1):用鼠标在ssh2的连接页签上面右键选择“连接SFTP标签”


2):在sftp页签中:用put filepath 的方式上传文件

image


查看上传的文件信息。

image

image

Last login: Sat Dec 22 14:34:45 2018 from 192.168.1.107
[root@oracle ~]# ls
anaconda-ks.cfg  Documents  install.log         Music                                   p17694377_121020_Linux-x86-64_2of8.zip  Public     Videos
Desktop          Downloads  install.log.syslog  p17694377_121020_Linux-x86-64_1of8.zip  Pictures                                Templates
[root@oracle ~]# ll
total 2625160
-rw-------. 1 root root       1805 Dec 16 23:53 anaconda-ks.cfg
drwxr-xr-x. 2 root root       4096 Dec 16 00:37 Desktop
drwxr-xr-x. 2 root root       4096 Dec 16 00:37 Documents
drwxr-xr-x. 2 root root       4096 Dec 16 00:37 Downloads
-rw-r--r--. 1 root root      51901 Dec 16 23:53 install.log
-rw-r--r--. 1 root root       9810 Dec 16 23:49 install.log.syslog
drwxr-xr-x. 2 root root       4096 Dec 16 00:37 Music
-rw-r--r--. 1 root root 1673517582 Dec 22 11:37 p17694377_121020_Linux-x86-64_1of8.zip
-rw-r--r--. 1 root root 1014527110 Dec 22 11:18 p17694377_121020_Linux-x86-64_2of8.zip
drwxr-xr-x. 2 root root       4096 Dec 16 00:37 Pictures
drwxr-xr-x. 2 root root       4096 Dec 16 00:37 Public
drwxr-xr-x. 2 root root       4096 Dec 16 00:37 Templates
drwxr-xr-x. 2 root root       4096 Dec 16 00:37 Videos
[root@oracle ~]# cd /
[root@oracle /]# ls
bin  boot  dev  etc  home  lib  lib64  lost+found  media  misc  mnt  net  opt  proc  root  sbin  selinux  srv  sys  tmp  u01  usr  var
[root@oracle /]# cd /home/oracle/
[root@oracle oracle]# ls
[root@oracle oracle]# mv /root/p17694377_121020_Linux-x86-64_* /home/oracle/.
[root@oracle oracle]# ls
p17694377_121020_Linux-x86-64_1of8.zip  p17694377_121020_Linux-x86-64_2of8.zip
[root@oracle oracle]# 
[root@oracle oracle]# ll
total 2625056
-rw-r--r--. 1 root root 1673517582 Dec 22 11:37 p17694377_121020_Linux-x86-64_1of8.zip
-rw-r--r--. 1 root root 1014527110 Dec 22 11:18 p17694377_121020_Linux-x86-64_2of8.zip

[root@oracle oracle]# chown oracle:oinstall p17694377_121020_Linux-x86-64_*
[root@oracle oracle]# ll
total 2625056
-rw-r--r--. 1 oracle oinstall 1673517582 Dec 22 11:37 p17694377_121020_Linux-x86-64_1of8.zip
-rw-r--r--. 1 oracle oinstall 1014527110 Dec 22 11:18 p17694377_121020_Linux-x86-64_2of8.zip
[root@oracle oracle]# 



2:解压压缩包

这个解压过程需要些时间

# unzip p17694377_121020_Linux-x86-64_1of8.zip
# unzip p17694377_121020_Linux-x86-64_2of8.z

image

修改文件的 权限

[root@oracle oracle]# pwd
/home/oracle
[root@oracle oracle]# ll
total 2625060
drwxr-xr-x. 7 oracle oinstall       4096 Jul 11  2014 database
-rw-r--r--. 1 oracle oinstall 1673517582 Dec 22 11:37 p17694377_121020_Linux-x86-64_1of8.zip
-rw-r--r--. 1 oracle oinstall 1014527110 Dec 22 11:18 p17694377_121020_Linux-x86-64_2of8.zip
[root@oracle oracle]# chown -R oracle:oinstall /home/oracle/database/
[root@oracle oracle]# ll
total 2625060
drwxr-xr-x. 7 oracle oinstall       4096 Jul 11  2014 database
-rw-r--r--. 1 oracle oinstall 1673517582 Dec 22 11:37 p17694377_121020_Linux-x86-64_1of8.zip
-rw-r--r--. 1 oracle oinstall 1014527110 Dec 22 11:18 p17694377_121020_Linux-x86-64_2of8.zip
[root@oracle oracle]# cd database/
[root@oracle database]# ll
total 72
drwxr-xr-x.  4 oracle oinstall  4096 Dec 23 10:44 install
-rwxr-xr-x.  1 oracle oinstall 34132 Jul 11  2014 readme.html
drwxrwxr-x.  2 oracle oinstall  4096 Jul  7  2014 response
drwxr-xr-x.  2 oracle oinstall  4096 Jul  7  2014 rpm
-rwxr-xr-x.  1 oracle oinstall  8533 Jul  7  2014 runInstaller
drwxrwxr-x.  2 oracle oinstall  4096 Jul  7  2014 sshsetup
drwxr-xr-x. 14 oracle oinstall  4096 Jul  7  2014 stage
-rwxr-xr-x.  1 oracle oinstall   500 Feb  7  2013 welcome.html
[root@oracle database]# 
[root@oracle database]# 


image


3.安装数据库软件


1:安装Xme30.exe 软件

软件下载路劲:链接:http://pan.baidu.com/s/1gf5cbKn 密码:m1pn

1):安装步骤一直下一步即可

img7

2):注册lic

image


3):启动工具

img10




2:oracle 11g 安装步骤图解

1:查看宿主机器(即:客户机的ip)

image

2:设置Oracle 用户登录密码,(我这里设置的为oracle  实际情况的密码据实际环境情况而定)。并切换到 oracle用户

image

#查看文件
[oracle@oracle ~]$ ls
database  p17694377_121020_Linux-x86-64_1of8.zip  p17694377_121020_Linux-x86-64_2of8.zip
[oracle@oracle ~]$ ll
total 2625060
drwxr-xr-x. 7 oracle oinstall       4096 Jul 11  2014 database
-rw-r--r--. 1 oracle oinstall 1673517582 Dec 22 11:37 p17694377_121020_Linux-x86-64_1of8.zip
-rw-r--r--. 1 oracle oinstall 1014527110 Dec 22 11:18 p17694377_121020_Linux-x86-64_2of8.zip
#显示文件路径
[oracle@oracle ~]$ pwd
/home/oracle
#查看文件属性
[oracle@oracle ~]$ ls -all
total 2625092
drwx------. 5 oracle oinstall       4096 Dec 23 11:25 .
drwxr-xr-x. 5 root   root           4096 Dec 22 16:36 ..
-rw-------. 1 oracle oinstall         81 Dec 23 11:25 .bash_history
-rw-r--r--. 1 oracle oinstall         18 Mar 22  2016 .bash_logout
-rw-r--r--. 1 oracle oinstall        176 Mar 22  2016 .bash_profile
-rw-r--r--. 1 oracle oinstall        124 Mar 22  2016 .bashrc
drwxr-xr-x. 7 oracle oinstall       4096 Jul 11  2014 database
drwxr-xr-x. 2 oracle oinstall       4096 Nov 20  2010 .gnome2
drwxr-xr-x. 4 oracle oinstall       4096 Dec 16 23:42 .mozilla
-rw-r--r--. 1 oracle oinstall 1673517582 Dec 22 11:37 p17694377_121020_Linux-x86-64_1of8.zip
-rw-r--r--. 1 oracle oinstall 1014527110 Dec 22 11:18 p17694377_121020_Linux-x86-64_2of8.zip
#递归的查看 database 文件夹下的文件属性
[oracle@oracle ~]$  ls -allR database/



修改:.bash_profile 文件内容;增加下内容。

#//以下内容可不写
#//指定安装Oracle 终端的类型
export ORACLE_TERM=xterm

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

#设置临时的库文件的path 路径

export CLASSPATH=$ORACLE_HOME/JRE:ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

#设置java lib 文件搜索路径

image


Last login: Sun Dec 23 11:21:51 2018 from 192.168.1.107
[root@oracle ~]# su - oracle
[oracle@oracle ~]$ ls
database  p17694377_121020_Linux-x86-64_1of8.zip  p17694377_121020_Linux-x86-64_2of8.zip
[oracle@oracle ~]$ cd database/
[oracle@oracle database]$ ll
total 72
drwxr-xr-x.  4 oracle oinstall  4096 Dec 23 10:44 install
-rwxr-xr-x.  1 oracle oinstall 34132 Jul 11  2014 readme.html
drwxrwxr-x.  2 oracle oinstall  4096 Jul  7  2014 response
drwxr-xr-x.  2 oracle oinstall  4096 Jul  7  2014 rpm
-rwxr-xr-x.  1 oracle oinstall  8533 Jul  7  2014 runInstaller
drwxrwxr-x.  2 oracle oinstall  4096 Jul  7  2014 sshsetup
drwxr-xr-x. 14 oracle oinstall  4096 Jul  7  2014 stage
-rwxr-xr-x.  1 oracle oinstall   500 Feb  7  2013 welcome.html
[oracle@oracle database]$






[oracle@oracle database]$ export DISPLAY=192.168.1.106:0.0
[oracle@oracle database]$ ./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB.   Actual 42455 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 3967 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-12-23_12-04-12PM. Please wait ...[oracle@oracle database]$

image


6]7~%R2{2G0HRP[BP9_SK)E



3:进行图形界面的安装操作

 取消接受更新选项框, next

image

点击yes

image

这里先选择“install database software only” 仅安装数据库软件

image



单实例数据库安装,Next

image


安装语言选择。

image

image

Next

image

ORACLE_BASE:

ORACLE_HOME:

安装目录位置

image

image


OraInventory目录位置,Next

image



image

检查约束条件

image

image

问题处理方法:

image




对于下面缺少的依赖包是yum 安装依赖包的时候出现错误,没有安装成功。需要出现把依赖包安装成功。如果再重新检查一下就有可以了。

点击”install”,开始安装

image


image

开始安装

image



image


Last login: Sun Dec 23 14:28:59 2018 from 192.168.1.107
[root@oracle ~]# 

[root@oracle ~]# /u01/app/oracle/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oracle/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oracle/oraInventory to oinstall.
The execution of the script is complete.
[root@oracle ~]# /u01/app/oracle/product/12.1.0/dbhome_1/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/12.1.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
[root@oracle ~]# 

image




4:DBCA创建数据库


  1.  使用DBCA创建数据库 

image

image


创建数据库库

image


高级配置:

image



 
模板类型主要有seed和noseed两种,主要的区别在于是否包含数据文件。简单来说,seed就是 从RMAN备份中恢复数据库,由于是恢复所以也不能做其他更多的定制修改,但是最大的特点是 创建速度快,OLTP和OLAP的模板就属于seed模板类型;而“定制数据库”则属于nonseed模板 ,不包含数据文件,需要使用create database命令创建数据库,创建时间要稍微长一些,对于大 部分系统业务来说,需要根据自己的需求来选择合适的模板类型。


image

如果创建一个空CDB,多一个PDB: proc1,proc2,proc3

image


image

用户密码设置

image



image

归档文件,闪回区,Next

image


image

Oracle Database Vault提供控制以防止未经授权的特权用户访问敏感数据并防止未经授权的数据库更改。

image



image

数据库块

进程数:300 并发。

image


image



image


image


image


image

image


image





      2:使用DBCA更改数据库的配置 









3: 使用DBCA删除数据库

方法一:ORACLE_HOME目录
$ORACLE_HOME/deinstall/deinstall

方法二:软件包目录
cd database/

$ ./runInstaller -deinstall -home /u01/app/oracle/product/12.1.0/dbhome_1

方法三:
$ORACLE_HOME/dbs 参数文件删除
$ORACLE_BASE/oradata
/etc/oratab
/etc/oraInst.loc
oraInventory
$ORACLE_HOME




######删除数据库软件
图形化界面:
路径:
software + db


DB :
DBCA   ---delete database

SQL>
mount;
alter  session distcitxxxx;(drop)
drop database;
show database name;

数据库文件,参数文件,控制文件都删除;
rman target /
drop database include  xxx;
备份,归档,数据

software:
图形化:
命令:
rm -rf $ORACLE_BASE
/usr/local/bin/
/etc/ora*

 oraInst.loc  oratabs



#删除数据库 
Last login: Wed Dec 26 22:40:58 2018 from 192.168.1.107
[root@oracle ~]# su - oracle
[oracle@oracle ~]$ cd /u01/app/oracle/
admin/        audit/        cfgtoollogs/  checkpoints/  diag/         oradata/      oraInventory/ product/
[oracle@oracle ~]$ cd /u01/app/oracle/product/12.1.0/dbhome_1/
[oracle@oracle dbhome_1]$ ls
addnode     cdata        ctx        demo         hs             jdbc  log      oc4j    oracore      perl     R         root.sh       sqlpatch  ucp
apex        cfgtoollogs  cv         diagnostics  install        jdk   md       odbc    oraInst.loc  plsql    racg      scheduler     sqlplus   usm
assistants  clone        dbs        dmu          instantclient  jlib  mgw      olap    ord          plugins  rdbms     slax          srvm      utl
bin         crs          dc_ocm     dv           inventory      ldap  network  OPatch  oui          precomp  relnotes  sqldeveloper  suptools  wwg
ccr         css          deinstall  has          javavm         lib   nls      opmn    owm          QOpatch  rest      sqlj          sysman    xdk
[oracle@oracle dbhome_1]$ cd inventory/
[oracle@oracle inventory]$ ls
Actions21  backup  Clone  Components21  ContentsXML  globalvariables  invDetails.properties  make  Queries21  response  Scripts  Templates
[oracle@oracle inventory]$ ll
total 48
drwxr-x---.  13 oracle oinstall 4096 Dec 23 14:56 Actions21
drwxr-x---.   3 oracle oinstall 4096 Dec 23 15:04 backup
drwxr-x---.   2 oracle oinstall 4096 Dec 23 15:04 Clone
drwxr-x---. 137 oracle oinstall 4096 Dec 23 15:01 Components21
drwxr-x---.   3 oracle oinstall 4096 Dec 23 15:04 ContentsXML
drwxr-x---.   3 oracle oinstall 4096 Dec 23 15:03 globalvariables
-rw-r-----.   1 oracle oinstall  191 Dec 23 15:04 invDetails.properties
drwxr-x---.   2 oracle oinstall 4096 Dec 23 15:03 make
drwxr-x---.  20 oracle oinstall 4096 Dec 23 14:56 Queries21
drwxr-x---.   2 oracle oinstall 4096 Dec 23 14:56 response
drwxr-x---.   3 oracle oinstall 4096 Dec 23 15:04 Scripts
drwxr-x---.  24 oracle oinstall 4096 Dec 23 15:03 Templates
[oracle@oracle inventory]$ pwd
/u01/app/oracle/product/12.1.0/dbhome_1/inventory
[oracle@oracle inventory]$ cd ..
[oracle@oracle dbhome_1]$ ls
addnode     cdata        ctx        demo         hs             jdbc  log      oc4j    oracore      perl     R         root.sh       sqlpatch  ucp
apex        cfgtoollogs  cv         diagnostics  install        jdk   md       odbc    oraInst.loc  plsql    racg      scheduler     sqlplus   usm
assistants  clone        dbs        dmu          instantclient  jlib  mgw      olap    ord          plugins  rdbms     slax          srvm      utl
bin         crs          dc_ocm     dv           inventory      ldap  network  OPatch  oui          precomp  relnotes  sqldeveloper  suptools  wwg
ccr         css          deinstall  has          javavm         lib   nls      opmn    owm          QOpatch  rest      sqlj          sysman    xdk
[oracle@oracle dbhome_1]$ cd deinstall/
[oracle@oracle deinstall]$ ls
bootstrap_files.lst  bootstrap.pl  deinstall  deinstall.pl  deinstall.xml  jlib  readme.txt  response  sshUserSetup.sh  utl
[oracle@oracle deinstall]$ pwd
/u01/app/oracle/product/12.1.0/dbhome_1/deinstall
[oracle@oracle deinstall]$






















以上是关于第四章:Oracle12c 数据库在linux环境安装的主要内容,如果未能解决你的问题,请参考以下文章

如何从零安装Linux环境 Oracle12C

手把手系列:安装Oracle 12c数据库- linux

(转)oracle linux 7 安装oracle 12c

Linux下oracle12c数据库安装详解

Linux Centos7安装Oracle12c第二版本

[原创]zero downtime using goldengate实现oracle 12C升级系列 第四篇:集群安装