Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sqlplus oracle : How can I run sql command on bash in 1 line?

Tags:

oracle

sqlplus

Can I convert this into 1 command line on bash in sqlplus? cause i want to automate it.

sqlplus / as sysdba
SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);
exit
like image 513
TheOneTeam Avatar asked Jun 28 '12 03:06

TheOneTeam


1 Answers

You won't need the exit with automation because it should exit on end of file anyway. So on one line you could do:

echo 'EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);' | sqlplus / as sysdba
like image 168
Sodved Avatar answered Oct 06 '22 02:10

Sodved