马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?站点注册
×
大家好,sybase刚接触使用,有问题请教, sybase中有执行***.sql文件的命令吗?
问题描述:
sybase碰到断电或者其它不可预测操作时,会导致sybase数据库操作,这时候需要还原数据库
解决步骤:
1:用Dbtran -y sybase.log db.sql 将sybase.log中的数据库操作都读取出来放到db.sql中
2:dbeng9 sybase.db 连接sybase数据库
3:sqlpp -c "userid=dba;password=sql" db.sql 执行db.sql操作
问题:
db.sql我在anywhere9里面执行是没有问题的,但用命令读取文件执行报错.不知道怎么回事,是命令错误还是参数不对?
请大家帮忙看看,谢谢.
db.sql:
--CHECKPOINT-0000-0009145536-2008-06-08 16:38
--CONNECT-1003-0009145562-DBA-2008-06-08 16:38
--BEGIN TRANSACTION-1003-0009145573
BEGIN TRANSACTION
go
--INSERT-1003-0009145618
INSERT INTO DBA.a(id,sql)
VALUES (1,'a')
go
--INSERT-1003-0009145625
INSERT INTO DBA.a(id,sql)
VALUES (2,'b')
go
--COMMIT-1003-0009145632
COMMIT WORK
go
--CHECKPOINT-0000-0009145640-2008-06-08 16:39
db.c:
// *************************************************
// ********* GENERATED FILE - DO NOT EDIT! *********
// *************************************************
#define _SQL_SQLPP_VERSION_MAJOR 9
#define _SQL_SQLPP_VERSION_MINOR 0
#define _SQL_SQLPP_VERSION_MAINT 2
#define _SQL_SQLPP_DBLIB_VERSION 9
--CHECKPOINT-0000-0009145536-2008-06-08 16:38
--CONNECT-1003-0009145562-DBA-2008-06-08 16:38
--BEGIN TRANSACTION-1003-0009145573
BEGIN TRANSACTION
go
--INSERT-1003-0009145618
INSERT INTO DBA.a(id,sql)
VALUES (1,'a')
go
--INSERT-1003-0009145625
INSERT INTO DBA.a(id,sql)
VALUES (2,'b')
go
--COMMIT-1003-0009145632
COMMIT WORK
go
--CHECKPOINT-0000-0009145640-2008-06-08 16:39
fined(UL_ENABLE_SEGMENTS) || !defined(UL_ENABLE_GNU_SEGMENTS)
#define GNU_SEGMENT
#endif
#endif
typedef struct __alignment_detection __alignment_detection;
struct __alignment_detection{ ul_byte _byte; ul_u_big _big; };
#ifdef UL_ENABLE_SEGMENTS
#ifdef UL_ENABLE_GNU_SEGMENTS
#undef GNU_SEGMENT
#define GNU_SEGMENT __attribute__((section("ULSEGDB")))
#else
#pragma segment ULSEGDB
#endif
#endif
extern ul_s_short ULMemSchemaRdr( ul_u_long ) GNU_SEGMENT;
ul_database ULDatabase =
{ UL_NULL,
UL_TEXT("ul_db"),
UL_NULL,
ULMemSchemaRdr,
UL_NULL,
#ifdef UL_ENABLE_OBFUSCATION
ULD_OBFUSCATE |
#endif
#if defined(UNICODE) || defined(_UNICODE)
ULD_UNICODE |
#endif
#ifdef UL_ENABLE_BIGIDX
ULD_BIGIDX |
#endif
ULD_NO_FLAGS,
UL_OFFSETOF( __alignment_detection, _big ) };
SQLCA sqlca = {{0}};
// Generated file -- do not edit
// input file size: 1728 or 2K (rounded upwards).
#if !defined(UL_ENABLE_SEGMENTS) || !defined(UL_ENABLE_GNU_SEGMENTS)
#define GNU_SEGMENT
#endif
#ifdef UL_ENABLE_SEGMENTS
#ifdef UL_ENABLE_GNU_SEGMENTS
#undef GNU_SEGMENT
#define GNU_SEGMENT __attribute__((section("ULSEGDB")))
#else
#pragma segment ULSEGDB
#endif
#endif
extern ul_s_short ULMemSchemaRdr
( ul_u_long index )
{
char const * usm_data =
"\x12\xAB\x34\xCD\x23\x32\xFF\xFF\xF0\xFF\xFF\xF0\xFF\x01\x00\x00"
很长串这样的字符
"\xFF\xF0\xFF\x01\xFF\xFF\xF0\xFF\xFF\xF0\xFF\x01\x12\xAB\x34\xCD"
;
return index >= 1728 ? (-1) : (unsigned char)usm_data[ index ];
} |