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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change database mode?

Status
Not open for further replies.

babeo

Technical User
Mar 30, 2000
398
CA
Hello,
Could someone help me about the problem below?
There is a problem with our hardware (memory chip), and after replace the chip, reboot and run Sybase, and it put all the database in "suspect" mode. How can I change to "open" mode or whatever mode that normally a database is available to use.?
Thanks
 
Hi,

I afraid your databases are corrupt.


If this is the case you need to restore them.I hope master database is not corrupted.

1-drop suspect databases
2-Re_create and load them

To destroy databases ,you should first do activities below to remove suspect status.


root@> isql -Usa
1> sp_helpdb
2> go
name db_size owner dbid
created
status

------------------------ ------------- ------------------------ ------
--------------
-----------------------------------------------------------------------
-------------------------------
adb 225.0 MB adb 5
Sep 25, 2000
not recovered, offline

master 93.0 MB sa 1
Jan 01, 1900
no options set

model 2.0 MB sa 3
Jan 01, 1900
no options set

sybsystemprocs 95.0 MB sa 4
Sep 23, 2000
trunc log on chkpt

tempdb 302.0 MB sa 2
Dec 14, 2000
select into/bulkcopy/pllsort, trunc log on chkpt


(1 row affected)
(return status = 0)
1>select * from sysusages where dbid = 5
2>go
1> sp_dboption adb,"single user",true
2> go
Database option 'single user' turned ON for database 'adb'.
Run the CHECKPOINT command in the database that was changed.
(return status = 0)
1> select name from master..sysdatabases where status & 256=256
2> go
name
------------------------------
adb

(1 rows affected)
1> sp_configure "allow update", 1
2> go
Parameter Name Default Memory Used Config Value
Run Value
------------------------------ ----------- ----------- ------------
-----------
allow updates to system tables 0 0 1
1

(1 row affected)
Configuration option changed. The SQL Server need not be rebooted since the
option is dynamic.
(return status = 0)
1> reconfigure with override
2> go
1> begin tran
2> update sysdatabases set status=status-256 where name="adb"
3> commit tran
4> go
(1 row affected)
1> sp_configure "allow update",0
2> go
Parameter Name Default Memory Used Config Value
Run Value
------------------------------ ----------- ----------- ------------
-----------
allow updates to system tables 0 0 0
0

(1 row affected)
Configuration option changed. The SQL Server need not be rebooted since the
option is dynamic.
(return status = 0)
1> reconfigure with override
2> go
1>dbbc dbrepair(adb,dropdb)
2>go
 
Thanks crasho2001,

Thanks for the reply, I am appreciate, the problem is exact as as you described, and it was fixed by our DBA (How, I don't know, but probably as you posted), I thought it is just simple issue. I have questions:
- Once the db is crashed, then does it mean all the databases are reset to the beginning? just as you do "sp_helpdb" command? and then I have to rebuild db from there? (we have to restore all dbs any way, in our case)
- What is the purpose/mean for the following commands:
"sp_configure "allow update", 1",
"reconfigure with override",
"update sysdatabases set status=status-256 where name="adb"
"?
What does 256 mean ?
Thanks
 
Hi,
you can not update system tables automaticly.
You should first allow to update system tables.
"allow update,1" is doing this job. Actually "reconfigure with override" has no effect on new sybase releases. It was writing your configuration.
If your database is in suspect mode, you can not drop it and restore it. You should make your database droppable.
You can use status "-256" to make your database droppable.
"-256" means not recovered, ddl in tran, read only, dbo use only, single user, allow nulls by default...
I do not have too much information about first question.
Actually dbs are crashed one by one. I do not know what cause total crash.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top