rami.info



Solving System Headers Problems When Using sunfreeware.com’s GCC

Posted in Errors,Software,Solaris,Sysadmin by Rami on the August 9th, 2006

When getting an error like:

In file included from /usr/include/sys/signal.h:34,
from /usr/include/signal.h:26,
from /usr/local/lib/perl5/5.8.7/sun4-solaris/CORE/unixish.h:106,
from /usr/local/lib/perl5/5.8.7/sun4-solaris/CORE/perl.h:2220,
from u32align.c:10:
/usr/include/sys/siginfo.h:259: error: parse error before “ctid_t”
/usr/include/sys/siginfo.h:292: error: parse error before ‘}’ token
/usr/include/sys/siginfo.h:294: error: parse error before ‘}’ token
/usr/include/sys/siginfo.h:390: error: parse error before “ctid_t”
/usr/include/sys/siginfo.h:392: error: conflicting types for `__proc’
/usr/include/sys/siginfo.h:261: error: previous declaration of `__proc’
/usr/include/sys/siginfo.h:398: error: conflicting types for `__fault’
/usr/include/sys/siginfo.h:267: error: previous declaration of `__fault’
/usr/include/sys/siginfo.h:404: error: conflicting types for `__file’
/usr/include/sys/siginfo.h:273: error: previous declaration of `__file’
/usr/include/sys/siginfo.h:420: error: conflicting types for `__prof’
/usr/include/sys/siginfo.h:287: error: previous declaration of `__prof’
/usr/include/sys/siginfo.h:424: error: conflicting types for `__rctl’
/usr/include/sys/siginfo.h:291: error: previous declaration of `__rctl’
/usr/include/sys/siginfo.h:426: error: parse error before ‘}’ token
/usr/include/sys/siginfo.h:428: error: parse error before ‘}’ token
/usr/include/sys/siginfo.h:432: error: parse error before “k_siginfo_t”
/usr/include/sys/siginfo.h:437: error: parse error before ‘}’ token

It’s possible to solve the problem using:

cd /usr/local/lib/gcc-lib/sparc-sun-solaris2.10/3.3.2/install-tools
./mkheaders

10 on 10

Posted in RDBMS,Software,Solaris,Sysadmin by Rami on the August 7th, 2006

To install Oracle 10g on Solaris 10 do the following:

  • Add the SUNWi15cs and the SUNWi1cs packages.
  • Create the needed groups:

groupadd -g 100 oinstall
groupadd -g 101 dba

  • Create the oracle user:

useradd -u 100 -g 100 -G 101 -d /data/oracle -m -s /bin/tcsh oracle

  • Create the oracle project:

projadd oracle

  • Edit /etc/user_attr and add the following:

oracle::::project=oracle

  • Set the max.shm.memory and max.sem.ids for the project:

projmod -s -K "project.max-shm-memory=(priv,4gb,deny)" oracle
projmod -s -K "project.max-sem-ids=(priv,100,deny)" oracle

  • Edit /etc/system and add the following:

set noexec_user_stack=1

  • Reboot
  • Install ORACLE using the installer by running the following:

./runInstaller -ignoreSysPrereqs

  • Enjoy

Cloning A Drive Under Solaris

Posted in Solaris,Sysadmin by Rami on the May 15th, 2006

1. Find the device names of the source and destination drives:
format < /dev/null

2. run the following sh script:
SRC=c0t0d0
DEST=c0t1d0
MOUNTDIR=/clone
SLICES="s0 s1 s2 s3 s4"
mkdir ${MOUNTDIR}
prtvtoc /dev/rdsk/${SRC}s2 > /tmp/vtoc
fmthard -s /tmp/vtoc /dev/rdsk/${DEST}s2
installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/${DEST}s2
# OR installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/${DEST}s0
for i in $SLICES; do
newfs /dev/dsk/${DEST}${i} < /dev/null
mount /dev/dsk/${DEST}${i} ${MOUNTDIR}
cd ${MOUNTDIR}
ufsdump 0f - /dev/dsk/${SRC}${i}| ufsrestore rf -
cd /
umount ${MOUNTDIR}
done
rmdir ${MOUNTDIR}
rm /tmp/vtoc

Updating Solaris 10

Posted in Solaris,Sysadmin by Rami on the May 15th, 2006

In order to update Solaris 10 with the latest OS updates the following is needed to be done:

1. Create a file /tmp/registration.properties with the following:
userName=sunusername
password=sunpassword
hostName=
subscriptionKey=
portalEnabled=false
proxyHostName=
proxyPort=
proxyUserName=
proxyPassword=

2. Run the following command:
sconadm register -a -r /tmp/registration.properties

3. To perform the update do the following:
smpatch update