RBAC quick and dirty

Filed under: trickitortips — Wrote on Saturday, June 28th, 2008 @ 9:19 am

Terkait dengan Project Identity manager dikantor yang menggunakan Oracle Identity Management
penggunaan tool semacam RBAC menjadi sangat populer, sebetulnya ingin sekali memakai sudo, tapi itulah project yang kadang menjadi tidak masuk akal dengan requirement-requirementnya.

Disini kita akan coba setup RBAC, dimana RBAC ini diperlukan oleh OIM agar dapat mencreate, modifikasi dan mendelete user disystem.
untuk systemnya menggunakan SunOS 5.9.

Untuk pertama kali kita buat “Base User” untuk login ke system untuk useradd
# useradd -md /export/home/idm -g 102 idm
# passwd idm

Lalu kita buat Role untuk useradd dimana rolenya ini seperti yang disebutkan diatas, yaitu create, modified dan delete user
# roleadd -md /export/home/user1 -c "Role For Adding User" useradd
# passwd useradd

Berikutnya kita tambahkan role untuk “base user” tadi dan “user role” tadi
# usermod -R useradd idm

Next kita tambahkan autorisasi di file “/etc/security/prof_attr”
# echo "USERADD:::Rights Profile to IDM PROJECT:help=usera1.html" >> /etc/security/prof_attr

(more…)

Linux Multipath Setup Howto

Filed under: trickitortips — Wrote on Friday, June 27th, 2008 @ 3:10 pm

Multipathing Di linux dengan Device Mapper
———————————————-
1. Server IBM BladeCenter HS20 dengan RHEL 4
2. Storage HDS USP1100
3. Switch brocade 48000

Langsung aja ya..

Cek HBA WWN nya
# cat /proc/scsi/qla2xxx/2 |grep port
scsi-qla1-adapter-port=210000145e24e4d5;
# cat /proc/scsi/qla2xxx/1 |grep port
scsi-qla0-adapter-port=210000145e24e4d4;

Cek Aplikasi Device mapper
# rpm -qa|grep device-mapper
# wget ftp://ftp.pbone.net/mirror/ftp.centos.org/4.6/os/i386/CentOS/RPMS/device-mapper-multipath-0.4.5-27.RHEL4.i386.rpm
# wget ftp://ftp.pbone.net/mirror/ftp.centos.org/4.6/os/i386/CentOS/RPMS/sysfsutils-1.2.0-1.i386.rpm
# rpm -ivh sysfsutils-1.2.0-1.i386.rpm
# rpm -ivh device-mapper-multipath-0.4.5-27.RHEL4.i386.rpm

ModProbe ke Kernel
# modprobe dm-multipath

Startup Config
# chkconfig multipathd on
# service multipathd start
(more…)

Extend New Logical Volume

Filed under: trickitortips — Wrote on Tuesday, May 20th, 2008 @ 7:33 am

This shows how to increase the size of the logical volume of the mount point /rdbms/oradata/data2, size to increase was grab from unnecessary logical volume (/data1) on another VG (vg71).

$ bdf |grep vg56
/dev/vg56/lvol1 209715200 200494696 9148512 96% /rdbms/oradata/data2

$ bdf | grep vg71
/dev/vg71/lvol2 314507264 9630632 302495344 3% /data1
/dev/vg71/lvol3 314441728 218277456 95544216 70% /data2

The problem is VG71 have two logical volume, lvol2 (data1) and lvol3 (data2). So first we must remove the unnecessary logical volume, then out the disk member of unnecessary logical volume (/dev/dsk/c64t15d5), after that you can extend the disk to another VG (vg56), extend the lvol (vg56|lvol1|/rdbms/oradata/data2), and verify the space.

Backup the data before use this step.
-verify the online JFS has installed
# swlist |grep -i jfs
B3929CA B.11.11.03.03 HP OnLineJFS

-Remove /dev/vg71/lvol2
# umount /data1
# lvremove /dev/vg71/lvol2

-step out the disk /dev/dsk/c64t15d5 from vg71
# vgreduce /dev/vg71 /dev/dsk/c64t15d5

-Added /dev/dsk/c64t15d5 to VG56
# vgextend /dev/vg56 /dev/dsk/c64t15d5

-Extend lvol1 from vg56
I’want to extend above 50GB, (source size is 209GB, so totally is 259GB)
# lvextend -L 259000 /dev/vg56/lvol1

