Archive

Archive for the ‘DB’ Category

linux下安装Oracle Database 10g Express Universal Edition

March 17th, 2011 tonyxu No comments

1、首先,上传oracle-xe-univ-10.2.0.1-1.0.i386.rpm到相应的目录,

例如:/home/oracle

2、执行安装

[oracle@mylinux ~]$ rpm -ivh oracle-xe-univ-10.2.0.1-1.0.i386.rpm
error: Failed dependencies:
        libaio >= 0.3.96 is needed by oracle-xe-univ-10.2.0.1-1.0.i386
    Suggested resolutions:
        libaio-0.3.102-1.i386.rpm

切换到root用户,

[root@mylinux oracle]# rpm -ivh libaio-0.3.96-7.i386.rpm
warning: libaio-0.3.96-7.i386.rpm: V3 DSA signature: NOKEY, key ID 025e513b
Preparing…                ########################################### [100%]
   1:libaio                 ########################################### [100%]

 

[root@mylinux oracle]# rpm -ivh oracle-xe-univ-10.2.0.1-1.0.i386.rpm
Preparing…                ########################################### [100%]
   1:oracle-xe-univ         ########################################### [100%]
Executing Post-install steps…
You must run ‘/etc/init.d/oracle-xe configure’ as the root user to
configure the database.

 

[root@mylinux oracle]# /etc/init.d/oracle-xe configure

Oracle Database 10g Express Edition Configuration
————————————————-
This will configure on-boot properties of Oracle Database 10g Express
Edition.  The following questions will determine whether the database should
be starting upon system boot, the ports it will use, and the passwords that
will be used for database accounts.  Press <Enter> to accept the defaults.
Ctrl-C will abort.

Specify the HTTP port that will be used for Oracle Application Express [8080]:8080

Specify a port that will be used for the database listener [1521]:1521

Specify a password to be used for database accounts.  Note that the same
password will be used for SYS and SYSTEM.  Oracle recommends the use of
different passwords for each database account.  This can be done after
initial configuration:
Confirm the password:

Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:y

Starting Oracle Net Listener…Done
Configuring Database…Done
Starting Oracle Database 10g Express Edition Instance…Done
Installation Completed Successfully.
To access the Database Home Page go to "http://127.0.0.1:8080/apex"
You have new mail in /var/spool/mail/root

截图00

[oracle@mylinux ~]$ $ORACLE_HOME/bin/sqlplus

SQL*Plus: Release 10.2.0.1.0 – Production on Wed Mar 16 16:16:14 2011

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

Enter user-name: hr@xe
Enter password:

Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 – Production

SQL>

SQL> select table_name from user_tables;

TABLE_NAME
——————————
REGIONS
LOCATIONS
DEPARTMENTS
JOBS
EMPLOYEES
JOB_HISTORY
COUNTRIES

7 rows selected.

SQL>

Categories: DB, unix&linux Tags: ,

oralce学习日记之启动 Enterprise Manager dbconsole 进程

September 25th, 2010 tonyxu 1 comment

当安装 Oracle 软件时,Oracle Universal Installer 将安装 Oracle Enterprise Manager Database Control。Enterprise Manager Database Control 提供了一个基于 Web 的界面,可以使用这个界面来管理 Oracle 例程和数据库。

要从客户端浏览器访问 Oracle Enterprise Manager Database Control,则必须启动 dbconsole 进程。dbconsole 进程在安装之后自动启动。如果该进程没有启动,则您必须在命令行下按如下方式人工启动它:
1、作为 oracle 用户登录到操作系统上。执行以下命令来启动 dbconsole 进程:
emctl start dbconsole
2、可以通过执行以下命令来检查 dbconsole 进程的状态:
emctl status

C:\Documents and Settings\tony>emctl start dbconsole
Environment variable ORACLE_SID not defined. Please define it.

提示ORACLE_SID无法定义

C:\Documents and Settings\tony>set oracle_sid=orcl

C:\Documents and Settings\tony>emctl start dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserve
http://eproe-tony:1158/em/console/aboutApplication
Agent Version     : 10.1.0.4.1
OMS Version       : 10.1.0.4.0
Protocol Version  : 10.1.0.2.0
Agent Home        : D:\oracle\product\10.2.0\db_1\eproe-tony_orc
Agent binaries    : D:\oracle\product\10.2.0\db_1
Agent Process ID  : 5036
Agent Process ID  : 5036
Agent URL         :
http://eproe-tony:3938/emd/main
Started at        : 2010-09-25 14:14:25
Started by user   : SYSTEM
Last Reload       : 2010-09-25 14:14:25
Last successful upload                       : 2010-09-25 14:53:
Total Megabytes of XML files uploaded so far :     2.70
Number of XML files pending upload           :        0
Size of XML files pending upload(MB)         :     0.00
Available disk space on upload filesystem    :    88.69%
Agent is already started. Will restart the agent
This will stop the Oracle Enterprise Manager 10g Database Contro
nue [y/n] :y
The OracleDBConsoleorcl service is stopping……………
The OracleDBConsoleorcl service was stopped successfully.

C:\Documents and Settings\tony>emctl start dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserve
http://eproe-tony:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control …The O
cl service is starting…………….
The OracleDBConsoleorcl service was started successfully.

检查dbconsole的状态时有异常信息如下,

C:\Documents and Settings\tony>emctl status dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserve
http://eproe-tony:1158/em/console/aboutApplication
EM Daemon is not running.
—————————————————————-
Logs are generated in directory D:\oracle\product\10.2.0\db_1/ep
sman/log

奇怪的是,过一会就显示正常了,

C:\Documents and Settings\tony>emctl status dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
http://eproe-tony:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
——————————————————————
Logs are generated in directory D:\oracle\product\10.2.0\db_1/eproe-tony_orcl/sy
sman/log

检查agent的状态

C:\Documents and Settings\tony>emctl status agent
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
—————————————————————
Agent Version     : 10.1.0.4.1
OMS Version       : 10.1.0.4.0
Protocol Version  : 10.1.0.2.0
Agent Home        : D:\oracle\product\10.2.0\db_1\eproe-tony_orcl
Agent binaries    : D:\oracle\product\10.2.0\db_1
Agent Process ID  : 224
Agent Process ID  : 224
Agent URL         :
http://eproe-tony:3938/emd/main
Started at        : 2010-09-25 14:58:13
Started by user   : SYSTEM
Last Reload       : 2010-09-25 14:58:13
Last successful upload                       : 2010-09-25 15:08:16
Total Megabytes of XML files uploaded so far :     0.10
Number of XML files pending upload           :        0
Size of XML files pending upload(MB)         :     0.00
Available disk space on upload filesystem    :    88.69%
—————————————————————
Agent is Running and Ready

Categories: DB, oracle Tags: