Oracle1
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时才操作此步骤!
参考修改部分,起始值为修改前备份的取值;