<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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>评论：Sybase从Windows到Linux的迁移指南（使用资源文件来快速新建sybase服务器）</title>
	<atom:link href="http://www.dbainfo.net/ase-migrate-from-windows-to-linux.htm/feed" rel="self" type="application/rss+xml" />
	<link>https://www.dbainfo.net/ase-migrate-from-windows-to-linux.htm</link>
	<description>提供Sybase ASE及Sybase SQL Anywhere数据库修复服务，电话：13811580958(微信)，QQ：289965371！We have many years of experience in recovering data from damanged Sybase devices. Contact us by Phone: +86 13811580958 Wechat: 13811580958 Email: 289965371@qq.com</description>
	<lastBuildDate>Fri, 04 Dec 2020 03:15:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>由：dbainfo</title>
		<link>https://www.dbainfo.net/ase-migrate-from-windows-to-linux.htm#comment-105</link>
		<dc:creator>dbainfo</dc:creator>
		<pubDate>Sun, 19 Dec 2010 08:22:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.dbainfo.net/?p=90#comment-105</guid>
		<description>两种方法：跨平台dump&amp;load 和 ddl+data，个人感觉ddl+data更能够锻炼DBA或者开发人员的能力。
从你说的上述步骤中：1. 导table 2.导proxy_table 3.导两次view 4. 导function 导两次procedure 5.导data 6. 导trigger 7.导索引和key，
这些是个基本的能力，拿到其他数据库，比如oracle，mysql都是通用的。而跨平台dump&amp;load 不是，甚至它还有很多的限制。

