Using Operating System Environment Variables in SQLPLUS
425344Jul 14 2004 — edited Nov 28 2005 I'm looking for a way to use the Operating System Environment Variables inside of a sql script. I'd like to create a generic script that will run on all machines regardless of directory structure. I know that in SQLPLUS I can call on Operating System commands using ! followed by the Operating System command. But I'd like to use a SQL command using a Operating System variable. Example:
spool $ORACLE_BASE/assistants/dbca/logs/CreateDB.log
startup nomount pfile="$ORACLE_BASE/admin/orc3/pfile/init.ora";
If this is not possible to do can I set SQLPLUS variables to match the operating system variables through scripting some way?