今天碰到了测试环境和生产环境默认日期格式不一致的问题。
测试环境 YY/MM/DD
生产环境 YYYYMMDD
2者之间默认的Default Date Format不同,在DBS Control中的Date Format的标志都是0,既默认应该为YY/MM/DD(在V2R5之前有个Default Date
Format的选项),不是通过DBS Control来更改默认的日期格式的。
Teradata Forum 上有个例子:
Assuming this is an MP-RAS system and at least R5.0
a. Logon to Teradata UNIX node (PDN): (log in as root)
b. Look for following file: /tpasw/etc/tdlocaledef.txt and edit the following line to look like this:
DATE {"YYYY-MM-DD"}
c. Save with :wq! in "vi" editor because this is Read Only.
d. Then execute the following command to post it to all of the other nodes and internal:
/tpasw/bin/tdlocaledef -input /tpasw/etc/tdlocaledef.txt -output new
e. Restart with tpareset to make it take effect.
也可如下:
1.进入/opt/teradata/tdat/tdbms/12.00.02.01/bin/下
2.然后输入tdlocaledef -reverse current -source mytdlocaledata.txt。( 输出文件mytdlocaledata.txt,要么在当前目录下,要么 在/etc/opt/teradata/tdconfig下面)
3.编辑mytdlocaledata.txt文件,修改缺省日期格式等
4.输入tdlocaledef -input mytdlocaledata.txt -output new
6.重新启动数据,使修改生效。
晚上进行了修改的操作,从生产同步了tdlocaledef.txt文件,导入到测试环境中,重启数据库TPA,修改成功
阅读(1338) | 评论(0) | 转发(0) |