Out Here In The Field : Boost


IBM Tape drive serial number in Redhat, AIX, and HP-UX
August 21, 2010, 11:16
Filed under: *Nix, AIX, HP-UX, Red Hat, rhel | Tags: , , , , , , , ,

One thing that you need to set up LanFree on TSM (or any kind of SAN Fiber channel backup) is the serial number of the tape drive registered on your server. I happen to be working on a somewhat heterogeneous environment that includes AIX, HP-UX, RHEL, and Windows. Below is my note on how to obtain the tape drive serial number those OSes. I’m using IBM TS3200 as our media library

RHEL

Pretty straight forward . All you have to do is  type the following command:

[root@hqdwhbe1 ~]# cat /proc/scsi/IBMtape
lin_tape version: 1.10.0
lin_tape major number: 250
Attached Tape Devices:
Number  model       SN                HBA                             FO Path   
0       ULT3580-TD4 1310140159        qla2xxx                         NA        
1       ULT3580-TD4 1310039844        qla2xxx                         NA        
2       ULT3580-TD4 1310135990        qla2xxx                         NA        
3       ULT3580-TD4 1310135028        qla2xxx                         NA        
4       ULT3580-TD4 1310136043        qla2xxx                         NA        
5       ULT3580-TD4 1310136063        qla2xxx                         NA        
[root@hqdwhbe1 ~]#

The command above will show you the serial number of all tape drive installed on your RHEL box

AIX

Similar to RHEL, do this on the console:

# lscfg -vpl rmt0
 rmt0             U789D.001.DQD74R5-P1-C2-T2-W2002000E11114398-L0 
 IBM 3580 Ultrium Tape Drive (FCP)
 Manufacturer................IBM     
 Machine Type and Model......ULT3580-TD4     
 Serial Number...............1310140159
 Device Specific.(FW)........89B2
 PLATFORM SPECIFIC
 Name:  tape
 Node:  tape
 Device Type:  byte

HP-UX

IBM provide us with tapeutil, a nice tool operate the IBM tape from console. To start, just type:

# tapeutil

From the menu, press “1″ to open a device. Type down the path to your tape drive. Next press “1″ to choose to open the device for read/write access

..On the next screen, press “3″ to query for the tape drive serial number

There you go

That’s it :)



ANR0454E Session rejected by server , reason: Authentication Failure
March 18, 2010, 15:17
Filed under: *Nix, HP-UX | Tags: , , , ,

So somehow, the storage agent in one of the node of my HP-UX RAC clusters won’t start. Manually starting the storage agent reveal this error message :

“ANR0454E Session rejected by server , reason: Authentication Failure.”

So, that’s my problem. My TSM server refused to authenticate the storage agent. The first thing that I tried is to reinitialize the storage agent. Here is how:

  1. go to your TSMSERVER console by typing

    dsmadmc
  2. Update the password the corresponding node, the syntax is as follows :

    UPDATE SERVER <sta-name> SERVERPASSWORD=<sta-password>

    for example :

    tsm: TSMSERVER> UPDATE SERVER HQCMSDB1_AGENT  SERVERPASSWORD=myTSApassCMS
  3. Reinitialize the storage agent, the syntax is :
    ./dsmsta setstorageserver myname=<sta-node-name> mypassword=<sta-node-pass> myhladdress=<sta-node-ip> servername=<tsm-server-name> serverpassword=<tsm-server-pass> hladdress=<tsm-server-ip> lladdress=1500
    for example :

    ./dsmsta setstorageserver myname=HQCMSDB1_AGENT mypassword=mySTApassCMS myhladdress=192.168.1.110 servername=TSMSERV serverpassword=TSMSERV hladdress=192.168.1.201 lladdress=1500
  4. Start the storage agent again, see if you still get the error, if not, you’re done, otherwise, the problem might not be about the authentication. Check whether your node can reach the TSM server, and make sure that the appropriate port used by the agent to communicate is opened


how to find files by age
December 13, 2009, 12:15
Filed under: *Nix, AIX, HP-UX, oracle | Tags: , , , , ,

So I don’t know what that vendor engineer did to my EBS install, some of the concurrent manager function is spitting temporary files to my /tmp directory. The thing is, that &^%$^$** engineer insisted that he has setup that all temp files are stored in it’s EBS specific directory, and clean up process has been scheduled for them. But every couple of days my /tmp is clogged with files belonged to EBS service account

Since these files basically has no expiration date, and the scheduled clean up does not cover that particular directory, I have to set my own temp files cleaning cycle. Here is what I need :

  1. find files belong to the EBS service account, let’s assume it’s “oracle”
  2. find files within certain age range
  3. delete those files
  4. automate the task to run everyday

