Sqlplus script example

    how to execute sql file in sqlplus
    how to run .sql file in sqlplus command line
    how to execute multiple sql files in sqlplus
    how to run sql script in sqlplus
  • How to execute sql file in sqlplus
  • How to run sql script in sqlplus command line in windows

  • How to run sql file in oracle sql developer
  • Sqlplus -s option in shell script
  • Sqlplus run sql file from command line
  • How to run sql script in sqlplus command line in linux
  • Sqlplus -s option in shell script.

    There are several Oracle SQL*Plus questions often asked. How to run a SQL script in Oracle SQLPlus? How to execute a script file within SQL Plus environment? How to save the script output in SQLPlus to a text file?

    In Oracle, use @ to run a script file after starting SQL Plus.

    SQL Plus can be started from any directory where the user is given the access to.

    How to run sql file in oracle command line

    The user account needs privilege to run sqlplus which is usually in the $ORACLE_HOME/bin folder. The following is the format to run a script in SQL Plus in the Linux environment:

    SQL > @script.sql
    SQL > @/path/script.sql

    If the path is not specified, SQL Plus look for the script file in the directory where the current user account is at.

    You can use cd to change the directory to the location where the script is put, and then run SQL Plus. Otherwise, you can specify the path of the script in the @ command.

    Examples

    We need to run “DGPhyStby_script_v3.sql” which is provided by Oracle for Data Guard diagnostics.

    First, we download the script and upload it to our Oracle server (Linux) in the /oracle_staging

      how to run sql script in sqlplus command line
      how to run sql script in sqlplus command line in linux