Results 1 to 7 of 7

Thread: Help in Sybase

  1. #1
    Join Date
    Dec 2006
    Posts
    5

    Unanswered: Help in Sybase

    I want to simulate/inject any Hard fault in my sybase database. can someone please suggest me a simple way for this?
    That is, if i run 'dbcc checkverify', it should show atleast one Hard fault.

    thanks

  2. #2
    Join Date
    Feb 2002
    Location
    Willy is on vacation
    Posts
    1,208
    dbcc corrupt(<objid>,<indid>,<error nr>)

  3. #3
    Join Date
    Dec 2006
    Posts
    5

    hi again

    How can i revert the corrupted database back to normal state?
    Also 3rd parameter err_no is what you mean by error code like 100035 or 100016,etc?

  4. #4
    Join Date
    Dec 2006
    Posts
    5

    this command reports some error

    i gave the same same 'dbcc corrupt' in my sybase. But it says incorrect parameter passed to dbcc.
    am i missing anything here?

  5. #5
    Join Date
    Dec 2006
    Posts
    5

    i tried dbcc corrupt

    hi,
    i tried 'dbcc corrupt (dbid,indid,err_no)
    Then did 'dbcc checkstorage (dbname)'
    But checkstorage didnt report any hard fault.
    can someone please advise me which command exactly will do this?

  6. #6
    Join Date
    Feb 2002
    Location
    Willy is on vacation
    Posts
    1,208
    Checkstorage reports it's own set of errors that 100xxx numbers to that of standard ASE errors. The dbcc corrupt is only meant for ASE errors. dbcc corrupt only works on a database named victimdb and only as login 'sa'

    create database victimdb
    go
    use victimdb
    go
    create table foo (c1 int, c2 varchar(10))
    go
    insert foo values (1, "Helllo")
    go
    dbcc corrupt(foo,0,697)
    go
    pg_corrupt: Unknown error:697
    no modifications for obj=32000114 indexid=0 error=697
    DBCC execution completed. If DBCC printed error messages, contact a user with System Administrator (SA) role.

  7. #7
    Join Date
    Dec 2006
    Posts
    5

    hi again

    Many thanks for your detailed info.
    I did the same thing as follow
    ----------------------------
    1> dbcc corrupt(foo,0,697)
    2> go
    DBCC execution completed. If DBCC printed error messages, contact a user with
    System Administrator (SA) role.
    1> dbcc checkstorage (victimdb)
    2> go
    Checking victimdb: Logical pagesize is 2048 bytes
    Storage checks for 'victimdb' are complete. DBCC is now recording the results in
    the dbccdb database.
    DBCC CHECKSTORAGE for database 'victimdb' sequence 2 completed at Dec 8 2006
    9:18AM. 0 faults and 0 suspect conditions were located. 0 checks were aborted.
    You should investigate the recorded faults, and plan a course of action that
    will correct them.
    1> dbcc checkverify (victimdb)
    2> go
    Verifying faults for 'victimdb'.
    DBCC CHECKVERIFY for database 'victimdb' sequence 2 completed at Dec 8 2006
    9:19AM. 0 suspect conditions considered, 0 identified as faults, 0 identified as
    harmless, and 0 could not be checked. 0 objects could not be checked.
    --------------------------------------------------------------

    Still it doesnt show any Hard Faults ..So how do i get atleast an Hard fault now?
    Again am i missing anything?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •