Home Database Mysql Tutorial 非Oracle用户使用操作系统验证登陆(/ as sysdba)

非Oracle用户使用操作系统验证登陆(/ as sysdba)

Jun 07, 2016 pm 03:45 PM
oracle use operating system user Login verify

之前写过一篇blog《新用户使用sqlplus / as sysdba登录报错》http://blog.csdn.net/bisal/article/details/9285087 今天碰巧看到一篇推荐的帖子《新建一个用户(非oracle),在不赋予dba所属组的情况下,不能使用操作系统验证》 http://www.itpub.net/thread

之前写过一篇blog《新用户使用sqlplus / as sysdba登录报错》http://blog.csdn.net/bisal/article/details/9285087

今天碰巧看到一篇推荐的帖子《新建一个用户(非oracle),在不赋予dba所属组的情况下,不能使用操作系统验证》

http://www.itpub.net/thread-1811278-1-1.html,也是按照实际操作的流程解释了处理的方法,很实际。


总结起来,使用非oracle用操作系统验证登录,需要做的

1、设置相关环境变量;

2、将用户添加到dba组中;

3、用户具有$ORACLE_HOME相关路径(尤其是bin)文件的执行权限。

但上次调试一个测试库,创建非Oracle安装用户时也试了如上方法,但未奏效,肯定哪里还有点问题,找个时间再看看了要。


转:

新建一个用户(非oracle),在不赋予dba所属组的情况下,不能使用操作系统验证

[grid@dbaup ~]$ id

uid=1002(grid)gid=1003(grid) 组=1003(grid)

[grid@dbaup ~]$export ORACLE_BASE=/u01/oracle

[grid@dbaup ~]$export ORACLE_HOME=$ORACLE_BASE/product/11.0.2.1

[grid@dbaup ~]$export ORACLE_SID=gbk11g

[grid@dbaup ~]$export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

[grid@dbaup ~]$export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

--linux默认SQLNET.AUTHENTICATION_SERVICES=beq ,操作系统和密码验证都能使用,我下边并没有设none

[grid@dbaup ~]$ cat/u01/oracle/product/11.0.2.1/network/admin/sqlnet.ora

# sqlnet.ora NetworkConfiguration File: /u01/oracle/product/11.0.2.1/network/admin/sqlnet.ora

# Generated byOracle configuration tools.

NAMES.DIRECTORY_PATH=(TNSNAMES, EZCONNECT)

ADR_BASE =/u01/oracle

--操作系统认证报ORA-01031: insufficient privileges

[grid@dbaup ~]$sqlplus / as sysdba

SQL*Plus: Release11.2.0.1.0 Production on Tue Aug 20 21:39:04 2013

Copyright (c) 1982,2009, Oracle.  All rights reserved.

ERROR:

ORA-01031:insufficient privileges

Enter user-name:

新开一个窗口(窗口2),为grid用户添加dba附加组

[root@dbaup ~]# idgrid

uid=1002(grid)gid=1003(grid) 组=1003(grid),1001(dba)

在窗口1重新登录gird用户,查看grid用户已经有dba附加组了

[gird@dbaup ~]$ exit

logout

[root@dbaup bin]# su- grid

[grid@dbaup ~]$ id

uid=1002(grid)gid=1003(grid) 组=1003(grid),1001(dba)

--重新设置环境变量

[grid@dbaup ~]$export ORACLE_BASE=/u01/oracle

[grid@dbaup ~]$export ORACLE_HOME=$ORACLE_BASE/product/11.0.2.1

[grid@dbaup ~]$export ORACLE_SID=gbk11g

[grid@dbaup ~]$export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

[grid@dbaup ~]$export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

--登录操作系统验证成功

[grid@dbaup ~]$sqlplus / as sysdba

SQL*Plus: Release11.2.0.1.0 Production on Tue Aug 20 21:42:36 2013

Copyright (c) 1982,2009, Oracle.  All rights reserved.

Connected to:

Oracle Database 11gEnterprise Edition Release 11.2.0.1.0 - 64bit Production

With thePartitioning, OLAP, Data Mining and Real Application Testing options

SQL>

为什么会出现这种情况呢?

[root@dbaup ~]# find/ -group dba

/u01/oracle/product/11.0.2.1/dbaup_gbk11g/sysman/log

/u01/oracle/product/11.0.2.1/dbaup_ora11g/sysman/log

find:“/proc/20062/task/20062/fd/5”: 没有那个文件或目录

find:“/proc/20062/task/20062/fdinfo/5”: 没有那个文件或目录

find:“/proc/20062/fd/5”: 没有那个文件或目录

find:“/proc/20062/fdinfo/5”: 没有那个文件或目录

--发现/u01/oracle/product/11.0.2.1/dbaup_gbk11g/sysman/log所属组是dba,并且other没有任何权限

[root@dbaup ~]# ls-l /u01/oracle/product/11.0.2.1/dbaup_gbk11g/sysman/log

