Showing posts with label Solaris 11. Show all posts
Showing posts with label Solaris 11. Show all posts

Saturday 24 June 2017

Sun Solaris zonecfg commands with an example

"zonecfg" command is very useful command which is mostly used during configuration of new zone or installed zone as well as for removal of any zone configuration files.

This command are valid for Sun Solaris 10.x,11.x,12.x version.

➤ Command for creating a Solaris zone:

Please find the below commands to creating a zone on Sun Solaris server. The command must be run on Global zone with root user.

!-[solaris]# zonecfg -z <zone>

Example: !-[solaris]# zonecfg -z sunz01

Once you run the above command, you can enter in the configuration file, where you can add or edit the configuration for the zone.

Command for deleting a Solaris zone:

Please find the below command to deleting a Solaris zone from Global zone.

!-[solaris]# zonecfg -z <zone> delete -F

Example: !-[solaris]# zonecfg -z sunz01 delete -F

using above command you can delete or remove the configuration file of solaris local zone.

Note: You need to shutdown and uninstall the local zone before deleting the configuration files of Sun Solaris local zone.

Command for display zone current configuration:

Please find the below command to display the current configuration of local Solaris zones.

!-[solaris]# zonecfg -z <zone> info

Example: !-[solaris]#zonecfg -z sunz01 info

This command output show you the zonename, zonepath, autoboot etc attributes information of the solaris zone.

Command for zone creation file:

Please find the below command to create a solaris zone creation file.

!-[solaris]#zonecfg -z <zone> export

Example: !-[solaris]#zonecfg -z sun01 export

Once the creation file has been export you can use this file to another zone creation as well as for restoration of this local zone if any problem occur on this zone.

Sunday 18 June 2017

Sun Solaris Processes Monitoring - prstat command

"PRSTAT" command basically used for monitoring the current memory and CPU utilization of Sun solaris local zones and global zone.

Using "prstat" command we can display the solaris zone process information. This command generate the reports information about the processes and zones.

The prstat statistics utility shows a summary of the processes that are using system resources currently. The prstat utility summarizes this information for an every 5 seconds by default and reports the statistics for that period.

Display the zones process information:

!-[solaris]# prstat -Z

 PID USERNAME  SIZE   RSS STATE   PRI NICE      TIME  CPU PROCESS/NLWP
 18638 20159    2118M 1502M cpu43    10    0   0:00:44 2.4% oracle/7
 20927 24076    8784K 8136K cpu127    0    2   0:00:17 1.8% prstat/1
   897 24865     916M  512M sleep    59    0  27:52:32 0.7% java/95
 17511 26055     599M  285M sleep    59    0  35:08:33 0.6% java/115
 12540 26055     951M  341M sleep    59    0  31:00:01 0.5% java/101

 ZONEID    NPROC  SWAP   RSS MEMORY      TIME  CPU ZONE
     8     3427   73G   27G    21%  44:01:48 2.8% sunz01
     0      100  465M  132M   0.1% 507:26:46 2.6% global
     6     4056   86G   32G    25%  35:23:30 2.3% sunz02    
Total: 13382 processes, 36594 lwps, load averages: 9.11, 9.27, 9.47

Using above command "prstat -Z" we can monitor the server process utilization in every 5 second. This command is show you the global zone & their local zone process utilization only.

If you want to only specific zone process utilization then you can use the below command.

!-[solaris]# prstat -z sun01

This command output show you only process utilization of specific zone only.

Note:

-Z Reports information about processes and zones.
-z Reports information about a particular zone.

You can use the below syntax to monitor the Global zone as well as only specific zone.

How to run Oracle Explorer on Sun Solaris 11 Operating System

Explorer files are used as a snapshot when we need to check all hardware issues or internal issue. The explorer files keeps all these information.

Oracle SUN Solaris explorer is a collection of scripts and binary executable files which collect all information and creates a detailed snapshot of Oracle Sun Solaris system configurations.

Oracle Sun Solaris Explorer is always installed on Global zone using root user which are running only Sun Sparc system and Solaris X86 systems as well as we are gathers information related to drivers, patches, recent system event history, and log file entries from the Oracle Explorer Data Collector output.

Before moving to run the explorer files we need to understand which packages is required to installed and configure the explorer files.

➤ First we need to download the Service tools bundle from any ftp servers and extract them and run the script with extension syntax.

!-[solaris]# ./install_stb.sh -ext

➤ In this step we will uncompressed and untar the Explorer tar file using below command.

!-[solaris]# cd /var/tmp/stb/extract/Explorer
!-[solaris]# uncompress Explorer.tar.Z
!-[solaris]# tar xvf Explorer.tar

