Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DDF file format and Views 1

Status
Not open for further replies.

theniteowl

Programmer
May 24, 2005
1,975
US
Hi Again,
Related problem to last post but really a separate question:

Our vendor sent us replacement DDF files to either correct problems or add new functionality but the result was the loss of our own custom views that had been setup by a former employee so a web app could pull out some data.

I assume that the vendor did not know about the custom views and the DDF files they sent contain only their own code.
When I look at the database in Control Center it shows no views or stored procedures with the new file.
When I swap out the new file with an old backup I can see the views that need to be there. The old file is only 42k but the new one without the views is 144k.

I do not know the structure of these files or how they all work together in Pervasive but obviously the new file contains a lot of other information than the old one did.
I would like to migrate the views from the old file into the new file but there is a problem.
This server has no test or failover environment. For me to view the old file and copy out the info manually means replacing the current production file with the old one for the time it takes to copy everything over.
Not knowing what other information is contained in the VIEW.DDF file or what the impact would be to the application putting the old one in place I am worried about making the attempt. My test to check the old file only took me about 90 seconds but it would take me as much as 45 minutes to an hour to get the info I needed from it and the system is potentially being accessed 24 hours a day.

Is there a safe way to pull the views from the old file so I can enter them into the new one?

I could make a backup of the data files and create a new ODBC to connect to the backup to get at the data but I do not know what all the files are that would be involved.

Suggestions?
I have been searching for a DDF file viewer but what I have found so far are more editors/creators and I need to know I am not going to do anything that will alter the server files.

Thanks.

At my age I still learn something new every day, but I forget two others.
 
First, make sure there isn't an X$PROC.DDF or X$VIEW.DDF in the DDF directory. Within the PCC, create a dummy stored procedure and dummy view in the new DDFs. Then, close the PCC and delete X$PROC.DDF and X$VIEW.DDF that were just created. Copy in the old X$VIEW.DDF and X$PROC.DDF. You should be able to access all of the views and procedures.

As far as a "Test" environment, you can copy the DDFs and data files to another directory, create a new DSN/DBN pointing to that location. That then gives you a completely separate database for testing.


Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
 
There are no X$PROC.DDF or X$VIEW.DDF files in the folder to begin with.

I do not know which files are the data files, I assume the .dat files but there are many others and numerous subfolders that may be unrelated to the current data. I can copy the entire data folder to another location to try it out though without having to get into the details of which files are and are not needed.
Copying the folder tree is going to take better than an hour to complete though. :)


At my age I still learn something new every day, but I forget two others.
 
OK, I copied the whole tree (2.4Gig) and set it up on my own machine as a test.
The new DDF files do not show me anything but the old still work. I can put the old-old files in to extract the custom views that had once been there so I can add them to the new DDF files once they are working.
Will try your suggestion about creating a dummy view and stored procedure and see what happens with the new DDF files but there were no X$PROC.DDF or X$VIEW.DDF files in the folder.


At my age I still learn something new every day, but I forget two others.
 
With the new DDF files in place if I try and create a new procedure or view I get "Unrecoverable error occured. Control Center will now be closed." and of course PCC closes.
With the old files in place I can perform those functions.
I still think that the new files are somehow corrupt but I do not know how to confirm that. At least I can look at the old views so I can migrate them over once we have working DDF files.

Thanks.


At my age I still learn something new every day, but I forget two others.
 
mirtheil, with the old DDF files in place on my own PC and a copy of the database set up under Databases (Engine) I am able to see the views. However, the only way to view the code of the views is to right click on it and select properties. Two of the views appear to be corrupt in that they end abruptly when there is obviously more of the query that should show and selecting Check Syntax will return an error.
If I right click and select Open or double click on the view it opens the SQL Data Manager but the query it shows in the list is simply SELECT * FROM "tablename"

I spoke with the person who originally created these views and no longer works in the area. She could not remember details but thought she had run into this problem and was able to get the whole code of the query by saving it to a file. But since in the Data Manager is not showing me the original query all I get by saving it is the basic Select * query.
Is there another way to get that code?
I suspect that it might be a corrupted file or is it possible that differences in the other DDF files would affect it as well?
There are 21 views and two of them are incomplete. The two incomplete ones are cut off at around character 1033 on one and 1065 (or something close to that) on the other and all the older backup files I have found seem to be cut at the same place or are an earlier totally different version of the view code and so unusable.

Any ideas?

At my age I still learn something new every day, but I forget two others.
 
You might be able to issue a "select * from X$VIEW" query. You might have to do some copy and pasting to get it in the right format but that might get you going.
I vaguely remember a defect in old versions of the PCC where it would cut off long Views and Stored Procedures but that was fixed in PSQL V8.6 and later (I think).

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
 
That did it. I was able to cut/paste the full query so I have it documented now and once they finally fix the DDF files I can restore the views.

Thanks again.

At my age I still learn something new every day, but I forget two others.
 
Well Nuts!
This problem just never ends.
I think what happened with the new DDF files is that they set the index.ddf file to have an incorrect path so it looked for the other files in the wrong location. In any event the vendor corrected this one file via a WebEx session and got it working.

I began trying to put our custom views back in and a few went in without trouble but when I got to one of the long ones that I had trouble extracting previously I pasted in the SQL code, did a Check Syntax which worked and clicked OK. As soon as I hit OK it dumped me right out of Control Center. Every time I have tried since I have received the same result.
I looked at the list of tables and found that there is no X$VIEW.DDF table. At first I was sure this was the problem but then realized that the first few views I had created still show up so they are storing somewhere.

Am I doing something wrong or is it the missing table for X$VIEW.DDF?
I do not have the ability to modify the configuration on the database, it is password protected.
Is it possible to add in the X$VIEW.DDF system table with the Add Table option and not cause any problems with the existing tables/data?


At my age I still learn something new every day, but I forget two others.
 
You would issue a "CREATE VIEW" statement through the SQL DM to avoid the Create View wizard.

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top