8.6.8 使用Oracle数据库
数据库安装完成后,Oracle服务自动启动,接着就可以登录Oracle了,如下所示:[oracle@oracledb ~]$ ps -ef|grep ixdba
oracle 28279 1 0 02:29 ? 00:00:00 ora_pmon_ixdba
oracle 28281 1 0 02:29 ? 00:00:00 ora_vktm_ixdba
oracle 28285 1 0 02:29 ? 00:00:00 ora_diag_ixdba
oracle 28287 1 0 02:29 ? 00:00:00 ora_dbrm_ixdba
oracle 28289 1 0 02:29 ? 00:00:00 ora_psp0_ixdba
oracle 28293 1 0 02:29 ? 00:00:00 ora_dia0_ixdba
oracle 28295 1 0 02:29 ? 00:00:00 ora_mman_ixdba
oracle 28297 1 0 02:29 ? 00:00:00 ora_dbw0_ixdba
oracle 28299 1 0 02:29 ? 00:00:00 ora_lgwr_ixdba
oracle 28301 1 0 02:29 ? 00:00:00 ora_ckpt_ixdba
oracle 28303 1 0 02:29 ? 00:00:00 ora_smon_ixdba
oracle 28305 1 0 02:29 ? 00:00:00 ora_reco_ixdba
oracle 28307 1 0 02:29 ? 00:00:00 ora_mmon_ixdba
oracle 28309 1 0 02:29 ? 00:00:00 ora_mmnl_ixdba
oracle 28311 1 0 02:29 ? 00:00:00 ora_d000_ixdba
oracle 28313 1 0 02:29 ? 00:00:00 ora_s000_ixdba
oracle 28321 1 0 02:29 ? 00:00:00 ora_smco_ixdba
oracle 28323 1 0 02:29 ? 00:00:00 ora_fbda_ixdba
oracle 28325 1 0 02:29 ? 00:00:00 ora_qmnc_ixdba
oracle 28340 1 0 02:29 ? 00:00:00 ora_w000_ixdba
oracle 28342 1 0 02:29 ? 00:00:00 ora_q000_ixdba
oracle 28344 1 0 02:29 ? 00:00:00 ora_q001_ixdba
oracle 28360 28246 0 02:32 pts/1 00:00:00 grep ixdba
[oracle@oracledb ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.1.0.6.0 - Production on Sun Feb 22 11:22:01 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for Linux: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production
为了保证Oracle在下次系统重启后,能自动启动服务,这里我们可以通过一个Shell脚步来实现这个功能。假定脚步名称为/app/oracle/oraclestart.sh,其内容如下:#!/bin/sh
su - oracle<
exportORACLE_SID=ixdba
lsnrctl start
sqlplus /nolog<
conn / as sysdba
startup
exit
EOF
exit
EON
注意,此脚步是以root用户身份执行的。
在上面的这个脚步中,EOF或EON只是一个分界符,这个分界符可以用你喜欢的任意字符代替,只不过大家都习惯了用EOF或EON来表示。当Shell在执行脚步时,发现"<
将此脚步加入到/etc/rc.local文件,以保证系统重启时自动加载。[root@localhost ~]#echo "/app/oracle/oraclestart.sh">>/etc/rc.local
【责任编辑:云霞 TEL:(010)68476606】
点赞 0