8 Replies Latest reply on Mar 7, 2012 5:51 PM by Pavan Kumar

    sqlplus help

    user13062453
      We place all our Adhoc scripts in /home/oracle/Adhoc location on the server.

      Now everytime I want to execute a script I have to give the full path.(i.e @/home/oracle/Adhoc/test1.sql

      Is there a way in which i execute the script directly.(with out the full path, from any loc on the server) like @test1.sql



      In short I don't want to qualify the script the full patch while executing from sqlplus.


      What files need to be updated .

      Can someone help me.


      Thanks,
      Prasad
        • 1. Re: sqlplus help
          Hans Forbrich
          user13062453 wrote:
          We place all our Adhoc scripts in /home/oracle/Adhoc location on the server.

          Now everytime I want to execute a script I have to give the full path.(i.e @/home/oracle/Adhoc/test1.sql

          Is there a way in which i execute the script directly.(with out the full path, from any loc on the server) like @test1.sql



          In short I don't want to qualify the script the full patch while executing from sqlplus.


          What files need to be updated .

          Can someone help me.


          Thanks,
          Prasad
          http://www.oracle.com/pls/db112/to_toc?pathname=server.112/e16605/toc.htm
          http://www.oracle.com/pls/db112/to_toc?pathname=server.112/e16604/toc.htm

          have a lot of relevant information.

          Easiest way is to simply change to the central directory.

          Second easiest way is to set the SQLPath according to http://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_two.htm#CHDHAECG
          • 2. Re: sqlplus help
            INRi
            change ur directory path to +/home/oracle/Adhoc+
            • 3. Re: sqlplus help
              Upul Indika
              Hi,

              I didn't do this before. try to put it oracle bin directory which sqlplus program located.

              regards
              upul
              • 4. Re: sqlplus help
                Hans Forbrich
                Upul Indika wrote:
                Hi,

                I didn't done this before. try to put it oracle bin directory which sqlplus program located.
                You obviiously don't need to maintain databases through patches and upgrades. Putting operation scripts in the ORACLE_HOME would be a very bad in a production environment.

                Try reading the docs I referenced for the correct answer.
                • 5. Re: sqlplus help
                  sb92075
                  user13062453 wrote:
                  We place all our Adhoc scripts in /home/oracle/Adhoc location on the server.

                  Now everytime I want to execute a script I have to give the full path.(i.e @/home/oracle/Adhoc/test1.sql

                  Is there a way in which i execute the script directly.(with out the full path, from any loc on the server) like @test1.sql
                  SQL_PATH=/home/oracle/Adhoc/
                  • 6. Re: sqlplus help
                    Upul Indika
                    Hi,

                    Thank for information.

                    upul.
                    • 7. Re: sqlplus help
                      EdStevens
                      user13062453 wrote:
                      We place all our Adhoc scripts in /home/oracle/Adhoc location on the server.

                      Now everytime I want to execute a script I have to give the full path.(i.e @/home/oracle/Adhoc/test1.sql

                      Is there a way in which i execute the script directly.(with out the full path, from any loc on the server) like @test1.sql



                      In short I don't want to qualify the script the full patch while executing from sqlplus.


                      What files need to be updated .

                      Can someone help me.


                      Thanks,
                      Prasad
                      one way:
                      oracle> cd /home/oracle/Adhoc
                      oracle> sqlplus ...
                      (sqlplus will look in the current directory for unqualified file names)

                      Else check the SQLPATH enviornment variable - http://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_two.htm
                      • 8. Re: sqlplus help
                        Pavan Kumar
                        Hi,

                        As said by Han's, Second option would be more appropriate(Append the path to your environment settings)


                        - Pavan Kumar N