在RHEL5.2上安装Oracle 数据库10g(三)

三、安装 Oracle 10g
 
    使用 oracle 帐户登录。指定数据库名称 (ORACLE_SID)。该名称通常不多于五个字符。对此安装使用 之前环境变量使用的ORCL。前面折腾了这么长时间,终于到安装了,也该上图了,要不敲字太累。
      [root@RHEL ~]# mount.cifs //10.10.10.198/Ora10G  /usr/app/oracle/install  -o  username=administrator,password=123456
      [oracle@RHEL oracle]$ cd /usr/app/oracle/install
      [oracle@RHEL install]$ ./runInstaller
Starting Oracle Universal Installer...
Checking installer requirements...

(因为环境变量配置正确,一切尽在把握)

(不知道干啥的)
 


(开始自检,这部分主要是内核参数等要配置正确)


(安装清单...)

(开始安装咯...)


(开始配置...)

(配置数据库中...)

(创建数据库...)

 
(数据库创建成功...)

(配置完成,需要执行上面两个脚本)
    [oracle@RHEL ~]$ su - root
Password:
    [root@RHEL ~]# /usr/app/oracle/oraInventory/orainstRoot.sh
Changing permissions of /usr/app/oracle/oraInventory to 770.
Changing groupname of /usr/app/oracle/oraInventory to oinstall.
The execution of the script is complete
    [root@RHEL ~]# /usr/app/oracle/product/10.2.0/db_1/root.sh
Running Oracle10 root.sh script...

The following environment variables are set as:
      ORACLE_OWNER= oracle
      ORACLE_HOME=  /usr/app/oracle/product/10.2.0/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
    Copying dbhome to /usr/local/bin ...
    Copying oraenv to /usr/local/bin ...
    Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.

(至此,安装完毕...)
      带着喜悦的心情,查看一下战果。
      [oracle@RHEL ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Dec 31 12:24:26 2008

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

SQL> select instance_name,status from v$instance;

INSTANCE_NAME      STATUS
---------------- ------------
orcl                        OPEN

SQL> select sysdate from dual;               

SYSDATE
---------
31-DEC-08
      好像万事大吉了。可当我登录EM,却显示数据库未启动,并且Listener也没起来。可刚才SQL里明明是已经启动了。检查一下监听器的状态:
      [oracle@RHEL ~]$ lsnrctl
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 31-DEC-2008 12:30:31

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.
      LSNRCTL> services
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
TNS-12541: TNS:no listener
  TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
    Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=RHEL.smnpc.com)(PORT=1521)))
TNS-12541: TNS:no listener
  TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
    Linux Error: 111: Connection refused
      LSNRCTL> exit
      检查一下监听器配置,好像也没什么问题:
      [oracle@RHEL ~]$ gedit /usr/app/oracle/product/10.2.0/db_1/network/admin/sqlnet.ora
      [oracle@RHEL ~]$ gedit /usr/app/oracle/product/10.2.0/db_1/network/admin/tnsnames
      [oracle@RHEL ~]$ gedit /usr/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
      [oracle@RHEL ~]$ tnsping ORCL

TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 30-DEC-2008 21:43:38

Copyright (c) 1997, 2005, Oracle.  All rights reserved.

Used parameter files:
/usr/app/oracle/product/10.2.0/db_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = RHEL.smnpc.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))
TNS-12541: TNS:no listener
      手动起一下服务:
      LSNRCTL> start
Starting /usr/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...

TNS-12537: TNS:connection closed
  TNS-12560: TNS:protocol adapter error
  TNS-00507: Connection closed
    Linux Error: 29: Illegal seek
      好像不起作用,重新配置一下监听:
      [oracle@RHEL ~]$ netca

Oracle Net Services Configuration:
Configuring Listener:LISTENER
Listener configuration complete.
Oracle Net Listener Startup:
      Running Listener Control:
          /usr/app/oracle/product/10.2.0/db_1/bin/lsnrctl start LISTENER
      Listener Control complete.
      Listener start failed. Listener may already be running.
Stopping Oracle Net Listener:
      Running Listener Control:
          /usr/app/oracle/product/10.2.0/db_1/bin/lsnrctl stop LISTENER
      Listener Control complete.
      Listener stop failed.
      Deleted listener: LISTENER
Oracle Net Services configuration successful. The exit code is 0
      再次查看监听状态,依然有问题:
      [oracle@RHEL ~]$ lsnrctl

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 30-DEC-2008 21:49:18

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

      LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=RHEL.smnpc.com)(PORT=1521)))
TNS-12541: TNS:no listener
  TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
    Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
TNS-12541: TNS:no listener
  TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
    Linux Error: 111: Connection refused
      LSNRCTL> exit
      查找了一下原因,还是在2.10中提到的,网络配置问题:
      [oracle@RHEL ~]$ su - root
      Password:
      [root@RHEL ~]# gedit /etc/hosts
      修改成如下配置,即取消注释:
# Do not remove the following line, or various programs
# that require network functionality will fail.
::1      localhost.localdomain      localhost      RHEL
127.0.0.1      RHEL.smnpc.com      localhost RHEL
10.10.10.197         RHEL.smnpc.com  RHEL
      [oracle@RHEL ~]$ su - oracle
      [oracle@RHEL ~]$ lsnrctl
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 30-DEC-2008 21:51:38

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

      LSNRCTL> start
Starting /usr/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /usr/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /usr/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=RHEL.smnpc.com)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=RHEL.smnpc.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                                        LISTENER
Version                                    TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                              30-DEC-2008 21:51:47
Uptime                                      0 days 0 hr. 0 min. 0 sec
Trace Level                            off
Security                                  ON: Local OS Authentication
SNMP                                          OFF
Listener Parameter File    /usr/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File                /usr/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=RHEL.smnpc.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

      再次登录EM。终于正确了,OK!


(登录EM)

(第一次登录,有个协议)

(成功)

      在RHEL5.2上安装Oracle 数据库10g至此结束。此外,除了官方的文档外,这里还参考了下面这篇文章。也比较喜欢,很整洁清新。地址如下:
《 RHEL 5 环境 ORACLE10G(32位) 安装》: http://neptune.javaeye.com/blog/165863


转自 http://blog.sina.com.cn/s/blog_3f2ef1180100bsw2.html

你可能感兴趣的:(oracle,数据库,职场,休闲)