Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to execute a .sql file using shell script

User_E97G7Mar 24 2022

Hi All,
Please note, this is related to preparing the shell script for migration in Oracle EBS R12.2.3. Please let me know if I raised in wrong category.

As part of requirement we created 5 views, 3 packages, 1 custom table and 2 concurrent Programs. Now, we want to migrate all these using shell script. We are aware of migrating Concurrent Program using shell script. But we are not able to figure out how to run the .sql files(Which holds the create table, create views, create package) from .sh file. Because, in general, if we want to run any .sql file from PUTTY, we first connect to DB using syntax <sqlplus> and then DB credentials. Then, we will give the file execution command as <@file_name.sql> and once the file is executed, we will give <exit> to come out of db and then remaining process.

But, here we are facing issues writing commands in shell scripts for how to connect to db, how to run the .sql file and then how to exist .

Thanks in Advance,
Srivathsava

This post has been answered by User_GSQTY on Mar 25 2022
Jump to Answer

Comments

Post Details

Added on Mar 24 2022
4 comments
39,978 views