关于这次oracle数据迁移未添加NLS_LANG参数的记录

上周做了次数据的迁移,数据量不到40G的样子,迁移发生在12月8日周四晚,最大的一个用户数据量36G。
迁移比较快,1个小时左右就完成了。
周五开发人员那边没有发现异样,直到到12月12日星期一,开发人员反映有的表的comments存在乱码的现象。
突然发现所有的表的comments都出现乱码现象,离迁移完成已经过去3天,不能做回退,只能手动更改注释,比对数据,这个过程比较痛苦,万幸的是数据库比较小,影响范围比较小。
以后做导出时可以参考一下下面的备份脚本,export_full.sh

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME

. ~/.bash_profile

export EXPLOG=/home/oracle/backup/fullexp.log
echo `date` "begin exp" >> $EXPLOG
mknod /db/backup/exp/export_pipe p
nohup /bin/gzip < /db/backup/exp/export_pipe > /db/backup/exp/expfull_`date +%Y%m%d`.dmp.gz &
exp userid=expname/passwd file=/db/backup/exp/export_pipe full=y statistics=none buffer=800000 >> $EXPLOG 2>> $EXPLOG
echo `date` "end exp" >> $EXPLOG
rm -rf /db/backup/exp/export_pipe

scp /db/backup/exp/expfull_`date +%Y%m%d`.dmp.gz backup@xx.xx.xx.xx:/exportbackup

###################.bash_profile文件内容
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

ORACLE_BASE=/db/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0.3
ORACLE_SID=testdb
PATH=$ORACLE_HOME/bin:$PATH:$ORACLE_HOME/OPatch:/sbin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export NLS_LANG=american_america.zhs16gbk    #就是这个参数,在导入导出的时候一定要设置#
export LD_LIBRARY_PATH
export ORACLE_BASE
export ORACLE_HOME
export ORACLE_SID
export PATH


export PATH
unset USERNAME

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21374452/viewspace-2130668/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/21374452/viewspace-2130668/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值