The last part is pretty easy with crontab. The 1-3 part must be done carefully since there is a bunch of other file on /tmp that I would rather not touch :D

So here is the find command that I use to accomplish task 1 to 3 :

find /tmp -mtime +3 -type f -user oracle -exec rm -rf {} \;
  • the -mtime +3 flag is used to search for files which were last modified 3 or more days ago
  • the -type f flag is used so that the search will only find plain files only
  • the -user oracle is used so that the search will only find files belong to the user “oracle”
  • the -exec rm -rf {} is used so that every single files found by the search is automatically deleted. The search will find a single file at the time, and put the file name between the bracket.

At first I’m not sure whether the file should be deleted right away or not, so at first I decided that, instead of deleting the files, I move it to a temporary directory so I can review the files, and then delete them. Here is the find command that I use :

find /tmp -mtime +3 -type f -user oracle -exec mv {} /dumptmp \;

With the above command, instead of deleting the files found by the search, it move the said files to different location. I can then review and examine whether the files are save to be deleted.



ORA-27054 : Failed to create dump of Oracle database over NFS
December 17, 2008, 05:21
Filed under: *Nix, HP-UX

 

My previous post was regarding how to setup NFS server on HP-UX. It is used as target to dump database from an Oracle 10g.

The first thing that I have to do is, of course to make sure that the NFS share is automatically mounted on startup by adding a line on my /etc/fstab. The client  is on HP-UX 11.23 also

# vi /etc/fstab

This is the line that I add to the end of /etc/fstab file:

hqcmsdb2:/backup/dump /backup/dump nfs proto=tcp,rw,intr,bg,rsize=32768,wsize=32768 0 2 

Please note that the lines above is intended to be written on a single line. The NFS share is mounted on /backup/dump. I was also able to write to the folder using oracle user account. Mount the share…

# mount /backup/dump

… and start the dump process. But the process logged an error, saying this:

“ORA-27054: NFS file system where the file is created or resides is not mounted with correct options

A short trip to google land told me that Oracle 10GR2 checks for certain parameter to be present on an NFS share before it start the dump process. Namely forcedirectio, vers=3, and hard. After trying several suggestion, this is my current entry on /etc/fstab:

 

hqcmsdb2:/backup/dump /backup/dump nfs proto=tcp,forcedirectio,vers=3,rw,hard,intr,bg,rsize=32768,wsize=32768 0 2

 

After remounting the /backup/dump folder, I was able dump the database normally like it should be.

Please note that this is done on HP-UX system. Please consult the manual for fstab of your *Nix flavor for the similar parameters




Activating NFS server on HP-UX 11.xx
December 11, 2008, 05:29
Filed under: *Nix, HP-UX | Tags: ,

