Saving current env in sqlplus scripts
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Saving current env in sqlplus scripts

  1. #1
    Join Date
    Sep 2000
    Location
    Sao Paulo,SP,Brazil, Earth, Milky Way
    Posts
    350

    Saving current env in sqlplus scripts

    In my sqlplus (version 10.2.0.3) scripts I want to save the current environment (ie, SETs, ALTER SESSIONs altered values, COLUMNs, BREAKs and COMPUTEs) before the execution of the scripts (because some scripts need to change it), and restore exactly then env after the execution : today Im doing the SETs saving with a :

    STORE set sqlplus_settings.sql REPLACE

    in the beginning of the script, and a :

    @sqlplus_settings.sql

    in the end - what would be your suggestions for the rest of the points ??
    Myself, I was thinking about of :

    SPOOL sess_status.sql
    BREAK
    COMPUTE
    COLUMN
    SPOOL off

    but the generated .sql file contains line breaks in the commands - I could to use something foreign to sqlplus to eliminate the breaks, but I prefer work in sqlplus, only. And I cant use UTL_FILE (PL/SQL) for it, because the scripts can be running in the server OR in a client machine. Any suggestions are welcome...

    Regards,

    Chiappa

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,333

  3. #3
    Join Date
    Sep 2000
    Location
    Sao Paulo,SP,Brazil, Earth, Milky Way
    Posts
    350

    NO, sorry..

    Sorry Davey, your answer doesnt cut it : in the link Steve just do a CLEAR BREAKS before and after, and store set just save the SETs , so it is LOSTING the BREAK anterior status , my target is different, : as I said want to SAVE the contents of BREAK and COLUMN, and COMPUTE), then clear it, alter it, and later, AFTER the execution of the script, set the BREAKs contents to EXACTLY whatever it was..... The script you pointed does NOT ....
    Besides any clever lateral-programming in sqlplus , the only way I see it really save BREAK command output to fle with SPOOL, as I said, but I really dont know how to xcut the extra line breaks on it.

    Regards,

    Chiappa

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width