本例将时区设置为 Asia/Shanghai
步骤如下:
1)root 用户下修改时区
# cd /root
# vi .bashrc //打开配置文件 .bashrc
添加:export TZ=‘Asia/Shanghai’
添加后文件完整内容如下:
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export TZ='Asia/Shanghai' //此行为新加内容
2)oracle 用户下修改时区
# su - oracle
$ vi .bash_profile //打开配置文件.bash_profile
添加:export TZ=‘Asia/Shanghai’
添加后文件完整内容如下:
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
... //此处省略数据库环境变量配置信息
export TZ='Asia/Shanghai' //此处为新加内容
修改完毕!问题解决!