Re: Mirroring
Posted in 1997
In article <3313D72E.77A70447@www.weideneder.de>, Stefan Weideneder
<stefan@www.weideneder.de> writes
>cburton@gte.net wrote:
>>
>> I am currently on 7.11.UC1 on HP-UX 9.04
>>
>> To experiment (before implementing), I created a mirror of the
>> root_dbs. Both the root and the mirror are seperate logical (and
>> physical) devices. The links to the devices were created in
>> /usr/informix/dev. t_root_dbs and t_root_mir
>>
>> After recovery of the root had taken place (watched the log), I did a
>> level 0 to make sure everything was in sync. Then I deleted the
>> symbolic link in /usr/informix/dev to t_root_dbs so it would be on the
>> mirror. I then waited for onstat -d or the log to report the root_dbs
>> was down. I then did update stats on a table. Dropped and recreated
>> another table. Created a stored procedure. (All should of had
>> activity on the root_dbs space). onstat -d showed reads and writes
>> from the now (supposedly missing) root_dbs. Again I waited. Two
>> check points; another hour. NO MESSAGES that I now have a (simulated)
>> device error. I called INFORMIX help, and their answer was that I had
>> to bounce the server (at least once a week, according to their
>> guidelines) in order to find a problem. If I have a 24x7 system, &
>> cannot bounce the server, the mirroring is a moot point.
>>
>> Someone please tell me this is wrong.
>>
>> TIA
>>
>> Chris
>
>Hi Chris,
>
>I think you should contact your UNIX support or just read the manual
>entry of "rm". It's only removed from your directory, but it's still
>there. A file will not be deleted as long as a process has
>an open connection (read/write) to this file. It's very difficult
>to "simulate" a device error. If you want to simulate a device error
>you must force the UNIX calls (read/write/lseek/tell) to return the
>value -1. Otherwise it's nearly impossible, because Informix will
>open it's chunks only at startup time.
>Maybe it's possible to switch off your disks, or make use of a floppy
>disk to simulate the device error.
>
>Have a nice day,
>
>Stefan
Correct. rm removes the directory entry note the file.
UNIX top of the day: way to create temporary file which
a) cannot be overwritten.
b) is automatically deletes once the program dies e.g. if it dies
with a core dump or kill -9:-
fd1=open("/tmp/x","a"); /* create file */
unlink("/tmp/x"); /* remove directory entry */
/* From here on the file cannot be accessed by anything but this
process i.e. other processes can create file /tmp/x but it will
use a different inode and hence be a separate file!! */
The only way to do what you want to achieve is to pick a large file
e.g. oninit and dd the first 100K onto the start of the mirror chunk
i.e.
dd if=oninit of=<chunk path> bs=1024 oseek=<offset of start of chunk
in K> count=100
This is :-
if=oninit : input file = oninit
of=<chunk path> : output file = your chunk
bs=1024 : input and output block size is 1024 bytes (1L)
oseek : skip first n blocks of <chunk path>
Note to get offset
a) use onstat -b and look at end of output to get
pagesize in bytes.
b) use onstat -d to get start offset for chunk in
pages
calculate
(offset in pages) x (pagesize/1024)
to get the value to use here.
count=1000 : copy 100 blocks (in this case 100K).
I have done this before and it works (Online 5.07.UC1 on Solaris 2.5).
Yes I got wrong once and used seek= rather that oseek=.
Yes it skip block from the input rather than the output.
Yes I overwrote the VTOC on the disk and it had used filesystems on it
Yes I got virtually thrown into a car and driven on-site at stupid
speeds by a salesman to fix the problem
No I will never get it wrong again
PS Check the above dd command before using it.
--
David Williams