一、挂载光盘拷贝Oracle
将Oracle10g_linux装入虚拟光驱,并将光盘挂载
# mount /mnt/cdrom
注:关于光盘挂载的操作,见“
Linux的mount命令简介
”
然后将Oracle拷贝到硬盘中:
# cp -r -b /mnt/cdrom/* /tmp/ora10
注:Oracle安装必须要将拷到硬盘上,否则将提示:
Error: OUI cannot be launched because the current working directory is set on the CD-ROM mount point. Launching OUI from this directory will make it difficult to unmount the disk later in the installation. Please change the working directory and relaunch OUI.
二、安装Oracle
用oracle用户登录一个视窗界面(必须),然后执行安装
$ /tmp/ora10g/runInstaller -ignoreSysPrereqs
注:-ignoreSysPrereqs 是为了跳过安装时的系统版本检测。因为Oracle安装时会进行操作系统检测,不在其指定操作系统列表之中则无法安装。
也可以修改linux的系统参数/etc/redhat-release来做,但是比较麻烦。
之后进入安装界面,跟Windows下没有什么区别。
在开始使用中文界面
安装时发现出现乱码,搞了半天没解决,最后直接把操作系统改成英文了,英文界面下安装还比较方便一些。
安装时会两次弹出提示框,需要手动执行某个指定的shell
需要切换到root用户下,执行文件中的某个shell
$ su root
# ./xxxx.sh
关于shell的使用方法,可以参见“Linux shell程序设计”
注:此次安装只配置了256M内存,但依然安装成功,可见并不是非要1G内存不可。不过安装之后机子超慢,但至少这不是技术限制。
三、配置Oracle
1、修改listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.3)(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PlsExtProc)
(ORACLE_HOME = /opt/ora10g/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = dodo)
(ORACLE_HOME = /opt/ora10g/product/10.2.0/db_1)
(SID_NAME = dodo)
)
)
2、修改tnsnames.ora
DODO =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.3)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dodo)
)
)
3、增加dbstart 到rc.local
$ vi /opt/ora10g/product/10.2.0/db_1/bin/dbstart_self
ORACLE_SID=dodo
sqlplus /nolog <<!
connect / as sysdba
startup
!
lsnrctl start
$ chmod +577 dbstart_self
$ su root
# vi /etc/rc.local
su - oracle 'dbstart_self' >>/var/log/dbstart_self.log
以上配置完成后重启系统后即可远程连接。
四、查看进程
Linux下的进程操作方法见“Linux 进程管理”
# ps -aef | grep oracle
oracle 1982 1 0 09:09 ? 00:00:01 ora_pmon_dodo
oracle 1984 1 0 09:09 ? 00:00:00 ora_mman_dodo
oracle 1986 1 0 09:09 ? 00:00:01 ora_dbw0_dodo
oracle 1988 1 0 09:09 ? 00:00:00 ora_lgwr_dodo
oracle 1990 1 0 09:09 ? 00:00:02 ora_ckpt_dodo
oracle 1992 1 0 09:09 ? 00:00:01 ora_smon_dodo
oracle 1994 1 0 09:09 ? 00:00:00 ora_reco_dodo
oracle 1996 1 0 09:10 ? 00:00:01 ora_cjq0_dodo
oracle 1998 1 0 09:10 ? 00:00:00 ora_d000_dodo
oracle 2000 1 0 09:10 ? 00:00:00 ora_s000_dodo
oracle 2010 1 0 09:10 ? 00:00:00 ora_qmnc_dodo
oracle 2012 1 0 09:10 ? 00:00:03 ora_mmon_dodo
oracle 2014 1 0 09:10 ? 00:00:01 ora_mmnl_dodo
oracle 2017 1 0 09:10 ? 00:00:00 /opt/ora10g/product/10.2.0/db_1/bin/tnslsnr LISTENER -inherit
oracle 2599 2343 0 09:10 ? 00:00:00 /opt/ora10g/product/10.2.0/db_1/bin/ocssd.bin
oracle 2799 2798 0 09:13 pts/1 00:00:00 -bash
oracle 2817 2799 0 09:13 pts/1 00:00:00 sqlplus
oracle 2821 1 0 09:14 ? 00:00:00 oracledodo (LOCAL=NO)
oracle 2825 1 0 09:16 ? 00:00:00 oracledodo (LOCAL=NO)
需要注意的是linux下的进程/线程的启动机制与windows是有区别的。
-The End-