This is done on HP-UX v 11.23.

  1. Make NFS Server to autostart
    • Open /etc/rc.config.d/nfsconf

      # vi /etc/rc.config.d/nfsconf

    • Change NFS_SERVER paramater from “0″ to “1″, then save.

      NFS_CLIENT=1
      NFS_SERVER=1
      NUM_NFSD=16
      NUM_NFSIOD=16
      PCNFS_SERVER=0

  2. Share some directories
    • Open /etc/exports

      # vi /etc/exports

    • add directories that you want to share to the file, for example:

      /var/opt/ignite/clients -anon=2
      /var/opt/ignite/recovery/archives/hqcmsdb1 -anon=2,access=hqcmsdb1
      /backup/dump -access=hqcmsdb1

      the parameter “-anon=2” means all anonymous access will be given default uid “2” while the parameter “-acess=hqcmsdb1” means only that server is allowed to mount the share. No parameters means the directories shared with read write access for everyone. For more infos and examples, type “man 4 exports” on the console

    • Update the share

      # /usr/sbin/exportfs -a

    • Make sure the right folder are shared

      # /usr/sbin/exportfs
      /var/opt/ignite/clients -anon=2
      /var/opt/ignite/recovery/archives/hqcmsdb1 -anon=2,access=hqcmsdb1
      /backup/dump -access=hqcmsdb1

  3. Start NFS Server
    • Check whether NFS is already started or not

      # ps -ef | grep nfsd
      root 2309 2308 0 20:22:54 ? 0:00 /usr/sbin/nfsd 16
      root 2333 2312 0 20:22:54 ? 0:00 /usr/sbin/nfsd 16
      root 2332 2312 0 20:22:54 ? 0:00 /usr/sbin/nfsd 16
      root 2307 1 0 20:22:54 ? 0:00 /usr/sbin/nfsd 16
      root 2334 2312 0 20:22:54 ? 0:00 /usr/sbin/nfsd 16
      root 2308 1 0 20:22:54 ? 0:00 /usr/sbin/nfsd 16
      root 2310 2309 0 20:22:54 ? 0:00 /usr/sbin/nfsd 16
      root 2312 2308 0 20:22:54 ? 0:00 /usr/sbin/nfsd 16
      root 2313 2308 0 20:22:54 ? 0:00 /usr/sbin/nfsd 16
      root 2316 2308 0 20:22:54 ? 0:00 /usr/sbin/nfsd 16
      root 2315 2313 0 20:22:54 ? 0:00 /usr/sbin/nfsd 16
      root 2314 2308 0 20:22:54 ? 0:00 /usr/sbin/nfsd 16
      root 2317 2308 0 20:22:54 ? 0:00 /usr/sbin/nfsd 16
      root 2318 2309 0 20:22:54 ? 0:00 /usr/sbin/nfsd 16

      If the output is similar to the above example, then the nfsd is already started, if not..

    • start the nfsd daemon

      # /sbin/init.d/nfs.server start

  4. Test whether the shared directories can be mounted from the target server
    • Mount the shared directory manually

      # mount -F nfs hqcmsdb2:/backup/dump /backup/dump

    • Check whether the directory is mounted correctly

      # mount
      / on /dev/vg00/lvol3 ioerror=nodisable,log,dev=40000003 on Sun Dec 7 18:03:17 2008
      /stand on /dev/vg00/lvol1 ioerror=mwdisable,log,nodatainlog,tranflush,dev=40000001 on Sun Dec 7 18:03:18 2008
      /var on /dev/vg00/lvol8 ioerror=mwdisable,delaylog,nodatainlog,dev=40000008 on Sun Dec 7 18:03:31 2008
      /var/opt/ignite/recovery/archives on /dev/vg00/lvol10 ioerror=mwdisable,largefiles,delaylog,nodatainlog,dev=4000000a on Sun Dec 7 18:03:31 2008
      /usr on /dev/vg00/lvol7 ioerror=mwdisable,delaylog,nodatainlog,dev=40000007 on Sun Dec 7 18:03:31 2008
      /u01 on /dev/vg00/lvol9 ioerror=mwdisable,delaylog,nodatainlog,dev=40000009 on Sun Dec 7 18:03:31 2008
      /backup/dump on hqcmsdb2:/backup/dump rsize=32768,wsize=32768,NFSv3,dev=7 on Wed Dec 10 20:37:33 2008

Aand.. I think we’re done



Scheduling a move file using cron and scp
October 6, 2008, 13:21
Filed under: *Nix, HP-UX, Red Hat, Ubuntu | Tags: , , , ,

So I need to automate a process where an oracle dump file is moved to a remote server, and the existing loacl file is then permanently removed. I have to make sure that:

  1. the status of copy process is reported, whether successful, or not
  2. The remove process will only start if the copy process is successful
  3. The copy process is unattended, so a public key authentication must be available between the local and remote server. I have guide regarding a public key authentication for ssh/scp somewhere around here

This is how the script looked like:


#!/sbin/sh
date >> /backup/movedump.log
tgl=$(date +”%y-%m-%d-%M”)
cd /backup
if [ -f /backup/dumpf* ];
then
scp dumpf* kirim@172.16.2.15:/opt/data/dump/backup/
STAT=$?
echo “$tgl-S1:dump file succesfuly moved” >> /backup/movedump.log
else
STAT=1
fi
if [ $STAT -eq 0 ];
then
rm dumpf*
echo “$tgl-S2:local dump file deleted” >> /backup/movedump.log
else
if [ $STAT -eq 1 ];
then
echo “$tgl-E1:no dump file on source directory, no action taken” >> /backup/movedump.log
else
echo “$tgl-E2:dump file move process exit with code $STAT, remove process not executed” >> /backup/movedump.log
fi
fi

The code above will check whether the dumpfile exists or not. If the file doesn’t exist, the variable STAT will be given a value of 1. If the file exist, it will begin scp process to the remote server. Scp process provide us with several report codes that is stored on “$?”. If the copy process is successful, the value of “$?” is 0, other if it’s not. That value is then stored on the variable STAT

The process then proceed based on the value inserted to the variable STAT

  1. If STAT=0, the copy process is successful, the script will proceed to remove the dump file on the local server
  2. if STAT=1, the script did not find a dump file to transfer to remote server
  3. if STAT value is other than 1 and 0, the transfer process has failed

All of the step taken by the script is logged on file movedump.log

The next step is to make sure the script is executed everyday, automatically. For me, it is scheduled to run 4 pm, everyday:.

$crontab -e

Then put this line:

00 16 * * * /backup/movedump.sh

With this, the script will be executed every day at 4 pm sharp.

Done!




Follow

Get every new post delivered to your Inbox.

Join 104 other followers