Oracle Sql XE - Error entering sqlplus [Linux deepin (based on debian)]

0

I have a problem trying to login to sqlplus from the terminal.

I run the sqlplus command, and then it asks for username and password.

When trying to put system and the password that I put during the installation, I find the following error:

I hope you can help me.

INFORMATION:

OPERATING SYSTEM: GNU / LINUX DEEPIN

ARCHITECTURE: 64x

SOFTWARE: Oracle-xe 11g

    
asked by GOHANCKZ 29.04.2018 в 02:23
source

1 answer

1

The error indicates that the database is not available, you have to start the base and then the listener of it. This occurs because the Oracle service was not configured to start automatically (this is fine if the database is not going to be used whenever the computer equipment where it is installed is started).

What has to be done is to start the database and then the listener of it.

The following commands must be done with the operating system user oracle . They can be done with any other user of the Operating System but to not make the answer so long we will do it only with the oracle user.

Before executing commands, you must make sure that the environment variables ORACLE_SID and ORACLE_HOME are set.

If they were not, you have to execute previously:

export ORACLE_SID=XE
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe/

For convenience you can add the following environment variables to have them in the PATH.

export ORACLE_CONFIGURACION=/u01/app/oracle/product/11.2.0/xe/config/scripts
export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_CONFIGURACION

(note: the routes that I place correspond to the installation in my linux system, which is not exactly the same as yours, make sure that the routes I place are those that correspond to your installation) After this to start the database run:

sqlplus / as sysdba

That should show you an exit like:

SQL*Plus: Release 11.2.0.2.0 Production on Sun May 6 00:34:37 2018

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

Connected to an idle instance.

SQL>

If you have seen the above, you are at the sqlplus prompt. Now execute STARTUP to start the database.

SQL> STARTUP

The output should indicate something like:

Total System Global Area 1068937216 bytes
Fixed Size          2233344 bytes
Variable Size         624954368 bytes
Database Buffers      436207616 bytes
Redo Buffers            5541888 bytes
Database mounted.
Database opened.

What follows is to start the listener of the base (it can be understood as the service that listens to the connections). To do this you have to exit the sqlplus prompt by typing quit

SQL> quit

That will show you an exit like the following

Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

Now from the terminal we write: lsnrctl start

This will yield an output like the following:

LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 06-MAY-2018 00:41:38

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

Starting /u01/app/oracle/product/11.2.0/xe/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.2.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/11.2.0/xe/log/diag/tnslsnr/localhost/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))

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                06-MAY-2018 00:41:38
Uptime                    0 days 0 hr. 0 min. 0 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/product/11.2.0/xe/log/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(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

Then you can connect to the database via sqlplus with the user you mentioned

SQL*Plus: Release 11.2.0.2.0 Production on Sun May 6 00:49:29 2018

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

Enter user-name: system
Enter password: 

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

SQL> 

Just comment that these steps work for both a 11g XE database and an Oracle 12c database by varying only the paths of the environment variables.

I remain attentive to any comments or questions.

    
answered by 06.05.2018 / 08:10
source