Advertisements

Archive

Author Archive

How to Solve Connection Error on Oracle Listener Control

September 20, 2017 1 comment

This is an error that occurs from using Oracle’s lsrnctl start command to enable the Oracle database connection listener. Upon using that command, here’s the output of the error:

lsnrctl start
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 30-APR-2010 10:42:24
Copyright (c) 1991, 2009, Oracle.  All rights reserved.
Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/wrath/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=PACT)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12547: TNS:lost contact
 TNS-12560: TNS:protocol adapter error
  TNS-00517: Lost contact
   Linux Error: 104: Connection reset by peer
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=PACT)(PORT=1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused
This is probably caused by an incorrect configuration in the /etc/hosts file. So, make sure that inside this config file there is an entry for the loopback address like so:
127.0.0.1 PACT localhost
::1 PACT localhost
Note: The PACT value on the configuration file is due to the setup I use during my Oracle database installation. I use PACT as my hostname and have to put PACT as one of the entry in the /etc/hosts. But the point is, you have to have a localhost entry on the 127.0.0.1 and ::1. If done, save the file and start the lsnrctl service once again.
lsnrctl start
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 30-APR-2010 10:55:27
Copyright (c) 1991, 2009, Oracle.  All rights reserved.
Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/wrath/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=PACT)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                30-APR-2010 10:55:29
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/wrath/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=PACT)(PORT=1521)))
The listener supports no services
The command completed successfully
Advertisements

Changing Hostname on Linux Server

September 14, 2017 1 comment

In your Linux server, you can change the hostname of your server by following this simple steps. I’m using a Centos 6.9 as my server to this tutorial but I’m sure it applies to other Linux distros as well. First of all, edit the network file on the Linux server to change the hostname by typing this command:

vi /etc/sysconfig/network

Then, find the HOSTNAME variable and change it the name as you desired.

Next, apply the hostname change by typing:

hostname [name]

Replace the [name] with the host name that you want. Next, restart the network service to make the changes permanent.

service network restart

Enabling SSH Access to Remote Linux Server

September 14, 2017 Leave a comment

In this tutorial, I’m using Centos 6.9 but I’m sure this configuration applies to every Unix base Linux Server. To enable ssh access from your local computer to a remote Linux Server, first you have to edit the sshd_config file on the remote server. You can find this file in the directory /etc/ssh/sshd_config. Edit the ssh configuration file by typing the command:

vi /etc/ssh/sshd_config

Inside the file find the string #PermitRootLogin yes, and uncomment that line like so:

Save your edited configuration and restart the sshd service by typing the command:

service sshd restart

By typing that command, you will get an output something like this:

Now, do an ifconfig command on the remote server to find out what’s the IP of the remote server:We find out that our remote server is at 192.168.11.140. So, startup an ssh client application such as putty to connect to the remote server.

How to Fix ORA-65093: multitenant container database not set up properly on Oracle 12c

August 11, 2017 Leave a comment

This issue often occurs in a Oracle database 12c installation on Linux. The error stated that multitenant container database not set up properly, which means we have to set the enable_pluggable_database to True. This error occurs whenever we want to mount the database but the multitenant container database was not set up properly. To fix this, connect to your Oracle 12c using the sysdba user:

sqlplus / as sysdba

Next, do a startup nomount command on the SQLPlus command line interface:

startup nomount

Change the value of the enable_pluggable_database system parameter by typing:

ALTER SYSTEM SET “enable_pluggable_database”= TRUE SCOPE = SPFILE;

COMMIT;

Now, do a shutdown command on the database and do a startup command again to show that now you can mount the database:

shutdown immediate

startup

How to Install Missing Perl Modules in Linux

August 3, 2017 Leave a comment

When encountering a missing Perl module during an application installation execution such as like this:

You can install the missing Perl module (in this case, IO::Uncompress::Unzip), by typing a yum command like this:

yum install ‘perl(IO::Uncompress::Unzip)’

Press enter and the yum application will automatically search the missing module you input and install it to your Linux system.

How to Install Instant Client for Oracle Database

August 3, 2017 Leave a comment

Instant Client is an Oracle database auxiliary application that contains libraries such as OCI or JDBC to connect to a remote database server. To install Instant Client, it is available in the following link: http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html

Select the Instant Client product that has the same as your Oracle database version. In this tutorial, we are using Oracle database 11g so we will use instant client 11.2.0.4. After you have downloaded the instant client, unpack the zip file and put it under the directory /opt/oracle/instantclient/. After that, make a symbolic link to the libclntsh.so.11.1 file by typing:

ln -s libclntsh.so.11.1 libclntsh.so

Also, set file permission to libclintsh.so and libnnz11.so by typing:

chmod 755 libclntsh.so
chmod 755 libnnz11.so

Change to the oracle user that you use to install your Oracle by typing su – oracle. Next, set your system environment accordingly for the instant client directory:

export D_LIBRARY_PATH=/opt/oracle/instantclient/
export ORACLE_HOME=$ORACLE_HOME:/opt/oracle/instantclient/
export PATH=$PATH:/opt/oracle/instantclient/

Adventure Time: Melaka, Malaysia

August 2, 2017 Leave a comment

During the weekend, My colleagues and I decided to go on a road trip to Melaka. We took a car there and it took approximately 2-3 hours to arrive there. For those who don’t know, Melaka city is located on the southern east part of Malaysia. It’s a port city where I believe the dutch once colonized during the time. Jonker street is a place to be, street food vendors are lining up here in the evening until night so if you want to look for a great food, you might want to stroll around this area. Just passing the Jonker street, you will find a tourist spot. This part is what you called Kota Tua (Old City) and the buildings here resembles European style because of the dutch previous occupation on this city. It makes up for a great experience taking a vacation here.