Linux Setting Oracle Environment variables
Method One: Run the export command directly to define the variable, which is valid only under the current shell (bash) or its child shell (bash), the shell is closed, the variable is invalidated, the new shell is opened without this variable, and needs to be redefined.
To set Oracle environment variables as an example
Export oracle_base=/data/app/ORACLE, export oracle_home= $ORACLE _base/product/12.1. 0/dbhome_1; export Oracle_sid=orcl; export PATH= $ORACLE _home/bin: $PATH;
Method Two: Add the variable in the. bash_profile file in the user directory, and the change amount will only be valid for the current user and is "permanent".
oracle_base=/data/app/Oracle; Export Oracle_baseoracle_home= $ORACLE _base/product/12.1. 0/dbhome_1; Export Oracle_homeoracle_sid=ORCL; Export Oracle_sidpath= $ORACLE _home/bin: $PATH; Export PATH
Method Three: Add the variable in the/etc/profile file, which will be valid for all users under Linux and is "permanent".
oracle_base=/data/app/Oracle; Export Oracle_baseoracle_home= $ORACLE _base/product/12.1. 0/dbhome_1; Export Oracle_homeoracle_sid=ORCL; Export Oracle_sidpath= $ORACLE _home/bin: $PATH; Export PATH
Setting Oracle environment variables under Linux