My Oracle Support Banner

Setting Environment Variables Through Srvctl (Doc ID 733567.1)

Last updated on JUNE 18, 2023

Applies to:

Oracle Database - Enterprise Edition - Version 10.1.0.2 to 11.2.0.4 [Release 10.1 to 11.2]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Cloud Exadata Service - Version N/A and later
Information in this document applies to any platform.

Purpose

The srvctl utility can be used to set environment variables for a resource, with the "srvctl setenv" command.  These environment variables are then used at resource startup.  The purpose of this FAQ is to supplement the documentation for this command to provide a greater understanding of its use and impact.

The documentation on "srvctl setenv" and its sister command, "srvctl getenv", can be found in the "Server Control Utility Reference", in the Oracle documentation for your release.

10gR1:
Oracle Real Application Clusters Administrator's Guide
Appendix B - Server Control (SRVCTL) Reference
B10765-02
http://download.oracle.com/docs/cd/B14117_01/rac.101/b10765/srvctladmin.htm

10gR2:
Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide
Appendix E - Server Control Utility Reference
B14197-15
URL: http://download-west.oracle.com/docs/cd/B19306_01/rac.102/b14197/srvctladmin.htm

11gR1:
Oracle Real Application Clusters Administration and Deployment Guide
Appendix A - Server Control Utility Reference
B28254-07
URL: http://download.oracle.com/docs/cd/B28359_01/rac.111/b28254/srvctladmin.htm

11gR2:
Oracle Real Application Clusters Administration and Deployment Guide 11gR2
Appendix A - Server Control Utility Reference
E16795-07
URL: http://docs.oracle.com/cd/E18283_01/rac.112/e16795/srvctladmin.htm

Questions and Answers

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Purpose
Questions and Answers
 What is the effect of setting environment variables through srvctl?
 How to show the values of environment variables set in the OCR ?
 What variables can be set with srvctl setenv?
 What objects can srvctl setenv/getenv be used for?
 When setting an environment variable for the database with "srvctl setenv database", does this affect all nodes or just the node where the command is run?
 If I set an environment variable for the database using srvctl, will it affect database startup when I start up a database instance manually with sqlplus?
 What is the syntax for the srvctl setenv/unsetenv/getenv commands?
 For 10.2 and 11.1:
 
For 11.2:
 Example: Setting, Viewing, and Unsetting TNS_ADMIN for a Database
 Scalability RAC Community
References

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.