总用量 5604

-rw-r-----. 1 oracleoinstall       0  6月  322:19 emagentfetchlet.log

-rw-r-----. 1 oracleoinstall       0  6月  322:19 emagentfetchlet.trc

-rw-r-----. 1 oracleoinstall     956  7月 29 17:04 emagent.log

-rw-r-----. 1 oracleoinstall   39430  7月 29 17:10 emagent_perl.trc

-rw-r-----. 1 oracleoinstall  757974  7月 29 18:49 emagent.trc

-rw-r-----. 1 oracleoinstall   11794  7月 29 18:49 emdb.nohup

-rw-r-----. 1 oracleoinstall       0  6月  322:18 emdctl.log

-rw-r-----. 1 oracleoinstall    3441  7月 29 17:04 emdctl.trc

-rw-r-----. 1 oracleoinstall 2443250  7月 29 18:49 emoms.log

-rw-r-----. 1 oracleoinstall 2443250  7月 29 18:49 emoms.trc

-rw-r-----. 1 oracleoinstall       0  6月  322:21 nfsPatchPlug.log

drwxr-----. 2 oracleoinstall    4096  6月  322:20 pafLogs

-rw-r-----. 1 oracleoinstall       0  6月  322:19 patchAgtStPlugin.log

-rw-r-----. 1 oracleoinstall    5279  6月  322:19 secure.log

[root@dbaup ~]# ls-ld /u01/oracle/product/11.0.2.1/dbaup_gbk11g/sysman/log

drwxr-x---.3 oracle dba 4096  7月 29 17:04/u01/oracle/product/11.0.2.1/dbaup_gbk11g/sysman/log

结论:oracle之外的用户,在打开了操作系统验证的情况下,还需要加入dba组才能使用操作系统验证

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What is Linux actually good for? What is Linux actually good for? Apr 12, 2025 am 12:20 AM

Linux is suitable for servers, development environments, and embedded systems. 1. As a server operating system, Linux is stable and efficient, and is often used to deploy high-concurrency applications. 2. As a development environment, Linux provides efficient command line tools and package management systems to improve development efficiency. 3. In embedded systems, Linux is lightweight and customizable, suitable for environments with limited resources.

How to create oracle dynamic sql How to create oracle dynamic sql Apr 12, 2025 am 06:06 AM

SQL statements can be created and executed based on runtime input by using Oracle's dynamic SQL. The steps include: preparing an empty string variable to store dynamically generated SQL statements. Use the EXECUTE IMMEDIATE or PREPARE statement to compile and execute dynamic SQL statements. Use bind variable to pass user input or other dynamic values ​​to dynamic SQL. Use EXECUTE IMMEDIATE or EXECUTE to execute dynamic SQL statements.

How to create cursors in oracle loop How to create cursors in oracle loop Apr 12, 2025 am 06:18 AM

In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.

How to use triggers for oracle How to use triggers for oracle Apr 11, 2025 pm 11:57 PM

Triggers in Oracle are stored procedures used to automatically perform operations after a specific event (insert, update, or delete). They are used in a variety of scenarios, including data verification, auditing, and data maintenance. When creating a trigger, you need to specify the trigger name, association table, trigger event, and trigger time. There are two types of triggers: the BEFORE trigger is fired before the operation, and the AFTER trigger is fired after the operation. For example, the BEFORE INSERT trigger ensures that the age column of the inserted row is not negative.

What are the methods of tuning performance of Zookeeper on CentOS What are the methods of tuning performance of Zookeeper on CentOS Apr 14, 2025 pm 03:18 PM

Zookeeper performance tuning on CentOS can start from multiple aspects, including hardware configuration, operating system optimization, configuration parameter adjustment, monitoring and maintenance, etc. Here are some specific tuning methods: SSD is recommended for hardware configuration: Since Zookeeper's data is written to disk, it is highly recommended to use SSD to improve I/O performance. Enough memory: Allocate enough memory resources to Zookeeper to avoid frequent disk read and write. Multi-core CPU: Use multi-core CPU to ensure that Zookeeper can process it in parallel.

How to stop oracle database How to stop oracle database Apr 12, 2025 am 06:12 AM

To stop an Oracle database, perform the following steps: 1. Connect to the database; 2. Shutdown immediately; 3. Shutdown abort completely.

Who invented the mac system Who invented the mac system Apr 12, 2025 pm 05:12 PM

The macOS operating system was invented by Apple. Its predecessor, System Software, was launched in 1984. After many iterations, it was updated to Mac OS X in 2001 and changed its name to macOS in 2012.

How to change the oracle table name How to change the oracle table name Apr 11, 2025 pm 11:54 PM

Two ways to rename Oracle table names: use SQL statements: ALTER TABLE <Old table name> RENAME TO <New table name>;Use PL/SQL statements: EXECUTE IMMEDIATE 'ALTER TABLE ' || :old_table_name || ' RENAME TO ' || :new_table_name;

See all articles