6 Replies Latest reply: Mar 12, 2014 1:14 PM by EdStevens RSS

    spooling rman interactive session

    EdStevens

      Oracle 10.2.0.4 SE-One on Windows Server (32 bit)

      Oracle 11.2.0.2 SE-One on Oracle Linux 5.6 (64 bit)

       

      Maybe I'm not seeing the obvious, but am not having any luck spooling the output of an rman session when I'm working interactively at the rman command prompt.  I've tried the logfile and spool options,  In both cases, the actual output of the commands I enter are sent ONLY to the indicated file .. they are not sent to stdout, so I end up working blind.  I see that in the documentation this quote in the description of the "LOG" parameter:

       

      Note: The easiest way to send RMAN output both to a log file and to standard output is to use the Linux tee command or its equivalent. For example:

      % rman | tee rman.log 

      Ok, that's workable for linux.  Seems for windows, the only option would be to download a 3d party port of 'tee', which is not acceptable on my servers.

       

      Seems strange that 'spool' in rman was not implemented the same way as in sqlplus.  Just turn spool on, work away, and have a complete log of the entire session.  Seems that the logging capabilities for rman (log or spool) were intended only for use in a batch job.

        • 1. Re: spooling rman interactive session
          BeGin

          Hello ,

           

          I have never tried on windows but what's the result with "set echo on" in rman ?

           

          HTH,

           

          Regards,

           

          --

          Bertrand

          • 2. Re: spooling rman interactive session
            EdStevens

            BeGin wrote:

             

            Hello ,

             

            I have never tried on windows but what's the result with "set echo on" in rman ?

             

            HTH,

             

            Regards,

             

            --

            Bertrand

             

            Quoting from the docs:

             

            Controls whether RMAN commands appear in the message log. When reading commands from a command file, RMAN automatically echoes them to the message log. When reading commands from standard input, by default RMAN does not echo these commands to the message log. To force RMAN to echo the commands, run the SET ECHO ON command before running your command file. Run SET ECHO OFF to disable echoing to the command log.

            The command is useful when stdin and stdout have been redirected. For example, in UNIX you can redirect RMAN's input and output in this manner:

            % rman TARGET / < in_file > out_file 

            By including SET ECHO ON in the in_file, you enable the commands contained in in_file to be visible in out_file.

             

            But just in case there was any un-documented behavior, I tried it anyway.  Nope.  It behaves exactly as documented. If you are logging or spooling, the output does not come back to stdout.

            • 3. Re: spooling rman interactive session
              BeGin

              EdStevens wrote:

               


              But just in case there was any un-documented behavior, I tried it anyway.  Nope.  It behaves exactly as documented. If you are logging or spooling, the output does not come back to stdout.

               

              I hoped it would make a little more on windows.

               

              If powershell is available on your servers it has a native implementation of tee - at least on my version of windows 7 .

              You have to run powershell "rman | tee test.txt"

              I tried it, rman seems to have some different behaviours  : I have to hit "enter" once more after each command to get the prompt back, but this can perhaps do the trick.

               

              HTH

               

              Regards,

               

              --

              Bertrand

              • 4. Re: spooling rman interactive session
                EdStevens

                the powershell option works exactly as you described.  Better than nothing, but that behavior means you don't really know when a command has completed and control returned for more command input.  Just have to hit 'enter' again when you think it should be done.

                 

                I'm really surprised that oracle did not implement a 'spool' for rman the same way it did for sqlplus.

                • 5. Re: spooling rman interactive session
                  BeGin

                  Glad to know it helped ...

                   

                  On the other way, I'm wondering why they did not implement in sqlplus for linux the command line history, or at least just arrow keys support the same way it did for windows, without a third party tool like rlwrap ...

                   

                  regards,

                   

                  --

                  Bertrand

                  • 6. Re: spooling rman interactive session
                    EdStevens

                    BeGin wrote:

                     

                    Glad to know it helped ...

                     

                    On the other way, I'm wondering why they did not implement in sqlplus for linux the command line history, or at least just arrow keys support the same way it did for windows, without a third party tool like rlwrap ...

                     

                    regards,

                     

                    --

                    Bertrand

                    Because, as I understand it, that is not controlled by sqlplus but by the environment in which it runs.  When you peel back the layers, it is not sqlplus that is reading the keyboard and buffering (or not) the input.

                    But then, maybe at some deep level, that is the same fundamental issue with spooling output ... I don't know.