-Now Increase with online JFS tools
# fsadm -b 265216000 /rdbms/oradata/tm1_matrix_m2
Note: 265216000= 259000 * 1024

-Verify
# bdf /rdbms/oradata/tm1_matrix_m2
Filesystem kbytes used avail %used Mounted on
/dev/vg56/lvol1 262078464 200496296 61101096 77% /rdbms/oradata/tm1_matrix_m2

Oh..Archive Log

Filed under: trickitortips — Wrote on Monday, May 19th, 2008 @ 4:23 pm

Damn…
when project upgrade veritas netbackup from 5.0 to 6.0 never shown their progress.
and the database archive log was grown rapidly, so for the quickly action, I build this script.
works on HP-UX environments


#!/usr/bin/sh
# moving archive log
#####################################
bdf -l /oracle/archivelog | grep -iv Filesystem |awk '{print $6" "$5}' | while
read LINE; do
ASS=`echo $LINE | cut -d"%" -f1 | awk '{ print $2 }'`
if [ $ASS -gt 95 ]; then
/usr/bin/find /oracle/archivelog -name "*.arc" -type f -exec mv {} /backup/archive_may/ \;
fi
done

combination with the crontab..

$ crontab -l
* * * * * sh /scripting/arsip.sh >/dev/null 2>&1

No locks available

Filed under: trickitortips — Wrote on Tuesday, February 19th, 2008 @ 7:47 pm

superdomeList Error Hari ini
“lckpwdf: Lockf deadlock detection Cannot obtain lock for /etc/.pwd.lock”
“WARNING: Failed to lock file: /var/opt/ignite/recovery/mnr_lockfile: Lockf deadlock detection (errno = 45)”
“Oracle instance running on a system with low open file descriptor limit. Tune your system to increase this limit to avoid severe performance degradation”
“ORA-00313: open failed for members of log group 2 of thread 1″
“ORA-00312: online log 2 thread 1: ‘/rdbms/oracle/users/oracle_sid/log_oracle-sid.ora’”
“ORA-27086: skgfglk: unable to lock file - already in use”
“HP-UX Error: 46: No locks available”

Machine Detail

  • Model: 9000/800/SD32A
  • Main Memory: 143277 MB
  • Processors: 20
  • OS mode: 64 bit
  • OS: HP-UX B.11.11 U 9000/800

Solving with tuning the kernel parameter below here..

  • nflocks = 200 + sum of database files for all instance
  • maxfiles = 25% x current value
  • maxfiles_lim = 25% x current value
  • maxusers = No of connection oracle + 64
  • maxuprc = maxusers * 5

Expanding Your Solaris Filesystem

Filed under: trickitortips — Wrote on Monday, December 31st, 2007 @ 4:55 pm

c0t0d0Use with your own risk, but this is works

Req:
-Metadevice : d56
-Disk: emcpower6a(A2=c3t500601623021B12Ed2s2) + emcpower8a(A2=c3t500601623021B12Ed8s2)

Command:

# df -h |grep d56
/dev/md/dsk/d56 391G 64M 390G 1% /archive1

# metastat d56
d56: Soft Partition
Device: c3t500601623021B12Ed2s2
State: Okay
Size: 832421888 blocks (396 GB)
Device Start Block Dbase Reloc
c3t500601623021B12Ed2s2 16384 No Yes

# metaclear d56
d56: Soft Partition is cleared

# metainit d56 2 1 emcpower6a 1 emcpower8a
d56: Concat/Stripe is setup

# mount /dev/md/dsk/d56 /archive1
# growfs -M /archive1 /dev/md/rdsk/d56
# df -h|grep d56
/dev/md/dsk/d56 788G 64M 787G 1% /archive1

# metastat d56
d56: Concat/Stripe
Size: 1677639680 blocks (799 GB)
Stripe 0:
Device Start Block Dbase Reloc
emcpower6a 0 No No
Stripe 1:
Device Start Block Dbase Reloc
emcpower8a 16384 No No

Device Relocation Information:
Device Reloc Device ID
emcpower6a No -
emcpower8a No -

Moving & Recreate Temp Tablespace

Filed under: trickitortips — Wrote on Thursday, December 13th, 2007 @ 12:29 am

Yesterday i get error on my database

