ITPub博客

首页 > 数据库 > Oracle > 关于这次oracle数据迁移未添加NLS_LANG参数的记录

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

原创 Oracle 作者:kakaxi9521 时间:2016-12-15 14:15:38 0 删除 编辑
上周做了次数据的迁移,数据量不到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博客 ” ,链接:https://blog.itpub.net/21374452/viewspace-2130668/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 手工创建AWR快照
请登录后发表评论 登录
全部评论

注册时间:2009-04-13

  • 博文量
    136
  • 访问量
    179046