Is there a possibility to execute an SQL script that is located on the database server using SQLPlus?

For example, if I execute @@?/rdbms/admin/awrrpti.sql the SQL file located on the client machine is used (if existent). Can I tell SQLPlus to look the script up on the server itself (without SSHing into the remote machine)?

  • Why not just connect to the location that holds the scripts and run them that way? You wouldn't need to ssh in. – Nasir Riley Jan 25 '18 at 14:13
  • @NasirRiley: I'm not quite sure what you mean by "why not just connect to the location" - how can I achieve that? I'm already connected to the database server, but it seems like only local files are accessed by using @@? – Gernot R. Bauer Jan 25 '18 at 14:33
  • What operating system are you using for SQLPlus? – Nasir Riley Jan 25 '18 at 14:51
  • @NasirRiley: I'm using a Linux OS and I am trying to automate this on a Jenkins slave – Gernot R. Bauer Jan 25 '18 at 15:48

Short answer: no, you cannot.

sqlplus is a client application, it has no way to access the server's filesystem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.