advertisements
_____________________________________________________________________________________________________________________
You can use either ! or host keyword to execute OS commands or to run shell script from the sqlplus / sql prompt.
Here are some examples for OS command execution
SQL> !pwd /home/oracle SQL> host pwd /home/oracle SQL> host date Wed Mar 1 00:33:47 EST 2017 SQL> !date
$ cat New_Shell.sh ls -ltr sleep 10 Wed Mar 1 00:33:50 EST 2017 $ vi New_Shell.sh Change the permissions to executable mode. $ chmod 744 New_Shell.sh
advertisements
Now you can run the shell script using either ! or host command.
SQL> !./New_Shell.sh total 4 -rwxr--r-- 1 oracle oinstall 18 Mar 1 00:29 New_Shell.sh SQL> host ./New_Shell.sh total 4 -rwxr--r-- 1 oracle oinstall 18 Mar 1 00:29 New_Shell.sh
_____________________________________________________________________________________________________________________
0 comments:
Post a Comment