您查看的文章来源于http://www.oklinux.cn
4. 启动em
touch /var/lock/oracle
$ORACLE_HOME/bin/emctl start dbconsole
问题:
Timezone mismatch: The agentTZRegion value (GMT) in
/opt/ora10/aaron-pc_tmp/sysman/config/emd.properties
does not match the current environment TZ setting().
The dbconsole cannot run with this mismatch.
解决方法:
$emctl resetTZ agent
$emctl start dbconsole
就可以启动成功了。
经过1-3步之后就可以通过sqlplus连接数据库了,如果需要在浏览器上访问,需要启动第4步。
5. 用sys用户登录之后startup实例,才可以用其他用户登录
$su - oracle
$sqlplus "sys/aaron as sysdba"
SQL>startup
SQL>quit
$sqlplus "staimsp/staimsp"
启动脚本
oracle占用资源比较多,不设置默认启动,写启动脚本,用的时候再启动。
-------------------------------------------------------------
#!/bin/bash
#name: runoracle.sh
if [ $UID != 1002 ]
then
echo "should run by user 'oracle'"
exit 1
elif [ $# != 1 ]
then
echo "Usage: `basename $0` start|stop|restart"
exit 2
fi
case "$1" in
start)
echo -n "Starting Oracle:"
$ORACLE_HOME/bin/lsnrctl start
$ORACLE_HOME/bin/dbstart
touch /var/lock/oracle
$ORACLE_HOME/bin/emctl start dbconsole
echo
echo "OK!"
;;
stop)
echo -n "Shutdown Oracle:"
$ORACLE_HOME/bin/lsnrctl stop
$ORACLE_HOME/bin/dbshut
rm -f /var/lock/oracle
$ORACLE_HOME/bin/emctl stop dbconsole
echo
echo "OK!"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart"
exit 2
esac
exit 0
-------------------------------------------------------------
脚本放到/home/oracle/bin中,用oracle用户启动
$su - oracle
$runorcale.sh
启动之后用sys用户startup数据库:
$sqlplus "sys/aaron as sysdba"
SQL>startup
然后就可以用了。
QA
1. 导入中文数据乱码问题解决方法: