Discussion:
Asking for help..calling all guru's
(too old to reply)
unknown
2008-06-05 13:15:13 UTC
Permalink
Hello,
Please, calling all Sybase guru's......
I would like to know if anyone has created generic scripts
for Unix on Sun Solaris in shell scripting that would
accomplish these things.
1. I need to bcp out all data and then bcp the data back in
once the data and log segments have been changed to
different locations on disk. We do NOT have mixed data and
log segments. Log is created on the same physical disk as
data.
PS: I am asking for any advice how to accomplish this task.
I want to separate the log and move them to a separate newly
created disk just for logs. At the same time, the data
segments are all made up of very small fragments and I want
to recreate the database with one big data device and get
rid of the small fragments. I understand the only way to do
this is bcp out/in the data.
What about referential integrity for the data since this in
prod? I would have to leave the indexes in place for a slow
bcp out.
Do you know of a good migration tool that would do this?

2. What is your recommendation to load a compressed database
backup from production to a different host in a QA
environment - again all in a Sun Solaris Unix environment.
We are running ASE 12.5.3.

Thank you for any advice and assistance. I have already
opened a case with Sybase for the bcp question and they sent
the link to the Utility guide for how to use bcp. I am
looking for more information than this.
unknown
2008-06-05 16:22:18 UTC
Permalink
I do not have a script ready but suggest the following way
to do it in a few steps:
isql -U YOUUSER -S YOURSERVER -P YOURDB -P YOURPASSWORD -o
output<<EOF
set nocount on
declare @db varchar(30)
select @db=db_name()
select "bcp " +@db +".." + name + " out " +name +".bcp -c
-t '|||||' YOUR_SERVER_NAME -U YOUUSER -P YOUPASS" from
sysobjects where
type="U"
EOF
2- Run the resulting file to bcp out the all the user tables
3- vi the file and change globally the out into in,
SERVERname to newservername, database to new databse
4: run file and bcp in the data for all your user tables.
This will work provided that you have created the user
tables in the new database.

Hope that it helps.
Post by unknown
Hello,
Please, calling all Sybase guru's......
I would like to know if anyone has created generic scripts
for Unix on Sun Solaris in shell scripting that would
accomplish these things.
1. I need to bcp out all data and then bcp the data back
in once the data and log segments have been changed to
different locations on disk. We do NOT have mixed data and
log segments. Log is created on the same physical disk as
data.
PS: I am asking for any advice how to accomplish this
task. I want to separate the log and move them to a
separate newly created disk just for logs. At the same
time, the data segments are all made up of very small
fragments and I want to recreate the database with one big
data device and get rid of the small fragments. I
understand the only way to do this is bcp out/in the data.
What about referential integrity for the data since this
in prod? I would have to leave the indexes in place for a
slow bcp out.
Do you know of a good migration tool that would do this?
2. What is your recommendation to load a compressed
database backup from production to a different host in a
QA environment - again all in a Sun Solaris Unix
environment. We are running ASE 12.5.3.
Thank you for any advice and assistance. I have already
opened a case with Sybase for the bcp question and they
sent the link to the Utility guide for how to use bcp. I
am looking for more information than this.
peter collard
2008-06-05 21:28:30 UTC
Permalink
Dump/load is the only robust way to do it. Just load into your new database
with 'ideal' segments.

To move logs to log segments just put a few transactions thru and truncate
as all new allocations will go to log segments and the truncate will return
those on data to free space to be used by data.

To move data to data segments just rebuild the clustered index for those
tables on log segments.
Post by unknown
Hello,
Please, calling all Sybase guru's......
I would like to know if anyone has created generic scripts
for Unix on Sun Solaris in shell scripting that would
accomplish these things.
1. I need to bcp out all data and then bcp the data back in
once the data and log segments have been changed to
different locations on disk. We do NOT have mixed data and
log segments. Log is created on the same physical disk as
data.
PS: I am asking for any advice how to accomplish this task.
I want to separate the log and move them to a separate newly
created disk just for logs. At the same time, the data
segments are all made up of very small fragments and I want
to recreate the database with one big data device and get
rid of the small fragments. I understand the only way to do
this is bcp out/in the data.
What about referential integrity for the data since this in
prod? I would have to leave the indexes in place for a slow
bcp out.
Do you know of a good migration tool that would do this?
2. What is your recommendation to load a compressed database
backup from production to a different host in a QA
environment - again all in a Sun Solaris Unix environment.
We are running ASE 12.5.3.
Thank you for any advice and assistance. I have already
opened a case with Sybase for the bcp question and they sent
the link to the Utility guide for how to use bcp. I am
looking for more information than this.
Loading...