10.安装并创建数据库
 
 
  
 
 
 
  
 
 
  
 
 
  
 
 
 
  
 
请以KDE视窗模式下进入.否则无法执行runInstaller
 
 
  
[oracle@oracle ~]$ ./runInstaller
Starting Oracle Universal Installer...
 
Checking installer requirements...
 
Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
                                      Passed
 
 
All installer requirements met.
 
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2009-06-07_12-13-22PM. Please wait ...[oracle@localhost database]$ Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using 'localhost:0.0' as the value of the DISPLAY variable.
        at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
        at sun.awt.X11GraphicsEnvironment.<clinit>(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Unknown Source)
        at java.awt.Window.init(Unknown Source)
        at java.awt.Window.<init>(Unknown Source)
        at java.awt.Frame.<init>(Unknown Source)
        at oracle.ewt.popup.PopupFrame.<init>(Unknown Source)
        at oracle.ewt.lwAWT.BufferedFrame.<init>(Unknown Source)
        at oracle.sysman.oio.oioc.OiocOneClickInstaller.<init>(OiocOneClickInstaller.java:378)
        at oracle.sysman.oio.oioc.OiocOneClickInstaller.main(OiocOneClickInstaller.java:2091)
 
解决办法:
 
如果还不成功,
 
 
 
 
 
 
  
  <?xml:namespace prefix = v /><?xml:namespace prefix = o />

根据提示,此时我们需要切换到两个目录下,分别执行程序
cd /u01/app/oracle/oraInventory/
. /orainstRoot.sh
cd /u01/app/oracle/product/10.2.0/db_1
./root.sh
然后点击 ok 即可,随即出现安装完成界面,点击退出即可。
IE 中输入 http://192.168.0.117:1158/em ,( 注意:此处的 192.168.0.117 是你的安装 oracle 的机子的 ip 地址 )即可出现以下登录界面:
 
以上会出现是否同意的信息,使管点击 I aggress 即可。
到此为止,安装已经全部结束,数据库也创建了。 ( 有人可能会在安装数据库的时候没有创建数据库,这时就可以用 dbca 创建, 注意: dbca 是创建数据库帮手,可以帮你创建数据库 )
如果上图中出现 Java 的错误提示信息,则需要编辑 /u01/app/oracle/product/10.2.0/db_1/sysman/config ,在此文件中加入
agentTZRegin=Asia/Shanghai
11. 下面是对数据库的管理:
[oracle@oracle ~]$ emctl stop dbconsole (用于停止监听器)
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0 
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://oracle.example.com:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ...
 ... Stopped.
[oracle@oracle ~]$
[oracle@oracle ~]$ emctl start dbconsole (用于开启监听器)
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0 
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://oracle.example.com:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control ............... started.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/10.2.0/db_1/oracle.example.com_orcl/sysman/log
[oracle@oracle ~]$
如果监听程序没有开启,执行以下命令可以开启:
[oracle@oracle ~]$ lsnrctl start
 
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 21-MAR-2010 22:45:57
 
Copyright (c) 1991, 2005, Oracle. All rights reserved.
 
Starting /u01/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 /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle.example.com)(PORT=1521)))
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                21-MAR-2010 22:45:57
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle.example.com)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
 Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@oracle ~]$
文件 /u01/app/oracle/product/10.2.0/db_1/install/portlist.ini 中定义了监听的端口:
iSQL*Plus HTTP port number =5560
Enterprise Manager Console HTTP Port (orcl) = 1158
Enterprise Manager Agent Port (orcl) = 3938
查看监听端口:
[oracle@oracle install]$ netstat -tunlp|grep 1158
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:1158                0.0.0.0:*                   LISTEN      8934/java          
[oracle@oracle install]$
 
[oracle@oracle ~]$ sqlplus / as sysdba (以 sysdba 的身份登录数据库)
 
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Mar 21 22:56:50 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
 
SQL> select * from v$instance;
INSTANCE_NUMBER INSTANCE_NAME
--------------- ----------------
HOST_NAME
----------------------------------------------------------------
VERSION           STARTUP_T STATUS     PAR         THREAD# ARCHIVE LOG_SWITCH_WAIT
----------------- --------- ------------ --- ---------- ------- ---------------
LOGINS       SHU DATABASE_STATUS   INSTANCE_ROLE       ACTIVE_ST BLO
---------- --- ----------------- ------------------ --------- ---
               1 orcl
oracle.example.com
10.2.0.1.0    21-MAR-10 OPEN NO       1 STOPPED
ALLOWED    NO ACTIVE             PRIMARY_INSTANCE   NORMAL    NO
SQL> select INSTANCE_NAME from v$instance; (查看当前运行的实例)
INSTANCE_NAME
----------------
orcl
[oracle@oracle database]$ sqlplus / as sysdba
 
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Mar 22 08:01:33 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
 
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.
 
Total System Global Area 356515840 bytes
Fixed Size                  1219400 bytes
Variable Size             113247416 bytes
Database Buffers          239075328 bytes
Redo Buffers                2973696 bytes
SQL> alter database mount;
 
Database altered.
 
SQL> alter database open;
 
Database altered.
 
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options