<?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/"
	>

<channel>
	<title>sybinfo.com</title>
	<atom:link href="http://www.sybinfo.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sybinfo.com</link>
	<description>formulas, code-snippets,tips and tricks for sybase ase, rep and asiq - a subpage of sybinfo.org</description>
	<pubDate>Wed, 21 Apr 2010 12:44:49 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to sync a Warm Standby - REP - ASE Sybase</title>
		<link>http://www.sybinfo.com/repserver/how-to-sync-a-warm-standby-rep-ase-sybase/</link>
		<comments>http://www.sybinfo.com/repserver/how-to-sync-a-warm-standby-rep-ase-sybase/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 12:44:49 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
		
		<category><![CDATA[repserver]]></category>

		<category><![CDATA[sync]]></category>

		<category><![CDATA[synchronization]]></category>

		<category><![CDATA[Warm Standby]]></category>

		<category><![CDATA[WS]]></category>

		<guid isPermaLink="false">http://www.sybinfo.com/?p=180</guid>
		<description><![CDATA[Re-Sync after Primary DB load
When loading a dump into a primary database, the connections to the primary and the warm-standby databases need to be dropped and rebuild. In this case, also disable the REP-Agents on both DBs:
use &#60;DB&#62;
go
sp_config_rep_agent &#60;DB&#62;,&#34;disable&#34;
go
Do this step after dropping the replication connections. After loading the dump into the primary database, before [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Re-Sync after Primary DB load</strong></p>
<p>When loading a dump into a primary database, the connections to the primary and the warm-standby databases need to be dropped and rebuild. In this case, also disable the REP-Agents on both DBs:</p>
<pre>use &lt;DB&gt;
go
sp_config_rep_agent &lt;DB&gt;,&quot;disable&quot;
go</pre>
<p>Do this step after dropping the replication connections. After loading the dump into the primary database, before setting up replication, don't forget to:</p>
<ul>
<li>disable the RepAgent again</li>
<li>drop the maintenance alias user again and re-add it as a regular user.</li>
</ul>
<p>When just resyncing a Warm-Standby database, follow these instructions:</p>
<p><strong>Sync WS replication</strong></p>
<ul>
<li>On primary replication server, drop physical connections:</li>
</ul>
<pre>drop connection to &lt;rep.srv._ws&gt;.&lt;replicated.db&gt;
go</pre>
<ul>
<li>disalbe rep_agent on WS</li>
</ul>
<pre>use  &lt;replicated.db&gt;
go
sp_config_rep_agent &lt;replicated.db&gt;, &quot;disable&quot;
go</pre>
<ul>
<li>drop &lt;replicated.db&gt;_maint user or alias in WS db</li>
</ul>
<pre>use  &lt;replicated.db&gt;
go
sp_dropalias &lt;replicated.db&gt;_maint
go</pre>
<ul>
<li>drop &lt;prim.db&gt;_maint user or alias in prim. db</li>
</ul>
<pre>sp_dropalias &lt;prim.db&gt;_maint
go</pre>
<ul>
<li>sp_adduser _maint to db</li>
</ul>
<pre>sp_adduser &lt;prim.db&gt;_maint
go</pre>
<ul>
<li>check logical connection name on REP.srv.</li>
</ul>
<pre>admin logical_status
go</pre>
<ul>
<li>rebuild WS connection to WS with rs_init
<ul>
<li>When asked if this DB is a replicated DB, answer YES</li>
<li>Setup a &quot;physical connection for a logical connection&quot;</li>
<li>Setup a standby database</li>
<li>&quot;initialise using dump and load&quot;? -&gt; YES</li>
<li>&quot;use dump marker&quot;? -&gt; YES</li>
</ul>
</li>
</ul>
<ul>
<li>drop &lt;replicated.db&gt;_maint user on prim</li>
</ul>
<pre>sp_dropuser &lt;prim.db&gt;_maint
go</pre>
<ul>
<li>add alias (user &lt;prim.db&gt;_maint) to dbo</li>
</ul>
<pre>sp_addalias &lt;prim.db&gt;_maint, dbo
go</pre>
<ul>
<li>dump and load db</li>
</ul>
<pre>dump database &lt;prim.db&gt; to &quot;/dumpdir/&lt;prim.db&gt;
go

load database &lt;replicated.db&gt; from &quot;/dumpdir/&lt;prim.db&gt;.bck&quot;
go</pre>
<ul>
<li>set db online</li>
</ul>
<pre>online database &lt;replicated.db&gt;
go</pre>
<ul>
<li>resume connection to WS</li>
</ul>
<pre>resume connection to &lt;rep.srv._ws&gt;.&lt;replicated.db&gt;
go</pre>
<p>If you have any problems resuming the connection and you find messages like these in the Rep-Errorlog:</p>
<pre>&quot;The DSI thread for database '&lt;rep.srv._ws&gt;.&lt;replicated.db&gt;' is being
shutdown. DSI received data server error #17232 which is mapped to
STOP_REPLICATION. See logged data server errors for more information.
&quot;The error was caused by line #158 of stored procedure 'sp_dropuser'
on the data server mapped from input command #2 (or a command before
it) of the failed transaction.&quot;</pre>
<p>or:</p>
<pre>&quot;The DSI thread for database '&lt;rep.srv._ws&gt;.&lt;replicated.db&gt;' is being
shutdown. DSI received data server error #17234 which is mapped to
STOP_REPLICATION. See logged data server errors for more information.
The error was caused by line #167 of stored procedure 'sp_addalias'
on the data server mapped from input command #2 (or a command before
it) of the failed transaction.&quot;</pre>
<p>then you probably did something wrong while dropping and recreating the 'maintenance user'. Repeat the following command until you find a different error message. Doing this, you will skip the &quot;create-&quot; and &quot;drop-user&quot; commands, which you don't need on the replicated system.</p>
<pre>resume connection to &lt;rep.srv._ws&gt;.&lt;replicated.db&gt; skip tran
go</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.sybinfo.com/repserver/how-to-sync-a-warm-standby-rep-ase-sybase/feed/</wfw:commentRss>
		</item>
		<item>
		<title>utility_db - IQ server name already in use  - DBSPAWN ERROR:  -85</title>
		<link>http://www.sybinfo.com/asiq/utility_db-iq-server-name-already-in-use-dbspawn-error-85/</link>
		<comments>http://www.sybinfo.com/asiq/utility_db-iq-server-name-already-in-use-dbspawn-error-85/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 09:37:22 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
		
		<category><![CDATA[asiq]]></category>

		<category><![CDATA[utility_db]]></category>

		<category><![CDATA[v127]]></category>

		<guid isPermaLink="false">http://www.sybinfo.com/?p=176</guid>
		<description><![CDATA[In some cases the utility_db cannot be started due to the following error:
I. 04/20 02:18:25.      Adaptive Server IQ
I. 04/20 02:18:25.       Version 12.7
I. 04/20 02:18:25.        (64bit mode)
I. 04/20 02:18:25. Copyright 1992-2008 by Sybase, Inc. All rights reserved
I. 04/20 [...]]]></description>
			<content:encoded><![CDATA[<p>In some cases the <strong>utility_db</strong> cannot be started due to the following error:</p>
<pre>I. 04/20 02:18:25.      Adaptive Server IQ
I. 04/20 02:18:25.       Version 12.7
I. 04/20 02:18:25.        (64bit mode)
I. 04/20 02:18:25. Copyright 1992-2008 by Sybase, Inc. All rights reserved
I. 04/20 02:18:25.
I. 04/20 02:18:25. 40 physical processor(s) detected.
I. 04/20 02:18:25. Running on SunOS 5.10 Generic_138888-07
I. 04/20 02:18:25. 49152K of memory used for caching
I. 04/20 02:18:25. Minimum cache size: 49152K, maximum cache size: 262008K
I. 04/20 02:18:25. Using a maximum page size of 4096 bytes
I. 04/20 02:18:25. Database server started at Tue Apr 20 2010 02:18
I. 04/20 02:18:25. Trying to start SharedMemory link ...
I. 04/20 02:18:25.     SharedMemory link started successfully
I. 04/20 02:18:25. Trying to start TCPIP link ...
I. 04/20 02:18:25. Starting on port 2638
I. 04/20 02:18:25. Server name already in use
I. 04/20 02:18:25. TCPIP communication link not started
E. 04/20 02:18:25. A database server with that name has already started
I. 04/20 02:18:25. Database server stopped at Tue Apr 20 2010 02:18
DBSPAWN ERROR:  -85
Communication error</pre>
<p><strong>Possible reasons:</strong></p>
<p> 1. The server port number is already in use</p>
<p>Check the output of <em>netstat -a | grep &lt;PortNumber&gt;</em></p>
<p>  2. IQ server with the same server name already exists on the subnet</p>
<p>Add the -z option to the start script (e.g. <em>start_asiq -n utility_db -z</em>),  check the network diagnostic messages below and try to find another IQ server with the same name on the subnet (<em>ping -s &lt;BroadcastAddress&gt;</em>).</p>
<pre>I. 04/20 11:05:35. Looking for server with name utility_db
I. 04/20 11:05:35. Sending broadcast to find server
I. 04/20 11:05:35. Using broadcast address of: 140.16.48.255:2638
I. 04/20 11:05:35. Looking for server with name utility_db
I. 04/20 11:05:35. Sending broadcast to find server
I. 04/20 11:05:35. Using broadcast address of: 127.0.0.1:2638
I. 04/20 11:05:35. Server name already in use</pre>
<p><strong>Workarounds:</strong></p>
<p><span id="more-176"></span></p>
<p>  1. Make the IQ server name unique on the network</p>
<p>  2. Disable sending broadcasts - start IQ with the “DoBroadcast=no” network protocol option</p>
<p>  3.  Disable receiving broadcasts - start IQ with the “–sb 0” server option or use “BroadcastListener=no” as the network protocol option</p>
<p>Annoyingly it was later possible to start up two utility_db with the same name in the subnet later. But it would seem sensible to start the utility_db with "DoBroadcast=no" in the future to avoid this problem. </p>
<p><strong>Examples:</strong></p>
<p>1. Start utility_db@host_name using default "Brodacast" options...</p>
<pre>> start_asiq -n utility_db –z (you have to use the –z server option)
…
I. 04/20 11:05:35. Looking for server with name utility_db
I. 04/20 11:05:35. Sending broadcast to find server
I. 04/20 11:05:35. Using broadcast address of: 140.16.48.255:2638
I. 04/20 11:05:35. Looking for server with name utility_db
I. 04/20 11:05:35. Sending broadcast to find server
I. 04/20 11:05:35. Using broadcast address of: 127.0.0.1:2638
I. 04/20 11:05:35. Server name already in use
I. 04/20 11:05:35. TCPIP communication link not started</pre>
<p>2. Start utility_db@host_name using the option (DoBroadcast=no).</p>
<pre>> start_asiq -n utility_db -x tcpip{DoBroadcast=no} –z
…
I. 04/20 10:52:22. Trying to start TCPIP link ...
I. 04/20 10:52:22. Starting TCP listener on IP address 0.0.0.0:2638
I. 04/20 10:52:22. Starting on port 2638
I. 04/20 10:52:22. Not performing a broadcast</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.sybinfo.com/asiq/utility_db-iq-server-name-already-in-use-dbspawn-error-85/feed/</wfw:commentRss>
		</item>
		<item>
		<title>search argument, SARG</title>
		<link>http://www.sybinfo.com/glossary/search-argument-sarg/</link>
		<comments>http://www.sybinfo.com/glossary/search-argument-sarg/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 07:51:17 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
		
		<category><![CDATA[Glossary]]></category>

		<category><![CDATA[SARG]]></category>

		<category><![CDATA[search argument]]></category>

		<guid isPermaLink="false">http://www.sybinfo.com/?p=171</guid>
		<description><![CDATA[A search argument is the criteria used in a WHERE clause of as query. it is used to restrict a query to an exact match or a range of values. SARG is a acronym for the term Search ARGument.
]]></description>
			<content:encoded><![CDATA[<p>A <strong>search argument</strong> is the criteria used in a WHERE clause of as query. it is used to restrict a query to an exact match or a range of values. <strong>SARG</strong> is a acronym for the term <strong>S</strong>earch <strong>ARG</strong>ument.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sybinfo.com/glossary/search-argument-sarg/feed/</wfw:commentRss>
		</item>
		<item>
		<title>capture show_missing_stats in ASE15</title>
		<link>http://www.sybinfo.com/ase/capture-show_missing_stats-in-ase15/</link>
		<comments>http://www.sybinfo.com/ase/capture-show_missing_stats-in-ase15/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 09:00:16 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
		
		<category><![CDATA[ase]]></category>

		<category><![CDATA[options]]></category>

		<category><![CDATA[set]]></category>

		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://www.sybinfo.com/?p=164</guid>
		<description><![CDATA[show_missing_stats shows details of useful statistics missing from SARG / Join columns.
It is important to note there are several situations where show_missing_stats will not print.

If you run a "stored-procedure" and there is a current plan in the master..sysqueryplans", the "show_missing_statistics" will not print anything. You can do one of 2 things.


Run the stored-procedure with  [...]]]></description>
			<content:encoded><![CDATA[<p><strong>show_missing_stats</strong> shows details of useful statistics missing from SARG / Join columns.</p>
<p>It is important to note there are several situations where show_missing_stats will not print.</p>
<ol>
<li>If you run a "stored-procedure" and there is a current plan in the master..sysqueryplans", the "show_missing_statistics" will not print anything. You can do one of 2 things.
</li>
<ul>
<li>Run the stored-procedure with  the recompile option. i.e. "exec <stored-proc> with recompile"</li>
<li>If the problem is a long running query and you do not want to wait a long time for the result then before you run the query you can execute "set noexec on". The only problem is, if there is a current query plan in sysqueryplans, even with the "with recompile" it won't work. In this situation you would first have to delete the query plan from sysqueryplans.
</li>
</ul>
<li>If you run an ad-hoc query the query plans for these are not stored in sysqueryplans.   Ad-hoc query plan is created every time you run any ad-hoc query unless you have activated "statement cache". If "statement cache" is active on the server then you have the same problem as with "stored-procedures" and "procedure cache". Fortunately there is an easy solution here. At the session level "set statement_cache off" and the problem is solved.</li>
<li>If "capture metrics" is activated on the server this can cause "show_missing_stats" not to print. Again there is a simple solution for this that is to "set metrics capture off" at the session level and the problem is solved.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.sybinfo.com/ase/capture-show_missing_stats-in-ase15/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Determine size of a text/image field</title>
		<link>http://www.sybinfo.com/ase/determine-size-of-a-textimage-field/</link>
		<comments>http://www.sybinfo.com/ase/determine-size-of-a-textimage-field/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 14:49:25 +0000</pubDate>
		<dc:creator>Carsten</dc:creator>
		
		<category><![CDATA[ase]]></category>

		<category><![CDATA[column]]></category>

		<category><![CDATA[image]]></category>

		<category><![CDATA[size]]></category>

		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://www.sybinfo.com/?p=158</guid>
		<description><![CDATA[When trying to extract data from a text or image field, it is not always clear, how many bytes of data can be expected. Here's a way how to determine this:
&#160;
1&#62; SET textsize 1669842
2&#62; go
1&#62; SELECT Xml FROM TradeXml WHERE AsOfDate = '20091019' AND TradeId = 'xxxxxxx'
2&#62; go
&#160;
In order to determine the value that needs [...]]]></description>
			<content:encoded><![CDATA[<p>When trying to extract data from a text or image field, it is not always clear, how many bytes of data can be expected. Here's a way how to determine this:</p>
<pre class="sql">&nbsp;
<span style="color: #cc66cc;">1</span>&gt; <span style="color: #993333; font-weight: bold;">SET</span> textsize <span style="color: #cc66cc;">1669842</span>
<span style="color: #cc66cc;">2</span>&gt; go
<span style="color: #cc66cc;">1</span>&gt; <span style="color: #993333; font-weight: bold;">SELECT</span> Xml <span style="color: #993333; font-weight: bold;">FROM</span> TradeXml <span style="color: #993333; font-weight: bold;">WHERE</span> AsOfDate = <span style="color: #ff0000;">'20091019'</span> <span style="color: #993333; font-weight: bold;">AND</span> TradeId = <span style="color: #ff0000;">'xxxxxxx'</span>
<span style="color: #cc66cc;">2</span>&gt; go
&nbsp;</pre>
<p>In order to determine the value that needs to be set for "textsize", use this query:</p>
<pre class="sql">&nbsp;
<span style="color: #cc66cc;">1</span>&gt; <span style="color: #993333; font-weight: bold;">SELECT</span> datalength<span style="color: #66cc66;">&#40;</span>Xml<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> TradeXml <span style="color: #993333; font-weight: bold;">WHERE</span> AsOfDate = <span style="color: #ff0000;">'20091019'</span> <span style="color: #993333; font-weight: bold;">AND</span> TradeId = <span style="color: #ff0000;">'xxxxxxx'</span>
<span style="color: #cc66cc;">2</span>&gt; go
&nbsp;
 <span style="color: #808080; font-style: italic;">-----------</span>
     <span style="color: #cc66cc;">1669842</span>
&nbsp;</pre>
<p>This determines the size of bytes for the data field query.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sybinfo.com/ase/determine-size-of-a-textimage-field/feed/</wfw:commentRss>
		</item>
		<item>
		<title>sp_iqaddlogin different in IQ 12.7 and IQ 15</title>
		<link>http://www.sybinfo.com/asiq/sp_iqaddlogin-different-in-iq-127-and-iq-15/</link>
		<comments>http://www.sybinfo.com/asiq/sp_iqaddlogin-different-in-iq-127-and-iq-15/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 10:41:52 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
		
		<category><![CDATA[asiq]]></category>

		<category><![CDATA[IQ 12.7]]></category>

		<category><![CDATA[IQ 15.1]]></category>

		<category><![CDATA[sp_iqaddlogin]]></category>

		<category><![CDATA[sp_iqpassword]]></category>

		<guid isPermaLink="false">http://www.sybinfo.com/?p=153</guid>
		<description><![CDATA[The system stored procedure sp_iqaddlogin is different in IQ 12.7 and IQ 15.1
The main difference ist the syntax and it seems that the 15-version might have a bug. 
Neither sp_iqaddlogin, nor sp_iqpassword will accept symbols in passwords, such as "=", "%", "!", "+". Strangely the dollar symbol is accepted. The following error message is generated; [...]]]></description>
			<content:encoded><![CDATA[<p>The system stored procedure sp_iqaddlogin is different in IQ 12.7 and IQ 15.1</p>
<p>The main difference ist the syntax and it seems that the 15-version might have a bug. </p>
<p>Neither sp_iqaddlogin, nor sp_iqpassword will accept symbols in passwords, such as "=", "%", "!", "+". Strangely the dollar symbol is accepted. The following error message is generated; </p>
<pre class="sql">Msg <span style="color: #cc66cc;">102</span>, Level <span style="color: #cc66cc;">15</span>, State <span style="color: #cc66cc;">0</span>:
SQL Anywhere Error <span style="color: #cc66cc;">-131</span>: Syntax error near <span style="color: #ff0000;">'+'</span> <span style="color: #993333; font-weight: bold;">ON</span> line <span style="color: #cc66cc;">1</span></pre>
<p>Also a password can not start with a number. The following error message is generated; </p>
<pre class="sql">Msg <span style="color: #cc66cc;">102</span>, Level <span style="color: #cc66cc;">15</span>, State <span style="color: #cc66cc;">0</span>:
SQL Anywhere Error <span style="color: #cc66cc;">-131</span>: Syntax error near <span style="color: #ff0000;">'4'</span> <span style="color: #993333; font-weight: bold;">ON</span> line <span style="color: #cc66cc;">1</span></pre>
<p>The Sybase <a href="http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc00801.1510/html/iqrefso/CIHBCIAH.htm">documentation</a> contains the recommendation that only 7-bit ASCII characters are used for passwords. These symbols are included in the 7-bit ASCII character set and are acceptable in passwords on IQ 12.7 Servers. </p>
<p>More details can be found here: <a href="  http://www.sybinfo.de/asiq/sp_iqaddlogin-unterschied-zwischen-iq-127-und-iq-15/">sp_iqaddlogin - unterschied zwischen IQ 12.7 und IQ 15/</a> a post on the german blog sybinfo.de.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sybinfo.com/asiq/sp_iqaddlogin-different-in-iq-127-and-iq-15/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Proxy Tables on IQ Servers</title>
		<link>http://www.sybinfo.com/asiq/proxy-tables-on-iq-servers/</link>
		<comments>http://www.sybinfo.com/asiq/proxy-tables-on-iq-servers/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 13:26:07 +0000</pubDate>
		<dc:creator>Maria</dc:creator>
		
		<category><![CDATA[asiq]]></category>

		<category><![CDATA[IQ]]></category>

		<category><![CDATA[Proxy]]></category>

		<guid isPermaLink="false">http://www.sybinfo.com/?p=141</guid>
		<description><![CDATA[
Tables on a remote IQ Server can be made available to another IQ Server using Proxy Tables.
1. Configure the remote IQ Server for proxy access on the local IQ Server.
(DBA)&#62; create server REMOTE_IQ class 'asajdbc' using 'remote_iq.my_domain.com:4000/REMOTE_IQ'
This SQL statement puts an entry into the SYSSERVERS table.
2.  Configure EXTERNLOGIN for users and/or "table owners".
For example, on [...]]]></description>
			<content:encoded><![CDATA[<div class="storycontent">
<p>Tables on a remote IQ Server can be made available to another IQ Server using Proxy Tables.</p>
<p>1. Configure the remote IQ Server for proxy access on the local IQ Server.</p>
<p>(DBA)&gt; create server REMOTE_IQ class 'asajdbc' using 'remote_iq.my_domain.com:4000/REMOTE_IQ'</p>
<p>This SQL statement puts an entry into the SYSSERVERS table.</p>
<p>2.  Configure EXTERNLOGIN for users and/or "table owners".</p>
<p>For example, on the remote IQ Server there is a table called MY_TABLE owned by my_user. A user must be created on the local IQ Server with sp_iqaddlogin and mapped to my_user on the remote IQ Server, using a CREATE EXTERNLOGIN statement and giving the user's password for the remote IQ Server. The user names can be different, but it seems simpler to use the same user names.</p>
<p>(DBA)&gt; CREATE EXTERNLOGIN my_user TO REMOTE_IQ REMOTE LOGIN my_user IDENTIFIED BY my_remote_password</p>
<p>3.  The Proxy Table must be made available using a CREATE EXISTING TABLE statement.</p>
<p>DBA&gt; create existing table my_user.MY_TABLE at 'REMOTE_IQ..my_user.MY_TABLE'</p>
<p>The table names can be different, but normally customers want the same table name.</p>
<p>4. Use the usual GRANT statements to allow local users access to the table contents.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sybinfo.com/asiq/proxy-tables-on-iq-servers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Determine size of a raw device in Unix Solaris</title>
		<link>http://www.sybinfo.com/ase/determine-size-of-a-raw-device-in-unix-solaris/</link>
		<comments>http://www.sybinfo.com/ase/determine-size-of-a-raw-device-in-unix-solaris/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 08:36:57 +0000</pubDate>
		<dc:creator>Carsten</dc:creator>
		
		<category><![CDATA[ase]]></category>

		<category><![CDATA[calculate]]></category>

		<category><![CDATA[device]]></category>

		<category><![CDATA[devinfo]]></category>

		<category><![CDATA[raw]]></category>

		<category><![CDATA[size]]></category>

		<guid isPermaLink="false">http://www.sybinfo.com/ase/determine-size-of-a-raw-device-in-unix-solaris/</guid>
		<description><![CDATA[Log on to the server 
$ devinfo -i /dev/md/rdsk/d301
          /dev/md/rdsk/d301       0       0       16384   512     1 ]]></description>
			<content:encoded><![CDATA[<p>Log on to the server </p>
<p><code>$ devinfo -i /dev/md/rdsk/d301<br />
          /dev/md/rdsk/d301       0       0       16384   <strong>512     </strong>1 <-- This is the block size<br />
$ devinfo -p /dev/md/rdsk/d301<br />
          /dev/md/rdsk/d301       55      c12d    16384   <strong>524288  </strong>0       0 <-- this is the device size in blocks<br />
</code></p>
<p>To calculate the device size in bytes, you need both bits of information obtained from the above commands as follows:</p>
<p>Device size = ( (<strong>524288 </strong>/ (1024 / <strong>512</strong>) ) / 1024 = 256MB</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sybinfo.com/ase/determine-size-of-a-raw-device-in-unix-solaris/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dropping IQ DBSPACEs</title>
		<link>http://www.sybinfo.com/ase/dropping-iq-dbspaces/</link>
		<comments>http://www.sybinfo.com/ase/dropping-iq-dbspaces/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 07:53:53 +0000</pubDate>
		<dc:creator>Maria</dc:creator>
		
		<category><![CDATA[ase]]></category>

		<category><![CDATA[DBSPACE]]></category>

		<category><![CDATA[IQ]]></category>

		<category><![CDATA[sp_iqrelocate]]></category>

		<guid isPermaLink="false">http://www.sybinfo.com/?p=130</guid>
		<description><![CDATA[It is possible to drop DBSPACEs on an IQ Server, if there is enough space to move all data to other DBSPACEs.
1. Check DBSPACEs
The sp_iqdbspace command should be used to list all DBSPACEs and their status.
(DBA)&#62; sp_iqdbspace
Execution time: 0.053 seconds
Name           Path     [...]]]></description>
			<content:encoded><![CDATA[<p>It is possible to drop DBSPACEs on an IQ Server, if there is enough space to move all data to other DBSPACEs.<br />
1. Check DBSPACEs<br />
The sp_iqdbspace command should be used to list all DBSPACEs and their status.<br />
(DBA)&gt; sp_iqdbspace<br />
Execution time: 0.053 seconds<br />
Name           Path                                       SegmentType RWMode Usage DBSSize Reserve StripeSize BlkTypes         FirstBlk LastBlk<br />
----------------------------------------------------------------------------------------------------------<br />
IQ_SYSTEM_MAIN /var/sybase/IQ_Server/devices/IQstore.50 MAIN        RW     1     65G     0B      8K         1H,320F,32D,128M 1        8516599<br />
IQ_51          /var/sybase/IQ_Server/devices/IQstore51  MAIN        RW     4     65G   0B      8K         1H,32F           9408960  9409959<br />
IQ_52          /var/sybase/IQ_Server/devices/IQstore52  MAIN        RW     4     65G   0B      8K         1H,32F           10454400 10455399<br />
IQ_SYSTEM_TEMP /var/sybase/IQ_Server/devices/IQtmp.10   TEMPORARY   RW     1     33G     0B      8K         1H,192F,16A      1        4325272<br />
TMP_11         /var/sybase/IQ_Server/devices/IQtmp11    TEMPORARY   RW     65    33G    0B      8K         1H,64F           5227200  5227299</p>
<p>2. Change the DBSPACE Status<br />
The DBSPACE to be dropped should be put into "relocate" status using the "alter dbspace" command.<br />
(DBA)&gt; alter dbspace IQ_51 relocate<br />
Execution time: 0.18 seconds</p>
<p>A DBSPACE can have one of three statuses, displayed in the RW column of the sp_iqdbspace output; RW - readwrite, RO - readonly, RR - relocate .</p>
<p>3. Use sp_iqrelocate<br />
(DBA)&gt; sp_iqrelocate database<br />
Execution time: 0.038 seconds<br />
Object Blocks Relocated Status<br />
------------------------------<br />
(First 0 rows)<br />
(DBA)&gt; commit<br />
Execution time: 0.012 seconds</p>
<p>Whilst in relocate mode, no data will be written to the DBSPACE and next time the sp_iqrelocate command is used data on that DBSPACE will be moved to other DBSPACEs. NOTE: sp_iqrelocate can only be used with MAIN DBSPACEs. If used with a TEMP DBSPACE you will see the following error message;<br />
sp_iqrelocate database<br />
Could not execute statement.<br />
There must be at least one readwrite dbspace and one relocate dbspace to<br />
relocate data.<br />
-- (db_iqutility.cxx 6894)<br />
SQLCODE=-1009061, ODBC 3 State="HY000"<br />
Line 1, column 1<br />
sp_iqrelocate database</p>
<p>So, if the DBSPACE is a MAIN DBSPACE execute "sp_iqrelocate database" followed by a commit, because sp_iqrelocate does not automatically commit. If the DBSPACE is a TEMP DBSPACE this step can be skipped.</p>
<p>4. Drop DBSPACE<br />
Execute the "sp_dbspace" command.<br />
(DBA)&gt; drop dbspace IQ_55<br />
Execution time: 0.221 seconds<br />
If the DBSPACE is a TEMP DBSPACE it may be necessary to restart the IQ Server to free Temporary Blocks, before dropping the DBSPACE.</p>
<p>The relocate steps are deeper explained here: <a href="http://www.sybinfo.de/asiq/iq-relocate-sp_iqrelocate-database/">IQ sp_iqrelocate database</a> - written in german.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sybinfo.com/ase/dropping-iq-dbspaces/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Corrupt transaction log - Build a new ASE transaction log</title>
		<link>http://www.sybinfo.com/ase/corrupt-transaction-log-build-a-new-ase-transaction-log/</link>
		<comments>http://www.sybinfo.com/ase/corrupt-transaction-log-build-a-new-ase-transaction-log/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 15:58:50 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
		
		<category><![CDATA[ase]]></category>

		<category><![CDATA[dbcc]]></category>

		<category><![CDATA[Corrupt transaction log]]></category>

		<category><![CDATA[rebuild log]]></category>

		<category><![CDATA[transaction log]]></category>

		<guid isPermaLink="false">http://www.sybinfo.com/?p=117</guid>
		<description><![CDATA[Corrupt transaction log; Build a new ASE transaction log with dbcc rebuild_log
In some cases it is necessary to rebuild the ASE transaction log.
Sybase Technical Support states that this is extremely dangerous. It may cause potential database corruption if the system fails while the timestamp rolls over.

dump the database first. If "dbcc rebuild_log" corrupts the database [...]]]></description>
			<content:encoded><![CDATA[<p>Corrupt transaction log; Build a new ASE transaction log with <strong>dbcc rebuild_log</strong></p>
<p>In some cases it is necessary to rebuild the ASE transaction log.</p>
<p><strong>Sybase Technical Support states that this is extremely dangerous. It may cause potential database corruption</strong> if the system fails while the timestamp rolls over.</p>
<ul>
<li>dump the database first. If "dbcc rebuild_log" corrupts the database you can give it a second try.</li>
<li>login to the ASE</ol>
<li>run
<pre class="sql"><span style="color: #993333; font-weight: bold;">SELECT</span> count<span style="color: #66cc66;">&#40;</span>*<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> db_name_with_corrupt_log..syslogs</pre>
<p> the result is an int-value higher than 1.
</li>
<p>configure the ASE to allow updates on systemtables:
<pre class="sql">sp_configure <span style="color: #ff0000;">&quot;allow updates&quot;</span>,<span style="color: #cc66cc;">1</span></pre>
<li>identify the "status" from sysdatabases with:
<pre class="sql"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">STATUS</span> <span style="color: #993333; font-weight: bold;">FROM</span> master..sysdatabases <span style="color: #993333; font-weight: bold;">WHERE</span> name = <span style="color: #ff0000;">&quot;db_name_with_corrupt_log&quot;</span></pre>
<p> The result is "your_db_status" which is a int-value. Save it.
</li>
<li>set the status of "db_name_with_corrupt_log" to "bypass recovery mode" (-32786).
<pre class="sql">begin tran
go
<span style="color: #993333; font-weight: bold;">UPDATE</span> sysdatabases <span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #993333; font-weight: bold;">STATUS</span> = <span style="color: #cc66cc;">-32768</span> <span style="color: #993333; font-weight: bold;">WHERE</span> name = <span style="color: #ff0000;">&quot;db_name_with_corrupt_log&quot;</span>
go
commit tran
go</pre>
</li>
<li>if the update was successfull shutdown and reboot the ASE</li>
<li>than run first
<pre class="sql">dbcc rebuild_log <span style="color: #66cc66;">&#40;</span>db_name_with_corrupt_log, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span></pre>
</li>
<li>and afterwards
<pre class="sql">dbcc rebuild_log <span style="color: #66cc66;">&#40;</span>db_name_with_corrupt_log, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span></pre>
</li>
<li>
<pre class="sql"><span style="color: #993333; font-weight: bold;">USE</span> db_name_with_corrupt_log</pre>
</li>
<li>check the syslogs of db_name_with_corrupt_log. It should be 1.
<pre class="sql"><span style="color: #993333; font-weight: bold;">SELECT</span> count<span style="color: #66cc66;">&#40;</span>*<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> syslogs</pre>
</li>
<li>set the status in sysdatabases back to the original one. Run:
<pre class="sql">begin tran
go
<span style="color: #993333; font-weight: bold;">UPDATE</span> sysdatabases <span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #993333; font-weight: bold;">STATUS</span> = &lt;your_db_status&gt; <span style="color: #993333; font-weight: bold;">WHERE</span> name = <span style="color: #ff0000;">&quot;db_name_with_corrupt_log&quot;</span>
go
commit tran
go</pre>
</li>
<li>reboot the ASE again.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.sybinfo.com/ase/corrupt-transaction-log-build-a-new-ase-transaction-log/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
