cancel
Showing results for 
Search instead for 
Did you mean: 

how to take database backup using sql in db13?

former_member183044
Active Participant
0 Kudos

Hello Experts,

I am trying to take database backup using sql in DB13. My database is Sybase ASE 15.7.

I gave it as background job.

But when i checked in my backup folder , there is no backup.

Can any body help me in resolving this? I have searched on net , but till now i didn't get a proper reply.

Please help...

Regards

Praveen

Accepted Solutions (0)

Answers (1)

Answers (1)

srinivasan_vinayagam
Active Contributor
0 Kudos

Hi Praveen,

You can refer below thread carefully. You will get idea to take backup using SQL script in DB13.

Important Points.

download SQL script from SAP Note file sp_dumpdb.sql copy it on your OS DB server e.g. to  /backup

modified and adapt to your needs e.g. curr_logdev

from command line run sql script

isql -S<YOURDBSID> -Usapsa -i /backup/sp_dumpdb.sql

system will ask for password - it should be master password during installation - I guess

/backup - for Linux if windows provide the path

it will create SP at saptools as you can see at script>

use saptools

go

if not exists (select name from sysobjects where name = 'dump_history' and type = 'U')

begin

  exec('create table dump_history (DBName VARCHAR(30), Type VARCHAR(10), Command VARCHAR(512), StartTime DATETIME, EndTime DATETIME, RC INTEGER, Status CHAR(1))')

end

go

if exists (select name from sysobjects where name = 'sp_dumpdb' and type = 'P')

begin

  drop procedure sp_dumpdb

end

go

create procedure sp_dumpdb (@sapdb_name varchar (256))

<

So it mean if already you have one, it will run drop, and then create new one - so if you decided to change your backup location, just modified SQL and re-run it

So now you should have at saptools your SP called sp_dumpdb

About the dbacockpit - I am not sure what need to be done, as I always run it from OS level

Hope now it is more clear.

If I run it from OS level I run those commands

sp_dumpdb <DBSID>

go

Regards,

V Srinivasan