1
votes

I installed Oracle 11g on Ubuntu 14.04 by review this reference links. When installing, I do not see any step to create username and password

After that, I configured as below

$# sudo /etc/init.d/oracle-xe configure
Oracle Database 11g Express Edition Configuration

This will configure on-boot properties of Oracle Database 11g 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]:1522

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 11g Express Edition to be started on boot (y/n) [y]:y

Starting Oracle Net Listener...Done
Configuring database...Done
Starting Oracle Database 11g Express Edition instance...Done
Installation completed successfully.
  1. I tried to login to apex using http://localhost:8080/apex/f?p=4950 ==> Unable to connect. Firefox can't establish a connection to the server at localhost:8080.

  2. I try to connect using SQL Developer

SQL Developer

Error: Status : Failure -Test failed: Listener refused the connection with the following error:ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

More information:

$ lsnrctl status

rgm@Motown:~$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 25-JUL-2015 08:49:19

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE))) STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date                23-JUL-2015 17:21:04
Uptime                    1 days 15 hr. 28 min. 14 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Default Service           XE
Listener Parameter File   /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/Motown/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Motown)(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

listener.ora file

# listener.ora Network Configuration File:

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
      (PROGRAM = extproc)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
      (ADDRESS = (PROTOCOL = TCP)(HOST = Motown)(PORT = 1521))
    )
  )

DEFAULT_SERVICE_LISTENER = (XE)

Login SqlPlus using SYSTEM

rgm@Motown:~$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Sat Jul 25 09:00:29 2015

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

ERROR:
ORA-01031: insufficient privileges


Enter user-name: SYSTEM
Enter password:
ERROR:
ORA-01033: ORACLE initialization or shutdown in progress
Process ID: 0
Session ID: 0 Serial number: 0


Enter user-name: oracle
Enter password:
ERROR:
ORA-01033: ORACLE initialization or shutdown in progress
Process ID: 0
Session ID: 0 Serial number: 0


SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

Login SqlPlus using oracle (su to oracle user)

rgm@Motown:~$ su oracle
Password:
oracle@Motown:/home/rgm$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Sat Jul 25 09:02:19 2015

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


Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL>
SQL>

Please help me to fix the problem to login SQL using Apex and SQL Developer.

Thanks

2

2 Answers

1
votes

Your SQL Developer screenshot, you are not using tnsnames.ora - which is fine.

How about using service name = XE, instead of SID. And localhost to Motown.

Before doing this - Go to the command and see if you can tnsping Motown.

c:\ tnsping motown

You should see OK somewhere on the last line. I'm assuming you have installed the Oracle client tools

0
votes

In your install log it shows a port of 1522 instead of the default 1521.

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

In your SQL Developer screenshot you showed a connection dialog using the default of 1521. At least getting the port number right will move you closer if not solve it.