How to Perform Database Repairs

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
m (How to Create a "Clean Database")
m (Trainz Wiki)
 
(63 intermediate revisions by one user not shown)
Line 1: Line 1:
This guide will take you through the process of performing manual database repairs and clean database installs. TRS19 and TANE will automatically perform database repairs when they detect corruption in the Trainz database but sometimes a manual repair or even a manual clean install of the database is required.
+
<table width=1000>
 +
<tr valign="top">
 +
<td>The information in this Wiki Page applies to '''TANE''', '''TRS19''', '''Trainz Plus''' and '''TRS22'''.<br>
  
=What is the "Trainz Database"?=
+
This guide will take you through the process of performing manual database repairs and clean database installs. '''Trainz''' will automatically perform database repairs when it detects corruption in the Trainz database but sometimes a manual repair will be required.</td>
 +
</tr>
 +
</table>
  
<table cellpadding="4" bgcolor=#c1e7e7>
+
<table width=1000>
 
<tr valign="top">
 
<tr valign="top">
<td>[[file:DotPoint.JPG]]</td>
+
<td width=375>
<td>The '''Trainz Database''' contains all the installed assets</td>
+
__TOC__
 +
</td>
 +
<td>
 +
<table cellpadding=2 bgcolor="Aquamarine">
 +
<tr valign="top">
 +
<td>[[image:LinkWiki.PNG|link=]]</td>
 +
<td>The section describing how to create a '''Clean Install''' (i.e. containing only '''Base''' and '''Built-in''' assets) has been moved to its own Wiki Page. This can be found at:-
 +
:'''[[How_to_Create_a_Clean_Install|How to Create a Clean Install]]'''
 +
</td>
 +
</tr>
 +
</table>
 +
</td>
 
</tr>
 
</tr>
 
</table>
 
</table>
 
<br>
 
<br>
In the earliest Trainz versions all the assets that came installed with Trainz, or that you installed from the DLS or downloaded as .cdp files, were stored as separate folders on your designated data drive. This made it easy to access the assets for editing and other operations. However the penalty was that each time you started Trainz it had to scan the assets to check their integrity and the more assets you had the longer the startup took. This led to a great many complaints from users.
+
<table width=1000> <!-- BEGIN Nav Buttons Table -->
 +
<tr valign="top">
 +
<td width=729><span id="stepWhat"></span>&nbsp;</td>
 +
