Sybase Adaptive Server Enterprise (ASE) introduces enhanced dump and load capabilities for moving databases or restoring backups to a different ASE .
It may be confusing for some other database administrators. So, I would like to share with you my experience and give you a brief explanation of the device, database and the restoration of the Sybase database from command line
Let’s start with:
Creating database devices
Creating databases
Loading database dumps
The follow is the procedure to create a device, database and alter database operation.
1- Create the device:
Makes a physical device or file usable by Adaptive Server, Sybase devices can be created on a single disk or across multiple disks. Sybase devices is used during create databases process
disk init name = ‘data1′,physname=’/tmp/data1′,size=’100G’
go
disk init name=’log1′,physname=’/tmp/log1′,size=’50G’
go
allows you to configure Adaptive Server to transfer data directly to disk, bypassing the operating system buffer cache.
directio is a static parameter that requires a restart of Adaptive Server to take effect. By default, directio is set to false
Now lets create mydatabase1 and mydatabase2 database on the devices created earlier, notice that you can create more than on databases on one device
example:
create database mydatabase1 on data1=’1000M’ log on log1=’800M’ for load
go
create database mydatabase2 on data1=’1000M’ log on log1=’800M’ for load
go
3- Alter the database:
alter database mydatabase1 on data1 = ‘500M’ for load
go
alter database mydatabase1 on log1 = ‘200M’ for load
go
Execute the following to bring the database online.
Make sure to load the database dump and all of the transaction logs before bringing the database online.
online database mydatabase1
go
execute the following to check database status
sp_helpdb mydatabase1
go
use mydatabase1
go
Bonus : You can create a many database device and create a database on multiple device
example:
disk init name=’data1′,physname=’/tmp/data1′,size=’50G’
go
disk init name=’data2′,physname=’/tmp/data2′,size=’50M’
go
disk init name=’log1′,physname=’/tmp/log1′,size=’50G’
go
create database mydatabase1 on data1=’1000M’, data2=’500M’ log on log1=’800M’ for load
go
alter database mydatabase1 on data1 = ’50M’
go
alter database mydatabase1 log on log1 = ’20M’
go