Thursday, February 21, 2008

Learning the Cluster (installation) Type of an Solaris

Solaris OS has various cluster types for installation.
here is the list:

SUNWCrnet Reduced Networking Core System Support
SUNWCreq Core System Support
SUNWCuser End User System Support
SUNWCprog Developer System Support
SUNWCall Entire Distribution
SUNWCXall Entire Distribution plus OEM support

if you want to learn the cluster type of an installed system, you can run this command:

# cat /var/sadm/system/admin/CLUSTER
CLUSTER=SUNWCXall

Wednesday, February 20, 2008

Oracle Client for Linux (rpm)

if you want to connect to a remote oracle database from a linux machine (with net naming services, tnsnames.ora file) you should have oracle client software. you can download this software from oracle official site.
size of the softwares for client and server are so huge. Maybe it is normal for server software but not for client.
But you have an another choice, you can install only 2 rpm files and use sqlplus and oracle client libraries.
total size of these files is 34mb, download url is: http://www.oracle.com/technology/software/products/database/xe/htdocs/102xelinsoft.html

installation:
it is too basic.
rpm -iv oracle-instantclient-basic-10.2.0.3-1.i386.rpm
rpm -iv oracle-instantclient-sqlplus-10.2.0.3-1.i386.rpm

after installation you have to set LD_LIBRARY_PATH and add /usr/lib/oracle/10.2.0.3/client/lib. (to see the path of client files:
[root@oracle]# rpm -qlv oracle-instantclient-basic
-rwxr-xr-x 1 root root 39612 Nov 15 2006 /usr/lib/oracle/10.2.0.3/client/bin/genezi
-rw-r--r-- 1 root root 18825267 Nov 15 2006 /usr/lib/oracle/10.2.0.3/client/lib/libclntsh.so.10.1
-rw-r--r-- 1 root root 5486009 Nov 15 2006 /usr/lib/oracle/10.2.0.3/client/lib/libnnz10.so
-rw-r--r-- 1 root root 1398088 Nov 15 2006 /usr/lib/oracle/10.2.0.3/client/lib/libocci.so.10.1
-rw-r--r-- 1 root root 72480394 Nov 15 2006 /usr/lib/oracle/10.2.0.3/client/lib/libociei.so
-rw-r--r-- 1 root root 120135 Nov 15 2006 /usr/lib/oracle/10.2.0.3/client/lib/libocijdbc10.so
-rw-r--r-- 1 root root 1545954 Nov 15 2006 /usr/lib/oracle/10.2.0.3/client/lib/ojdbc14.jar
)

so, where is tnsnames.ora file?
you can put this file anywhere. it is enough to set TNS_ADMIN shell variable to the directory of tnsnames.ora file.

now you can use sqlplus to connect remote oracle database.

Router Configuration for Solaris

if you want to make router configuration permanent for a solaris machine, you should put the ip or hostname of your router to /etc/defaultrouter file. (ipv4)

Tuesday, February 19, 2008

how to see the storage engine of a mysql table

you can use the
mysql> show create table TABLE_NAME
command to see the engine of a table.
the response should be like that:

Create Table: CREATE TABLE t (
id INT(11) default NULL auto_increment,
s char(60) default NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM

Friday, February 15, 2008

Setting kernel and project parameters for Oracle on Solaris 10

Before installing Oracle on Solaris, you have to do some preparatory works for a correct installation. For example creating groups and user. (groups: oinstall, (dba-optional); user: oracle)
there is an another important requirement. Kernel parameters..
Before Solaris 10, you have to edit the /etc/system file to change kernel parameters. But with Solaris 10, we use projects to define required parameters.
first of all, control the project information for the user you loged in (for installation it should be oracle)

# id -p
uid=101(oracle) gid=101(oinstall) projid=3(default)

it is clear that proejct id for oracle is 3. now we can control the kernel parameters.

for the parameter max-shm-memory :
# prctl -n project.max-shm-memory -i project 3

for the parameter max-sem-ids
# prctl -n project.max-sem-ids -i project 3

if the values are not enough for oracle (compare them with the requirements given in Oracle Documentation) you have to change them. If you don't change these values, you can get "Out Of Memory" error while installing Oracle.

you can change them with these commands:


# prctl -n project.max-shm-memory -v 6gb -r -i project 3
# prctl -n project.max-sem-ids -v 256 -r -i project 3


there is a last point, to make these values permanent, you have to run these commands:
# projmod -K "project.max-sem-ids=(priv,256,deny)" default
# projmod -s -K "project.max-shm-memory=(priv,6000MB,deny)" default

now your /etc/project file is changed.

Thursday, February 14, 2008

Solaris Patch Installation Status Codes

if you are installing a Solaris patch, these status code may be useful for you

Solaris Patch Installation Status Codes
0. No error
1. Usage error
2. Attempt to apply a patch that's already been applied
3. Effective UID is not root
4. Attempt to save original files failed
5. pkgadd failed
6. Patch is obsoleted
7. Invalid package directory
8. Attempting to patch a package that is not installed
9. Cannot access /usr/sbin/pkgadd (client problem)
10. Package validation errors
11. Error adding patch to root template
12. Patch script terminated due to signal
13. Symbolic link included in patch
14. NOT USED
15. The prepatch script had a return code other than 0.
16. The postpatch script had a return code other than 0.
17. Mismatch of the -d option between a previous patch install and the current one.
18. Not enough space in the file systems that are targets of the patch.
19. $SOFTINFO/INST_RELEASE file not found
20. A direct instance patch was required but not found
21. The required patches have not been installed on the manager
22. A progressive instance patch was required but not found
23. A restricted patch is already applied to the package
24. An incompatible patch is applied
25. A required patch is not applied
26. The user specified backout data can't be found
27. The relative directory supplied can't be found
28. A pkginfo file is corrupt or missing
29. Bad patch ID format
30. Dryrun failure(s)
31. Path given for -C option is invalid
32. Must be running Solaris 2.6 or greater
33. Bad formatted patch file or patch file not found
34. Incorrect patch spool directory
35. Later revision already installed

uninitialized state for any service on solaris 10

if there is a problem about a service on solaris 10 (i.e telnet), you can control the status of this service with command
# svcs grep telnet

you should see "online" as output if there is no problem. if the status in the output is offline, you can take it online with this command:
# svcadm enable svc:/network/telnet:default

if the status is "uninitialized", you should control the output of
# svcs -vx
command. with this information you can find the problem (maybe a dependancy)

i met with this problem and saw that some of the services look for /etc/resolv.conf (telnet, ftp). i created the file, then the statuses became online.