➤ In this step we will install Explorer packages and create directories "SUNWexplo" and "SUNWexplu" to install the required packages.

!-[solaris]# pkgadd -d . SUNWexplo SUNWexpl

➤ Now we will run the explorer command to obtained the logs files from the Sun Solaris system.

!-[solaris]# explorer
  
Normally on Solaris server the default location to run the above command is /usr/sbin/explorer which create & send the explorer log file.

➤ If you want the create default configuration file only first time please use the below syntax.

 !-[solaris]# explorer -g 

➤ If you want to check explorer version please run the below command.

 !-[solaris]# explorer -V
        
Normally in most of the Solaris server the default path of the explorer output is /var/explorer/output but it depends where you installed the Explorer.

Please comment on the post, if you have any query related to this topic.

Thursday 25 May 2017

How to increase the file system size in Solaris 10/11 operating system

When you file system get full on Sun Solaris operating system , you need to increase it but on Solaris platform it is quite different from other unix operating version.

The below method are used for both type of Sun Solaris version 10/11. You can used the same command on different version platform.

➤ Mostly on Solaris 10/11 machine we have only use default storage pool. if you server is not connected to any SAN, then zpool name should be "rpool".

If you want to check which zpool are present on the Solaris box, you can run the below command for this work.

!-[solaris]# zpool status

Using the above command you can check which zpool storage are present on the solaris server. In my case my Solaris box is connected to SAN storage, so it is display both system default "rpool" & "san" storage system.

➤ Let's suppose you want to increase the size of root file system on server, then first you need to check the current disk space on the filesystem.

To check the current file size of filesystem you can use "df -h" command. This command will show you the filesystem size in correct manner.

On my Solaris box the root filesystem was created with rpool storage, so if I need to increase or extend the size of root filesystem I need to take space from this zpool.

For example, If you want to 5 Gb more space on root filesystem then please use the below command to extend the root filesystem size more 5 Gb. In my case my current root filesystem size is 12Gb so I will extend it to 17 Gb.

!-[solaris]# zfs set quota=17G rpool/ROOT/solaris-1

You can add the 5 Gb space in your current size (12Gb).

!-[solaris]# zfs set reservation=17G rpool/ROOT/solaris-1

In above command you can reserve the 17G space to root filesystem. You can check the new filesystem space using "zfs get quota" command.

Please comment on the post if you are facing any issue regarding the filesystem.

Monday 22 May 2017

Sun Solaris 11 failed connect to studio repo connection refused error

On Solaris server when you are trying to download the packages from the oracle repo server then sometimes you are facing a connection refused error.

Sun Solaris 11 failed to connect the studio repo during downloading the packages online from Oracle server. You can find the error message which you are getting normally on the Solaris server.

!-[solaris]# pkg install pkg://solaris/x11/diagnostic/x11-info-clients

pkg: 1/3 catalogs successfully updated:
Unable to contact valid package repository
Encountered the following error(s):
Unable to contact any configured publishers.
This is likely a network configuration problem.
Framework error: code: 7 reason: Failed connect to studio-repo.oracle.com:1008; Connection refused
URL: 'http://studio-repo.oracle.com' (happened 6 times)

Framework error: code: 7 reason: Failed connect to solaris-repo.oracle.com:1008; Connection refused
URL: 'http://solaris-repo.oracle.com/versions/0/'
any suggestion ??


If you see the above error you can see that when I try to install the X11 info clients packages on the server, I am getting a framework error which describe that failed to connect with Solaris repo.

Normally , user afraid with such type of error while working on it but I believe its very small error and get resolved in two steps.

Just go through my below solution which is very useful for such type of error troubleshooting.

You need to check the pkg services on the Solaris operating system, please check they are enable or not on the server.

!-[solaris]# svcs \*pkg\*
STATE          STIME    FMRI
disabled       May_22   svc:/application/pkg/dynamic-mirror:default
disabled       May_22   svc:/application/pkg/mirror:default
disabled       May_22   svc:/application/pkg/server:default
online         13:27:09 svc:/system/pkgserv:default
online         13:27:09 svc:/application/pkg/zones-proxy-client:default
online         13:27:09 svc:/application/pkg/repositories-setup:default

If you see the above pkg service result , lot of service related to packaging system are disable, so you need to restart the all disable and enable service then after again start to install the package.

Please post your comment on my blog, if you have any query related to this topic.

Sunday 21 May 2017

Step by Step method to enable SAR (System Activity Reporter) on Solaris Server

When you work on Solaris operating system, you need to managed the performance of the operating system. If the performance are very good then your server behave normal and run the long time without any issue.

