Sunday, July 12, 2009

Installing ArcSDE 9.3 64-bit on Red Hat Enterprise Linux 5

* Install Red Hat Enterprise Linux 5.0 with the following package groups:

* from Development group
+ Development Tools package group
+ Legacy Software Development package group
* from Base System group
+ Legacy Software Support package group with compat-openldap from Optional Packages
+ X Window System package group

* Ensure 32-bit i386 versions of these softwares are installed:

o compat-libf2c-34
o compat-libstdc++-33
o compat-libstdc++-296
o libXp
o mesa-libGL
o mesa-libGLU
o openldap
o openssl


[root@srvsde cdrom]# rpm -qa --queryformat %-{name}-%{version}-%{release}-%{arch}"\n" | grep ^compat | grep i386$ | sort
compat-libf2c-34-3.4.6-4-i386
compat-libstdc++-296-2.96-138-i386
compat-libstdc++-33-3.2.3-61-i386
compat-openldap-2.3.43_2.2.29-3.el5-i386
[root@srvsde cdrom]# rpm -qa --queryformat %-{name}-%{version}-%{release}-%{arch}"\n" | grep ^mesa | grep i386$ | sort
mesa-libGL-6.5.1-7.7.el5-i386
mesa-libGLU-6.5.1-7.7.el5-i386
[root@srvsde cdrom]# rpm -qa --queryformat %-{name}-%{version}-%{release}-%{arch}"\n" | grep ^libXp | grep i386$ | sort
libXp-1.0.0-8.1.el5-i386
[root@srvsde cdrom]# rpm -qa --queryformat %-{name}-%{version}-%{release}-%{arch}"\n" | grep ^open | grep 86$ | sort
openldap-2.3.43-3.el5-i386
openssl-0.9.8e-7.el5-i686


* Mount the installation cdrom into /mnt/cdrom

[root@srvsde sde]# mount 172.31.32.120:/media/ESRI /mnt/cdrom/
[root@srvsde sde]# ls /mnt/cdrom/
Autorun.inf ESRI.bmp ESRI.exe ESRI.ini GDBDirectConnect GDBDirectConnect_unix hp hpia ibm linux Media PDFs quickstart.pdf quickstart_unix.pdf Readme.txt sdk solaris windows Xtras

* Create the sde user
[root@srvsde ~]# useradd sde
[root@srvsde ~]# passwd sde
[root@srvsde ~]# useradd -G oinstall sde

* Switch to sde user

[root@srvsde cdrom]# su - sde
[sde@srvsde ~]$ ls ESRI-linux/
db2 documentation_server install_db2.htm install_oracle.htm install_postgresql.htm oracle10g oracle11g oracle9i pg
[sde@srvsde ESRI-linux]$ ls ESRI-linux/oracle10g/
01.toc 02.tar b5.nls en.nls install ja.nls jp.nls ko.nls th.nls tw.nls zh.nls

* Start the installation :
[sde@srvsde oracle10g]$ ./install -load
ESRI is willing to license the software to you only if you accept and agree to the enclosed license agreement.
If you have read and agree with the terms in the enclosed license agreement type 'yes' to continue the installation process, if not press or type 'no' to exit installation process. [no] yes


Press to take the default, '?' for help, '^' to return to
the previous question, or 'q' to quit.

Enter CD-ROM mount point: [/cdrom] /mnt/cdrom

Select which product to load by entering the product number.

1 - /mnt/cdrom/hp/db2_64
2 - /mnt/cdrom/hp/informix
3 - /mnt/cdrom/hp/oracle10g_64
4 - /mnt/cdrom/hp/oracle9i_64
5 - /mnt/cdrom/hpia/oracle10g_64
6 - /mnt/cdrom/ibm/db2_64
7 - /mnt/cdrom/ibm/informix
8 - /mnt/cdrom/ibm/oracle10g_64
9 - /mnt/cdrom/ibm/oracle11g_64
10 - /mnt/cdrom/ibm/oracle9i_64
11 - /mnt/cdrom/linux/db2
12 - /mnt/cdrom/linux/oracle10g
13 - /mnt/cdrom/linux/oracle11g
14 - /mnt/cdrom/linux/oracle9i
15 - /mnt/cdrom/linux/pg/arcsde
16 - /mnt/cdrom/solaris/db2_64
17 - /mnt/cdrom/solaris/informix
18 - /mnt/cdrom/solaris/oracle10g_64
19 - /mnt/cdrom/solaris/oracle11g_64
20 - /mnt/cdrom/solaris/oracle9i_64

Enter product number to load: [1] 12

Enter pathname to install directory: [/home/sde/ESRI-linux/oracle10g]
The pathname to the install directory must not contain any upper-case letters

Enter pathname to install directory: [/home/sde/ESRI-linux/oracle10g] /home/sde/sdeexe9.3

Directory does not exist: /home/sde/sdeexe9.3
Would you like to create it? [yes]

