RSS
 

Solaris tips #1: How to get process PID bound to a given port

10 Mar

Lately I wasn’t able to startup an application cause the port needed was already used by another process.

An istance of the process I was attempting to run resulted to be idle, but it wasn’t really straight forward to identify that process by executing the command

ps -ef | grep ...

I have found useful a script that I have found in internet and that I have used in the following way.

1. First of all, create a shell script file

vi which_pid_is_bounded_to_port.sh

2. Then type in the following script and save

#!/bin/ksh

line='---------------------------------------------'
pids=$(/usr/bin/ps -ef -o pid=)

if [ $# -eq 0 ]; then
read ans?"Enter port you would like to know pid for: "
else
ans=$1
fi

for f in $pids
do
/usr/proc/bin/pfiles $f 2>/dev/null | /usr/xpg4/bin/grep -q "port: $ans"
if [ $? -eq 0 ]; then
echo $line
echo "Port: $ans is being used by PID:\c"
pargs -l $f
#/usr/bin/ps -o pid,args -p $f
fi
done

3. Now you can run the script and prompt the port in order to find the pid is bound to

. ./which_pid_is_bounded_to_port.sh
Enter port you would like to know pid for: 8080

4. You will get an output that looks like the following:

---------------------------------------------
Port: 8080 is being used by PID:/usr/server/http

5. If you haven’t got the PID in the previous step, you can obtain it with the following:

ps -ef | grep /usr/server/http
user   585 15735   0 16:49:43 pts/12      0:00 grep /usr/server/http
user 17018 13104   0 15:57:44 pts/12      0:25 /usr/server/http

Once you get the PID, you can kill the process if you need it.

kill -9 17018
 

Unix tips #1: Replace multiple white spaces with one blank by using sed

07 Mar

Sometimes is useful to remove from a file multiple white spaces by replacing them with one only blank.

If you need to achieve this, you could probably find useful the sed utility; sed allows you to apply regular expressions to a string / file.

The command below prints the string multiple spaces everywhere

echo "multiple    spaces    everywhere" | sed -e "s/ \+ / /g"

The following example works for a file (blanks are removed from input.txt and the result is store in output.txt):

cat input.txt | sed -e "s/ \+ / /g" > output.txt

Enjoy!

 

OBIEE 10g repository and catalog migration-merging

21 Dec

1 – Introduction

This post will explain how to migrate/merge modifications from a development repository to a production one. Moreover will explain how to move development catalog modifications to a production one.

In order to provide some screenshots, I have used the same demo repository and catalog; I created 2 copies and I have applied few modifications.

So the screenshots won’t reflect a real and complex situation but at least will be helpful to understand all the steps.

First to go on with the migration, just take a look to the different object we want to migrate.

Environment A
Repository Dashboard Answers
Environment B
Repository Dashboard Answers

Read the rest of this entry »

 

OBIEE Tips #6: Get a direct link to a dashboard

21 Dec

To get a link that points to a dashboard you can use the following::
http://<hostname>:<port>/analytics/saw.dll?Dashboard&PortalPath=<DASHBOARD_PATH>
<hostname> is the host name/address
<port> is the presentation service port (9704 for the default stand alone installation)
<DASHBOARD_PATH> is the path to the target dashboard inside the catalog.

You can get the <DASHBOARD_PATH> using the administration panel:

Read the rest of this entry »