侯体宗的博客
  • 首页
  • Hyperf版
  • beego仿版
  • 人生(杂谈)
  • 技术
  • 关于我
  • 更多分类
    • 文件下载
    • 文字修仙
    • 中国象棋ai
    • 群聊
    • 九宫格抽奖
    • 拼图
    • 消消乐
    • 相册

Oracle 12c安装方法及一些使用问题

数据库  /  管理员 发布于 6年前   558

Linux Centos6.5 64bit下安装oracle12c:

groupadd oinstallgroupadd dbamkdir -p /u01/oracleuseradd -g oinstall -G dba -d /u01/oracle oracle(这里不是一定要把home目录更改到/u01/oracle,默认也可。)把下面三个文件复制到 /u01/oracle目录下[root@oracle /]# cd /etc/skel/[root@oracle skel]# ll -a-rw-r--r--. 1 root root 18 7月 18 2013 .bash_logout-rw-r--r--. 1 root root 176 7月 18 2013 .bash_profile-rw-r--r--. 1 root root 124 7月 18 2013 .bashrc注:useradd添加用户时,会自动从这个目录下的文件复制到用户的家目录password oraclechown -R oracle:oinstall /u01chmod -R 775 /u01/

/*安装vnc*/

yum -y install tigervnc-servervncserver 回车输入密码ps -ef | grep vncvnc客户端连接:ip:1

检测是否有安装以下程序:

binutils-2.17.50.0.6compat-libstdc++-33-3.2.3 -elfutils-libelf-0.125elfutils-libelf-devel-0.125 -elfutils-libelf-devel-static-0.125 -gcc-4.1.2 -gcc-c++-4.1.2 -glibc-2.5-24glibc-common-2.5glibc-devel-2.5glibc-headers-2.5kernel-headers-2.6.18ksh-20060214 -libaio-0.3.106libaio-devel-0.3.106 -libgcc-4.1.2libgomp-4.1.2libstdc++-4.1.2libstdc++-devel-4.1.2 -make-3.81sysstat-7.0.2 unixODBC-2.2.11 -unixODBC-devel-2.2.11 -

修改 /etc/sysctl.conf 文件,加上如下参数

fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 536870912kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048586

为使上述配置生效而不重启系统,执行如下命令
# /sbin/sysctl -p

修改用户限制

root用户:修改 /etc/security/limits.conf 文件,加上下面的参数

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

修改用户验证选项
root用户下:修改/etc/pam.d/login文件加上如下参数

session required  pam_limits.so

修改用户配置文件
root用户下:修改/etc/profile文件加入如下参数:

if [ $USER = "oracle" ]; then  if [ $SHELL = "/bin/ksh" ]; then    ulimit -p 16384    ulimit -n 65536  else    ulimit -u 16384 -n 65536  fifi

修改oracle用户bash_profile:
$ vi .bash_profile
增加如下内容,主要是修改

export ORACLE_BASE=/u01 export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1export ORACLE_SID=hxw168 export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin

安装oracle:

安装oracle无法使用命令/usr/bin/xdpyinfo自动检查显示器颜色:

[root@oracle /]# xdpyinfo | grep "name of display"name of display: :1.0[root@oracle /]# 在Oracle用户下执行命令:export DISPLAY=:1.0 (上面name of display:后面的 :1.0)

prvf-0002:无法检索本地节点名

host文件 ip与名称对应192.168.198.188 oracle

SQL> create user admin identified by zerostudy;
create user admin identified by zerostudy
*
ERROR at line 1:
ORA-65096: invalid common user or role name


SQL> !oerr ora 65096
65096, 00000, "invalid common user or role name"
// *Cause: An attempt was made to create a common user or role with a name
// that wass not valid for common users or roles. In addition to
// the usual rules for user and role names, common user and role
// names must start with C## or c## and consist only of ASCII
// characters.
// *Action: Specify a valid common user or role name.
//

解决方法:///article/92720.htm

调整虚拟机的内存到600多M(原来1G多),启动oracle时提示:
SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system

SQL> !oerr ora 00854
00854, 00000, "ASM IOServer Instance Fence monitor process terminated."
// *Cause: The ASM IOServer Fence monitor process died.
// *Action: Warm start the instance.

原因就是Linux系统的shm的大小比SGA设置的小造成的。
可以调整shm的大小:
vi /etc/fstab
修改如下行的设置
tmpfs /dev/shm tmpfs defaults 0 0
改成
tmpfs /dev/shm tmpfs defaults,size=6G 0 0
重新mount下shm使其生效
mount -o remount /dev/shm

