Environment: Windows 2003 server SE, upgrading Oracle 10.2.0.4 standard edition to 22.214.171.124Objective: to be familiar with Oracle service and listener creation and deletion in case needed.
SummaryNormally, if you install Oracle 11g on Windows, it'll create listener and service automatically. In case you have deleted them and need to create back, here are the steps:Steps
1. delete Oracle Windows service (database and listener)
a. manually delete from registry run regedit or regedt32Open regedit and browse to the following keyHKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/ServicesFind the service name 'OracleOraDb11g_home1TNSListener' or 'OracleOraDb10g_home1TNSListener'right click it and export to a .reg file, then delete the key. (You might need to reboot server as refresh might not be able to remove service name completely, if that's the case, try also the following sc command to remove it)b. use sc to delete servicebackup the registry according to point a, then run:sc delete OracleOraDb11g_home1TNSListener2. create Oracle Windows service - Listenera. scCreate listener service:sc create OracleOraDb11g_home1TNSListener binPath= C:\oracle\product\11.2.0\dbhome_2\BIN\TNSLSNR.exenote: after binPath=, there must be a space there
b. run netca to create listener service by OracleStart -> All programs -> Oracle - OraDb11g_home1 -> Configuration and Migration Tools -> Net Configuration AssistantWhen asking for Listener Name, don't change anything, just leave the default name 'LISTENER' there, it will create service name as OracleOraDb11g_home1TNSListener 3. create Oracle Windows service - databasea. stop OracleServiceorcl service (orcl is the sid here)net stop OracleServiceORCLb. use oradim to delete servicec:\> oradim -delete -sid orcl
c. use oradim to create again
C:\> ORADIM -NEW -SID SID -INTPWD PASSWORD -MAXUSERS USERS
-STARTMODE AUTO -PFILE ORACLE_HOME\DATABASE\INITSID.ORAOr
c:\> oradim -new -id orcl -startmode auto to use OS authenticationSID The same SID name as the SID of the database you are upgrading.
PASSWORD The password for the new release 10.2 database instance. This is the password for the user connected with SYSDBA privileges. The -INTPWD option is not required. If you do not specify it, then operating system authentication is used, and no password is required.
USERS The maximum number of users who can be granted SYSDBA and SYSOPER privileges.
ORACLE_HOME The release 10.2 Oracle home directory. Ensure that you specify the full path name with the -PFILE option, including drive letter of the Oracle home directory.
4. Referencesa. http://publib.boulder.ibm.com/infocenter/ltscnnct/v1r0/index.jsp?topic=/com.ibm.help.lotus.connections.doc/t_db_oracle_listener.htmlb. http://psoug.org/reference/oradim.htmlc. http://www.theeldergeek.com/add_a_service_in_windows_xp.htm