Yes is a good idea, if the DB is spread across different devices. ( that ideally would be on different volumes ). The percentage of the volume of corruption would be less. However to restore you still have to restore the whole DB, which in separate devices and volumes can be faster. ( I/O is spread, less concurrency )
No. You have to recover the Db(s) that the corrupted device holds. So if you have a DB that has 1 corrupt device and you have those logical connections (good practice), you just need to change on OS, the connection to the new physical device. Then restore DB.
How is you replication ? Repserver or disk mirroring? For repserver, i do not think so, your source ASE would stop functioning, and you would have to stop replication to restore the db. Disk mirroring I don't know.
Response to updated question:
My point 2 was:
- You will need to recover the whole db, unless you know exactly which objects where present on that device (and segments of it) that got corrupted, if yes then you can rebuild them manually( tables, procs, views... ). If you don't know or the labour to do it manually is too great, complete db recover.
What I mentioned about the logical connections was this, for example:
You have DB called TEST1 on the the following devices:
data01
data04
log02
data03
When you create the device with disk init, you have to give the path. But the path is not directed to the device itself, it goes to a soft link. Your data01 for example:
disk init.... physname='..sybase/data01.dat" ...
On the OS that sybase/data01.dat will be pointing to /dev/data01.dat. This way if you need on the OS to replace a corrupted device, you won't have to rebuild the database, you just create a new raw file, point data01.dat to it, and on DB restore data (LOAD). Faster process, than drop old DB, create new, load.
Well I'm pretty sure your errorlog would have some information about that corrupted device and also about your dumps had issues.
If your dumps were successfully dumped you should be able to use them on your restore (good devices). So I don't really get why you had to go back so many days. The thing is for instance if you have a corrupted device, it will manifest whenever some action tries to use it, (I/O). So your dumps would have failed i believe.
Sybase ASE will not allow you to directly delete rows from multiple tables using a wild card, but it's pretty simple to create a script to find the table names, and loop through them.
You can find the tables names by querying sysobjects
within the database.
To find all the tables with the prefix Table_
you would do:
select name from myDatabase..sysobjects
where type = "U"
and name like "Table\_%" escape "\"
In the above query "U"
is the flag for User defined tables. Also because _
is a single character wild card in T-SQL, we have to escape it to find the literal _
. T-SQL allows almost any character to act as the escape, but it must be defined after the like
clause. Finally %
is the multi-character wild card, the T-SQL equivalent to *
in *nix and DOS.
It would also be possible to use the above query to build a sql script. We start by telling the server not to print out the number of rows affected by the query using set nocount
. This allows us to create a script that will run error-free, without needing additional editing.
set nocount on \\supressess rows affected printout
select "delete from " +name+ " where type = 1" + char(10) + "go"
from myDatabase..sysobjects
where type = "U"
and name like "Table\_%" escape "\"
go
If you execute this from isql
and using the -b
flag to supress headers, and -o
flag to redirect output to a file, it will build a script that can then be executed directly.
isql -Uusername -Ppassword -Sservername -b -omyScriptToDeleteData.sql -iSQLToFindTables.sql
Best Answer
It seems that the 5GB limit is per server, so you would not be able to have multiple 5GB databases.
As for migration, it should be just a matter of shutting down the Express Edition, and using the Developer Edition binaries to start your existing data server.
It may be as easy as copying then RUN_[servername] file from the old
./install
directory to the new one, if all of your system and user databases exist outside of the installation directory.The link above is worth checking out, as it details the restrictions of the different versions. It's also a great resource for ASE knowledge, as Rob Verschoor is one of the most knowledgable Sybase/SAP database guys around.