Sometime your Solaris server performance is not good and memory and resource utilization get very high, then you need to find out what is the cause of this high utilization and if you are working on client project then your client must want the report.

So on Solaris server we are used SAR (System Activity Reporter) to generate all the report related to server health.

SAR (System Activity Reporter) is used to troubleshoot the performance issue on Sun Solaris Servers. Using SAR (System Activity Reporter) we can troubleshoot or monitored the disk, memory or CPU performance issues on the Solaris operating system servers.

Step by step procedure to enable SAR (System Activity Reporter):

⏩ By default SAR utility are installed on the Solaris 11 operating system. If you want to check the current service status of SAR, then you need to run the below command.

!-[solaris]# svcs status sar
disabled        May_22  svc:/system/sar:default

You can used also below command to check the current status of SAR services.

!-[solaris]# svcs -a | grep -i sar
disabled        May_22  svc:/system/sar:default

In above command output, if you see currently the sar service is disable so in the next step we need to enable this service

⏩ In this step, you need to enable the SAR services which is disable on the my solaris server.

!-[solaris]# svcadm enable svc:/system/sar:default

Using above command the SAR service has been started, if you want to check the current status please run the below command.

!-[solaris]# svcs status sar
enabled        May_22  svc:/system/sar:default

⏩ We will make a setup for automatic data collection, once we enable the sar service. The default script for SAR utility are located the below directory location.

/usr/lib/sa/sa1➤ This is a shell script to collect and store data in the binary file /var/adm/sa/sadd, where dd is the current day.

/usr/lib/sa/sa2➤ This is a  shell script for generating daily report in the file /var/adm/sa/sardd, where dd is current day.

As these above script are used normally to collect the automatically data from Solaris Server. If you required the daily report or weekly report then you need to add both the script in crontab file which is describe in next step.

⏩ If you required the SAR report regularly then you need to make an entry of above script on the crontab file.

!-[solaris]# crontab -e

Using these command you can edit the existing file and make an entry of above script according to your requirement when you want to generate the report.

Please comment on my post, if you have any query related to this sar topic.

Thursday 18 May 2017

How to Increase a Swap Space on Solaris Server

Swap memory work as a virtual memory in Unix operating systems. In Unix server when your physical memory used fully, that time swap memory are used and its maintain the system performance.

On Solaris server, if your swap size space use full then you need to create a new swap file or increase the swap space. We have a different method to increase/create a swap size on Solaris operating system server.

Here, we will discuss how to increase a swap size on Sun Solaris 11 operating system. The same steps are used for Sun Solaris 10 operating system.

In my testing machine, we are using storage space to create a new swap file as my operating system pool space are already fully utilized. 

Step by Step Method to Increase a Swap Space:

➤ On your Solaris machine , first you check the current swap space. Please use the below command to check the current running swap size.

!-[solaris]# swap -l
swapfile                               dev        swaplo   blocks       free
/dev/zvol/dsk/san/swap1     202,1        16         731596    6730226

In above example, "swap -l" command used to check the existing swap size space, you can use "top" command as well but using "top" command you can not find which swap named file are in used. You can find only total swap memory available on the Solaris server. On my solaris testing machine "swap1" file was already created which is currently in used.

➤ If you want to increase more size then you need to create a new swap file like swap2 or swap 3 as per your requirement and space available on server storage.

Let's assume on my Solaris server, I need to increase 30 GB more swap size, then you need to create new swap file.

Please use the below command to create a new swap file on Sun Solaris 11 operating system.

!-[solaris]# zfs create –V 30G san/swap2
!-[solaris]# swap –a /dev/zvol/dsk/san/swap2

In above command, we will create swap2 file with 30 GB space. Once you run both command one by one in given sequence a new swap 2 file with 30 GB has been created on the server.

➤ To verify the new swap size space, you need to run the below command.

!-[solaris]# swap -l
swapfile                               dev        swaplo   blocks       free
/dev/zvol/dsk/san/swap1     202,1        16         731596    6730226
/dev/zvol/dsk/san/swap2     209,2        16         832226    31457280

If you see the above output, the newly created swap file are seen with 30 GB space, and you can run the top command which show you the total swap memory space.

➤ To make it this swap space on Solaris server, please make an entry in "/etc/vfstab" file.

!-[solaris]# vi /etc/vfstab
/dev/zvol/dsk/san/swap1 -       -       swap    -       no      -

When we make this an entry in vfstab file, we don't need to take a reboot.  Once you take a reboot your space would be available and you can show it without any problem.

Please post your comment on this blog, if you have any query related to this topic.