0% found this document useful (0 votes)
266 views

Restore Sybase

1) The document outlines the steps to restore a Sybase ASE database server on UNIX/Linux after a hardware failure, which includes recreating file systems, rebuilding the ASE server, configuring UTF-8 encoding and binary sorting order, and loading database backups and transaction log dumps. 2) Key prerequisites are backups of critical databases like 'master', availability of the file system containing the database, and backups of the target database and its transaction logs. 3) The steps are to recreate required file systems, remove the server from the interfaces file, rebuild the server using response files, configure UTF-8 and binary sorting, and finally load the database and transaction log backups to restore the data.

Uploaded by

Justin Adams
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
266 views

Restore Sybase

1) The document outlines the steps to restore a Sybase ASE database server on UNIX/Linux after a hardware failure, which includes recreating file systems, rebuilding the ASE server, configuring UTF-8 encoding and binary sorting order, and loading database backups and transaction log dumps. 2) Key prerequisites are backups of critical databases like 'master', availability of the file system containing the database, and backups of the target database and its transaction logs. 3) The steps are to recreate required file systems, remove the server from the interfaces file, rebuild the server using response files, configure UTF-8 and binary sorting, and finally load the database and transaction log backups to restore the data.

Uploaded by

Justin Adams
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

SAP Note

Header Data
Symptom
You need t o r est or e an SAP Sybase Adapt i ve Ser ver Ent er pr i se ( ASE) dat abase i nst ance on UNI X /
Li nux.

Other Terms
' DUMP DATABASE' , ' LOAD DATABASE'

Reason and Prerequisites
You ar e r unni ng SAP on an ASE dat abase ser ver on UNI X or a Li nux oper at i ng syst em. You need t o
r est or e t he dat abase ser ver af t er a har dwar e f ai l ur e.

Solution
The i nst r uct i ons bel ow pr ovi de an out l i ne of t he st eps t hat need t o be car r i ed out i n or der t o
r est or e a Sybase ASE ser ver . They appl y when backups ar e per f or med usi ng DUMP DATABASE. I f you use
an ext er nal backup and r est or e met hod wi t h t he QUI ESCE DATABASE command, f ol l ow t he i nst r uct i ons i n
SAP Not e 1887068.