<td width=46>[[file:BackToTop.png|link=#top|alt=Top|Top]]</td>
 +
<td width=75>&nbsp;</td>
 +
<td width=75>[[file:NextDown.png|link=#stepWhy|alt=Next Down|Next Down]]</td>
 +
<td width=75>[[file:BackToBottom.png|link=#bottom|alt=Bottom|Bottom]]</td>
 +
</tr>
 +
</table> <!-- END Nav Buttons Table -->
 +
 
 +
='''What is the "Trainz Database"?'''=
 +
 
 +
<table width=1000 bgcolor="lightcyan" cellpadding=2>
 +
<tr valign="top">
 +
<td width=10>[[image:BlueDot10x10.png|link=]]</td>
 +
<td>The '''Trainz Database''' contains all the installed assets</td>
 +
</tr>
 +
</table>
 +
 
 +
<table width=1000>
 +
<tr valign="top">
 +
<td>In the earliest Trainz versions all the assets that came installed with Trainz, or that you installed from the DLS or downloaded as .cdp files, were stored as separate folders on your designated data drive. This made it easy to access the assets for editing and other operations. However the penalty was that each time you started Trainz it had to scan the assets to check their integrity and the more assets you had the longer the startup took. This led to a great many complaints from users.
  
 
Today, all installed Trainz assets are added as records in an asset database which has significantly sped up the startup process and has reduced the possibility of accidental data corruption by users. The penalty is that users can no longer access the installed assets by using Windows Explorer. Access to the assets in the database for editing and examination is through the '''Content Manager''' program.
 
Today, all installed Trainz assets are added as records in an asset database which has significantly sped up the startup process and has reduced the possibility of accidental data corruption by users. The penalty is that users can no longer access the installed assets by using Windows Explorer. Access to the assets in the database for editing and examination is through the '''Content Manager''' program.
  
Because it is a database manager, '''Content Manager''' also provides users with many more search, display and management options than were ever previously possible. Each entry in the display shown below is a single record in the Trainz database. Each entry can be easily opened for editing, it can be deleted, copied (cloned) and updated. New assets can be manually created or installed from other sources.
+
Because it is a database manager, '''Content Manager''' also provides users with many more search, display and management options than were ever previously possible. Each entry in the display shown below is a single record in the Trainz database. Each entry can be easily opened for editing, it can be deleted, copied (cloned) and updated. New assets can be manually created or installed from other sources.</td>
 +
</tr>
 +
</table>
 
<br>
 
<br>
<table width=100%>
+
<table width=1000>
 
<tr>
 
<tr>
<td>
+
<td>[[file:DBR_EDBR20.png|link=]]</td>
[[file:DBR_EDBR20.png]]
+
</td>
+
 
</tr>
 
</tr>
 
</table>
 
</table>
 
<br>
 
<br>
 +
<table width=1000> <!-- BEGIN Nav Buttons Table -->
 +
<tr valign="top">
 +
<td width=729><span id="stepWhy"></span>&nbsp;</td>
 +
<td width=46>[[file:BackToTop.png|link=#top|alt=Top|Top]]</td>
 +
<td width=75>[[file:NextUp.png|link=#stepWhat|alt=Next Up|Next Up]]</td>
 +
<td width=75>[[file:NextDown.png|link=#stepHow|alt=Next Down|Next Down]]</td>
 +
<td width=75>[[file:BackToBottom.png|link=#bottom|alt=Bottom|Bottom]]</td>
 +
</tr>
 +
</table> <!-- END Nav Buttons Table -->
 +
='''Why Would a Database Repair (DBR) Be Needed?'''=
  
=How to Perform a Database Repair (a DBR)=
+
<span style="font-weight: 700; font-size: 15px;">A Quote from N3V</span>
  
<table cellpadding="4" bgcolor=#c1e7e7>
+
<table width=1000>
 
<tr valign="top">
 
<tr valign="top">
<td>[[file:DotPoint.JPG]]</td>
+
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>A '''DBR''' performs a "surface scan" of the database detecting missing content and content errors. It will update your database and can clean up some corrupted data.</td>
+
<td>"In terms of DB repairs, it should only be necessary if the program is updated or crashes. My understanding of the additional repairs are for things that are done outside the program function [i.e. outside of '''Content Manager''' and '''Surveyor'''] (like manually adding content into the local data folder) so in that case the db repair 'discovers' the new content".</td>
 
</tr>
 
</tr>
 
</table>
 
</table>
<br>
 
This is the simplest and (usually) the fastest option.<br>
 
  
<table cellpadding="4" bgcolor=#ffffb0>
+
<table width=1000>
 
<tr valign="top">
 
<tr valign="top">
<td>[[file:NotePad.PNG]]</td>
+
<td>When '''Trainz''' is operating there is a great deal of database activity going on with records being opened and closed, and data being read and written. Corruption of the data is always possible, particularly if the power supply is interrupted or the program is suddenly terminated (a "crash") while records are open or being written. For this reason, '''Content Manager''' comes equipped with automatic and manual database repair tools.</td>
<td><font size="3">'''Notes:'''</font><br>
+
Perform a '''DBR''' if you have:-
+
*'''unexpected problems''' with missing content
+
*content errors with installed assets (particularly if those assets did not previously show any problems)
+
A DBR process updates your database, revalidates the content and can often clear up any corruption that has occurred.
+
</td>
+
 
</tr>
 
</tr>
 
</table>
 
</table>
 
<br>
 
<br>
<table cellpadding="4" bgcolor=#c1e7e7>
+
<table width=1000 bgcolor=#000000>
 
<tr valign="top">
 
<tr valign="top">
<td>[[file:DotPoint.JPG]]</td>
+
<td>
<td>If you have installed a new asset that CM reports has having "missing" or "unknown" assets then a DBR is very '''unlikely''' to find those missing assets.</td>
+
<table bgcolor=#ffffe0>
 +
<tr valign="top">
 +
<td>[[file:PencilTips.PNG|link=]]</td>
 +
<td>A common, but not exclusive, cause of database problems and even '''CTD'''s (crashes to desktop) may be your antivirus program. Everytime '''Trainz''' accesses the database your AV program may perform a scan of the database.<br><br>
 +
Adding '''TANE.exe''', '''TRS19.exe''' and '''TRS22.exe''' to your AV programs '''real time scan''' exclusion list can potentially resolve many of these issues by preventing the AV from accessing the database.
 +
</td>
 +
</tr>
 +
</table>
 +
</td>
 
</tr>
 
</tr>
 
</table>
 
</table>
 
<br>
 
<br>
+
<table width=1000> <!-- BEGIN Nav Buttons Table -->
<table cellpadding="4" bgcolor=#ffffff>
+
 
<tr valign="top">
 
<tr valign="top">
<td colspan="2">
+
<td width=729><span id="stepHow"></span>&nbsp;</td>
----</td>
+
<td width=46>[[file:BackToTop.png|link=#top|alt=Top|Top]]</td>
 +
<td width=75>[[file:NextUp.png|link=#stepWhy|alt=Next Up|Next Up]]</td>
 +
<td width=75>[[file:NextDown.png|link=#stepEDBR|alt=Next Down|Next Down]]</td>
 +
<td width=75>[[file:BackToBottom.png|link=#bottom|alt=Bottom|Bottom]]</td>
 
</tr>
 
</tr>
 +
</table> <!-- END Nav Buttons Table -->
 +
='''How to Perform a Database Repair (a DBR)'''=
 +
 +
<table width=1000 bgcolor="lightcyan" cellpadding=2>
 
<tr valign="top">
 
<tr valign="top">
<td>[[file:Steps.PNG]]</td>
+
<td width=10>[[image:BlueDot10x10.png|link=]]</td>
<td><font size="3">'''Steps (both TRS19 and TANE):'''</font><br>
+
<td>A '''DBR''' performs a "surface scan" of the database detecting missing content and content errors. It will update your database and can clean up some corrupted data.</td>
<table cellpadding="4" bgcolor=#ffffff>
+
</tr>
 +
</table>
 +
<br>
 +
This is the simplest and (usually) the fastest option.<br>
 +
 
 +
<table bgcolor=#000000>
 +
<tr valign="top">
 +
<td>
 +
<table bgcolor=#ffffb0>
 +
<tr valign="top">
 +
<td>[[file:NotePad.PNG|link=]]</td>
 +
<td><span style="font-size: 17px;">'''Notes:'''</span><br>
 +
----
 +
Perform a '''DBR''' if you have:-
 +
<table>
 
<tr valign="top">
 
<tr valign="top">
<td>[[file:DBR_EDBR01.png]]</td>
+
<td width=10>[[image:DotPoint.JPG|10px|link=]]</td>
<td>[[file:DBR_EDBR02.png]]</td>
+
<td>'''unexpected problems''' with missing content</td>
 
</tr>
 
</tr>
 
<tr valign="top">
 
<tr valign="top">
<td colspan="2">From either the '''Launcher''' (left) or '''Content Manager''' (right):-
+
<td>[[image:DotPoint.JPG|10px|link=]]</td>
#open the '''Developer''' menu
+
<td>content '''errors with installed assets''' (particularly if those assets did not previously show any problems)</td>
#select the '''Rebuild Database''' option</td>
+
 
</tr>
 
</tr>
</table></td>
+
<tr valign="top">
</tr>
+
<td colspan=2>A '''DBR''' updates your database, revalidates the content and can often clear up any corruption that has occurred.</td>
<tr>
+
<td colspan="2">
+
----</td>
+
 
</tr>
 
</tr>
 
</table>
 
</table>
The process will proceed automatically and unaided through a number of steps, '''only some of which are shown below'''. The time required for each step will vary enormously (some will take much longer than others) and the total time involved will depend on the number of assets installed, the speed of your system and other factors.<br><br>
+
</td>
1. '''Scanning for deleted asset files'''<br>
+
</tr>
[[file:DBR_EDBR03.png]]<br><br>
+
2. '''Scanning for added asset files'''<br>
+
[[file:DBR_EDBR04.png]]<br><br>
+
3. '''Importing built in assets'''<br>
+
[[file:DBR_EDBR06.png]]<br><br>
+
4. '''Rebuilding cached asset data'''<br>
+
[[file:DBR_EDBR07.png]]<br><br>
+
The '''Rebuilding Trainz Asset Data''' window will disappear if the DBR process has been successfully completed without finding any errors. If errors have been found then the window will remain on the screen to report on the number of errors and warnings.<br>
+
<br>
+
 
+
=How to Perform an Extended Database Repair (an EDBR)=
+
 
+
<table cellpadding="4" bgcolor=#c1e7e7>
+
 
<tr valign="top">
 
<tr valign="top">
<td>[[file:DotPoint.JPG]]</td>
+
<td colspan=2>
<td>An '''EDBR''' performs a "deep scan" of the database and checks that the data in every asset conforms to the rules for that type of asset</td>
+
<table bgcolor=#ffffe0>
 +
<tr valign="top">
 +
<td>[[file:PencilTips.PNG|link=]]</td>
 +
<td>If you have installed a new asset that '''Content Manager''' reports has having '''missing''' or '''unknown''' assets then a '''DBR''' is '''very unlikely''' to find those missing assets.
 +
</td>
 
</tr>
 
</tr>
 
</table>
 
</table>
<br>
 
This is a more complex, slower and potentially more dangerous repair. An EDBR will detect and flag errors in the data that a DBR will miss. It runs every single asset in the database through the same error and compliance checks that are run when a new asset is installed.<br>
 
 
<table cellpadding="4" bgcolor=#ffffb0>
 
<tr valign="top">
 
<td>[[file:NotePad.PNG]]</td>
 
<td><font size="3">'''Notes:'''</font><br>
 
*Perform a '''EDBR''' if you have '''serious problems''' with your data that a DBR does not repair
 
 
</td>
 
</td>
 
</tr>
 
</tr>
 
</table>
 
</table>
 
+
</td>
<table cellpadding="4" bgcolor=#fcbcbc>
+
<tr valign="top">
+
<td>[[file:Stop.PNG]]</td>
+
<td>It is not unusual for CM to display a list of faulty assets that were not shown as faulty before the EDBR was run</td>
+
 
</tr>
 
</tr>
 
</table>
 
</table>
 
<br>
 
<br>
<table cellpadding="4" bgcolor=#ffffff>
+
<table width=1000>
 
<tr valign="top">
 
<tr valign="top">
<td colspan="2">
+
<td colspan=2><span style="font-weight: 700; font-size: 17px;">Steps:</span></td>
----</td>
+
 
</tr>
 
</tr>
 
<tr valign="top">
 
<tr valign="top">
<td>[[file:Steps.PNG]]</td>
+
<td width=25>[[image:DotPoint1.JPG|link=]]</td>
<td><font size="3">'''Steps (both TRS19 and TANE):'''</font><br>
+
<td><span style="font-size: 17px; font-weight: 700;">Open the Developer Menu</span>
<table cellpadding="4" bgcolor=#ffffff>
+
<table>
 
<tr valign="top">
 
<tr valign="top">
<td>[[file:DBR_EDBR01.png]]</td>
+
<td colspan=2>From either the '''Launcher''' (below left) or '''Content Manager''' (below right) open the '''Developer''' menu and select the '''Rebuild Database''' option</td>
<td>[[file:DBR_EDBR02.png]]</td>
+
 
</tr>
 
</tr>
 
<tr valign="top">
 
<tr valign="top">
<td colspan="2">From either the '''Launcher''' (left) or '''Content Manager''' (right):-
+
<td>[[file:DBR_EDBR01.png|link=]]</td>
#open the '''Developer''' menu
+
<td>[[file:DBR_EDBR02.png|link=]]</td>
#hold down the '''Ctrl''' key
+
#select the '''Rebuild Database''' option</td>
+
</tr>
+
</table></td>
+
</tr>
+
<tr>
+
<td colspan="2">
+
----</td>
+
 
</tr>
 
</tr>
 
</table>
 
</table>
<br>
 
A possible result of an EDBR.<br>
 
<table width=100%>
 
<tr>
 
<td>
 
[[file:DBR_EDBR10.png]]
 
 
</td>
 
</td>
 
</tr>
 
</tr>
 
</table>
 
</table>
<br>
 
  
=How to Create a "Clean Database"=
+
<table width=1000>
 
+
<table cellpadding="4" bgcolor=#c1e7e7>
+
 
<tr valign="top">
 
<tr valign="top">
<td>[[file:DotPoint.JPG]]</td>
+
<td>The process will proceed automatically and unaided through a number of steps, '''only some of which are shown below'''. The time required for each step will vary enormously (some will take much longer than others) and the total time involved will depend on the number of assets installed, the speed of your system and other factors.
<td>Creating a '''Clean Database''':-
+
<table>
*will return your TRS19 or TANE database to its original, newly installed, condition
+
<tr valign="top">
*is usually performed when the Trainz Database contains faulty installed assets that are causing crashes and other major problems
+
<td width=25>[[image:DotPoint1Blue.png|link=]]</td>
*does not destroy your original database</td>
+
<td>'''Scanning for deleted asset files'''<br>
 +
[[file:DBR_EDBR03.png|link=]]</td>
 
</tr>
 
</tr>
</table>
 
 
<table cellpadding="4" bgcolor=#ffffb0>
 
 
<tr valign="top">
 
<tr valign="top">
<td>[[file:NotePad.PNG]]</td>
+
<td>[[image:DotPoint2Blue.png|link=]]</td>
<td><font size="3">'''Notes:'''</font><br>
+
<td>'''Scanning for added asset files'''<br>
This process will create a new Trainz database containing only the '''built in''' and '''base''' assets that came with the original Trainz (TRS19 or TANE) installation (a "clean" database). Use this option if you want to remove from your Trainz install all:-
+
[[file:DBR_EDBR04.png|link=]]</td>
*'''DLS''' assets
+
</tr>
*'''DLC''' assets - these will have to be reinstalled
+
<tr valign="top">
*third party assets
+
<td>[[image:DotPoint3Blue.png|link=]]</td>
*assets you have created yourself (e.g. routes, sessions, etc) - but make sure that you have the original data files backed up somewhere</td>
+
<td>'''Importing built in assets'''<br>
 +
[[file:DBR_EDBR06.png|link=]]</td>
 +
</tr>
 +
<tr valign="top">
 +
<td>[[image:DotPoint4Blue.png|link=]]</td>
 +
<td>'''Rebuilding cached asset data'''<br>
 +
[[file:DBR_EDBR07.png|link=]]</td>
 
</tr>
 
</tr>
 
</table>
 
</table>
 
+
</td>
<table cellpadding="4" bgcolor=#fcbcbc>
+
</tr>
 
<tr valign="top">
 
<tr valign="top">
<td>[[file:Stop.PNG]]</td>
+
<td>The '''Rebuilding Trainz Asset Database''' window will disappear if the '''DBR''' process has been successfully completed without finding any errors. If errors have been found then the window will remain on the screen to report on the number of errors and warnings.</td>
<td>You will be creating another copy of the database but without any downloaded content. You will need enough space on your selected data drive to hold the data. Your original database will not be deleted until you choose to delete it</td>
+
 
</tr>
 
</tr>
 
</table>
 
</table>
 +
<br>
 +
<table width=1000> <!-- BEGIN Nav Buttons Table -->
 +
<tr valign="top">
 +
<td width=729><span id="stepEDBR"></span>&nbsp;</td>
 +
<td width=46>[[file:BackToTop.png|link=#top|alt=Top|Top]]</td>
 +
<td width=75>[[file:NextUp.png|link=#stepHow|alt=Next Up|Next Up]]</td>
 +
<td width=75>&#160;</td>
 +
<td width=75>[[file:BackToBottom.png|link=#bottom|alt=Bottom|Bottom]]</td>
 +
</tr>
 +
</table> <!-- END Nav Buttons Table -->
  
<table cellpadding="4" bgcolor=#ffffff>
+
='''How to Perform an Extended Database Repair (an EDBR)'''=
<tr>
+
 
<td colspan="2">
+
<table width=1000 bgcolor="lightcyan" cellpadding=2>
----</td>
+
<tr valign="top">
 +
<td width=10>[[image:BlueDot10x10.png|link=]]</td>
 +
<td>An '''EDBR''' performs a "deep scan" of the database and checks that the data in every asset conforms to the rules for that type of asset</td>
 
</tr>
 
</tr>
 +
</table>
 +
<br>
 +
<table width=XXX bgcolor=#000000 cellpadding=2>
 
<tr valign="top">
 
<tr valign="top">
<td>[[file:Steps.PNG]]</td>
 
<td><font size="3">'''Step 1: Create a Container'''</font><br>
 
<table cellpadding="4" bgcolor=#ffffff>
 
<tr valign="top">
 
<td>[[file:DBR_EDBR30.png]]</td>
 
 
<td>
 
<td>
#use '''Windows File Explorer''' to create a new folder on your data drive ('''D:''' if you have one, '''C:''' if you don't)
+
<table width=XXX-4 bgcolor=#ffffb0 cellpadding=2>
#give the folder a meaningful and easy to remember name such as '''TRS19_Clean_Database'''<br>
+
<tr valign="top">
 +
<td width=25>[[image:NotePad.PNG|link=]]</td>
 +
<td><span style="font-size: 17px;">'''Notes:'''</span><br>
 +
----
 
</td>
 
</td>
 
</tr>
 
</tr>
</table></td>
+
<tr valign="top">
 +
<td>[[image:DotPoint.JPG|10px|link=]]</td>
 +
<td>An '''EDBR''' is a more complex, slower and potentially more troublesome repair process</td>
 
</tr>
 
</tr>
<tr>
+
<tr valign="top">
<td colspan="2">
+
<td>[[image:DotPoint.JPG|10px|link=]]</td>
----</td>
+
<td>An '''EDBR''' puts every single asset in the database through the same error and compliance checks that are run when a new asset is installed</td>
 +
</tr>
 +
<tr valign="top">
 +
<td>[[image:DotPoint.JPG|10px|link=]]</td>
 +
<td>Perform an '''EDBR''' if you have '''serious problems''' with your database that a DBR does not fix</td>
 
</tr>
 
</tr>
 
</table>
 
</table>
 
+
</td>
<table cellpadding="4" bgcolor=#ffffff>
+
<tr>
+
<td colspan="2">
+
----</td>
+
 
</tr>
 
</tr>
 +
</table>
 +
<br>
 +
<table bgcolor=#ff0000>
 
<tr valign="top">
 
<tr valign="top">
<td>[[file:Steps.PNG]]</td>
 
<td><font size="3">'''Step 2: In TRS19 (or TANE) Launcher'''</font><br>
 
<table cellpadding="4" bgcolor=#ffffff>
 
<tr valign="top">
 
<td>[[file:DBR_EDBR31.png]]</td>
 
 
<td>
 
<td>
#click the '''Trainz Settings''' button
+
<table bgcolor=#fcbcbc>
#click the '''Install''' tab
+
<tr valign="top">
#write down the location of the '''Local Data Folder''' - you may need it again!
+
<td>[[file:Stop.PNG|link=]]</td>
#click the button '''[...]''' next to the local folder display name
+
<td><span style="font-size: 15px; font-weight: 700;">CAUTION:</span><br>
#browse to your new data folder created in '''Step 1: Create a Container''' above
+
It is not unusual for '''Content Manager''' to display a list of faulty assets '''after an EDBR''' that were not shown as faulty before the '''EDBR''' was run
#select (click on but do not open) your new data folder
+
#click the button '''[Select folder]'''
+
#close any open '''File Explorer''' windows
+
You will see a progress bar as the built in assets are copied across to the new folder.
+
 
</td>
 
</td>
 
</tr>
 
</tr>
</table></td>
+
</table>
 +
</td>
 
</tr>
 
</tr>
<tr>
+
</table>
<td colspan="2">
+
<br>
----</td>
+
<table width=1000>
 +
<tr valign="top">
 +
<td colspan=2><span style="font-weight: 700; font-size: 17px;">Steps:</span></td>
 +
</tr>
 +
<tr valign="top">
 +
<td width=25>[[image:DotPoint1.JPG|link=]]</td>
 +
<td><span style="font-size: 17px; font-weight: 700;">Open the Developer Menu</span></td>
 +
</tr>
 +
<tr valign="top">
 +
<td colspan=2>
 +
<table> <!-- BEGIN Step 1 table -->
 +
<tr valign="top">
 +
<td>[[file:DBR_EDBR01.png|link=]]</td>
 +
<td>[[file:DBR_EDBR02.png|link=]]</td>
 
</tr>
 
</tr>
 
</table>
 
</table>
 
+
<table>
<table cellpadding="4" bgcolor=#ffffff>
+
<tr valign="top">
<tr>
+
<td colspan=2>From either the '''Launcher''' (left) or '''Content Manager''' (right):-</td>
<td colspan="2">
+
----</td>
+
 
</tr>
 
</tr>
 
<tr valign="top">
 
<tr valign="top">
<td>[[file:Steps.PNG]]</td>
+
<td width=25>[[image:DotPoint1Blue.png|link=]]</td>
<td><font size="3">'''Step 3: Restart and Reconfigure'''</font><br>
+
<td>open the '''Developer''' menu</td>
#restart TRS19/TANE when you are prompted to do so
+
</tr>
#open the '''Trainz Settings''' again and click the '''Internet''' tab
+
<tr valign="top">
#delete and re-enter your username and password
+
<td>[[image:DotPoint2Blue.png|link=]]</td>
#when your username/password have been accepted, restart TRS19/TANE again
+
<td>hold down the <span style="font-weight: 700; font-size: 15px; color: white; background-color: black;">&#160;Ctrl&#160;</span> key</td>
#open the '''Trainz Settings''' again and click the '''General''' tab
+
</tr>
#adjust the settings to your preferred values
+
<tr valign="top">
#click the '''Performance''' tab and adjust the settings to your preferred values
+
<td>[[image:DotPoint3Blue.png|link=]]</td>
#exit '''Trainz Settings''' and click '''Start Trainz'''
+
<td>select the '''Rebuild Database''' option</td>
You will be prompted to download any DLC assets that you may have previously purchased. You can install them now or delay their install until later.
+
</tr>
 +
</table>
 
</td>
 
</td>
 
</tr>
 
</tr>
 +
</table>
 +
<br>
 +
A possible result of an EDBR.<br>
 +
<table width=1000>
 
<tr>
 
<tr>
<td colspan="2">
+
<td>
----</td>
+
[[file:DBR_EDBR10.png|link=]]
 +
</td>
 
</tr>
 
</tr>
 
</table>
 
</table>
 
+
<br>
Your original (and possibly faulty) database is still on your system at the location you recorded in '''Step 2''' above. You may choose to leave it there (it will take up a many GB of space), move it to offline storage or delete it.
+
<table width=1000> <!-- BEGIN Nav Buttons Table -->
 
+
<tr valign="top">
 +
<td width=729><span id="bottom"></span>&nbsp;</td>
 +
<td width=46>[[file:BackToTop.png|link=#top|alt=Top|Top]]</td>
 +
<td width=75>[[file:NextUp.png|link=#stepEDBR|alt=Next Up|Next Up]]</td>
 +
<td width=75>&nbsp;</td>
 +
<td width=75>&nbsp;</td>
 +
</tr>
 +
</table> <!-- END Nav Buttons Table -->
 
----
 
----
 
----
 
----
 
 
='''Trainz Wiki'''=
 
='''Trainz Wiki'''=
<table cellpadding="4" bgcolor=#ffffff>
+
<table width=1000>
 
<tr valign="top">
 
<tr valign="top">
<td>[[file:TrainzWiki.png]]</td>
 
 
<td>
 
<td>
<font size="3">'''More Tutorials and Guides to Using Trainz'''</font><br>
+
<table width=500 cellpadding=2 bgcolor=#ffffff>
 +
<tr valign="top">
 +
<td width=80>[[image:TrainzWiki.png|link=]]</td>
 +
<td>
 +
<span style="font-size: 17px;">'''More Tutorials and Guides to Using Trainz'''</span><br>
 
*'''<span class="plainlinks">[http://online.ts2009.com/mediaWiki/index.php/HowTo How to Guides]</span>'''
 
*'''<span class="plainlinks">[http://online.ts2009.com/mediaWiki/index.php/HowTo How to Guides]</span>'''
 
*'''[[Driver Commands List]]'''
 
*'''[[Driver Commands List]]'''
Line 286: Line 347:
 
</tr>
 
</tr>
 
</table>
 
</table>
 +
</td>
 +
<td>
 +
<table width=500 cellpadding=4 bgcolor="aquamarine">
 +
<tr valign="top">
 +
<td width=50>[[image:LinkWiki.PNG|link=]]</td>
 +
<td>
 +
<span style="font-size: 17px;">'''Related Links'''</span><br>
 +
*'''[[How to Create a Clean Install|How to Create a Clean Install and Alternative User Data Folders]]'''
 +
*'''[[Using Content Manager to Update Assets|Using Content Manager to Update Assets]]'''
 +
*'''[[Understand Content Manager Status Labels|Understand Content Manager Status Labels]]'''
 +
</td>
 +
</tr>
 +
</table>
 +
</td>
 +
</tr>
 +
</table>
 +
----
 +
This page was created by Trainz user '''<span class="plainlinks">[http://online.ts2009.com/mediaWiki/index.php/User:Pware pware]</span>''' in January 2019 and was last updated as shown below.
 +
----
 +
[[Category:How-to guides]]

Latest revision as of 16:00, 20 November 2023

The information in this Wiki Page applies to TANE, TRS19, Trainz Plus and TRS22.
This guide will take you through the process of performing manual database repairs and clean database installs. Trainz will automatically perform database repairs when it detects corruption in the Trainz database but sometimes a manual repair will be required.

Contents

LinkWiki.PNG The section describing how to create a Clean Install (i.e. containing only Base and Built-in assets) has been moved to its own Wiki Page. This can be found at:-
How to Create a Clean Install


  Top   Next Down Bottom

[edit] What is the "Trainz Database"?

BlueDot10x10.png The Trainz Database contains all the installed assets
In the earliest Trainz versions all the assets that came installed with Trainz, or that you installed from the DLS or downloaded as .cdp files, were stored as separate folders on your designated data drive. This made it easy to access the assets for editing and other operations. However the penalty was that each time you started Trainz it had to scan the assets to check their integrity and the more assets you had the longer the startup took. This led to a great many complaints from users.

Today, all installed Trainz assets are added as records in an asset database which has significantly sped up the startup process and has reduced the possibility of accidental data corruption by users. The penalty is that users can no longer access the installed assets by using Windows Explorer. Access to the assets in the database for editing and examination is through the Content Manager program.

Because it is a database manager, Content Manager also provides users with many more search, display and management options than were ever previously possible. Each entry in the display shown below is a single record in the Trainz database. Each entry can be easily opened for editing, it can be deleted, copied (cloned) and updated. New assets can be manually created or installed from other sources.


DBR EDBR20.png


  Top Next Up Next Down Bottom

[edit] Why Would a Database Repair (DBR) Be Needed?

A Quote from N3V

     "In terms of DB repairs, it should only be necessary if the program is updated or crashes. My understanding of the additional repairs are for things that are done outside the program function [i.e. outside of Content Manager and Surveyor] (like manually adding content into the local data folder) so in that case the db repair 'discovers' the new content".
When Trainz is operating there is a great deal of database activity going on with records being opened and closed, and data being read and written. Corruption of the data is always possible, particularly if the power supply is interrupted or the program is suddenly terminated (a "crash") while records are open or being written. For this reason, Content Manager comes equipped with automatic and manual database repair tools.


PencilTips.PNG A common, but not exclusive, cause of database problems and even CTDs (crashes to desktop) may be your antivirus program. Everytime Trainz accesses the database your AV program may perform a scan of the database.

Adding TANE.exe, TRS19.exe and TRS22.exe to your AV programs real time scan exclusion list can potentially resolve many of these issues by preventing the AV from accessing the database.


  Top Next Up Next Down Bottom

[edit] How to Perform a Database Repair (a DBR)

BlueDot10x10.png A DBR performs a "surface scan" of the database detecting missing content and content errors. It will update your database and can clean up some corrupted data.


This is the simplest and (usually) the fastest option.

NotePad.PNG Notes:

Perform a DBR if you have:-

DotPoint.JPG unexpected problems with missing content
DotPoint.JPG content errors with installed assets (particularly if those assets did not previously show any problems)
A DBR updates your database, revalidates the content and can often clear up any corruption that has occurred.
PencilTips.PNG If you have installed a new asset that Content Manager reports has having missing or unknown assets then a DBR is very unlikely to find those missing assets.


Steps:
DotPoint1.JPG Open the Developer Menu
From either the Launcher (below left) or Content Manager (below right) open the Developer menu and select the Rebuild Database option
DBR EDBR01.png DBR EDBR02.png
The process will proceed automatically and unaided through a number of steps, only some of which are shown below. The time required for each step will vary enormously (some will take much longer than others) and the total time involved will depend on the number of assets installed, the speed of your system and other factors.
DotPoint1Blue.png Scanning for deleted asset files
DBR EDBR03.png
DotPoint2Blue.png Scanning for added asset files
DBR EDBR04.png
DotPoint3Blue.png Importing built in assets
DBR EDBR06.png
DotPoint4Blue.png Rebuilding cached asset data
DBR EDBR07.png
The Rebuilding Trainz Asset Database window will disappear if the DBR process has been successfully completed without finding any errors. If errors have been found then the window will remain on the screen to report on the number of errors and warnings.


  Top Next Up   Bottom

[edit] How to Perform an Extended Database Repair (an EDBR)

BlueDot10x10.png An EDBR performs a "deep scan" of the database and checks that the data in every asset conforms to the rules for that type of asset


NotePad.PNG Notes:

DotPoint.JPG An EDBR is a more complex, slower and potentially more troublesome repair process
DotPoint.JPG An EDBR puts every single asset in the database through the same error and compliance checks that are run when a new asset is installed
DotPoint.JPG Perform an EDBR if you have serious problems with your database that a DBR does not fix


Stop.PNG CAUTION:

It is not unusual for Content Manager to display a list of faulty assets after an EDBR that were not shown as faulty before the EDBR was run


Steps:
DotPoint1.JPG Open the Developer Menu
DBR EDBR01.png DBR EDBR02.png
From either the Launcher (left) or Content Manager (right):-
DotPoint1Blue.png open the Developer menu
DotPoint2Blue.png hold down the  Ctrl  key
DotPoint3Blue.png select the Rebuild Database option


A possible result of an EDBR.

DBR EDBR10.png


  Top Next Up    


[edit] Trainz Wiki

TrainzWiki.png

More Tutorials and Guides to Using Trainz

LinkWiki.PNG

Related Links


This page was created by Trainz user pware in January 2019 and was last updated as shown below.


Personal tools