Errors in file /rdbms/oracle/admin/udump/prod_ora_685.trc:
ORA-01114: IO error writing block to file 10004 (block # 503489)
ORA-27072: skgfdisp: I/O error
HP-UX Error: 28: No space left on device
Additional information: 503489

Karena semua query di tampung di temporary tablespace, so i go to that mount point, and you now what, the mount point was full
# bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg12/lvol5 112656384 112656384 0 100% /rdbms/oracle/temp

so i extend the new tablespace on that mount point (force..), the extend proses was to quickly than before, :(

so i use lvdisplay /dev/vg12/lvol5 and
fstyp -v /dev/vg12/lvol5,
to check the size and compare with bdf/sam command.

Think fast, I used another mount point to moving and recreate the temp tablespace..detail click here.

and blast..
the error was gone, the mount point was suspect corrupt,
umount, lvremove, lvcreate and than newfs, mount and yes new mount point was added again.

‘Lebaran’ at d office

Filed under: info, trickitortips — Wrote on Monday, October 15th, 2007 @ 12:10 pm

Yups..semua orang pasti pernah ngerasai ‘enak’ nya lebaran dikantor, entah loyalitas, terpaksa, lemburan yang berlimpah, ato banyak alasan lah.
kali ini setelah menunaikan sholat ied, dan bersimpuh (terlalu berlebihan kayanya deh) di hadapan ortu, gue langsung cabut ke kantor.

Here’s the problem summary
First we have issue about Undo_Retention (undo_retention before = 129600),
yes the Undo retention was set improper, this keep the query for a long-long time, this fix with alter system set undo_retention=14000, and then alter system set query_rewrite_enabled=false scope=both sid='*', Second we get error-code message from the client who’s connect to the databases (ORA-03113 end-of-file on communication channel), this cause the connection to server was break see problem next(third),
Third the database was slow response and you know what, like on schedule, the slow response was start at 6 am to 10 am, probably issue I/O contention and delay commit on database and the application.

After discuss with team application and running the statpack, known was we have very2 high traffic (probably lebaran days), solve for while was stop the backup script, rename and truncate the table (the table was B*tree index, hu..uh) was record the traffic,
for a while response to from application to database was come back normally and the database was back in good performance,
this solve..not quite.

Today i have the same problem, confuse, of course..
i think maybe memory was, cause (again) high traffic but handle only one node (first design RAC), so i change (again) pga parameter cause the ratio pga was 54% and for the optimum ratio i change to 1.5G (backup first –create pfile ='/app/oracle/product/9.2.0/dbs/init_141007.ora' from spfile–), alter system set pga_aggregate_target=1500M scope=both sid='*' and then restart.
was not impact, hu..uh..
I see the log buffer parameter, and then I see the log_checkpoint_interval was set improper (1410065407) , this impact to delay checkpoint, so for the faster checkpoint with no delay, I change to default “0″ with alter system set log_checkpoint_interval=0 scope=both id='*'
and you know what, the response queue from application to database was back to normal.

Know i must to distribute the busy datafile to other mountpoint and change from raid 5 to raid 1+0…Puih

who’s design this project..hu..uh.

Collect Data In Your Box with cfg2html

Filed under: trickitortips, ubuntu — Wrote on Tuesday, May 15th, 2007 @ 3:51 am

Cfg2html is a UNIX shell script similar to check_config or get_config, except that it creates a HTML (and plain ASCII) system documentation..

$ sudo apt-get install gawk
$ wget http://www.cfg2html.com/cfg2html-linux_1.39-4_all.deb
$ sudo dpkg -i cfg2html-linux_1.39-4_all.deb
$ sudo cfg2html-linux
$ firefox /etc/cfg2html/<your-hostname>.html

Enjoy The Document..
Cheers.

apache2: apr_sockaddr_info_get() failed for & Could not reliably determine the server’s fqdn, using 127.0.0.1 for ServerName

Filed under: trickitortips, ubuntu — Wrote on Tuesday, April 10th, 2007 @ 7:59 am

Pernah?
Dah Basi Pastinya

$ gksudo gedit /etc/apache2/httpd.conf
Lalu Masukan Parameter Dibawah ini
ServerName localhost
$ sudo /etc/init.d/apache2 start
* Starting web server (apache2)... httpd (pid 12023) already running [ OK ]

–EOF

© it’s simply a matter of a time…