Attaching Archived Volumes (OpenInsight 32-bit Specific)
At 13 SEP 2004 09:02:55PM Andrew Gunner wrote:
Hi all
I have created some archived volumes for a client which a direct copies of the live system with the data removed.
I now need to be able to attach these volumes so that the client can report on them.
I have tried using Detach_volume to detach the live and Attach_table to attach the achive. Which works fine the problem is when I attempt to either go to a different archive or return to the live system. The detach and attach do not work even though no error is reported.
Any Ideas ?
Thanks
Andrew
At 14 SEP 2004 08:09AM Colin Rule wrote:
Because it is a copy of the database, the date/time stamps are the same and it cannot attach multiple databases with the same details.
Try this to resolve, as a once off process.
attach REVMEDIA
OPEN "REVMEDIA" TO REVMEDIA THEN
WRITEV TIMEDATE() ON REVMEDIA,"REVMEDIA",2 ELSE NULL
END
At 14 SEP 2004 10:03PM Andrew Gunner wrote:
Thanks I will try it
Regards
Andrew
At 17 SEP 2004 01:04AM Andrew Gunner wrote:
I tried your suggestion but no joy it still performs the first detach attach sequence fine and not the second or subsequent tries.
Andrew
At 18 SEP 2004 02:08AM Richard Bright wrote:
After you do the detach, you might want to flush cache etc.
Richard Bright
BrightIdeas New Zealand
At 20 SEP 2004 03:06AM Andrew Gunner wrote:
I didn't know there was a cache how do we flush it.
Andrew
At 20 SEP 2004 07:32PM Paul Rule wrote:
Andrew, Hows things?
You aren't doing a setalias to any of those files are you?
Have you done a get_status after the attempted detach to check for any errors?
At 21 SEP 2004 11:38PM Andrew Gunner wrote:
Fine thanks
No set alias and the status is fine
Andrew
At 24 SEP 2004 06:24PM Richard Bright wrote:
OK,
Here is to snipits of code that might be useful. Note the flush and garbage collect. The Archive vol has been tweaked as prev mentioned to ensure the timestamp is different, elsewise it is a clone of the original volume.
/* to find whats attached */
* Compile list of current volumes attached
Vol_List='; Vols='Vol_List=@VolumesFor M=1 to Count(Vol_List,@FM) + 1Test=Vol_ListIf Test1,'F*'=RTP57' thenVols := Field(Test,'*',2):@fmendnext MIf Index(Vols,@fm,1) then Vols-1,1='/* To detach and attach archive Vol */
* First detach current_Volume to be sure
Set_Status=0 ; * Make sure status clearDetach_Volume(Current_Volume)If Get_Status(Status_Code) thenNewVol=Current_Volume
GoSub Error_Processing
Ret= 0
Return
End
Now flush cache - importantFlushGarbageCollect
Now attach selected volume - all tablesSet_Status=0 ; * Make sure status clearATTACH_TABLE(Volume,'',AppName,'')If Get_Status(Status_Code) thenNewVol=VolumeGoSub Error_Processing
etcEnd