Skip to content
Advertisement

SQL file executes with no error but also no results through shell script

I have a sqlfile that I want to run via shell script against an Oracle pluggable database. The sql file basically just loops through table names to apply grants to a role. When I run the script, it looks like it executes the file, but it really doesnt, no grants are applied. When I log into sqlplus and execute the sql file manually, it does actually execute and I see the output I expect.

Can someone help me understand the reason for this behavior and how to resolve it?

==SCRIPT==

==SCRIPT RESULT==

==RUN ON COMMAND LINE==

Advertisement

Answer

At advice of commenter, I double checked the script was logging into the PDB correctly, but it wasn’t, it was going to the CDB so the sqlfile that runs without error couldn’t find expected schemas. Updated script to do away with TWO_TASK since I was using it incorrectly and need to read more of the documentation on it, and logged in directly to PDB.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement