博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CentOS安装oracle12C
阅读量:7237 次
发布时间:2019-06-29

本文共 5681 字,大约阅读时间需要 18 分钟。

安装虚拟系统CentOS6.5,分配给至少1G的内存,其他条件适当高些,具体参考官方文档

一、安装数据库:

1、安装依赖软件包

yum install binutils -yyum install compat-libcap -yyum install compat-libstdc++-33 -yyum install compat-libstdc++-33.i686 -yyum install gcc -yyum install gcc-c++ -yyum install glibc -yyum install glibc.i686 -yyum install glibc-devel -yyum install glibc-devel.i686 -yyum install ksh -yyum install libgcc -yyum install libgcc.i686 -yyum install libstdc++ -yyum install libstdc++.i686 -yyum install libstdc++-devel -yyum install libstdc++-devel.i686 -yyum install libaio -yyum install libaio.i686 -yyum install libaio-devel -yyum install libaio-devel.i686 -yyum install libXext -yyum install libXext.i686 -yyum install libXtst -yyum install libXtst.i686 -yyum install libX11 -yyum install libX11.i686 -yyum install libXau -yyum install libXau.i686 -yyum install libxcb -yyum install libxcb.i686 -yyum install libXi -yyum install libXi.i686 -yyum install make -yyum install sysstat -yyum install unixODBC -yyum install unixODBC-devel -yyum install zlib-devel -y
View Code
补充:添加如下依赖
yum -y install compat-libcap1-1.10
2、创建用户和组
[  ~]# clear
[  ~]# groupadd dba
[  ~]# groupadd oinstall
[  ~]# useradd -g oinstall -G dba oracle
[  ~]# passwd oracle
3、创建oracle软件安装目录:
[  ~]# mkdir -p /u01/app/oracle
[  ~]# chown -R oracle:oinstall /u01
[  ~]# chmod -R  775 /u01/
4、编辑/etc/sysctl.conf文件
用root用户修改此文件,在末尾添加:
kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 4194304net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048586fs.aio-max-nr = 1048576fs.file-max = 6815744
View Code
使用下面的命令让内核参数更改生效,这样就无需重启计算机:
[root@vn ~]# sysctl -p
5、[ ~]# vim /etc/security/limits.conf 
root用户修改,在末尾添加:
oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536
View Code
6、[ ~]# vim /etc/pam.d/login 
在文件末尾添加:
session    required     /lib/security/pam_limits.sosession    required     pam_limits.so
View Code
7、用root修改[ ~]# vim /etc/profile
if [ $USER = "oracle" ];thenif [ $SHELL = "/bin/ksh" ];thenulimit -p 16384ulimit -n 65536elseulimit -u 16384 -n 65536fifi
View Code
8、编辑/etc/hosts
[ ~]# hostname vn [ ~]# ifconfig eth0|grep "inet addr"           inet addr:192.168.121.178  Bcast:192.168.121.255  Mask:255.255.255.0 [ ~]# cat /etc/hosts 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.121.178  vn                   #添加此行
9、用oracle用户身份编辑/home/oracle/.bash_profile 
[ ~]# su - oracle [ ~]$ vim /home/oracle/.bash_profile 
在末尾添加以下内容:
export TMP=/tmp;export TMPDIR=$TMP;export ORACLE_TERM=xtermexport ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1export ORACLE_SID=orclexport PATH=$ORACLE_HOME/bin:$PATH
View Code
使用下面的命令让设置生效:
[oracle@vn ~]$ source /home/oracle/.bash_profil
10、上传文件到/home/oracle,并用oracle用户解压缩
文件权限中oracle为所有者:
[root@vn oracle]# ls /home/oracle/ -l-rwxrw-rw-. 1 root   root     1361028723 6月   2 08:10 linuxamd64_12c_database_1of2.zip-rwxrw-rw-. 1 root   root     1116527103 6月   2 08:09 linuxamd64_12c_database_2of2.zip[root@vn oracle]# chown oracle /home/oracle linuxamd64_12c_database_1of2.zip [root@vn oracle]# chown oracle /home/oracle linuxamd64_12c_database_2of2.zip [root@vn oracle]# ls /home/oracle/ -l-rwxrw-rw-. 1 oracle root     1361028723 6月   2 08:10 linuxamd64_12c_database_1of2.zip-rwxrw-rw-. 1 oracle root     1116527103 6月   2 08:09 linuxamd64_12c_database_2of2.zip
View Code
切换成oracle用户解压: [ oracle]# su - oracle [ ~]$ unzip linuxamd64_12c_database_1of2.zip  [ ~]$ unzip linuxamd64_12c_database_2of2.zip
11、以oracle用户登录图形界面进行安装
11、以oracle用户登录图形界面进行安装
[  ~]$ cd database/
[  database]$ ./runInstaller 
正在启动 Oracle Universal Installer...
检查临时空间: 必须大于 500 MB。   实际为 39610 MB    通过
检查交换空间: 必须大于 150 MB。   实际为 3999 MB    通过
检查监视器: 监视器配置至少必须显示 256 种颜色。    实际为 16777216    通过
准备从以下地址启动 Oracle Universal Installer /tmp/OraInstall2015-06-08_08-52-17PM. 请稍候...
 
