合理配置Windows下Oracle10g的服务
 
Oracle10g安装后,会形成如下的服务,默认情况下很多服务都是自启动的,如果不常操作本机的Oracle数据库,可以将其设置为手动启动,这样可以大大提高系统运行速度。
 
 
如何合理配置这些服务,需要对各个服务的作用做个了解才行:
 
OracleServiceORCL:数据库的主服务,此服务的必须启动才能使用Oracle。此服务的命名规则是OracleService+全局数据库名称
OracleOraDb10g_home1TNSListener:Orace监听服务,如果有客户端需要连接到数据库,此服务必须打开。
OracleOraDb10g_home1iSQL*Plus:Oracle iSQL*Plus服务,只有在Web页面中使用iSQL*Plus时候才需要启动。
OracleJobSchedulerORCL:定时器的服务进程。
OracleDBConsoleorcl:oracle数据库控制台,启动之,10gR2里通过http://hostname/ip:1158/em进入数据库管理控制台。
 
有了上面的服务说明,配置服务就心中有数了。
 
下面是一个典型的配置,我本机安装了一个Oracle10g的服务器,没有安装客户端,但是我同时还想连接别的Oracle数据库,而我本地的数据库不常用,我仅仅开了一个服务:OracleOraDb10g_home1TNSListener
 
并配置listener.ora
# listener.ora Network Configuration File: F:\oracle\product\10.2.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
    (SID_LIST =
        (SID_DESC =
            (SID_NAME = PLSExtProc)
            (ORACLE_HOME = F:\oracle\product\10.2.0\db_1)
            (PROGRAM = extproc)
        )
        (SID_DESC =                    
                (GLOBAL_DBNAME = ORCL)                    
                (ORACLE_HOME = F:\oracle\product\10.2.0\db_1)                                    
                (SID_NAME = ORCL)                    
        )    
    )

LISTENER =
    (DESCRIPTION_LIST =
        (DESCRIPTION =
            (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
            (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
        )
    )
 
配置tnsnames.ora
# tnsnames.ora Network Configuration File: F:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

ORCL =
    (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
        (CONNECT_DATA =
            (SERVER = DEDICATED)
            (SERVICE_NAME = orcl)
        )
    )

EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
        (ADDRESS_LIST =
            (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
        )
        (CONNECT_DATA =
            (SID = PLSExtProc)
            (PRESENTATION = RO)
        )
    )

# CBOSS开发库
CMS1 =                                                    
    (DESCRIPTION =
        (ADDRESS_LIST =
            (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.101)(PORT = 1521))
        )
        (CONNECT_DATA =
            (SERVICE_NAME = cms1)
        )
    )        
    
# HNTEST2
CMS2 =
    (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.102)(PORT = 1521))
        (CONNECT_DATA =
            (SERVER = DEDICATED)
            (SERVICE_NAME = cms2)
        )
    )
 
其中CMS1、CMS2是连接其他的Oracle数据库。ORCL是本机的数据库。
 
 
如果是Oracle9i,可以参考文章: