Oracle1

本文详细介绍了如何在Informix数据库中查询、备份、重建和恢复序列信息,包括使用特定SQL语句获取序列值,备份sequences,修改序列的起始值,以及在需要时恢复序列。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

1.2      INFORMIX

1.2.1        查询sequence信息

可以根据下面的语句,获得sequence的当前值:

select seq_numservice.nextval   from systables where tabname = 'seq_numservice';

select seq_customer.nextval     from systables where tabname = 'seq_customer';

select seq_subscriber.nextval   from systables where tabname = 'seq_subscriber';

select seq_account.nextval      from systables where tabname = 'seq_account';

select seq_productorder.nextval from systables where tabname = 'seq_productorder';

select seq_tb_mobileno.nextval  from systables where tabname = 'seq_tb_mobileno';

 

1.2.2    备份sequences

以文本格式上传Backup.sh至BMP(SYSDB)用户根目录下,执行一下命令:

chmod u+x Backup.sh

./Backup.sh

该操作只备份了本次修改涉及的sequences,备份文件为:sys_seq.unl

 

1.2.3    重建上面的sequence,更改restart的值;(maxvalue创建后自动生成,同时必须重启服务)

alter SEQUENCE seq_numservice  restart with 300000000;

alter SEQUENCE seq_customer   restart with 300000000;

alter SEQUENCE seq_subscriber restart with 300000000;

alter SEQUENCE seq_account restart with 300000000;

alter SEQUENCE seq_tc_account_balance restart with 300000000;

alter SEQUENCE seq_productorder restart with 300000000;

标红的300000000为需要修改的序列号开始值,请根据实际需要修改该值;

1.2.4        恢复sequence

只有需要回滚恢复sequence时才操作此步骤!

参考修改部分,起始值为修改前备份的取值;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值