1

TNS-01189: The listener could not authenticate the user

I have two Oracle servers, old and new. The plan is to swap their IP addresses to use the new Oracle. After swapped the IP addresses, the Listener was not working.
The error was:
===========
[root@171db ~]# su - oracle
[oracle@171db ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 31-MAY-2013 10:49:58

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=171db)(PORT=1521)))
TNS-01189: The listener could not authenticate the user


Below is the explanation from the official website about this error code TNS-01189
==============================================================
TNS-01189: The listener could not authenticate the user
Cause: The user attempted to issue a privileged administrative command, but
could not be successfully authenticated by the listener using the local OS
authentication mechanism. This may occur due to one of the following reasons:
1. The user is running a version of LSNRCTL that is lower than the version of the
listener.
2. The user is attempting to administer the listener from a remote node.
3. The listener could not obtain the system resources needed to perform. the
authentication.
4. The local network connection between the listener and LSNRCTL was
terminated unexpectedly during authentication message exchange, such as if
LSNRCTL program was suddenly aborted.
5. The communication between the listener and LSNRCTL is being intercepted by
a malicious user.
6. The software that the user is running is not following the authentication
protocol, indicating a malicious user.
Action: Make sure that administrative commands are issued using the LSNRCTL
tool that is of a version equal or greater than the version of the listener, and that
the tool and the listener are running on the same node. You can issue the
VERSION command to find out the version of the listener. If a malicious user is
suspected, use the information provided in the listener log file to determine the
source and nature of the requests. Enable listener tracing for more information. If
the error persists, contact Oracle Support Services.

Solution
=======
Reason No.4 explained the current situation.
The solution is to check /etc/hosts. Because the IP has been swapped from 192.168.164.80 to 192.168.164.87 for the new Oracle server.

Here is the original file:

[root@new-oracle ~]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.164.80  new-oracle

The above IP needs to be updated to 192.168.164.87. After updated the file and start the Listener again, problem solved.

[oracle@new-oracle admin]$ lsnrctl start

2

Resolved: ORACLE_HOME_LISTNER is not set

I had the above error message when I tried to run dbstart, the problem is the dbstart script.

Edit $ORACLE_HOME/bin/dbstart, and found below lines:

ORACLE_HOME_LISTNER=$1
if [ ! $ORACLE_HOME_LISTNER ] ; then
  echo "ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener"
else
  LOG=$ORACLE_HOME_LISTNER/listener.log

Changed ORACLE_HOME_LISTNER=$1 to ORACLE_HOME_LISTNER=$ORACLE_HOME

Saved and exited, then ran "dbstart" successfully without errors

0

How to Uninstall Oracle 10g On Linux ?


Before uninstalling, close all oracle processes if there is any

$ORACLE_HOME/bin/shutdown abort
$ORACLE_HOME/bin/emctl stop dbconsole
$ORACLE_HOME/bin/lsnrctl stop
$ORACLE_HOME/bin/isqlplusctl stop

Backup $ORACLE_HOME if necessary (optional)
root> tar -xvf $ORACLE_HOME > /dev/rmt0/bkup

Unintall Steps:

