如何安装oracle12c单实例数据库软件

39次阅读
没有评论

共计 4274 个字符,预计需要花费 11 分钟才能阅读完成。

这篇文章主要介绍如何安装 oracle12c 单实例数据库软件,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

一、环境准备

[oracle@localhost ~]$ df -hl 查看内存情况

磁盘空间需要 6.4GB,/tmp 分区需要 1GB 

[oracle@localhost ~]$ df -hl /tmp 

内存配置 4G,swap 配置 2G

[oracle@localhost ~]$ grep MemTotal /proc/meminfo

[oracle@localhost ~]$ cat /proc/swaps

操作系统:Red Hat Enterprise Linux Server
release 7

[oracle@localhost ~]$ cat
/etc/redhat-release

安装包 yum -y install package*
把所有包安装

binutils-2.23.52.0.1-12.el7.x86_64 
compat-libcap1-1.10-3.el7.x86_64
compat-libstdc++-33-3.2.3-71.el7.i686 
compat-libstdc++-33-3.2.3-71.el7.x86_64
gcc-4.8.2-3.el7.x86_64 
gcc-c++-4.8.2-3.el7.x86_64 
glibc-2.17-36.el7.i686 
glibc-2.17-36.el7.x86_64 
glibc-devel-2.17-36.el7.i686 
glibc-devel-2.17-36.el7.x86_64 
libaio-0.3.109-9.el7.i686 
libaio-0.3.109-9.el7.x86_64 
libaio-devel-0.3.109-9.el7.i686 
libaio-devel-0.3.109-9.el7.x86_64 
libgcc-4.8.2-3.el7.i686 
libgcc-4.8.2-3.el7.x86_64 
libstdc++-4.8.2-3.el7.i686 
libstdc++-4.8.2-3.el7.x86_64 
libstdc++-devel-4.8.2-3.el7.i686 
libstdc++-devel-4.8.2-3.el7.x86_64 
libXi-1.7.2-1.el7.i686 
libXi-1.7.2-1.el7.x86_64 
libXtst-1.2.2-1.el7.i686 
libXtst-1.2.2-1.el7.x86_64 
make-3.82-19.el7.x86_64 
sysstat-10.1.5-1.el7.x86_64

查看组是否存在  

[root@localhost ~]# grep oinstall
/etc/group

[root@localhost ~]# grep dba /etc/group

创建组 oninstall 与 dba

[root@localhost ~]# /usr/sbin/groupadd
oinstall

[root@localhost ~]# /usr/sbin/groupadd dba

[root@localhost ~]# /usr/sbin/groupadd oper

查看 oracle 用户 是否存在

[root@localhost ~]# id oracle

创建 oracle 用户

[root@localhost ~]# /usr/sbin/useradd -g
oinstall -G dba,oper oracle

若已有 oracle 则报错存在

[root@localhost ~]# passwd oracle

为 oracle 创建密码

设置资源限制:

[root@localhost ~]# vi /etc/sysctl.conf

在文末添加:

fs.aio-max-nr = 1048576
fs.file-max = 6815744
#kernel.shmall = 2097152
#kernel.shmmax = 536870912
kernel.shmmni = 4096
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

使更改生效

[root@localhost ~]# /sbin/sysctl -p

设置安装用户的资源限制:

[root@localhost ~]# vi
/etc/security/limits.conf

在 root 下,添加

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

创建 oracle 安装目录并分配权限

[root@localhost ~]# mkdir /u01

[root@localhost ~]# chown -R
oracle:oinstall /u01

[root@localhost ~]# chmod -R 775 /u01

为 oracle 用户设置环境变量

[li@localhost ~]$ su – oracle

Password:

[oracle@localhost ~]$

[oracle@localhost ~]$ vi ~/.bash_profile

# .bash_profile

# Get the aliases and functions

if [-f ~/.bashrc]; then

 
. ~/.bashrc

fi

# User specific environment and startup
programs

PATH=$PATH:$HOME/bin

export PATH

export ORACLE_BASE=/u01/app/oracle

export
ORACLE_HOME=$ORACLE_BASE/product/12.2.0/dbhome_1

export PATH=$ORACLE_HOME/bin:$PATH

export ORACLE_SID=db12c

export NLS_LANG=AMERICAN_AMERICA.AL32UTF8

如何切换到 oracle 用户

Su – oracle

在 temp 下创建 oracle 然后把 12c 压缩包解压在里面

在 oracle 用户下

[li@localhost ~]$ su oracle

Password:

[oracle@localhost]$ cd /u01/software/database

[oracle@localhost database]$ ls

install 
response  rpm  runInstaller 
sshsetup  stage  welcome.html

执行安装
[oracle@localhost database]$ ./runInstaller
1、弹出此界面,不勾选选项(如果有也可以填写)然后 next

2、此处选择仅安装数据库软件,然后 next

3、选择安装单实例数据库,然后 next

4、选择安装企业版,然后 next
5、安装路径默认安装
6、默认安装 next

7、组默认 next

8、这里会检查是否有安装相关的包,可以新打开一个窗口 yum 安装包,然后检查
(这里检查的错误最好都想办法使得没有错误,不然在启动时会报错)

9、点击 install 开始安装

10、在 root 下执行两条脚本

[root@localhost ~]#
/u01/app/oraInventory/orainstRoot.sh

Changing permissions of
/u01/app/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for
world.

Changing groupname of /u01/app/oraInventory
to oinstall.

The execution of the script is complete.

[root@localhost ~]#
/u01/app/oracle/product/12.2.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.2.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.

Do you want to setup Oracle Trace File
Analyzer (TFA) now ? yes|[no] :

yes

Installing Oracle Trace File Analyzer
(TFA).

Log File:
/u01/app/oracle/product/12.2.0/dbhome_1/install/root_localhost.localdomain_2018-04-30_07-56-19-938348191.log

Finished installing Oracle Trace File
Analyzer (TFA)

执行完脚本,数据库软件安装完成

以上是“如何安装 oracle12c 单实例数据库软件”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注丸趣 TV 行业资讯频道!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-24发表,共计4274字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)