Bash/SQLPlus/Input/Redirect

From Chorke Wiki
Revision as of 01:18, 11 December 2018 by Shahed (talk | contribs) (Created page with "<source lang="bash"> # any where of the bash file can be placed this script SYSPWD=oracle;\ echo "Oracle SQLPlus Multi-Line Input";\ (cat<<EOF drop user academia_dev cascade;...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
# any where of the bash file can be placed this script
SYSPWD=oracle;\
echo "Oracle SQLPlus Multi-Line Input";\
(cat<<EOF
drop user academia_dev cascade;
create user academia_dev identified by academia_dev;
grant connect, resource, dba to academia_dev;
exit;
EOF
)|sqlplus -s sys/$SYSPWD as sysdba;\
ls -la;\
pwd
# only at the end of bash file can be place this script
SYSPWD=oracle;\
echo "Oracle SQLPlus Multi-Line Input";\
sqlplus -s sys/$SYSPWD as sysdba <<EOF
drop user academia_dev cascade;
create user academia_dev identified by academia_dev;
grant connect, resource, dba to academia_dev;
exit;
EOF