Settings to Run SQLPLUS from Other or Non-Oracle User

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
Add a new unix user as readuser

[root@Test]# useradd readuser
[root@Test]# passwd readuser
Changing password for user readuser.New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[root@Test]# exit

Connect to readuser and set following environment variables. 

1. ORACLE_HOME 
2. ORACLE_SID 
3. PATH (Especially path to the sqlplus which will be under Oracle_home/bin) 
4. LD_LIBRARY_PATH

 
[readuser@Test]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/db_1
[readuser@Test]$ export ORACLE_SID=ONLTEST
[readuser@Test]$ export PATH=$PATH:/u01/app/oracle/product/12.1.0.2/db_1/bin
[readuser@Test]$ export LD_LIBRARY_PATH=/u01/app/oracle/product/12.1.0.2/db_1/lib:/lib:/usr/lib

advertisements
 
Now you can run sqlplus

[readuser@Test]$  sqlplus sthomas

SQL*Plus: Release 12.1.0.2.0 Production on Thu Apr 6 01:07:59 2017

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

Enter password:
Last Successful login time: Thu Apr 06 2017 01:04:26 -04:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> show user
USER is "STHOMAS"

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer