You require to configure and run a network listener before creating a database with the Oracle's Database Configuration Assistant (dbca) tool. This is a how to configure such a listener.
I assume you already install a Oracle 11g Database Server on CentOS 6.2 with SSH X11 Forwarding and you are using a Linux client with a Desktop Environment like Gnome or KDE.
I assume you already install a Oracle 11g Database Server on CentOS 6.2 with SSH X11 Forwarding and you are using a Linux client with a Desktop Environment like Gnome or KDE.
- Login on the server using oracle user with SSH X11 Forwarding:
- You already had the $ORACLE_HOME/bin on the PATH environment variable (see ~/.bash_profile here) so you can issue:
- Choose Listener Configuration on the Welcome panel:
- Select Add as the action:
- Type a listener name, I recommend the default "LISTENER":
- Select protocols among the available, I choose TCP only:
- Choose a listening port, I recommend the default "1521" but you can change it if you want. NOTE: Remember to open this port on iptables if you want remote database access, otherwise you won't be able to use it:
- On More Listeners panels, choose No.
- If you finish gracefully the wizard, you should be able to see this on the standard output. Observe that the listener is running.
- One final step is to add the ORACLE_HOME_LISTNER environment variable to oracle's ~/.bash_profile. Login to the server as oracle user and edit:
$ ssh -Y oracle@SERVER
$ netca
you can manually stop the listener by issuing:$ netca Oracle Net Services Configuration: Configuring Listener:LISTENER Listener configuration complete. Oracle Net Listener Startup: Running Listener Control: /opt/app/oracle/product/11.2.0/db_1/bin/lsnrctl start LISTENER Listener Control complete. Listener started successfully. Oracle Net Services configuration successful. The exit code is 0
then start the listener by:$ lsnrctl stop LISTENER
and check the listener status:$ lsnrctl start LISTENER
or verify if the listener is alive and locally reachable via TNS ping:$ lsnrctl status LISTENER LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 06-FEB-2012 16:53:04 Copyright (c) 1991, 2009, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myserver)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production Start Date 06-FEB-2012 16:49:47 Uptime 0 days 0 hr. 3 min. 17 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /opt/app/oracle/product/11.2.0/db_1/network/admin/listener.ora Listener Log File /opt/app/oracle/diag/tnslsnr/soabpm/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=soabpm)(PORT=1521))) The listener supports no services The command completed successfully
to ensure the same thing remotely you must issue. NOTE: Remember to configure iptables to allow remote access.$ tnsping localhost 1521 TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 06-FEB-2012 16:55:34 Copyright (c) 1997, 2009, Oracle. All rights reserved. Used parameter files: Used HOSTNAME adapter to resolve the alias Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))) OK (0 msec) ... OK (0 msec)
NOTE: Remember you must a have a running listener before creating a database.$ tnsping myserver 1521
then append:$ nano ~/.bash_profile
at the end the ~/.bash_profile archive should look like:export ORACLE_HOME_LISTNER=LISTENER
# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin umask 022 export TMPDIR=$TMP export ORACLE_BASE=/opt/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export PATH=$ORACLE_HOME/bin:$PATH # The SID for a database, See http://eduardo-lago.blogspot.com/2012/02/creating-new-oracle-11g-r2-database-on.html export ORACLE_SID=demo export ORACLE_HOME_LISTNER=LISTENER
very insightful and helpful blog
ОтветитьУдалитьData science Courses in Manchester