ArcSDE version 9.3 for Oracle10g - May 14, 2008
-------------------------------------------------

ArcSDE Product
Package numbers to load: [all]


Package selection complete
--------------------------

You have chosen the following packages to be loaded

ArcSDE Product
ArcSDE Server

Is this correct? [yes]

Total size of chosen packages in megabytes: 169.7
Available space in megabytes: 4460.0

List file names while loading? [no] yes

Loading package(s), Please wait...

Help/
Help/accom_users.htm
Help/accounts.png
Help/add_new_svc.htm
Help/add_server.png
Help/add_soc.htm
Help/add_soc_1.png
Help/add_usrs_agsadmin.htm
Help/add_usrs_agsusers.htm
Help/agol_coordsys_extent.png

------------SNIP--------------

sdeexe93/lib/libpe.so
sdeexe93/lib/libsg.so
sdeexe93/lib/libsde.so
sdeexe93/lib/libsdeora10gsrvr93.so
sdeexe93/lib/libgsrvrora10g93.so
sdeexe93/lib/libsdesetup.so
sdeexe93/lib/liblocssa.so
sdeexe93/lib/libst_shapelib.so

Finished loading package(s)

Exiting...



* Uncomment
esri_sde 5151/tcp # ArcSDE service on pinetree
in $SDEHOME/etc/services.sde


* Copy the createsdeoracle.sql script to oracle home.
[root@srvsde ~]# cp /home/sde/sdeexe9.3/sdeexe93/tools/oracle/createsdeoracle.sql /home/ora10g/

* Switch to Oracle user
[root@srvsde ~]# su - ora10g

* Modify the createsdeoracle.sql file to replace the LOCATION variable in the line
datafile '/LOCATION/sde.dbf' size 400M
to
datafile '/u03/oradata/SRVSDE/sde.dbf' size 400M

* Execute the script

[ora10g@srvsde ~]$ sqlplus "/ as sysdba" @createsdeoracle.sql

SQL*Plus: Release 10.2.0.4.0 - Production on Thu Jul 2 09:47:13 2009

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

* CREATESDEORACLE.SQL script *
* *
* Purpose: *
* *
* To create the SDE tablespace, the SDE Oracle user *
* and grant privileges to the SDE user *
* *
* NOTES: 1. Before running this script *
* Replace the word LOCATION with the pathname for *
* the sde.dbf datafile to be created. *
* *
* 2. If upgrading remove rem from the grants in the *
* upgrade section *
* *
* 3. Please use the sys user to run this script. *
* You will also need to the system password *
* *
* Example: *
* % sqlplus "sys as sydba" @createsdeoracle.sql *
* *
* *
**************************************************************
* Granting of permissions by the SYS user in Oracle, on two packages
* to the public role.

Grant succeeded.


Grant succeeded.

* * * * * * * * * * * * * * *
* ArcSDE NEW INSTALLATION *
* * * * * * * * * * * * * * *
* Connect as system/ to create the sde
* tablespace and user.
Enter password:
Connected.
* Create the sde tablespace.
* Before you run this script update LOCATION for the desired datafile pathname.

Tablespace created.

* Create the sde user
* The password for the sde user is set to "XXX". You may
* change this if you wish.

User created.

* Granting the required privileges to the sde user.

Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.

* SELECT ANY TABLE is required for compressing the database
* This privilege needs to be granted whenever a compress is run.

Grant succeeded.

* ADMINISTER DATABASE TRIGGER can be revoked after install

Grant succeeded.

* * * * * * * * * * *
* ArcSDE UPGRADE *
* * * * * * * * * * *
* If upgrading please remove rem from each grant.
* Granting the required privileges to the sde user.
* After upgrading you may revoke the following privileges
* Please remove rem from each grant.
* Revoking the upgrade privileges to the sde user.
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[ora10g@srvsde ~]$ sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.4.0 - Production on Thu Jul 2 09:48:20 2009

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>
SQL>
SQL>
SQL>
SQL> GRANT EXECUTE ON dbms_pipe TO public;

GRANT EXECUTE ON dbms_lock TO public;
Grant succeeded.

SQL> SQL>

Grant succeeded.

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


* Configure the .bash_profile in /home/sde


[root@srvsde lib]# cat /home/sde/.bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin
SDEHOME=/home/sde/sdeexe9.3/sdeexe93/
export SDEHOME
ORACLE_HOME=/oracle/product/10.2.0
export ORACLE_HOME
TNS_ADMIN=$ORACLE_HOME/network/admin
export TNS_ADMIN
ORACLE_SID=QNMPSDE
export ORACLE_SID
PATH=$PATH:$SDEHOME/bin:$ORACLE_HOME/bin
export PATH
LD_LIBRARY_PATH=$SDEHOME/lib:/usr/lib:/lib:$ORACLE_HOME/lib:$ORACLE_HOME/lib32
export LD_LIBRARY_PATH
unset USERNAME

