Monday, July 31, 2017

Backup / Restore Procedure on SAP ASE DB --


Backup / Restore Procedure on SAP ASE DB --

Connection with DB 

login with
su - sybhdb
#Command to login with user on SID
isql -U sapsa -P password_sa_user -S SID -X

#Command to check Currently running DB 
sp_helpdb
go
#Command to check Backup servers
sp_hepserver
go

#To backup transnational data you have to disable trunc.log on chkpt 

***** error *** correction ...
DUMP TRANsaction to a dump device is not allowed while the trunc. log on chkpt.
option is enabled.  Disable the option with sp_dboption, then use DUMP DATABASE,
before trying again.
*************************
#Use command to switch to upper level 
use HDB
go
#Master command to change parameter 
master..sp_dboption HDB, "trunc log on chkpt", false
go
#checkpoint command to save new value
checkpoint
go
# Now you have to take full backup and after that you can take transnational backup as well 

#Command to  Backup Database of DB HDB on file system 

dump database HDB to "/data/backup/hdb_s1.dmp"
stripe on "/data/backup/hdb_s2.dmp" #stripe command will split db into pices
stripe on "/data/backup/hdb_s3.dmp"
with compression = 2 #compression ratio
go

#Command to Backup transactions of DB HDB on file system 

dump transaction HDB to "/data/backup/hdb_trn.trn"

go

#Restore Procedure 

#Command to check active connection with DB 

sp_who
go
#Command to restore DB 

load database HDB from "/data/backup/hdb_s1.dmp"
stripe on "/data/backup/hdb_s2.dmp"
stripe on "/data/backup/hdb_s3.dmp"

go
#Command to restore Transaction

load transaction HDB from ""/data/backup/t*.trn"
with until_time="September 28, 2012 1:02am"
go

#After Successful restore online command to set db online for user 
online database HDB