Inactive regions are pretty easy to fix. But, as always, a backup is recommended before poking that thar bear with a stick. :)<div><br></div><div>Ya just need to take your favorite database tool, and connect to your OpenSim db. First you'll need the UUIDs of any inactive regions. If you no longer have a record of this somewhere (say, in an old XML or INI region file) you can compare the UUIDs from your active regions to the results of the following query, and take note of the ones that are dead:</div>
<div><br></div><div>SELECT RegionID FROM estate_map;</div><div><br></div><div>Looks to me like there's only really two tables to worry about here named "prims" and "primshapes". We'll start with safe queries that don't actually change anything, so you can get a feel for whether this is worthwhile for you. We'll also only do one stale region for the sake of simplicity. Let's start by seeing just how many rows you might be able to remove. Run this simple query:</div>
<div><br></div><div>SELECT COUNT(*) FROM prims WHERE RegionUUID = '<OldRegionUUID>';</div><div><br></div><div>Replace <OldRegionUUID> with the inactive region's UUID. That query will return a number equaling the number of stale prims sitting in that table.</div>
<div><br></div><div>That's the prims table, which is easiest since each prim has a RegionUUID column. The primshapes table doesn't, so we'll have to use the prims table to figure out which shapes are stale. The following query will do this for you:</div>
<div><br></div><div><div>SELECT COUNT(*)</div><div> FROM primshapes</div><div> WHERE EXISTS</div><div> (SELECT * FROM prims WHERE</div><div> prims.RegionUUID = '<OldRegionUUID>'</div><div> AND prims.UUID = primshapes.UUID);</div>
</div><div><br></div><div>This *should* return the exact same number for primshapes that that you got from the query to the prims table. If you do not, stop right here, and don't make any changes to your database. If both counts are the same though, you now know how many rows you can remove by combining the two counts. So now we'll remove those rows. Make sure you have that backup before the next steps.</div>
<div><br></div><div>Now we'll remove the stale prims from the primshapes table. It's important to do this with primshapes before modifying the prims table. The following query will do so:</div><div><br></div><div>
<div>DELETE FROM primshapes</div><div> WHERE EXISTS</div><div> (SELECT * FROM prims WHERE</div><div> prims.RegionUUID = '<OldRegionUUID>'</div><div> AND prims.UUID = primshapes.UUID);</div><div><br>
</div><div>Finally, the query to remove them from the prims table:</div><div><br></div><div>DELETE FROM prims WHERE RegionUUID = '<OldRegionUUID>';</div><div><br></div><div>And there you have it. These queries removed over 9000 rows from my little OpenSim database. You can also remove those stale region UUIDs from the estate_* tables, but that should be pretty easy to do via a GUI of your choice since these tables tend to be very small in comparison to the prim tables. I just left them out of sheer laziness... they're a single row, so the space they take up is insignificant.</div>
<div><br></div><div>Marcus Llewellyn</div><div><br></div></div><div><br><div class="gmail_quote">On Tue, Dec 22, 2009 at 6:27 PM, Karen Palen <span dir="ltr"><<a href="mailto:karen_palen@yahoo.com">karen_palen@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I definitely have the remove/replace region problem. I suspect that I have more than that too though :-)<br>
<br>
Karen<br><br></blockquote></div></div>