Pr er equi si t es:
l The ASE ser ver ver si on i s 15. 7 ESD#2 or hi gher
( addi t i onal i nf or mat i on i s pr ovi ded at t he end of t hi s not e f or ASE ver si on <15. 7 ESD#2)
l The ' Dump Hi st or y' f eat ur e has been enabl ed ( def aul t i n SAP syst ems) and an up- t o- dat e copy of
t he dumphi st f i l e i s avai l abl e
l The UNI X syst emhas been successf ul l y r est or ed f r oma backup i mage ( i mpor t ant ar e t he OS user s
and envi r onment set t i ngs)
l The f i l e syst em/ sybase/ <SI D> i s avai l abl e. Al l t he dat abase devi ces and dat abases ar e damaged
and need t o be r ecr eat ed.
l Cur r ent dat abase dumps of ' mast er ' , ' sybmgmt db' , and ' sapt ool s' dat abases ar e avai l abl e.
l A cur r ent dump of t he <DBSI D> dat abase i s avai l abl e al ong wi t h al l t he r equi r ed dumps f r omt he
t r ansact i on l og
l A cur r ent copy of ASE ser ver conf i gur at i on f i l e i s avai l abl e
I f t he f i l e syst em/ sybase/ <SI D> i s not avai l abl e, r est or e i t f r oma f i l e syst embackup. I f you
don' t have a f i l e syst embackup, you wi l l need t o r ei nst al l an empt y SAP Net Weaver syst emusi ng t he
SAP i nst al l er and t hen l oad your dat abases i nt o t he newl y cr eat ed ASE ser ver . I t i s not possi bl e t o
r ei nst al l t he ASE ser ver st andal one usi ng t he ASE i nst al l er f r omt he RDBMS i nst al l at i on medi um
pr ovi ded by SAP.
Make sur e t he l at est copy of t he dumphi st f i l e i s avai l abl e at t he l ocat i on speci f i ed i n t he ASE
conf i gur at i on par amet er dump hi st or y f i l ename; t he def aul t l ocat i on i s $SYBASE/ $SYBASE_ASE/ dumphi st .
Recr eat e t he f i l e syst ems
Recr eat e t he f i l e syst ems as r equi r ed f or t he f ol l owi ng di r ect or i es:
/ sybase/ <SI D>/ sapdat a_[ 1- n]
/ sybase/ <SI D>/ sapl og_[ 1- n] ( *)
/ sybase/ <SI D>/ sybsyst em
/ sybase/ <SI D>/ sapdi ag
/ sybase/ <SI D>/ sybt emp
/ sybase/ <SI D>/ sapt emp
Remar k: I f t he f i l e syst em( s) / sybase/ <SI D>/ sapl og_[ 1- n] have not been cor r upt ed, t he devi ces f i l es
wi l l pr obabl y hol d t r ansact i onal dat a t hat has not yet been dumped t o a t r ansact i on l og dump.
Per f or man emer gency dump of t he t r ansact i on l og i n t hi s case ( see bel ow) . Make sur e you r et ai n a
good of f l i ne copy of t he devi ce f i l es bef or e you r ecr eat e t he f i l e syst ems / sybase/ <SI D>/ sapl og_[ 1-
n] .
Rebui l d ASE ser ver
I f t he mast er devi ce i s damaged, you wi l l need t o r ebui l d t he ASE ser ver . The si mpl est way t o do
1618817 - SYB: How to restore a Sybase ASE database server (UNIX)
Version 10 Validity: 06.11.2013 - active Language English (Master)
Released On 06.11.2013 17:34:06
Release Status Released for Customer
Component BC-DB-SYB Sybase ASE Database Platform
Priority Recommendations / Additional Info
Category Consulting
t hi s i s t o use t he r esponse f i l es f or t he command l i ne t ool s sr vbui l dr es and sql l ocr es, r espect i vel y
( see bel ow) .

The f ol l owi ng f i l es ar e r el evant f or t he r est or at i on of t he ASE
ser ver on a UNI X / Li nux host :
l sql sr v. r es - scr i pt f or r ecr eat i ng t he ASE ser ver
l sql sr v_l ang. r es - scr i pt f or r ei nst al l i ng t he ut f 8 char act er set and uni code bi nar y sor t or der
l bs. r es - scr i pt f or r ecr eat i ng t he backup ser ver
I f you can' t f i nd t he or i gi nal r esponse f i l es t hat wer e used dur i ng i nst al l at i on, downl oad t he
sampl e r esponse f i l es at t ached t o t hi s not e and adapt t he cont ent s t o mat ch your i nst al l at i on.

Pay par t i cul ar at t ent i on t o t he f ol l owi ng par amet er s:
Replace <DBSID> in the response file as it appliesfor your system. Ensure that both master device
and mast er dat abase ar e l ar ge enough t o l oad t he most r ecent dump of t he mast er dat abase f r ombef or e
t he syst emcr ash ( t ypi cal l y t her e i s no need t o r esi ze t he mast er dat abase and mast er devi ce, so t he
def aul t val ues wi l l usual l y be cor r ect ) .
Bef or e r ecr eat i ng t he ASE ser ver , you have t o r emove i t s ent r y f r omt he i nt er f aces f i l e. Open t he
f i l e $SYBASE/ i nt er f aces and r emove t he ent r i es f or t he l ocal ASE ser ver and backup ser ver f r omt he
f i l e. I f you don' t do t hi s, t he cr eat i on of t he new ASE ser ver wi l l f ai l wi t h a message i ndi cat i ng
t hat t he por t i s al r eady i n use.

To r ecr eat e t he ser ver , l og i n as user ' syb<si d>' and cal l t he command:
sr vbui l dr es - r sql sr v. r es
Not e t hat si nce you ar e r ebui l di ng t he mast er dat abase f r omscr at ch, onl y t he def aul t admi ni st r at i ve
l ogi n ' sa' i s act i ve at t hi s t i me wi t h t he passwor d you pr ovi ded i n t he r esponse f i l e. The SAP
admi ni st r at i ve l ogi n ' sapsa' does not yet exi st on t he ser ver .
Conf i gur e ut f 8 and bi nar y sor t or der
Af t er t he ASE has been r ei ni t i al i zed, i t i s i mpor t ant t o l oad t he ut f - 8 char act er set and conf i gur e
t he bi nar y sor t or der i n a second st ep.
Revi ew t he cont ent s of t he f i l e ' sql sr v_l ang. r es' . Typi cal l y, you wi l l onl y need t o adapt <DBSI D>
accor di ng t o your syst emand pr oper l y set t he passwor d f or ' sa' user .
Make sur e t hat t he t wo par amet er s bel ow ar e set i n t he ' sql sr v_l ang. r es' f i l e:
sql sr v. def aul t _char act er set : ut f 8
sql sr v. sor t _or der : bi nar y
Then cal l t he command ' sql l ocr es' t o set t he ut f 8 and bi nar y sor t or der usi ng t he f i l e
sql sr v_l ang. r es.
sql l ocr es - r sql sr v_l ang. r es
Ver i f y t hat ut f - 8 has been i nst al l ed as t he def aul t char act er set and t hat t he bi nar y sor t or der i s
set . The ASE er r or l og f i l e shoul d cont ai n an ent r y i ndi cat i ng t hat t he def aul t sor t or der i s now
' bi nar y' ( I D = 25) on t op of def aul t char act er set ' ut f 8' ( I D = 190) ( r evi ew t he ASE er r or l og
f i l e) .
Par amet er : Val ue: Comment:
sybi ni t . r el ease_di r ect or y: / sybase/ <DBSI D>
sybi ni t . pr oduct : sql sr v
sql sr v. ser ver _name: <DBSI D>
sql sr v. net wor k_host name_l i st : <db host name>
Repl ace wi t h
dat abase host
name
sql sr v. net wor k_por t _l i st : <ase_por t >
ASE por t
def aul t : 4901
( i n an SAP
envi r onment ) ,
must mat ch val ue
of envi r onment
var i abl e
' dbs_syb_por t '
of user <si d>adm
sql sr v. ser ver _page_si ze: 16k
16k i s mandat or y
f or an ASE
ser ver i n an SAP
envi r onment
sql sr v. mast er _devi ce_physi cal _name: / sybase/ <DBSI D>/ sybsyst em/ mast er . dat
sql sr v. mast er _devi ce_si ze: 400
sql sr v. mast er _dat abase_si ze: 250
sql sr v. er r or l og:
/ sybase/ <DBSI D>/ ASE-
15_0/ i nst al l / <DBSI D>. l og
sql sr v. sybsyst empr ocs_devi ce_physi cal _name: / sybase/ <DBSI D>/ sybsyst em/ syspr ocs. dat
sql sr v. sybsyst emdb_devi ce_physi cal _name: / sybase/ <DBSI D>/ sybsyst em/ sybsysdb. dat
sql sr v. t empdb_devi ce_physi cal _name: / sybase/ <DBSI D>/ sybt emp/ t empdbdev. dat
sql sr v. def aul t _backup_ser ver : <DBSI D>_BS
sql sr v. sa_passwor d: <sa passwor d>
Requi r ed, cannot
be bl ank
Rebui l d t he Backup Ser ver

Recr eat e and st ar t t he l ocal backup ser ver usi ng t he r esponsef i l e ' bs. r es' . Adapt i t s cont ent s as
needed and make sur e t o pr oper l y set <DBSI D>, ser ver _name, t he host name and por t , and t he passwor d
of ' sa' user .

Then execut e t he command:
sr vbui l dr es - r bs. r es
Load t he mast er dat abase
For t he l oad of t he mast er dat abase, t he ASE ser ver has t o be st ar t ed i n si ngl e- user mode i n or der .
I t i s r ecommended t hat you cr eat e an adapt ed RUN_<DBSI D> f i l e t o st ar t t he ASE i n si ngl e- user mode.
Copy t he or i gi nal RUN_<DBSI D> f i l e t o a f i l e RUN_<DBSI D>_SI NGLEUSER and add a st ar t up par amet er - m .
Exampl e:
#! / bi n/ sh
# Repl ace <DBSI D> wi t h t he name of your ASE ser ver
#
/ sybase/ <DBSI D>/ ASE- 15_0/ bi n/ dat aser ver \
- d/ sybase/ <DBSI D>/ sybsyst em/ mast er . dat \
- e/ sybase/ <DBSI D>/ ASE- 15_0/ i nst al l / <DBSI D>. l og \
- c/ sybase/ <DBSI D>/ ASE- 15_0/ <DBSI D>. cf g \
- M/ sybase/ <DBSI D>/ ASE- 15_0 \
- s<DBSI D> \
- m \
St ar t t he ASE ser ver wi t h t he command st ar t ser ver , passi ng t he newl y cr eat ed RUN_<SERVER>_SI NGELUSER
f i l e as par amet er .
st ar t ser ver - f . / ASE- 15_0/ i nst al l / RUN_<DBSI D>_SI NGELUSER
I f you have not al r eady done so, st ar t t he backup ser ver wi t h t he command:
st ar t ser ver - f . / ASE- 15_0/ i nst al l / RUN_<DBSI D>_BS
Load t he l at est dat abase dump of t he ' mast er ' dat abase.
Log on t o t he ASE ser ver usi ng i sql wi t h t he user ' sa' .

Execut e t he command:
1> l oad dat abase mast er f r om' <DUMPFI LE>'
2> go
Repl ace <DUMPFI LE> as appr opr i at e. I f your ASE ver si on i s ASE 15. 7 ESD#2 or hi gher and t he ASE
conf i gur at i on par amet er ' enabl e dump hi st or y' has been enabl ed ( def aul t f or SAP envi r onment s) , you
can get t he cor r ect l oad command by execut i ng t he SQL command:
1> l oad dat abase mast er wi t h l i st onl y = ' LOAD_SQL'
2> go
ASE shut s down aut omat i cal l y af t er compl et i ng t he l oad of t he mast er dat abase.
Recr eat e t empor ar y dat abase devi ces ( opt i onal )
Thi s i s an opt i onal st ep - i f you don' t per f or mi t now, you may r ecr eat e t he addi t i onal t empor ar y
dat abases at a conveni ent poi nt i n t i me l at er .
Bef or e you r est ar t ASE, r ecr eat e t he devi ces f or any addi t i onal t empor ar y dat abase( s) you may have
cr eat ed. I t i s suf f i ci ent t o cr eat e t he devi ce( s) as an empt y f i l e i n t he cor r ect l ocat i on wi t h
cor r ect per mi ssi ons ( syb<si d>: sapsys 660) i n t he f i l e syst em.
The devi ce of t he syst emt empor ar y devi ce shoul d al r eady exi st ( i t was r ecr eat ed dur i ng ASE
i ni t i al i zat i on) . As a mi ni mum, t he devi ce of t he syst emt empor ar y dat abase must exi st

Exampl e:

touch /sybase/<DBSID>/sybtemp/saptempdbdev.dat
chmod 660 /sybase/<DBSID>/sybtemp/saptempdbdev.dat

I f you do not know t he devi ce f i l es of t he t empor ay devi ce f i l es, st ar t ASE nor mal l y and get t he
devi ce f i l e names ei t her f r ommast er cat al og sysdevi ces or f r omt he messages i n t he ASE er r or . l og.
Reconf i gur e ASE t o your st andar d conf i gur at i on and r est ar t ASE i n mul t i - user mode

Dur i ng t he i ni t i al i zat i on of t he ASE ser ver a new conf i gur at i on f i l e <DBSI D>. cf g was cr eat ed i n
di r ect or y $SYBASE/ $SYBASE_ASE wi t h an i ni t i al def aul t conf i gur at i on. Repl ace i t wi t h t he saved copy
of t he f i l e <DBSI D>. cf g.
Rest ar t ASE usi ng t he st andar d RUN_<SERVER> f i l e.

startserver - f . / ASE- 15_0/ i nst al l / RUN_<DBSI D>
Per f or m an emer gency dump of t he t r ansact i on l og
Thi s st ep appl i es i f a dat abase i s of f l i ne, but t he devi ce f i l es cont ai ni ng t he t r ansact i on l og ar e
st i l l avai l abl e. I n a pr oduct i ve SAP syst em, t hi s wi l l be t he case f or t he dat abase ' <DBSI D>' .
Log i n t o ASE wi t h i sql as user ' sapsa' and execut e t he command:
1> dump t r ansact i on <DB_NAME> t o ' <DUMPFI LE_LOCATI ON>' wi t h no_t r uncat e
2> go
Repl ace <DUMPFI LE_LOCATI ON>as appr opr i at e. Repl ace <DB_NAME> wi t h t he name of t he dat abase.
Wi t h ASE ver si on 15. 7 SP100 and hi gher , t her e i s al so a t ool ' sybdumpt r an' avai l abl e t hat can be
used t o per f or man emer gency backup of unsaved par t s of t he t r ansact i on l og. The advant age of t hi s
t ool i s t hat i t can al so be used whi l e t he dat abase ser ver i t sel f i s of f l i ne. For t he synt ax of t he
t ool ' sybdumpt r an' , r ef er t o t he onl i ne document at i on.
Load user dat abases
Per f or mt he f ol l owi ng st eps:
l Dr op and r ecr eat e t he dat abases and devi ces f or l oad.
l Load t he dat abase and t he t r ansact i on l ogs ( i f appl i cabl e) .
l Set t he dat abases onl i ne.
You need t o per f or mt hese st eps f or t he dat abases ' sapt ool s' , <DBSI D>, and ' sybmgmt db' .
1. Dr op and r ecr eat e t he dat abases and devi ces f or l oad.
The assumpt i on i s t hat you l ost t he ASE di sk devi ces i n t he f i l e syst ems; hence you need t o
r ecr eat e t he di sk devi ces. To be abl e t o r ecr eat e devi ces, you have t o dr op t he non- exi st i ng
devi ces f r omt he cat al og and t he dat abases on t hese devi ces f i r st .

Log i n t o ASE wi t h i sql as user ' sapsa' and r un t he command:

1> l oad dat abase <DB_NAME> wi t h l i st onl y = ' CREATE_SQL'
2> go

Repl ace <DB_NAME> wi t h t he name of t he dat abase you want t o r ecr eat e. The above' LOAD' command
sear ches f or t he l ocat i on of t he l at est dat abase dump usi ng t he ' dumphi st ' f i l e and ext r act s t he
DDL command f or i t s devi ces, t he dat abase i t sel f , and t he set dat abases opt i ons f r omt he header
i nf or mat i on i n t he dump. Save t he out put t o a f i l e.

Dr op t he dat abase and al l i t s devi ces f r omt he mast er cat al og:

1>dr op dat abase ' <DB_NAME>'
2>go
1>exec mast er sp_dr opdevi ce ' < DB_DEVI CE>'
2>go

Repl ace <DB_NAME> wi t h t he name of t he dat abase. Repl ace <DB_DEVI CE> wi t h t he devi ce name. I f
t he dat abase has been cr eat ed on sever al devi ces, dr op al l t he devi ces of t he dat abase.
Fi nal l y, r ecr eat e t he devi ces and t he dat abase usi ng t he pr evi ousl y saved out put . To speed up
cr eat i on of a l ar ge dat abase, i t i s r ecommended t o edi t t he CREATE DATABASE command and add t he
FOR LOAD cl ause.

Exampl e:

1>createdatabase <DB_NAME>on data<DB_NAME>_1 = '40G'
2>log onlog<DB_NAME> _1 = '10G'
3>wi t h l ob_compr essi on = 100, compr essi on = page
4>f or l oad
2. Load t he dat abase and t r ansact i on l ogs.
To gener at e t he l oad sequence f or t he dat abase, l og i n t o ASE wi t h i sql as user ' sapsa' and
execut e t he command:

1>l oad dat abase <DB_NAME> wi t h l i st onl y = ' LOAD_SQL'
2>go

Save t he out put t o an SQL command f i l e and execut e i t i n i sql .
3. Set t he dat abase onl i ne.

Af t er t he dat abase dump and al l t r ansact i on l ogs have been l oaded, you need t o br i ng t he
dat abase onl i ne usi ng t he command onl i ne dat abase.
1>onl i ne dat abase <DB_NAME>
2>go
Rest ar t t he j ob schedul er
Af t er you have l oaded al l dat abases i ncl udi ng ' sybmgmt db' , r est ar t t he j ob schedul er . Log i n t o ASE
wi t h i sql as user ' sapsa' and execut e t he command:

1> exec sybmgmt db. . sp_sj obcont r ol ' ' , ' st ar t _j s'
2> go
Addi t i onal i nf or mat i on
Af t er you have compl et ed t he l oad, doubl e check t hat t he cor r ect dat abase opt i ons have been set
bef or e you st ar t t he SAP syst em.
Mandat or y DB opt i ons f or SAP ar e ' ddl i n t r an' , ' al l ow nul l s by def aul t ' , ' al l ow wi de dol r ows' ,
'page compression'.These have to be set whatever the case. Mandatory for a production system are
dat abase opt i ons ' enf or ce dump t r an sequence' and ' f ul l l oggi ng f or al l ' ( compar e SAP not e 1585981)

The opt i ons l i st ed bel ow ar e set per def aul t f or t he SAP dat abase; t hey ar e r ecommended, but not
mandat or y.
l ' def er r ed t abl e al l ocat i on' ( ASE Ver si on 15. 7. 0. 040 and hi gher )
l ' deal l ocat e f i r st t ext page' ( ASE ver si on ' 15. 7. 0. 043' and hi gher )
l ' al l ow i ncr ement al dumps' ( ASE Ver si on ' 15. 7. 0. 100' and hi gher )
Set t he dat abase opt i ons i mmedi at el y af t er t he dat abase has been br ought onl i ne and bef or e any user

connect s t o t he dat abase. I f any changes t o t he dat abase cont ent s ar e made bef or e you set ' enf or ce
dump t r an sequence' , you wi l l have t o get a f ul l dat abase dump bef or e you can set t he opt i on.

Addi t i onal i nf or mat i on i f your ASE Ver si on i s < 15. 7 ESD#2
I n ASE ver si on < 15. 7 ESD#2 t he i ni t i al passwor d f or t he user ' sa' must be NULL dur i ng
i ni t i al i zat i on of t he ASE ser ver . Leave t he passwor d ent r i es i n al l t he r esour ce f i l es empt y bef or e
bui l di ng t he ser ver .

I n ASE Ver si on < 15. 7 ESD#2 t he ' LOAD DATABASE' command cannot be used t o r et r i eve devi ce and
dat abase DDL st at ement s f r omt he dat abase dump i t sel f ( see above) . I nst ead you must r et r i eve t he
i nf or mat i on f r omt he syst emcat al og i n t he mast er dat abase ( so t he mast er dat abase must have been
l oaded and be avai l abl e) .

I f you need t o r et r i eve t he DDL st at ement f or t he dat abase devi ces, execut e t he command
' ddl gen' ( whi ch i s l ocat ed i n di r ect or y $SYBASE/ ASEP\ bi n) as user syb<si d> as bel ow:

ddlgen - S<DBSI D> - Usapsa - P<PASSWORD> - TDBD - N%

Repl ace <DBSI D> wi t h t he name of your ASE ser ver ; r epl ace <PASSWORD> wi t h t he cor r ect passwor d f or
user ' sapsa' .
Save t he out put t o f i l e. Open t he f i l e wi t h an edi t or and r emove t he DDL st at ement s f or t he syst em
devi ces ' mast er ' , ' syspr ocsdev' , ' syst emdbdev' , ' t empdbdev' , and any ot her exi st i ng devi ces t hat
you do not need t o r ecr eat e.
Then execut e t he DDL st at ement s f or t he mi ssi ng devi ces i n i sql .

I f you need t o cr eat e t he DDL st at ement f or a dat abase, l og i n t o ASE wi t h i sql as user ' sapsa' and
execut e t he SQL command:
1>exec mast er . . sp_ddl gen ' dat abase' , ' <DBNAME>'
2>go
Repl ace <DBNAME> wi t h t he name of t he dat abase.

Validity
This document is not restricted to a software component or software component version
References
This document is referenced by:
SAP Notes (1)

Attachments
1585981 SYB: Ensuring Recoverability for SAP ASE
File Name File Size (KB) Mime Type

ase_sample_resfiles.SAR

1

application/octet-stream

You might also like