Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2007
    Posts
    29

    Unanswered: sybase n aix 5.2 : backup to tape drive

    hi..

    i'm newbie in sybase or aix..i'm trying to backup my database to tape drive.
    i use this script

    #!/usr/bin/ksh
    dbname=$1 # 1st parameter is the database name
    dumpdir=$2 # 2nd parameter is dump directory
    scriptname=${0##*/} # remove path from script name
    if [ "$2" = "" ]
    then
    echo "Error: missing parameter"
    echo "Syntax: $scriptname <dbname> <backup_dir>"
    exit 8
    fi
    logfile=/tmp/"$scriptname"."$dbname".log$$
    . /usr/sybase1253/SYBASE.sh # sybase env (Note dot space slash)
    isql -Usa -P -SSYBASEKK <<EOF >"$logfile"
    dump database $dbname to "/dev/rmt1.1 capacity 2000000"
    go
    EOF
    if [ "$(grep 'DUMP is complete' $logfile )" = "" ]
    then
    echo dump database "$dbname" failed see "$logfile"
    exit 12
    fi


    when i trying to restore the file that i backup,an error occurs.

    1st,i wanna view file from my backup tape.how to do it?
    2nd,how can i restore the database back to my database? i use this command

    load database zihan from 'dev/rmt1.1'

    but and error occurs.

    3nd,i backup 7 database into same tape.so if i reused the tape,do i must to erase the tape first?

    thanx in advance

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    What error message did you get?
    Was the backup successful?
    Did you rewind the tape?
    Maybe the backup tried to write to file "/dev/rmt1.1 capacity 2000000" i.e. a file name with spaces.

  3. #3
    Join Date
    Jun 2007
    Posts
    29
    hi again..sori late answer

    thanks pdreyer.

    i'm already successfull make a script to dump database.but now i'm having problem with my tape.

    i use hp 4mm 40gb dds4 tape.
    after i backup all my database, then i wanna reused the tape.maybe i'm silly..i try to erase the tape contain using aix command.

    #tctl -f /dev/rmt1.1 erase

    after the command successfull erase the tape..i found that the tape cannot be read anymore..why it's happen?

    i wanna make sure that is because of tape or something else..then i trying to erase another tape..and guess what? same error i get.cannot read the tape again.

    if i use command

    #tctl -f /dev/rmt1.1 read
    tctl : 0511-578 cannot read 512 bytes : there is an input output error

    so i trying to use 1024 byte

    #tctl -f /dev/rmt1.1 -b 1024 read
    tctl :0511-578 cannot read 1024 bytes:there is an input or output error

    so..my question is..

    what is the tctl erase function? i read the manual,it said it only to erase the contain of tape.but now it make the tape cannot be read.

    or i'm doing something wrong?

    thanks..

  4. #4
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Sorry can't help if AIX specific.
    You can try posting at http://groups.google.com/group/comp.unix.aix
    But shouldn't you be writing to the empty (erased) tape first before you will be able to read it?

Posting Permissions

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