Unix Technical Forum

How to unload the schema from database ?

This is a discussion on How to unload the schema from database ? within the Sybase forums, part of the Database Server Software category; --> Hi, I want to unload the schema off all the procedures that are there in the syabase database, can ...


Go Back   Unix Technical Forum > Database Server Software > Sybase

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 04:01 PM
joseph v d'silva
 
Posts: n/a
Default How to unload the schema from database ?

Hi,

I want to unload the schema off all the procedures that are there in
the syabase database, can anyone tell me how to do this ?

Thankx

joe,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 04:01 PM
Jacques d'Hondt
 
Posts: n/a
Default Re: How to unload the schema from database ?

Daily download has to be cronned;

LOGDAY=`date "+%j"`
LOGDIR=`date "+%Y%m%d"`
LOGID=`date "+%H%M"`

mkdir $LOGDAY >/dev/null 2>/dev/null

cd $LOGDAY
mkdir UAT >/dev/null 2>/dev/null


fileName=ProcedureCS.$LOGID
fileTar=$fileName.tar

isql -U... -P... -S... >$fileName <<%EOF%

select name
from sysobjects
where type ='P'
order by name

go

%EOF%

for i in `cat $fileName `
do
echo $i
defncopy -U... -P... -S... out $i.sql DBNAME dbo.$i
done
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-08-2008, 04:01 PM
Subhas
 
Posts: n/a
Default Re: How to unload the schema from database ?

Hey,
Write a script
isql -Usa -S<Server> -PPASSWORD -osql.out<<!
Use DB
go
select+"defncopy -Usa -S<server_name> out "+name+".sql <database_name>
dbo."+name from sysobjects
where type in ("P","TR")
go
!

Run the above script which wiull give you defncopy command lines for
all your existing SP and Triggers. Then just run the sql.out file
which will have all the defncopy statements for all the procs and
trigs and this file sql.out will generate multiple files with the proc
name.sql.

Hope this helps.

Regards

Subhas
j_v_dsilva@www.com (joseph v d'silva) wrote in message news:<25bda1a5.0310152006.7fc87c4d@posting.google. com>...
> Hi,
>
> I want to unload the schema off all the procedures that are there in
> the syabase database, can anyone tell me how to do this ?
>
> Thankx
>
> joe,

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-08-2008, 04:01 PM
Brian Ceccarelli
 
Posts: n/a
Default Re: How to unload the schema from database ?

You can use DBPowerSuite's psListProcedures to do this, you can use
psCopyProcedures to write a SQL script which reloads them.

www.dbpowersuite.com



"joseph v d'silva" <j_v_dsilva@www.com> wrote in message
news:25bda1a5.0310152006.7fc87c4d@posting.google.c om...
> Hi,
>
> I want to unload the schema off all the procedures that are there in
> the syabase database, can anyone tell me how to do this ?
>
> Thankx
>
> joe,



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-08-2008, 04:04 PM
David Owen
 
Posts: n/a
Default Re: How to unload the schema from database ?

joseph v d'silva wrote:

> Hi,
>
> I want to unload the schema off all the procedures that are there in
> the syabase database, can anyone tell me how to do this ?


Yet another alternative is to use dbschema.pl (grab a copy from
ftp://ftp.midsomer.org/pub/dbschema.tgz), which uses the fantastic Sybperl
libraries.

dowen
--
David Owen Midsomer Consultants Inc. dowen@midsomer.org
Maintainer of the Sybase FAQ: http://www.isug.com/Sybase_FAQ
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:56 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com