How to access ENV variables of non global zones in global zone???


 
Thread Tools Search this Thread
Operating Systems Solaris How to access ENV variables of non global zones in global zone???
# 1  
Old 02-08-2010
How to access ENV variables of non global zones in global zone???

Hi Guys,

My requirement is I have file called /opt/orahome/.profile in non global zone.

Code:
PATH=/usr/bin:/usr/ucb:/etc:/usr/sbin:/usr/local/bin:/usr/openwin/bin:.
export PATH
PS1="\${ORACLE_SID}:`hostname`:\$PWD$ "
export PS1
EDITOR=vi
export EDITOR
ENV=/opt/orahome/.kshrc
export ENV
ORACLE_BASE=/opt/oracle
export ORACLE_BASE
umask 022       # This required by Oracle software installation
. /opt/oracle/admin/etc/optical2.profile

The above file exporting some values to env. I want to access those env variables in Global zone.

I am trying to do
Code:
zlogin -S $ZONE_NAME ". /opt/orahome/.profile"
echo "$ORACLE_BASE"

when I try to access variable it is showing as NULL.
But when i do `env` in non global zone variable values are set with values.
Code:
LD_LIBRARY_PATH=/opt/oracle/product/orhome/lib:/opt/sfw/lib:/opt/oracle/product/orhome/lib:/opt/sfw/lib:
ORACLE_BASE=/opt/oracle
PATH=/opt/oracle/product/orhome/bin:/opt/oracle/admin/bin:/opt/oracle/product/orhome/bin:/opt/oracle/admin/bin:/usr/sbin:/usr/bin:/usr/ccs/bin:/opt/oracle/admin/utl:/usr/local/bin:/usr/ccs/bin:/opt/oracle/admin/utl:/usr/local/bin
MAIL=/var/mail/root
PWD=/
ADMDIR=/opt/oracle/admin
SHLVL=1
HOME=/
ORJDBC=jdbc/lib/ojdbc14.jar
LOGNAME=root
CLASSPATH=/opt/BTSordba/etc:/opt/BTSordba/lib/dba.jar:/opt/oracle/product/orhome/jdbc/lib/ojdbc14.jar
ORACLE_HOME=/opt/oracle/product/orhome

So please tell me how to access env variables in non global zone.....

Last edited by vijaysachin; 02-08-2010 at 09:04 AM.. Reason: use code tags please, ty
# 2  
Old 02-08-2010
Variables containing a PATH will likely be invalid in the global zone. Anyway, this should work:
Code:
zlogin $ZONE_NAME '. /opt/orahome/.profile, echo $ORACLE_BASE'

Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Solaris

Solaris 11 zone has no external network access (except to Global Zone)

Hi, hoping someone can help, its been a while since I used Solaris. After creating a NGZ (non global zone), the NGZ can access the GZ (Global Zone) and the GZ can access the NGZ (using ssh, zlogin) However, the NGZ cannot access any other netwqork devices, it can't even see the default router ... (2 Replies)
Discussion started by: GazinLincoln
2 Replies

2. Solaris

Date and time change in global and non global zone

Hi, If I change date and time in global zone, then it will affect in non global zones. During this process what files will get affect in non global zones and which mechanism it's using to change. gloabl zone:Solaris 11.3 X86 TIA (1 Reply)
Discussion started by: Sumanthsv
1 Replies

3. Solaris

How can i enable audit logs for global zone and standard zones?

HI Community, how can i configure audit logs for global zones and standard zone. i have enabled and started auditd service and it went to maintenance mode. please help me to configure that Thanks & Regards, BEn (9 Replies)
Discussion started by: bentech4u
9 Replies

4. Solaris

Global and non-global zone resource sharing - tricky

hi all, Just a simple question but i cant get the answers in the book - In my globalzone , assuming i have 4 cpus (psrinfo -pv = 0-3), if i set dedicated-cpu (ncpus=2) for my local zone Is my globalzone left with 2 cpus or still 4 cpus ? Does localzone "resource reservation.e.g. cpu in... (6 Replies)
Discussion started by: javanoob
6 Replies

5. Solaris

showing 2 different time zones in global zone and nonglobal zone

can some one help me out as it is showing 2 different time zones in global zone and nonglobal zone .In global zone it is showing in GMT while in nonglobal zone i it showing as PDT. System in running with solaris 10 (3 Replies)
Discussion started by: ravijanjanam12
3 Replies

6. Solaris

How to see global hostname by logging in non global zones?

Hi guru Could any one help me by letting me know, how to see global hostname by logging in non global zones Regards (2 Replies)
Discussion started by: girish.batra
2 Replies

7. Solaris

[b]How to mount a folder from global zone to non global zone??

Hi All There is one folder in global zone I just want to share the same folder innon global zone. How can i do it? pls send me script for this. (2 Replies)
Discussion started by: vijaysachin
2 Replies

8. UNIX for Advanced & Expert Users

can not access global zone

hi , I am trying to access my machine at work with PuTTY and I keep obtaining "access denied"... and i can't access the global zone but i can login on any local zone and then from there i can login using "ssh -l root Ip command " command....... whats the problem , If anybody have idea about... (2 Replies)
Discussion started by: tahir23
2 Replies
Login or Register to Ask a Question