你导出的table，view，function，proxy_table，procedure，index&amp;键 是通过ddlgen实现的呢？还是利用自己写的工具完全自己根据系统表来提取的？
我知道至少函数function的语法需要自己写工具导出。</description>
		<content:encoded><![CDATA[<p>两种方法：跨平台dump&amp;load 和 ddl+data，个人感觉ddl+data更能够锻炼DBA或者开发人员的能力。<br />
从你说的上述步骤中：1. 导table 2.导proxy_table 3.导两次view 4. 导function 导两次procedure 5.导data 6. 导trigger 7.导索引和key，<br />
这些是个基本的能力，拿到其他数据库，比如oracle，mysql都是通用的。而跨平台dump&amp;load 不是，甚至它还有很多的限制。</p>
<p>你导出的table，view，function，proxy_table，procedure，index&amp;键 是通过ddlgen实现的呢？还是利用自己写的工具完全自己根据系统表来提取的？<br />
我知道至少函数function的语法需要自己写工具导出。</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：dbainfo</title>
		<link>https://www.dbainfo.net/ase-migrate-from-windows-to-linux.htm#comment-104</link>
		<dc:creator>dbainfo</dc:creator>
		<pubDate>Sun, 19 Dec 2010 08:14:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.dbainfo.net/?p=90#comment-104</guid>
		<description>drop statements对于更新对象的DDL是很有用的。

在移植对象DDL的时候，举个例子：表A外键引用表B，如果导出的DLL语句中表A的定义语句在前面，而表B的DDL在后面。那么在创建表A的时候会因为外键引用的表B不存在而导致表A创建不成功。表B是能够成功创建的。

第二次执行上面相同的脚本时，首先会成功创建表A，因为其所引用的表B已经创建上了。而表B不会再次创建因为上次执行的时候已建上，会给出一个错误信息。这在isql是个错误信息，可能在sybase central中会是一个让人讨厌的弹出窗口。

总之，如果数据库内表之间定义了引用关系，那么同样的脚本语句需要执行两边才能成功完成工作。下面举一个外键引用的例子，分两种情况：1：不带if exitsts .... drop table ... 
2：带if exitsts .... drop table ... 
有两种表：部门信息表dept，学生信息表students，学生表中的部门编号列引用表dept的dept_id列。语法如下：
use tempdb
go
create table students ( id int not null,name varchar(30) null,
  dept_id int not null,constraint fk_students_dept_id foreign key(dept_id) references dept(dept_id) )
go
create table dept(dept_id int unique not null, dept_name varchar(100) null)
go

第一种情况：不带if exitsts .... drop table ...
执行第一遍语句
1&gt; create table students ( id int not null,name varchar(30) null,
2&gt;   dept_id int not null,constraint fk_students_dept_id foreign key(dept_id) references dept(dept_id) )
3&gt; go
Msg 1710, Level 16, State 3:
Server &#039;NMR&#039;, Line 1:
Referenced table &#039;dept&#039; specified in a referential constraint declared on
&#039;students&#039; does not exist in the database &#039;tempdb&#039;.
Msg 2761, Level 16, State 4:
Server &#039;NMR&#039;, Line 1:
Failed to create declarative constraints on table &#039;students&#039; in database
&#039;tempdb&#039;.
1&gt; create table dept(dept_id int unique not null, dept_name varchar(100) null)
2&gt; go
因为学生信息表students没有成功创建，执行第二遍语句，
1&gt;
2&gt;
3&gt;
4&gt; use tempdb
5&gt; go
1&gt; create table students ( id int not null,name varchar(30) null,
2&gt;   dept_id int not null,constraint fk_students_dept_id foreign key(dept_id) references dept(dept_id) )
3&gt; go
1&gt; create table dept(dept_id int unique not null, dept_name varchar(100) null)
2&gt; go
Msg 2714, Level 16, State 1:
Server &#039;NMR&#039;, Line 1:
There is already an object named &#039;dept&#039; in the database.
第二遍执行语句的时候，报部门信息表已经存在的错误。

第二种情况：带if exitsts .... drop table ...
执行效果如下：
1&gt; use tempdb
2&gt; go
1&gt; if exists(select 1 from sysobjects where type=&#039;U&#039; and name=&#039;student&#039;)
2&gt;   drop table students
3&gt; go
1&gt; create table students ( id int not null,name varchar(30) null,
2&gt;   dept_id int not null,constraint fk_students_dept_id foreign key(dept_id) references dept(dept_id) )
3&gt; go
Msg 1710, Level 16, State 3:
Server &#039;NMR&#039;, Line 1:
Referenced table &#039;dept&#039; specified in a referential constraint declared on
&#039;students&#039; does not exist in the database &#039;tempdb&#039;.
Msg 2761, Level 16, State 4:
Server &#039;NMR&#039;, Line 1:
Failed to create declarative constraints on table &#039;students&#039; in database
&#039;tempdb&#039;.
1&gt;
2&gt; if exists(select 1 from sysobjects where type=&#039;U&#039; and name=&#039;dept&#039;)
3&gt;     drop table dept
4&gt; go
1&gt; create table dept(dept_id int unique not null, dept_name varchar(100) null)
2&gt; go
1&gt;
2&gt;
3&gt;
4&gt;
5&gt; use tempdb
6&gt; go
1&gt; if exists(select 1 from sysobjects where type=&#039;U&#039; and name=&#039;student&#039;)
2&gt;   drop table students
3&gt; go
1&gt; create table students ( id int not null,name varchar(30) null,
2&gt;   dept_id int not null,constraint fk_students_dept_id foreign key(dept_id) references dept(dept_id) )
3&gt; go
1&gt;
2&gt; if exists(select 1 from sysobjects where type=&#039;U&#039; and name=&#039;dept&#039;)
3&gt;     drop table dept
4&gt; go
Msg 3712, Level 16, State 1:
Server &#039;NMR&#039;, Line 3:
Cannot drop table &#039;dept&#039; because it still has referential integrity
constraints.
1&gt; create table dept(dept_id int unique not null, dept_name varchar(100) null)
2&gt; go
Msg 2714, Level 16, State 1:
Server &#039;NMR&#039;, Line 1:
There is already an object named &#039;dept&#039; in the database.
第一遍同样students不能成功创建，第二遍dept不能删除，因为存在引用它的表students，继而也不能再次创建。

PS：如果存在表之间的引用，且表之间的顺序不正确的话，需要将脚本执行两便才能保证对象都成功创建上。</description>
		<content:encoded><![CDATA[<p>drop statements对于更新对象的DDL是很有用的。</p>
<p>在移植对象DDL的时候，举个例子：表A外键引用表B，如果导出的DLL语句中表A的定义语句在前面，而表B的DDL在后面。那么在创建表A的时候会因为外键引用的表B不存在而导致表A创建不成功。表B是能够成功创建的。</p>
<p>第二次执行上面相同的脚本时，首先会成功创建表A，因为其所引用的表B已经创建上了。而表B不会再次创建因为上次执行的时候已建上，会给出一个错误信息。这在isql是个错误信息，可能在sybase central中会是一个让人讨厌的弹出窗口。</p>
<p>总之，如果数据库内表之间定义了引用关系，那么同样的脚本语句需要执行两边才能成功完成工作。下面举一个外键引用的例子，分两种情况：1：不带if exitsts &#8230;. drop table &#8230;<br />
2：带if exitsts &#8230;. drop table &#8230;<br />
有两种表：部门信息表dept，学生信息表students，学生表中的部门编号列引用表dept的dept_id列。语法如下：<br />
use tempdb<br />
go<br />
create table students ( id int not null,name varchar(30) null,<br />
  dept_id int not null,constraint fk_students_dept_id foreign key(dept_id) references dept(dept_id) )<br />
go<br />
create table dept(dept_id int unique not null, dept_name varchar(100) null)<br />
go</p>
<p>第一种情况：不带if exitsts &#8230;. drop table &#8230;<br />
执行第一遍语句<br />
1&gt; create table students ( id int not null,name varchar(30) null,<br />
2&gt;   dept_id int not null,constraint fk_students_dept_id foreign key(dept_id) references dept(dept_id) )<br />
3&gt; go<br />
Msg 1710, Level 16, State 3:<br />
Server &#8216;NMR&#8217;, Line 1:<br />
Referenced table &#8216;dept&#8217; specified in a referential constraint declared on<br />
&#8216;students&#8217; does not exist in the database &#8216;tempdb&#8217;.<br />
Msg 2761, Level 16, State 4:<br />
Server &#8216;NMR&#8217;, Line 1:<br />
Failed to create declarative constraints on table &#8216;students&#8217; in database<br />
&#8216;tempdb&#8217;.<br />
1&gt; create table dept(dept_id int unique not null, dept_name varchar(100) null)<br />
2&gt; go<br />
因为学生信息表students没有成功创建，执行第二遍语句，<br />
1&gt;<br />
2&gt;<br />
3&gt;<br />
4&gt; use tempdb<br />
5&gt; go<br />
1&gt; create table students ( id int not null,name varchar(30) null,<br />
2&gt;   dept_id int not null,constraint fk_students_dept_id foreign key(dept_id) references dept(dept_id) )<br />
3&gt; go<br />
1&gt; create table dept(dept_id int unique not null, dept_name varchar(100) null)<br />
2&gt; go<br />
Msg 2714, Level 16, State 1:<br />
Server &#8216;NMR&#8217;, Line 1:<br />
There is already an object named &#8216;dept&#8217; in the database.<br />
第二遍执行语句的时候，报部门信息表已经存在的错误。</p>
<p>第二种情况：带if exitsts &#8230;. drop table &#8230;<br />
执行效果如下：<br />
1&gt; use tempdb<br />
2&gt; go<br />
1&gt; if exists(select 1 from sysobjects where type=&#8217;U&#8217; and name=&#8217;student&#8217;)<br />
2&gt;   drop table students<br />
3&gt; go<br />
1&gt; create table students ( id int not null,name varchar(30) null,<br />
2&gt;   dept_id int not null,constraint fk_students_dept_id foreign key(dept_id) references dept(dept_id) )<br />
3&gt; go<br />
Msg 1710, Level 16, State 3:<br />
Server &#8216;NMR&#8217;, Line 1:<br />
Referenced table &#8216;dept&#8217; specified in a referential constraint declared on<br />
&#8216;students&#8217; does not exist in the database &#8216;tempdb&#8217;.<br />
Msg 2761, Level 16, State 4:<br />
Server &#8216;NMR&#8217;, Line 1:<br />
Failed to create declarative constraints on table &#8216;students&#8217; in database<br />
&#8216;tempdb&#8217;.<br />
1&gt;<br />
2&gt; if exists(select 1 from sysobjects where type=&#8217;U&#8217; and name=&#8217;dept&#8217;)<br />
3&gt;     drop table dept<br />
4&gt; go<br />
1&gt; create table dept(dept_id int unique not null, dept_name varchar(100) null)<br />
2&gt; go<br />
1&gt;<br />
2&gt;<br />
3&gt;<br />
4&gt;<br />
5&gt; use tempdb<br />
6&gt; go<br />
1&gt; if exists(select 1 from sysobjects where type=&#8217;U&#8217; and name=&#8217;student&#8217;)<br />
2&gt;   drop table students<br />
3&gt; go<br />
1&gt; create table students ( id int not null,name varchar(30) null,<br />
2&gt;   dept_id int not null,constraint fk_students_dept_id foreign key(dept_id) references dept(dept_id) )<br />
3&gt; go<br />
1&gt;<br />
2&gt; if exists(select 1 from sysobjects where type=&#8217;U&#8217; and name=&#8217;dept&#8217;)<br />
3&gt;     drop table dept<br />
4&gt; go<br />
Msg 3712, Level 16, State 1:<br />
Server &#8216;NMR&#8217;, Line 3:<br />
Cannot drop table &#8216;dept&#8217; because it still has referential integrity<br />
constraints.<br />
1&gt; create table dept(dept_id int unique not null, dept_name varchar(100) null)<br />
2&gt; go<br />
Msg 2714, Level 16, State 1:<br />
Server &#8216;NMR&#8217;, Line 1:<br />
There is already an object named &#8216;dept&#8217; in the database.<br />
第一遍同样students不能成功创建，第二遍dept不能删除，因为存在引用它的表students，继而也不能再次创建。</p>
<p>PS：如果存在表之间的引用，且表之间的顺序不正确的话，需要将脚本执行两便才能保证对象都成功创建上。</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：Eisen</title>
		<link>https://www.dbainfo.net/ase-migrate-from-windows-to-linux.htm#comment-101</link>
		<dc:creator>Eisen</dc:creator>
		<pubDate>Sat, 18 Dec 2010 02:40:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.dbainfo.net/?p=90#comment-101</guid>
		<description>另外再补充一下，个人感觉对象之间的依赖关系在迁移中没啥重要的，所以只要脚本前面有drop statement的就没有问题了。你觉得呢?</description>
		<content:encoded><![CDATA[<p>另外再补充一下，个人感觉对象之间的依赖关系在迁移中没啥重要的，所以只要脚本前面有drop statement的就没有问题了。你觉得呢?</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：Eisen</title>
		<link>https://www.dbainfo.net/ase-migrate-from-windows-to-linux.htm#comment-100</link>
		<dc:creator>Eisen</dc:creator>
		<pubDate>Sat, 18 Dec 2010 02:38:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.dbainfo.net/?p=90#comment-100</guid>
		<description>也是，所以我后来自己开发了那个小工具专门来导出procedure和function的脚本的。
而且用ddl+data的方法因为可以完全写成脚本自动运行&#8212;&#8212; 1. 导table 2.导proxy_table 3.导两次view 4. 导function 导两次procedure 5.导data 6. 导trigger 7.导索引和key，这样就可以自己跑去睡觉去了不是吗?呵呵</description>
		<content:encoded><![CDATA[<p>也是，所以我后来自己开发了那个小工具专门来导出procedure和function的脚本的。<br />
而且用ddl+data的方法因为可以完全写成脚本自动运行&mdash;&mdash; 1. 导table 2.导proxy_table 3.导两次view 4. 导function 导两次procedure 5.导data 6. 导trigger 7.导索引和key，这样就可以自己跑去睡觉去了不是吗?呵呵</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：dbainfo</title>
		<link>https://www.dbainfo.net/ase-migrate-from-windows-to-linux.htm#comment-97</link>
		<dc:creator>dbainfo</dc:creator>
		<pubDate>Fri, 17 Dec 2010 06:53:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.dbainfo.net/?p=90#comment-97</guid>
		<description>&lt;p&gt;&lt;strong&gt;由于要求dump时数据库必须处于静默状态&lt;/strong&gt;，是因为sybase在ASE15.x中不支持跨平台dump&amp;load transaction。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;用ddl的方式建架子&lt;/strong&gt;，让我觉得麻烦的是对象间的依赖关系不能&#8220;全部&#8221;导出，或者先后顺序不对。只能第一遍报错的时候再执行第二遍。如果在ASE15中利用了自定义函数。sybase central 和ddlgen是导不出来函数语法的，除非在sybase central中人工一个一个的复制函数定义。 另外PowerDesigner反工程能得到函数定义语法。 &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
	关于这个问题： 我感觉扩平台备份恢复不是一个经常性的工作，建议用系统自带的dump&amp;load。如果此活是经常性的工作的话，那用你说的ddl+data的方法比较好，因为毕竟熟悉了嘛。&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p><strong>由于要求dump时数据库必须处于静默状态</strong>，是因为sybase在ASE15.x中不支持跨平台dump&amp;load transaction。</p>
<p><strong>用ddl的方式建架子</strong>，让我觉得麻烦的是对象间的依赖关系不能&ldquo;全部&rdquo;导出，或者先后顺序不对。只能第一遍报错的时候再执行第二遍。如果在ASE15中利用了自定义函数。sybase central 和ddlgen是导不出来函数语法的，除非在sybase central中人工一个一个的复制函数定义。 另外PowerDesigner反工程能得到函数定义语法。 </p>
<p>
	关于这个问题： 我感觉扩平台备份恢复不是一个经常性的工作，建议用系统自带的dump&amp;load。如果此活是经常性的工作的话，那用你说的ddl+data的方法比较好，因为毕竟熟悉了嘛。</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：Eisen</title>
		<link>https://www.dbainfo.net/ase-migrate-from-windows-to-linux.htm#comment-95</link>
		<dc:creator>Eisen</dc:creator>
		<pubDate>Fri, 17 Dec 2010 06:36:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.dbainfo.net/?p=90#comment-95</guid>
		<description>windows上一样可以通过resource file来创建instance，其类似srvbuildres的命令叫做sybatch.exe，其%SYBASE%\%ASE%\init里面的那个sample sqlsrv.res文件就是。
另:通过dump,load跨平台的时候，由于要求dump时数据库必须处于静默状态，所以往往都是先从production给dump一份出来，然后load到同平台的另一个无人用的db上去，再dump出来才能跨平台，之后还得dbcc reindex()...还真挺麻烦，我看还不如用ddl的方式建架子，然后脚本走proxy_table转数据的好。</description>
		<content:encoded><![CDATA[<p>windows上一样可以通过resource file来创建instance，其类似srvbuildres的命令叫做sybatch.exe，其%SYBASE%\%ASE%\init里面的那个sample sqlsrv.res文件就是。<br />
另:通过dump,load跨平台的时候，由于要求dump时数据库必须处于静默状态，所以往往都是先从production给dump一份出来，然后load到同平台的另一个无人用的db上去，再dump出来才能跨平台，之后还得dbcc reindex()&#8230;还真挺麻烦，我看还不如用ddl的方式建架子，然后脚本走proxy_table转数据的好。</p>
]]></content:encoded>
	</item>
</channel>
</rss>
