6.启动数据库
1.启动
$ sqlplus " scott/tiger as sysdba"
将出现如下连接数据库信息:
SQL*Plus: Release 10.1.0.2.0 - Production on 星期三 3月 24 16:23:27 2004
Copyright (c) 1982, 2004, Oracle. All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
表明登录数据库系统成功,运行startup命令启动数据库。
SQL> startup
ORACLE instance started.
Total System Global Area 336356520 bytes
Fixed Size 279720 bytes
Variable Size 268435456 bytes
Database Buffers 67108864 bytes
Redo Buffers 532480 bytes
Database mounted.
Database opened.
SQL>
表示数据库正常启动。
2. 关闭Oracle10g 数据库
$ sqlplus "scott/tiger as sysdba" //以sysdba用户登录数据库
成功登录数据库系统后,运行shudown命令关闭数据库。
SQL> shutdown
3. 启动Oracle10g监听程序
Oracle的监听程序主要是为客户端的连接提供接口,在控制台窗口键入如下命令:
$ lsnrctl
将出现如下监听程序信息:
LSNRCTL for 32-bit Windows: Version 10.1.0.2.0 - Production on 24-3月 -2004 16
:59:51
Copyright (c) 1991, 2004, Oracle. All rights reserved.
欢迎来到LSNRCTL, 请键入"help"以获得信息。
LSNRCTL>
表明登录监听程序控制台成功,运行start命令启动监听程序。
LSNRCTL> start
将出现监听程序的一系列启动和配置情况信息列表。
信息行的最后一行是“The command completed successfully”字样时,监听程序启动成
功。
4. 关闭Oracle10g监听程序
运行stop命令关闭监听程序。
LSNRCTL> stop
7.创建自启动脚本
创建oracledb脚本到/etc/init.d/oracledb,内容如下
#!/bin/bash
#
# /etc/init.d/oracledb
#
# Run-level Startup script for the Oracle Instance, Listener, and
# Web Interface
export ORACLE_HOME=/opt/ora10
export ORACLE_SID=compiere
export PATH=$PATH:$ORACLE_HOME/bin
ORA_OWNR="oracle"
# if the executables do not exist -- display error
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi
# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display
case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
su $ORA_OWNR -c $ORACLE_HOME/bin/dbstart
touch /var/lock/oracle
su $ORA_OWNR -c $ORACLE_HOME/bin/emctl start dbconsole
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
su $ORA_OWNR -c $ORACLE_HOME/bin/dbshut
rm -f /var/lock/oracle
su $ORA_OWNR -c $ORACLE_HOME/bin/emctl stop dbconsole
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart|reload"
exit 1
esac
exit 0
设置权限,放到启动脚本中去
#chmod 755 /etc/init.d/oracledb
#update-rc.d oracledb defaults 99
7.使用企业管理器
启动控制台
#emctl start dbconsole
访问数据库控制器
http://localhost.localdomain:1158/em/
要提供sys/passwd as sysdba;
你要从一个客户端浏览器访问em 数据库控制器,必须要运行dbconsole进程.安装之后,dbconsole进程是自动会启动的.然后,如果这个集成没有启动,你可以向下面的命令行手工的启动它:
1.到$ORACLE_HOME/bin目录下
2.执行下面的命令: emctl start dbconsole
这样你就可以打开web浏览器,输入下面的http://hostnameortnumber/em
来访问em db control.
host那么是你的计算机的名字或地址.portnumber是em db control http的端口号,这是在安装的时候指定的.
默认的是1158 ,你可以在$ORACLE_HOME/install/portlist.ini文件中找到这个值.
如果实例启动了,EM就会显示db control登录页.你必须使用授权访问db control的用户登录到数据库.一开始是sys用户,
使用在安装的时候你确定的sys用户的密码.从connect as 下拉框选sysdba,然后点登录.这样就会出现db control的主页.
这是同Oracle 9i的不同的。其它的大家共同学习吧!