不使用电子邮件:
不使用更新:
 
忽略,单击“是”
选择创建和配置数据库:
选择服务器类型:
选择单实例数据库安装:
选择高级安装,这样有更多的可选项:
选择默认语言,这里选择英语和中文:
选择企业版:
指定安装位置,这里软件会自动读取,.profile里的设置,直接单击下一步:
选择一般用途/事物处理:
 
数据库标识符,选择默认:
选择启用自动内存管理,UTF-8字符集,创建具有示例方案的数据库:
 
 
 
选择文件系统:
不注册:
不启用恢复(根据自己需要选择哈):
口令(可以单独设置,也可以统一设置):
对权限的管理,根据需要设定,这里为方面统一设置为dba:
保存响应文件:
大概77%时,会出现弹框
 
执行两个脚本如下:
[root@vn ~]# /u01/app/oraInventory/orainstRoot.sh 更改权限/u01/app/oraInventory.添加组的读取和写入权限。删除全局的读取, 写入和执行权限。更改组名/u01/app/oraInventory 到 oinstall.脚本的执行已完成。[root@vn ~]# /u01/app/oracle/product/12.1.0/db_1/root.sh Performing root user operation for Oracle 12c The following environment variables are set as:    ORACLE_OWNER= oracle    ORACLE_HOME=  /u01/app/oracle/product/12.1.0/db_1Enter 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 byDatabase Configuration Assistant when a database is createdFinished running generic part of root script.Now product-specific root actions will be performed.
View Code
大概91%时出现配置数据库:
进行口令管理:
 
 
 
安装完成:
 
二、管理监听器和数据库启动关闭
管理监听器
1、查看监听器状态
[  ~]$ lsnrctl status
2、启动监听器
[  ~]$ lsnrctl start
[  ~]$ tnsping orcl
3、关闭监听器
[  ~]$ lsnrctl start
启动和关闭oracle
1、启动数据库
[oracle@vn ~]$ sqlplus "sys /as sysdba"SQL> startup SQL> SELECT status from v$instance;
2、关闭数据库
SQL> shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.
三、oracle客户端工具
(1)、SQL*plus
(2)、ORACLE EM Express(在网页上输入网址:https://IP地址:5500/em,然后在出现的警告中添加信任,(如果用实体机的浏览器,需要在虚拟系统中打开防火墙的5500、1521端口):
(3)、Oracle SQL Developer
 
 
 
 
 

转载于:https://www.cnblogs.com/chinas/p/4562191.html

你可能感兴趣的文章
Java 开发者最容易犯的10个错误
查看>>
Web 探索之旅 | 第三部分第一课:服务器
查看>>
0110 - 给 iPhone 6 换了电池
查看>>
Android-Rxjava+Retrofit2.x 获取Http状态码、响应头(Headers)等数据
查看>>
swift版indexOfObject()
查看>>
第二十九章:基于SpringBoot平台使用Lombok来优雅的编码
查看>>
第三章:SpringBoot使用SpringDataJPA完成CRUD
查看>>
Android任务队列使用
查看>>
Swift语法对编译速度的影响
查看>>
如何在Python下搭建QT+SIP+PyQt5环境
查看>>
说说在 Linux 中如何查看系统信息
查看>>
iphone 常用的app info plist设置
查看>>
快速排序算法的实现
查看>>
傻瓜式入门Redux
查看>>
最新图解 如何提升phpstudy中的mysql版本
查看>>
华山论剑之iOS&tableView的双剑合璧
查看>>
4K超清,2500万人在线,猫晚直播技术全解读
查看>>
服务器运维基础指南
查看>>
NginX+keepalived实现高可用
查看>>
linux文件管理类命令汇总(用法与选项)
查看>>