TNS-12514: TNS:listener does not currently know of service requested in connect descriptor

需要更改listener.ora文件(跟径在$ORACLE_HOME/network/admin),然后重启lsnrctl

# Generated by Oracle configuration tools.#LISTENER =# (DESCRIPTION_LIST =# (DESCRIPTION =#  (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))#  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.198.188)(PORT = 1521))# )# )hxw168 = (DESCRIPTION_LIST = (DESCRIPTION =  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.198.188)(PORT = 1521)) ) ) SID_LIST_hxw168= (SID_LIST = (SID_DESC=  (ORACLE_HOME = /u01/app/product/12.1.0/db_1)  (SID_NAME = hxw168) ) )

oracle简单的启动脚本:

[root@oracle ~]# cat /etc/init.d/oracle su - oracle <<EOFlsnrctl startsqlplus / as sysdbastartupEOF

本文出自 “尽管错,让我错到死!” 博客


  • 上一条:
    ORACLE 12C PDB 维护基础知识介绍
    下一条:
    oracle数据库定时任务dbms_job的用法详解
  • 昵称:

    邮箱:

    0条评论 (评论内容有缓存机制,请悉知!)
    最新最热
    • 分类目录
    • 人生(杂谈)
    • 技术
    • linux
    • Java
    • php
    • 框架(架构)
    • 前端
    • ThinkPHP
    • 数据库
    • 微信(小程序)
    • Laravel
    • Redis
    • Docker
    • Go
    • swoole
    • Windows
    • Python
    • 苹果(mac/ios)
    • 相关文章
    • 分库分表的目的、优缺点及具体实现方式介绍(0个评论)
    • DevDB - 在 VS 代码中直接访问数据库(0个评论)
    • 在ubuntu系统中实现mysql数据存储目录迁移流程步骤(0个评论)
    • 在mysql中使用存储过程批量新增测试数据流程步骤(0个评论)
    • php+mysql数据库批量根据条件快速更新、连表更新sql实现(0个评论)
    • 近期文章
    • 在go中实现一个常用的先进先出的缓存淘汰算法示例代码(0个评论)
    • 在go+gin中使用"github.com/skip2/go-qrcode"实现url转二维码功能(0个评论)
    • 在go语言中使用api.geonames.org接口实现根据国际邮政编码获取地址信息功能(1个评论)
    • 在go语言中使用github.com/signintech/gopdf实现生成pdf分页文件功能(0个评论)
    • gmail发邮件报错:534 5.7.9 Application-specific password required...解决方案(0个评论)
    • 欧盟关于强迫劳动的规定的官方举报渠道及官方举报网站(0个评论)
    • 在go语言中使用github.com/signintech/gopdf实现生成pdf文件功能(0个评论)
    • Laravel从Accel获得5700万美元A轮融资(0个评论)
    • 在go + gin中gorm实现指定搜索/区间搜索分页列表功能接口实例(0个评论)
    • 在go语言中实现IP/CIDR的ip和netmask互转及IP段形式互转及ip是否存在IP/CIDR(0个评论)
    • 近期评论
    • 122 在

      学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..
    • 123 在

      Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..
    • 原梓番博客 在

      在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..
    • 博主 在

      佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..
    • 1111 在

      佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
    • 2017-06
    • 2017-08
    • 2017-09
    • 2017-10
    • 2017-11
    • 2018-01
    • 2018-05
    • 2018-10
    • 2018-11
    • 2020-02
    • 2020-03
    • 2020-04
    • 2020-05
    • 2020-06
    • 2020-07
    • 2020-08
    • 2020-09
    • 2021-02
    • 2021-04
    • 2021-07
    • 2021-08
    • 2021-11
    • 2021-12
    • 2022-02
    • 2022-03
    • 2022-05
    • 2022-06
    • 2022-07
    • 2022-08
    • 2022-09
    • 2022-10
    • 2022-11
    • 2022-12
    • 2023-01
    • 2023-03
    • 2023-04
    • 2023-05
    • 2023-07
    • 2023-08
    • 2023-10
    • 2023-11
    • 2023-12
    • 2024-01
    • 2024-03
    Top

    Copyright·© 2019 侯体宗版权所有· 粤ICP备20027696号 PHP交流群

    侯体宗的博客