• 增加sudo用户访问oracle


    增加zgy用户可以访问数据库
    [root@DBDATA ~]# useradd zgy
    --设置密码
    [root@DBDATA ~]# passwd zgy
    --设置组
    [root@DBDATA ~]# usermod -G oinstall,dba zgy
    --环境变量
    [root@DBDATA ~]# cp ~oracle/.bash_profile ~zgy/.bash_profile 
    --yes
    --生效
    [root@DBDATA ~]# source ~zgy/.bash_profile

    [root@DBDATA ~]# su - zgy
    [zgy@DBDATA ~]$ sqlplus / as sysdba 
    ...
    --如下增加oracle,zgy两个用户
    sudo vi /etc/sudoers

    ## The COMMANDS section may have other options added to it.
    ##
    ## Allow root to run any commands anywhere
    root ALL=(ALL) ALL
    zgy ALL=(ALL) ALL  --这个给的权限比较大些

    [zgy@DBDATA ~]$ sql

    SQL*Plus: Release 11.2.0.3.0 Production on Wed Dec 18 15:04:19 2019
    Copyright (c) 1982, 2011, Oracle. All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options

    SQL> SELECT STATUS FROM GV$INSTANCE ;

    STATUS
    ------------------------------------
    OPEN

    Elapsed: 00:00:00.00

  • 相关阅读:
    道路和航线
    Sorting It All Out
    Sightseeing Cows(0/1分数规划+Spfa判负环)
    【模板】缩点
    间谍网络
    Tarjan算法专练
    数论知识点总结
    博客迁移到博客园
    第一届CCPC河南省赛
    find程序实现
  • 原文地址:https://www.cnblogs.com/ritchy/p/12094255.html
Copyright © 2020-2023  润新知