<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Multifunctioning DBA &#187; DDL</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/dba/tag/ddl/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/dba</link>
	<description></description>
	<lastBuildDate>Wed, 06 Feb 2013 01:01:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Sybase DR</title>
		<link>http://itknowledgeexchange.techtarget.com/dba/sybase-dr/</link>
		<comments>http://itknowledgeexchange.techtarget.com/dba/sybase-dr/#comments</comments>
		<pubDate>Tue, 11 May 2010 17:16:16 +0000</pubDate>
		<dc:creator>Colin Smith</dc:creator>
				<category><![CDATA[DDL]]></category>
		<category><![CDATA[DDLGEN]]></category>
		<category><![CDATA[Disaster Recovery]]></category>
		<category><![CDATA[Sybase]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/dba/sybase-dr/</guid>
		<description><![CDATA[Recently I did an upgrade from Sybase 12.5 to Sybase 15.0 and this upgrade changed some system tables that broke the scripts that we had in place to generate DDL for all the devices and database creates. I have been working on fixing this issue and I have resolved the issue by modifying our scripts [...]]]></description>
				<content:encoded><![CDATA[<p>Recently I did an upgrade from Sybase 12.5 to Sybase 15.0 and this upgrade changed some system tables that broke the scripts that we had in place to generate DDL for all the devices and database creates. I have been working on fixing this issue and I have resolved the issue by modifying our scripts to use DDLGen that comes with Sybase. I chose this solution because DDLGen is a Sybase tool that has been around for a while and I do not think that it will be going away anytime soon. DDLGen is a very cool utility that allows you to get DDL for all objects in the server. Here is what I did since I only wanted to get DDL for the devices to be added and the Create Statements for all databases on the server. I am not getting DDL for all DB objects like tables, triggers, constraints, and things of that nature.</p>
<p>This is how I generate a list of all the Devices that need to be part of the Server.</p>
<p>ddlgen -Usa -S $server -P $password -TDBD -N% -O $dis_rec_dir/$server.devices.sql</p>
<p>This will gather all the DDL for all devices and place them in the dis_rec_dir folder in a file called servername.devices.sql. In the case of a disaster, now I can just run this script and all the devices, as long as the raw files are available, will be added to the server.</p>
<p>Here is what I am doing to get all the Database Create DDL.</p>
<p>ddlgen -Usa -P $password -S $server -D $db -TDB -F% -O $dis_rec_dir/create.$db.sql</p>
<p>This will gather the DDL for all databases on the server and put them into the dis_rec_dir in a file called create.databasename.sql. Now I can run this script to create the database on the server on all the correct devices and with data and log on the correct devices.</p>
<p>The script is written so that it will loop thru and generate the DDL for all databases on the server.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/dba/sybase-dr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ddlgen in Sybase</title>
		<link>http://itknowledgeexchange.techtarget.com/dba/ddlgen-in-sybase/</link>
		<comments>http://itknowledgeexchange.techtarget.com/dba/ddlgen-in-sybase/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 21:32:09 +0000</pubDate>
		<dc:creator>Colin Smith</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[DDL]]></category>
		<category><![CDATA[DDLGEN]]></category>
		<category><![CDATA[Sybase]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/dba/ddlgen-in-sybase/</guid>
		<description><![CDATA[I completed an upgrade from Sybase 12.5 to Sybase 15.0 recently and I found that it ended up breaking some scripts that we use to generate ddl for all instance devices and all create databases. The scripts that we were using were writting log ago by people that are no longer working for the company. [...]]]></description>
				<content:encoded><![CDATA[<p>I completed an upgrade from Sybase 12.5 to Sybase 15.0 recently and I found that it ended up breaking some scripts that we use to generate ddl for all instance devices and all create databases. The scripts that we were using were writting log ago by people that are no longer working for the company. I decided to change this up to use ddlgen to create all this for us. ddlgen is a very nice little program that is able to generate the ddl and output it into files for use, if needed, in the future. Here is what I did to get all the devices ddl out of an instance.</p>
<p>ddlgen -U username -S servername -TDBD -N% -O outputfilename</p>
<p>That is simple enough to do and man it works great. This will get you the DDL needed to init all of the devices on the instance.  Now I need to get the DDL to create all of the databases. For this I wrote a little shell script to get a listing of all the databases and then do the ddl gen for each. Here is that.</p>
<p>#!/bin/ksh<br />
dblist=`isql -S servername -Usa &lt;&lt; endit | tail +4<br />
password<br />
use master<br />
go<br />
set nocount on<br />
go<br />
select name<br />
from sysdatabases<br />
go<br />
exit<br />
endit<br />
`<br />
echo $dblist<br />
for db in $dblist<br />
do<br />
ddlgen -Usa  -SCIRC_DBA -D $db -TDB -F% -O $db.definitions.out</p>
<p>password<br />
done</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/dba/ddlgen-in-sybase/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
