Linux下安装配置Oracle(二)

2014-11-24 18:39:11 · 作者: · 浏览: 1
all_temp/


[oracle@localhost ~]$cd database


[oracle@localhost ~]$ ./runInstaller #开始执行安装,等待一会出现



1.1后续安装与window上基本一致(略)


后续安装与windows上基本一致,最后完成后出现如下图,切换用户到root下执行下两个配置脚本即可:


执行[root@localhost /]#/oracle/oraInventory/orainRoot.sh


执行[root@localhost /]#/oracle/product/10.2.0/root.sh如下所示,输入/oracle/product/ 10.2.0/bin/



执行[oracle@localhost ~]$dbca或图形菜单进行,注意下面一致即可(sys/oracletest)



[oracle@localhost ~]$netca或图形菜单


最终 listener.ora


SID_LIST_LISTENER =


(SID_LIST =


(SID_DESC =


(GLOBAL_DBNAME = oracletest)


(ORACLE_HOME = /oracle/product/10.2.0/)


(SID_NAME = oracletest)


)


)



LISTENER =


(DESCRIPTION_LIST =


(DESCRIPTION =


(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))


)


)



tnsnames.ora


ORACLETEST =


(DESCRIPTION =


(ADDRESS_LIST =


(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))


)


(CONNECT_DATA =


(SERVICE_NAME = oracletest)


)


)



[oracle@localhost ~]$ emctl start| stop| status dbconsole


http://hostname:1158/em


[oracle@localhost ~]$ isqlplusctl startstart| stop| status


http://hostname:5560/isqlplus



配置机器启动时自动启动数据库,监听与EM管理平台


停止时自动停止数据库,监听与EM管理平台


修改Oracle系统配置文件/etc/oratab,把AUTO域由默认的N设置为Y,使oracle 自带的dbstart和dbshut才能够发挥作用


[root@localhost /]#vi /etc/oratab


创建启动脚本


1)[oracle@localhost ~] vi $ORACLE_HOME/bin/dbstart 找到第78行ORACLE_HOME_LISTNER=…


改为ORACLE_HOME_LISTNER=$ORACLE_HOME,


[oracle@localhost ~]cd $ORACLE_HOME/bin/


手动运行 [oracle@localhost ~] ./ dbstart


[oracle@localhost ~] ./ dbshut


测试正常与否


(日志:$ORACLE_HOME/startup.log与$ORACLE_HOME/shutdown.log)


2) [root@localhost /]#vi /etc/init.d/oracle10g


#!/bin/sh


# description: Oracle auto start-stop script.


# chkconfig: - 20 80


# Set ORA_HOME to be equivalent to the $ORACLE_HOME


# from which you wish to execute dbstart and dbshut;


#


# Set ORA_OWNER to the user id of the owner of the


# Oracle database in ORA_HOME.


ORA_HOME=/oracle/product/10.2.0/


ORA_OWNER=oracle


if [ ! -f $ORA_HOME/bin/dbstart ]


then


echo "Oracle startup: cannot start"


exit


fi


case "$1" in


'start')


# Start the Oracle databases:


# The following command assumes that the oracle login


# will not prompt the user for any values


su - $ORA_OWNER -c $ORA_HOME/bin/dbstart


#su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"


su - $ORA_OWNER -c "$ORA_HOME/bin/emctl start dbconsole"


;;


'stop')


# Stop the Oracle databases:


# The following command assumes that the oracle login


# will not prompt the user for any values


su - $ORA_OWNER -c "$ORA_HOME/bin/emctl stop dbconsole"


su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"


su - $ORA_OWNER -c $ORA_HOME/bin/dbshut


;;


'restart')


$0 stop


$0 start


;;


esac


3) [root@localhost ~]# chmod 750 /etc/init.d/oracle10g


[root@localhost ~]# ln -s /etc/init.d/oracle10g /etc/rc0.d/K10oracle10g


[root@localhost ~]#ln -s /etc/init.d/oracle10g /etc/rc3.d/S99oracle10g


[root@localhost ~]# chkconfig --list oracle10g


[root@localhost ~]# chkconfig --level 345 oracle10g on


[root@localhost ~]# chkconfig --list oracle10g