Quantcast
Channel: SCN: Message List - SAP Applications on SAP Adaptive Server Enterprise (SAP ASE)
Viewing all articles
Browse latest Browse all 3678

Re: Msg 840, Level 17, State 2:

$
0
0

Hi Nicolaas,

 

You need to drop & recreate the problematic database and the devices and then restore from backup.

 

 

To drop a database that is unable to recover either because of corruption, or another unidentified reason, you must reset the status to suspect mode to use the dbrepair command.

Please check the below steps :

 

 

 

1. check the current status of the database and keep these results:

Log in via isql using sa user  :

 

 

use master

go

select name,status from sysdatabases where name = '<dbname>'

go

 

 

 

2.

sp_configure "allow updates",1

go

begin tran

go

update sysdatabases set status = 320 where name = <dbname>

go

commit (if one row updated Or rollback)

go

 

 

 

3. select name,status from sysdatabases

go

*** Verify that the only db with 320 status is your problematic db.

 

 

 

4. Shutdown and then Restart ASE server.

 

 

 

5. when the server is back up, do:

dbcc dbrepair(dbname, dropdb)

go

 

 

 

6. select name from sysdatabases

go

 

 

 

7. Drop the problematic device .

sp_dropdevice <devicename>

go

 

 

 

 

 

Now recreate the db and restore from backup.

 

 

 

8. Create the required device using disk init.

 

 

 

9. create the database using create database.

 

 

 

10. Restore database from backup using load database.

 

 

Hope this will be helpful.

 

 

~Gaurav


Viewing all articles
Browse latest Browse all 3678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>