4.1配置oracle的环境变量
[oracle@localhost ~]$export ORACLE_BASE=/home/mytools/programs/oracle/u01/app/oracle
[oracle@localhost ~]$export ORACLE_SID=ORCL
[oracle@localhost ~]$export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
[oracle@localhost ~]$export PATH=$PATH:$ORACLE_HOME/bin
4.2启动和关闭Oracle数据库
[oracle@localhost ~]$ su oracle
[oracle@localhost ~]$ sqlplus system/system as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Dec 29 23:45:16 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
(oracle已经启动,可正常访问,或者采用如下方式启动)
$sqlplus
SQL*Plus:Release 10.1.0.2.0 - Production on Sun Jun 13 22:27:48 2004
Copyright (c) 1982, 2004, Oracle.All rights reserved.
Enter user-name:/ as sysdba
Connected to an idle instance.
SQL>startup(启动oracle数据库实例)
SQL>shutdown immediate(关闭oracle数据库实例)
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>exit
4.3启动和停止Oracle Enterprise Manager数据库控制
$emctl start dbconsole
$emctl stop dbconsole
(说明:必须启动dbconsole才能访问http://localhost.localdomain:1158/em)
4.4启动和停止iSQL*Plus
$isqlplusctl start
$isqlplusctl stop
(说明:只有启动了isqlplusctl才可以使用url的形式访问,同时如果linux系统中iptables是开启状态的话,需要将5560的端口添加到开放列表中方可在其他机器上访问
http://localhost.localdomain:5560/isqlplus)
4.5启动和停止监听器
监听器接受客户端的连接请求,并在验证证书后创建数据库连接。要使用OEM或iSQL*Plus,必须先启动监听器。
$lsnrctl start
$lsnrctl stop
第五部分Oracle的卸载
5.1 运行$ORACLE_HOME/bin/localconfig delete
5.2 rm -rf $ORACLE_BASE/*
5.3 rm -f /etc/oraInst.loc /etc/oratab
5.4 rm -rf /etc/oracle
5.5 rm -f /etc/inittab.cssd
5.6 rm -f /usr/local/bin/coraenv /usr/local/bin/dbhome /usr/local/bin/oraenv
5.7 删除oracle用户和组。
(参考文档:http://www.oracle.com/technology/global/cn/pub/articles/smiley_10gdb_install.html)