STDIO Parameter
Posted in 2017
A user asked what TAPEDEV/ontape's "STDIO" setting means and why their backup script used `ontape -s -L 0 -t STDIO > /path/file`. Answers: STDIO makes ontape write the archive to standard output (and read from stdin on restore), so the shell redirect sends it to that file — equivalent to naming the file directly with -t or in TAPEDEV. Andreas Legner noted the feature was really added for piping a backup straight into a new HDR/RSS secondary (often with a fake -F backup), that restore reads the stream once without rewinding, and that interactive prompts aren't possible since stdin/stdout are in use; Art Kagel suggested ifxclone as an easier cloning alternative. Question answered.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Storage & Space Management
Can someone tell me what this means in layman terms? You can set the TAPEDEV configuration parameter to STDIO to direct back up and restore operations to standard I/O instead of to a device. What is standard I/O? I know our database server uses raw disk space for its data. Does setting the backup to use STDIO mean it will go to just an ordinary folder or become just an ordinary file? I can't find anywhere that explains this. It must be a Unix term(standard I/O)
STDIO is the standard input and output method for a program, so typically the out is a tty (screen) and the input a keyboard. AFAIK they will always be file handle 1 and 2 within a program Cheers Paul -----Original Message----- From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of BENJI LONG Sent: Friday, April 14, 2017 3:46 PM To: ids@iiug.org Subject: STDIO Parameter [38939] Can someone tell me what this means in layman terms? You can set the TAPEDEV configuration parameter to STDIO to direct back up and restore operations to standard I/O instead of to a device. What is standard I/O? I know our database server uses raw disk space for its data. Does setting the backup to use STDIO mean it will go to just an ordinary folder or become just an ordinary file? I can't find anywhere that explains this. It must be a Unix term(standard I/O) **************************************************************************** *** Forum Note: Use "Reply" to post a response in the discussion forum.
Thanks Paul.
So this is the command that is being used for backups:
ontape -s -L 0 -t STDIO > /opt/informix/full_backup2/1_L0_Archive
What is the STDIO telling it? Backup to the screen and then put in it this
folder? Why would we want to do that?
STDIO is telling ontape to write the archive to it's standard output file
which you are redirecting with the greater-than sign (>) into the file
/opt/informix/full_backup2/1_L0_Archive. This would be the same as:
ontape -s -L 0 -t /opt/informix/full_backup2/1_L0_Archive
or setting TAPEDEV to /opt/informix/full_backup2/1_L0_Archive in the
ONCONFIG file.
Art
Art S. Kagel, President and Principal Consultant
ASK Database Management
www.askdbmgt.com
Blog: http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions
and do not reflect on the IIUG, nor any other organization with which I am
associated either explicitly, implicitly, or by inference. Neither do
those opinions reflect those of other individuals affiliated with any
entity with which I am affiliated nor those of the entities themselves.
On Fri, Apr 14, 2017 at 5:19 PM, BENJI LONG <ruggedmouse@hotmail.com> wrote:
> Thanks Paul.
>
> So this is the command that is being used for backups:
>
> ontape -s -L 0 -t STDIO > /opt/informix/full_backup2/1_L0_Archive>
> What is the STDIO telling it? Backup to the screen and then put in it this
> folder? Why would we want to do that?
>
>
> ************************************************************
> *******************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--f403045d13920b025a054d270dca
It says redirect stdout (1) output to a file rather than the screen,
My bad earlier fd(0) is input fd(1) is output and fd(2) is error by default
- long day
Cheers
Paul
-----Original Message-----
From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of BENJI
LONG
Sent: Friday, April 14, 2017 4:19 PM
To: ids@iiug.org
Subject: Re: RE: STDIO Parameter [38941]
Thanks Paul.
So this is the command that is being used for backups:
ontape -s -L 0 -t STDIO > /opt/informix/full_backup2/1_L0_Archive
What is the STDIO telling it? Backup to the screen and then put in it this
folder? Why would we want to do that?
****************************************************************************
***
Forum Note: Use "Reply" to post a response in the discussion forum.
Thanks Art. That is what I was wondering, why they used STDIO instead of omitting it. So it seems like there are at least 3 ways to get the same result.
Thanks for the help Paul. This has helped solve another mystery. I read and read, and couldn't see why they were doing this in this way.
My guess would be a Windoze'ism, doing this way is probably more portable. I recal JL saying it is non-trivial redirecting the standard io across all OS's This might be of interest, https://superuser.com/questions/999581/pipe-and-stdin-redirection-to-cat Cheers Paul -----Original Message----- From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of BENJI LONG Sent: Friday, April 14, 2017 5:10 PM To: ids@iiug.org Subject: Re: RE: RE: STDIO Parameter [38945] Thanks for the help Paul. This has helped solve another mystery. I read and read, and couldn't see why they were doing this in this way. **************************************************************************** *** Forum Note: Use "Reply" to post a response in the discussion forum.
Might want to have a look at "Decrease setup time using the ontape STDIO=20
feature" (
https://www.ibm.com/support/knowledgecenter/en/SSGU8G=5F12.1.0/com.ibm.admi=
n.doc/ids=5Fadmin=5F0932.htm
) for creating a new HDR or RSS secondary server.
Not only this would save time, it also would save you the need for an=20
on-disk (or on-tape) backup (which is why such backup should be flagged as =
a fake backup using -F option.)
This actually is what the -t STDIO feature (writing to stdout and reading=20
from stdin) got implemented for. It also slightly changes ontape=20
behavior, especially during restore where ontape now would read the backup =
stream once only and in one go, that is without rewinding.
Hope this is making sense.
Andreas
From: "BENJI LONG" <ruggedmouse@hotmail.com>
To: ids@iiug.org
Date: 15.04.2017 00:10
Subject: Re: RE: RE: STDIO Parameter [38945]
Sent by: ids-bounces@iiug.org
Thanks for the help Paul. This has helped solve another mystery. I read=20
and=20
read, and couldn't see why they were doing this in this way.=20
***************************************************************************=
****=20
Forum Note: Use "Reply" to post a response in the discussion forum.=20
You can also use the ifxclone utility for a very simplified way to create a
secondary!
Art
Art S. Kagel, President and Principal Consultant
ASK Database Management
www.askdbmgt.com
Blog: http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions
and do not reflect on the IIUG, nor any other organization with which I am
associated either explicitly, implicitly, or by inference. Neither do
those opinions reflect those of other individuals affiliated with any
entity with which I am affiliated nor those of the entities themselves.
On Sun, Apr 16, 2017 at 9:27 AM, Andreas Legner <andreas.legner@de.ibm.com>
wrote:
> Might want to have a look at "Decrease setup time using the ontape STDIO=20
> feature" (
> https://www.ibm.com/support/knowledgecenter/en/SSGU8G=
> 5F12.1.0/com.ibm.admi=
> n.doc/ids=5Fadmin=5F0932.htm
> ) for creating a new HDR or RSS secondary server.
> Not only this would save time, it also would save you the need for an=20
> on-disk (or on-tape) backup (which is why such backup should be flagged as
> =
>
> a fake backup using -F option.)
>
> This actually is what the -t STDIO feature (writing to stdout and
> reading=20
> from stdin) got implemented for. It also slightly changes ontape=20
> behavior, especially during restore where ontape now would read the backup
> =
>
> stream once only and in one go, that is without rewinding.
>
> Hope this is making sense.
>
> Andreas
>
> From: "BENJI LONG" <ruggedmouse@hotmail.com>
> To: ids@iiug.org
> Date: 15.04.2017 00:10
> Subject: Re: RE: RE: STDIO Parameter [38945]
> Sent by: ids-bounces@iiug.org
>
> Thanks for the help Paul. This has helped solve another mystery. I read=20
> and=20
> read, and couldn't see why they were doing this in this way.=20
>
> ************************************************************
> ***************=
> ****=20
>
> Forum Note: Use "Reply" to post a response in the discussion forum.=20
>
>
> ************************************************************
> *******************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--94eb2c11b59461a371054d48e480
Hi, your link doesn't work. I'll try and find it. My first attempt at searching for it failed.
Search for ontape and stdio, should turn up near the top.
As Art said, there are alternatives for this particular purpose (cloning a =
server). I just meant this as an illustration of the feature.
One more note on -t STDIO: as this would use standard out stream=20
(stdout) during backup, or standard in stream (stdin) during restore, the=20
two streams could no longer be used for any interactive prompting, e.g.=20
whether you want to restore logical logs. Definitely a second area of=20
modified behavior.
You'd not typically use this feature for regular backup and restore.
BR,
Andreas
From: "BENJI LONG" <ruggedmouse@hotmail.com>
To: ids@iiug.org
Date: 19.04.2017 14:39
Subject: Re: RE: RE: STDIO Parameter [38983]
Sent by: ids-bounces@iiug.org
Hi, your link doesn't work. I'll try and find it. My first attempt at=20
searching for it failed.=20
***************************************************************************=
****=20
Forum Note: Use "Reply" to post a response in the discussion forum.=20