1. run $ORACLE_HOME/bin/localconfig delete
2. rm -rf $ORACLE_BASE/*
3. rm -f /etc/oraInst.loc /etc/oratab
4. rm -rf /etc/oracle
5. rm -f /etc/inittab.cssd
6. rm -f /usr/local/bin/coraenv  /usr/local/bin/dbhome  /usr/local/bin/oraenv

7.remove the oracle user and the related group(dba,oinstall)

0

Reverse SSH Tunneling

source: http://www.howtoforge.com/reverse-ssh-tunneling
 
Have you ever wanted to ssh to your Linux box that sits behind NAT? Now you can with reverse SSH tunneling. This document will show you step by step how to set up reverse SSH tunneling. The reverse SSH tunneling should work fine with Unix like systems.

Let's assume that Destination's IP is 192.168.20.55 (Linux box that you want to access).
You want to access from Linux client with IP 138.47.99.99.
Destination (192.168.20.55) <- |NAT| <- Source (138.47.99.99) 

1. SSH from the destination to the source (with public ip) using command below:
ssh -R 19999:localhost:22 sourceuser@138.47.99.99
* port 19999 can be any unused port.

2. Now you can SSH from source to destination through SSH tuneling:
ssh localhost -p 19999

3. 3rd party servers can also access 192.168.20.55 through Destination (138.47.99.99).

Destination (192.168.20.55) <- |NAT| <- Source (138.47.99.99) <- Bob's server 

3.1 From Bob's server:
ssh sourceuser@138.47.99.99 

3.2 After the sucessful login to Source:
ssh localhost -p 19999 

* the connection between destination and source must be alive at all time.
Tip: you may run a command (e.g. watch, top) on Destination to keep the connection active.

0

Use SSH to Create an HTTP Proxy

SOCKS is built in to OpenSSH, so it's a trivial matter to set up a local SOCKS proxy with the -D flag.

For example:

$ ssh -D 12345 myuser@remote_ssh_server
 
will open up the port 12345 on your local machine as a SOCKS proxy so all your HTTP traffic can be specified to go through the SSH tunnel and out remote_ssh_server on the other end. Your proxy server is now set up.

Next, set up your browser to use the proxy server. Most browsers include proxy support. For Firefox 3, go to Edit→Preferences→Advanced→Network→Settings, and specify that you want to use a Manual Proxy, localhost, port 12345 and SOCKS v5 (although OpenSSH supports both versions 4 and 5).

Now your browser is using a secure tunnel to your remote SSH server.

0

Collecting Mini Dump file from Windows 2003 Server

Summary:

Under Windows 2003 Server, sometimes Dr. Watson logs are not generated when an application crashes. However, mini dump files are always generated for the Windows error reporting service. Unfortunately by default this service queues notifications and doesn’t usually alert the user until the server is rebooted. Below are instructions on configuring the Windows error reporting service to instantly display a dialog when a crash occurs, and how to retrieve the crash information.

Description:

To stop the Windows error reporting service from queuing crash information:
- Open the registry editor (Start -> Run -> regedit)
- Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PCHealth\ErrorReporting\
- Change the DWORD ForceQueueMode value to 0
- Restart the machine
To retrieve the mini dump file when an application crashes.
- After an application crashes a dialog with the following title will be displayed:
“(Application Name) has encountered a problem and needs to close. We are sorry for the inconvenience.”
- Click the “click here” hyperlink
- A second dialog will appear with an “Error signature” section and a “Reporting details” section. Keep a record of the “AppVer”.
- Click the “click here” that follows “To view technical information about the error report”.
- A third dialog with 2 complete paths will be displayed. They usually follow the format of:
(System Partition):\DOCUME~1\ADMINI~1\LOCALS~1\Temp\(Folder name starting with W)\(File name)
- Open Windows Explorer and navigate to the folder the starts with “W”
- (Do not dismiss any of the dialogs; doing so will remove the folder)
- Copy the folder to the desktop
- Create a text file and enter the “AppVer” into it, and add the file to the folder on the desktop
- ZIP the folder and send it to Group Logic

0

Windows Cluster - Manual Failover vs Automatic Failover

article source - SQL Server Tips by Ashwin


Often, DBA's are given a task to find the RCA of SQL Server failover in cluster and it is difficult to find whether the failover is an automatic failover (due to some issue) or a manual failover (by any other dba, system admin etc).

An easy way to figure that out is to take a look at the cluster log (which is generally seen at C:\Windows\Cluster\Cluster.log on all the member nodes in cluster.
Open the log and search for these keywords “FmsMoveGroupRequest” and “FmpDoMoveGroup”. You will find entries similar to the below.

This says that it is a manual failover and not an automatic failover
1.INFO [FM] FmsMoveGroupRequest: To move group ‘a47f0c1a-fc1b-45ed-8a34-07bf59300c9c’
2.INFO [FM] FmpDoMoveGroup: Entry
3.INFO [FM] FmpMoveGroup: Entry
4.INFO [FM] FmpPickNodeFromPreferredListAtRandom: Picking node for group a47f0c1a-fc1b-45ed-8a34-07bf59300c9c [SQL2005], suggested node 1…
5.INFO [FM] FmpPickNodeFromPreferredListAtRandom: Node 1 for group a47f0c1a-fc1b-45ed-8a34-07bf59300c9c is user preferred…
6.INFO [FM] FmpPickNodeFromPreferredListAtRandom: Selected node 1 for group a47f0c1a-fc1b-45ed-8a34-07bf59300c9c…
7.INFO [FM] FmpMoveGroup: Moving group a47f0c1a-fc1b-45ed-8a34-07bf59300c9c to node 1 (1)
8.INFO [FM] FmpNotifyGroupStateChangeReason: Notifying group SQL2005 [a47f0c1a-fc1b-45ed-8a34-07bf59300c9c] of state change reason 1…
If you scroll through the log, you will find these entries which says that the manual failvover has successfully completed
1.INFO [FM] FmpCompleteMoveGroup: Exit, status = 0
2.INFO [FM] FmpMovePendingThread Exit.

1

How to build LAPP (Linux + Apache + Postgres + PHP) easy

This LAPP is to be built based on Ubuntu (or Debian or any derivative of the Ubuntu)

Install Postgresql

sudo apt-get install postgresql-8.1 php5-pgsql

Install Apache

  • The following mod-security, ldap, and odbc libraries are optional:
sudo apt-get install apache2 libapache2-mod-php5 php5-gd
sudo apt-get install libapache2-mod-security php5-ldap php5-odbc
  • Restart Apache
sudo /etc/init.d/apache2 restart




============== below are optional or if you know what to do please skip ============== 


Install other software (optional)

sudo apt-get install openssh-server unattended-upgrades
sudo apt-get install unzip zip aspell-en aspell-fr aspell-de aspell-es
sudo apt-get install curl php5-curl php5-xmlrpc
sudo apt-get install clamav-base clamav-freshclam clamav

Configure Postgres (if you know what to do please skip)

  • Create the database user 'webuser'.
sudo -u postgres createuser -D -A -P webuser
Enter in a NewDatabasePassword here, then answer 'N' to the question.
  • Create the database 'webdb' for the user 'webuser'. Enter the password that you just created.
sudo -u postgres createdb -E utf8 -O webuser webdb
  • Secure the postgresql database with an admin password.
sudo -u postgres psql template1
# ALTER USER postgres WITH PASSWORD 'NewAdminDatabasePassword';
# \q
  • Edit the file '/etc/postgresql/8.1/main/pg_hba.conf' and on line 79 change the words ident sameuser to md5.
sudo nano /etc/postgresql/8.1/main/pg_hba.conf
  • Restart the database:
sudo /etc/init.d/postgresql-8.1 restart