Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2010
    Posts
    7

    Unanswered: regarding disk refit

    hi

    i wanted to take backup of database without starting the sqlsrvr.


    i have worked with disk reinit & disk refit, but i got few problems.

    firstly i have my database on the device created by me.

    i took the copy of my device & master device and after re installation of sybase i did disk reinit , after that it started showing my device i tried to do disk refit .

    what i understand is that the disk refit works on master device. so i tried disk refit on original master device which was created by sybase on reinstallation , but that doesn't worked .

    after that i replaced this master device from the copy of previously installed sybase master device . this time i got little success that now sybase is showing my device & also showing my database but still it is not showing the schema of that database neither it is showing any data or column in that database .

    & also its giving error "that the device & database are not properly initialized" . when trying to access that database.

    also i didn't understand how this disk refit works means whenever i m running the disk fit its giving me error "Only the master database can be recovered when attempting to use the DISK REFIT
    command. Restart the server using trace flag 3608."

    if anyone have any idea of how to make disk refit work please tell me the procedure of making it working so that i can recover my data.

    I wanted to take the backup of database which is on my created device without starting the sybase sqlsrvr. & to load it to re installed sybase.

    i m unable to use disk reinit & disk refit properly & not getting what mistake m doing.

    if any one knows how to use these then plz let me know.

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Use disk reinit/refit on your newly installed master to see your database device
    I'll create a sample for you to follow if I have some time later

  3. #3
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1

    disk reinit/refit example

    Here is my data files
    Code:
    $ cd /sybd1
    $ ls -l
    total 465184
    -rw-r-----   1 syb1503  sybase   62914560 Oct  8 10:18 master.dat
    -rw-r-----   1 syb1503  sybase   10485760 Oct  8 10:34 mydb_d1.dat
    -rw-r-----   1 syb1503  sybase   5242880 Oct  8 10:34 mydb_l1.dat
    -rw-r-----   1 syb1503  sybase   159383552 Oct  8 10:18 sysprocs.dat
    I move them away to build new server in same place
    Code:
    $ mkdir broken
    $ mv *.dat broken/
    Now I build a new sybase server
    Code:
    $ srvbuild
    $ ls -l
    total 434448
    drwxr-x---   2 syb1503  sybase       512 Oct  8 10:36 broken
    -rw-r-----   1 syb1503  sybase   62914560 Oct  8 10:43 master.dat
    -rw-r-----   1 syb1503  sybase   159383552 Oct  8 10:43 sysprocs.dat
    Now to get mydb back
    Code:
    $ cp -p broken/mydb* ./
    $ ls -l
    total 465200
    drwxr-x---   2 syb1503  sybase       512 Oct  8 10:36 broken
    -rw-r-----   1 syb1503  sybase   62914560 Oct  8 10:44 master.dat
    -rw-r-----   1 syb1503  sybase   10485760 Oct  8 10:34 mydb_d1.dat
    -rw-r-----   1 syb1503  sybase   5242880 Oct  8 10:34 mydb_l1.dat
    -rw-r-----   1 syb1503  sybase   159383552 Oct  8 10:44 sysprocs.dat
    $ isql -Usa -P -Spd1 -w333
    1> select db_name(dbid),* from sysusages
    2> go
                                    dbid   segmap      lstart      size        vstart      pad    unreservedpgs crdate                     vdevno      
     ------------------------------ ------ ----------- ----------- ----------- ----------- ------ ------------- -------------------------- ----------- 
     master                              1           7           0        6656           4   NULL          3986        Oct  8 2010 10:38AM           0 
     model                               3           7           0        1536       13316   NULL           694        Oct  8 2010 10:38AM           0 
     tempdb                              2           7           0        1536       16388   NULL           694        Oct  8 2010 10:38AM           0 
     sybsystemdb                     31513           7           0        1536       19460   NULL           646        Oct  8 2010 10:38AM           0 
     sybsystemprocs                  31514           7           0       38912           0   NULL          8471        Oct  8 2010 10:38AM           1 
    
    (5 rows affected)
    1> disk reinit name='mydb_d1',physname='/sybd1/mydb_d1.dat',size='10m'
    2> go
    1> disk reinit name='mydb_l1',physname='/sybd1/mydb_l1.dat',size='5m'
    2> go
    1> disk refit
    2> go
    Msg 5118, Level 16, State 1:
    Server 'pd1', Line 1:
    Unable to run DISK REFIT. ASE must be booted with the -m option. Please see your System Administration guide about the Restore Master procedure.
    Oops forgot need single user mode and trace flag 3608
    Create a new startup file
    Add this line to RUN_pd1_T3608 for trace flag 3608
    -T3608 \
    Code:
    1> shutdown
    2> go
    Server SHUTDOWN by request.
    ASE is terminating this process.
    CT-LIBRARY error:
            ct_results(): network packet layer: internal net library error: Net-Library operation terminated due to disconnect
    $ cd ~/ASE-15_0/install
    $ cp RUN_pd1 RUN_pd1_T3608
    $ vi RUN_pd1_T3608
    Now restart Sybase using the new file and use -m
    Code:
    $ startserver -f RUN_pd1_T3608  -m
    You should see these warnings
    server *** WARNING ******************
    server ASE booted single user mode - updates allowed to system catalogs
    server Recovering only master database

    Now do the disk refit
    Code:
    $ isql -Usa -P -Spd1 -w333
    1> disk refit
    2> go
    Warning: Disk Refit may not have the correct segment map information in sysusages.  Please review these after the command completes to verify their accuracy.
    (7 rows affected)
    CT-LIBRARY error:
            ct_results(): network packet layer: internal net library error: Net-Library operation terminated due to disconnect
    Restart with your original RUN file
    Code:
    $ startserver -f RUN_pd1
    Verify the db is there
    Code:
    $ isql -Usa -P -Spd1 -w333
    1> select db_name(dbid),* from sysusages order by dbid,lstart
    2> go
                                    dbid   segmap      lstart      size        vstart      pad    unreservedpgs crdate                     vdevno      
     ------------------------------ ------ ----------- ----------- ----------- ----------- ------ ------------- -------------------------- ----------- 
     master                              1           7           0        6656           4   NULL          3978        Oct  8 2010 10:56AM           0 
     tempdb                              2           7           0        1536       16388   NULL           694        Oct  8 2010 10:56AM           0 
     model                               3           7           0        1536       13316   NULL           694        Oct  8 2010 10:56AM           0 
     mydb                                4           3           0        2560           0   NULL          1459        Oct  8 2010 10:56AM           2 
     mydb                                4           4        2560        1280           0   NULL          1275        Oct  8 2010 10:56AM           3 
     sybsystemdb                     31513           7           0        1536       19460   NULL           646        Oct  8 2010 10:56AM           0 
     sybsystemprocs                  31514           7           0       38912           0   NULL          8471        Oct  8 2010 10:56AM           1 
    
    (7 rows affected)
    1> use mydb
    2> go
    1> select count(*) from numbers 
    2> go
                 
     ----------- 
           65025 
    
    (1 row affected)
    Last edited by pdreyer; 10-08-10 at 06:47.

  4. #4
    Join Date
    Sep 2010
    Posts
    10

    thanks

    hi
    thanks for help
    it worked

  5. #5
    Join Date
    Jan 2009
    Posts
    14
    Thanks for the great demo friend .....

    I did not remember the sybase server would go down after disk refit command.

Posting Permissions

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