export PATH


* Execute the sdesetup script
[sde@srvsde bin]$ ./sdesetup -o install -d ORACLE10G -H /home/sde/sdeexe9.3/sdeexe93/ -u sde -p XXX -D qnmpsde -i esri_sde -l /home/sde/ECP666666666_v93.ecp

ESRI ArcSDE Server Setup Utility Thu Jul 2 10:43:51 2009
----------------------------------------------------------------
Install or update ArcSDE, GDB schema objects:
Are you sure? (Y/N): y
Creating ArcSde schema.....
Successfully created ArcSde schema.

Installing locators.....
Successfully installed locators.

Creating geodatabase schema.....
Successfully created GDB schema.


Registering authorization key.....
Successfully registered authorization key.

Successfully installed ArcSDE components.
Refer SDEHOME\etc\sde_setup.log for more details.


* Start the sde service
[sde@srvsde bin]$ sdemon -o start
Please enter ArcSDE DBA password:


-------------------------------------------------------
ArcSDE 9.3 for Oracle10g Build 508 Thu Apr 17 12:23:18 2008
-------------------------------------------------------


ST_Geometry Schema Owner: (SDE) Type Release: 1007

Instance initialized for ((sde)) . . .


Connected to instance . . .

DBMS Connection established...

RDBMS: "Oracle"
Instance Name: "esri_sde"

IOMGR Process ID (PID): 13547


ArcSDE Instance esri_sde started Thu Jul 2 11:05:33 2009

Schedule cron jobs to send sms on mobile

I've got a weekly shutdown for our Websphere servers for a Database backup. To keep an eye on the logs as the shutdown procedures happen, I've got this cron entry



# Shut down Websphere Portal for Oracle backup every Thursday 12:05 midnight and start next morning 4:15 AM
05 00 * * 5 /etc/init.d/websphere_portal stop 2>&1 > /root/portal-stop.log; echo $HOSTNAME >> /root/portal-stop.log; tail -n 6 /root/portal-stop.log | mailx 'nabeel@smsserver.domain.tld'
15 04 * * 5 /etc/init.d/websphere_portal start 2>&1 > /root/portal-start.log; echo $HOSTNAME >> /root/portal-start.log; tail -n 6 /root/portal-start.log | mailx 'nabeel@smsserver.domain.tld'

So I get the last 6 lines in my mobile inbox as SMS

Init script for Websphere Portal/DB2 on linux

Copy the following script to /etc/init.d/webpshere_portal or some name.



#!/bin/bash
# Websphere_portal # Startup script for IBM WebSphere Portal Server
#
# chkconfig: - 99 15
# description: Websphere Portal server startup
# processname: websphere_portal
# pidfile: /var/run/websphere_portal.pid
# author: Nabeel Moidu nabeelmoidu.at.gmail dot com
# Source function library.
. /etc/rc.d/init.d/functions

portal=/opt/IBM/PE/AppServer/profiles/wp_profile/bin
args=WebSphere_Portal
prog="WebSphere Portal Server"
proc=/opt/IBM/WebSphere/AppServer/java/bin/java
RETVAL=0
username=portaluser
password=password


# verify installation
if [ ! -x $portal ]; then
echo "$prog is not installed"
exit 0
fi

# source function library
. /etc/rc.d/init.d/functions


case "$1" in
start)

# Websphere should come up only if DB2 is up.
for (( ; ; ))
do

# Check status of DB2
su - wpdb2ins -c 'db2gcf -s' | grep Available;
PRC_EXT_STAT=$?;

# If DB2 is available, then startup the portal

if [ $PRC_EXT_STAT = "0" ]; then
echo -n "Starting $prog: "

# Set ulimit
ulimit -n 1000000

# setup environment variables
. /home/wpdb2ins/sqllib/db2profile

# Bring up the portal
$portal/startServer.sh $args
RETVAL=$?
if [ $RETVAL = 0 ]; then
touch /var/lock/subsys/websphere_portal
echo_success
else
echo_failure
fi
break;
# If DB2 is not up, then start DB2
else
su - wpdb2ins -c 'db2start'
fi
done

;;
stop)
echo -n "Shutting down $prog: "
$portal/stopServer.sh $args -username $username -password $password
RETVAL=$?
if [ $RETVAL = 0 ]; then
rm -f /var/lock/subsys/websphere_portal
# Shut down DB2
su - wpdb2ins -c 'db2stop';
echo_success
else
echo_failure
fi
echo
;;
restart)
$0 stop
$0 start
;;
status)
status $proc
;;
*)
echo "Usage: websphered {start|stop|restart|status}"
exit 1

esac

exit 0



Then execute the following commands



chmod +x /etc/init.d/websphere_portal
chkconfig --add /etc/init.d/websphere_portal
chkconfig --level 345 websphere_portal on