help move database to new device

help move database to new device

Post by Jackie Martli » Tue, 10 Nov 1998 04:00:00



I need some help, i installed sybase on linux a month and half ago and
everything
works great...
i originally created a database call it database1 on the master device... of
20mb
i need to move this database1 to a new much larger device...

i created a new device of 200mb called device1 and everything is fine.
now how do i simply & the least complicated way move database1 from master
to
device1??

although ive been developing with sybase & dblib for a few years
im new to this type of procedure and dont want to blow up the database, its
live!

is there a simple easy way to do this, i
cant seem to find any instructions, or howto's on this type of move.
ive read dump and load, but picking through the docs, i dont want to just
run commands without knowing
what will happen!

thanks....

 
 
 

help move database to new device

Post by david Straito » Tue, 10 Nov 1998 04:00:00


You could always create two devices, one device is 20mb and one is 180mb.
You could establish Sybase mirroring to the new 20mb device and then
unmirroring, removing the mirror from the primary side.  You could then
alter the database onto the 180mb device and there you have it.

David Straiton
Senior DBA/Tech Lead
Dallas, Texas


>I need some help, i installed sybase on linux a month and half ago and
>everything
>works great...
>i originally created a database call it database1 on the master device...
of
>20mb
>i need to move this database1 to a new much larger device...

>i created a new device of 200mb called device1 and everything is fine.
>now how do i simply & the least complicated way move database1 from master
>to
>device1??

>although ive been developing with sybase & dblib for a few years
>im new to this type of procedure and dont want to blow up the database, its
>live!

>is there a simple easy way to do this, i
>cant seem to find any instructions, or howto's on this type of move.
>ive read dump and load, but picking through the docs, i dont want to just
>run commands without knowing
>what will happen!

>thanks....


 
 
 

help move database to new device

Post by Anthony Mandi » Wed, 11 Nov 1998 04:00:00



> I need some help, i installed sybase on linux a month and half ago and
> everything works great...
> i originally created a database call it database1 on the master device... of
> 20mb i need to move this database1 to a new much larger device...

> i created a new device of 200mb called device1 and everything is fine.
> now how do i simply & the least complicated way move database1 from master
> to device1??

        dump database <dbname> to "/some/file/on/disk"
        drop database <dbname>  -- to remove it from the master device
        create database <dbname> on <new device> for load
        load database <dbname> from "/some/file/on/disk"
        online database <dbname>

        Note that you can't shrink a database easily once you've created it
        (especially if you only have one device), so make sure that your new
        size is what you want.

-am

 
 
 

help move database to new device

Post by Bret Halfor » Wed, 11 Nov 1998 04:00:00



> I need some help, i installed sybase on linux a month and half ago and
> everything
> works great...
> i originally created a database call it database1 on the master device... of
> 20mb
> i need to move this database1 to a new much larger device...

> i created a new device of 200mb called device1 and everything is fine.
> now how do i simply & the least complicated way move database1 from master
> to
> device1??

> although ive been developing with sybase & dblib for a few years
> im new to this type of procedure and dont want to blow up the database, its
> live!

> is there a simple easy way to do this, i
> cant seem to find any instructions, or howto's on this type of move.
> ive read dump and load, but picking through the docs, i dont want to just
> run commands without knowing
> what will happen!

Here would be the easiest, safest way:

use the "dump database" command to dump and image of the database to a
filesystem file or a tape (choice of /work/dump1 is arbitrary, pick
an appropriate location, it has to be able to hold 20mb in this case).

   dump database database1 to "/work/dump1"

create a new database on device1 with a size at least as large
as the original db (can be larger)

   create database foobar on device1 = 20

load the database image into the new database:

   load database foobar from "/work/dump1"

Satisfy yourself that foobar contains your data.

   use foobar
   sp_help <sometable>
   ...

Drop the original database:

   drop database database1

Rename the foobar to database1:

   sp_renamedb foobar, database1

Once you get your confidence up, you can do what most people
do, which is to dump the database, drop the original, create
the new db (with the desired name), load the database.  But
the above sequence is a wee bit safer.

--
Bret Halford                    Imagine my disappointment
Sybase Technical Support        in learning the true nature            
3665 Discovery Drive            of rec.humor.oracle...
Boulder, CO 80303