Jenkins installation steps

How to install Jenkins in linux.

  1. Make sure Java’s latest version is installed or install the one.
  2. Download the Jenkins (
  3. Install the jenkins ( sudo
  4. Start the Jenkins (
  5. Make sure port 8080 (default) is open:
  6. Extract the ip address allocated to server:
  7. Access the Jenkins in url: ip:8080
  8. Install the necessary plugins.

Install the necessary plugins

Plugin installation in progress.


Once you will provide the admin/pwd and email etc. and click ‘Continue as admin’ Jenkins will be ready for use.

Jenkins plugins at a glance.

Important Git commands

  1. To see on which branch git is and the status of the branch changes.
git status

2. To push the changes to staging area from the working directory after the changes to it.

git add "file_name"

3. After add command to push the changes to local repository, use commit command as below to push the changes from staging area to local repository.

git commit -m "commimt message    or git commit

Note: If you will use command “git commit” command only, then the default text editor like Notepad++ will open. Where we can give the commit message.

We can use this way when we need to give long commit message.

4. To push the changes to remote repository(Here Github.com) from local reposiitory.

git push origin master

5. To check which remote repository account we are logged in.

cat ~/.gitconfig

6. To set up Notepad++ as defauklt editor in Git.

git config --global core.editor "Notepadd++.exe --multiInst --nosession"

7. To edit the config file.

git config --global -e

8. To crete a fresh repository in Git.

git init repository_name

9. Rebase: 10. Revert or undo:  It undo the changes made in previous commit.

  • New commit is created without the changes made in the other.
  • Old commit still resides in the history.

11. Reset: Can be used to undo the changes at different levels.

  • Note: –hard, –soft and –mixed (modifiers to decide the reset degree).
git reset v1.5

All important commands for cloning from Github remote repository

The first step to start with Git is to connect to a remote repository. It can be Gitlab, Github or any other. Here we will use Github.

So please follow below three commands to configure Github.

  1. To check if Git is installed or the Git version we are using.
git vesion

2. Next step is to give the User name.

git config --global user.name "Username"

3. Then give the registered email id.

git config --global user.email "user@email.com"

4. Use below command to see if User name and email are correctly given.

git config --global --list

5. Now login to Github.com where your repositories are placed and go to the repository you want to clone. There go to the Clone or Download button as shown in the screenshot below and first select use https and copy the HTTPs Link.

6. Now go to Git bash client and use next command as below.

Note: Change the https link.

git clone "https://github.com/1StopBuyers/Pilot.git"

7. Now give the usename and Password of the Github account for which the details are given above. And you will get the cloning successful message as below.

Please do comment in case of any doubt. Thank you.

Git GUI launching and options

Once you have installed git, can launch GUI just using simple command.

$ git gui

Below GUI will pop-up in few seconds and you can do everything what can be done from CLI of git. You can see the list of ‘Unstaged Changes’. There files were already available.

Options under ‘Repository’

Options under ‘Edit’

Primary and standby status

We can run following queries to check all are fine with Standby db.

       @Primary

set lines 500
column destination format a35 wrap
column process format a7
column archiver format a8
column ID format 99

select dest_id “ID”,destination,status,target,archiver,schedule,process,mountid from v$archive_dest;

Output (Status should return valid for standby destination)

ID DESTINATION STATUS TARGET ARCHIVER SCHEDULE PROCESS MOUNTID


1 /podaai/arch/PODAAI1/ VALID PRIMARY ARCH ACTIVE ARCH 0
2 podaai1_rmdc VALID STANDBY ARCH ACTIVE ARCH 0
3 INACTIVE PRIMARY ARCH INACTIVE ARCH 0
4 INACTIVE PRIMARY ARCH INACTIVE ARCH 0
5 INACTIVE PRIMARY ARCH INACTIVE ARCH 0
6 INACTIVE PRIMARY ARCH INACTIVE ARCH 0
7 INACTIVE PRIMARY ARCH INACTIVE ARCH 0
8 INACTIVE PRIMARY ARCH INACTIVE ARCH 0
9 INACTIVE PRIMARY ARCH INACTIVE ARCH 0
10 INACTIVE PRIMARY ARCH INACTIVE ARCH 0

column error format a55 tru
select dest_id,status,error from v$archive_dest;

Output (Should not return any error messages)

DEST_ID STATUS ERROR


     1 VALID
     2 VALID
     3 INACTIVE
     4 INACTIVE
     5 INACTIVE
     6 INACTIVE
     7 INACTIVE
     8 INACTIVE
     9 INACTIVE
    10 INACTIVE

column message format a80
select message, timestamp from v$dataguard_status where severity in (‘Error’,’Fatal’) order by timestamp;

Output (Should not return any rows)

SCP SYNTAX

scp PGEORI_2_23362*.arc rmohsgeor36.oracleoutsourcing.com:/pgeori/arch/PGEORI1

$ scp PCFITI_1_57371_604994162.arc rmohscfit03.oracleoutsourcing.com:/pcfiti/arch/
PCFITI_1_57371_604994162.arc

                               @Standby

select process,status,client_process,sequence#,block#,active_agents,known_agents from v$managed_standby;

Output (Should show MRP process up and running)

PROCESS STATUS CLIENT_P SEQUENCE# BLOCK# ACTIVE_AGENTS KNOWN_AGENTS


ARCH CONNECTED ARCH 0 0 0 0
ARCH CONNECTED ARCH 0 0 0 0
ARCH CONNECTED ARCH 0 0 0 0
ARCH CONNECTED ARCH 0 0 0 0
RFS RECEIVING UNKNOWN 13491 36819 0 0
RFS RECEIVING UNKNOWN 13364 1810 0 0
RFS RECEIVING UNKNOWN 13493 38735 0 0
RFS RECEIVING UNKNOWN 13363 156 0 0
RFS ATTACHED UNKNOWN 13494 36989 0 0
RFS RECEIVING UNKNOWN 0 0 0 0
RFS RECEIVING UNKNOWN 13362 327 0 0

PROCESS STATUS CLIENT_P SEQUENCE# BLOCK# ACTIVE_AGENTS KNOWN_AGENTS


RFS ATTACHED UNKNOWN 13365 165 0 0
RFS RECEIVING UNKNOWN 13492 36686 0 0
MRP0 WAIT_FOR_LOG N/A 13493 0 0 0

column message format a80
select message, timestamp from v$dataguard_status where severity in (‘Error’,’Fatal’) order by timestamp;

Output (Should not return any rows)

Note: If we gets results as shown above, we can close the standby alerts as TFALSE.

Pls correct/ add comments if required.

To determine if there is an archive gap on your physical standby database, query
the as shown in the following example:

break on report
compute sum of GAP on report
select to_char(sysdate,’DD.MM.RR HH24:MI:SS’) time, a.thread#, (select
max(sequence#) from v$archived_log where archived’YES’ and thread#a.thread#)
archived, max(a.sequence#) applied, (select max(sequence#) from v$archived_log
where archived’YES’ and thread#a.thread#)-max(a.sequence#) gap from
v$archived_log a where a.applied’YES’ group by a.thread#;

To verify the log application status.

On primary DB

SELECT THREAD#, MAX(SEQUENCE#) AS “LAST_GENERATED_LOG” FROM V$LOG_HISTORY GROUP BY THREAD#;

Standby DB

SELECT THREAD#, MAX(SEQUENCE#) AS “LAST_APPLIED_LOG” FROM V$LOG_HISTORY GROUP BY THREAD#;

To see the max seq applied.

select THREAD#,max(SEQUENCE#) from v$archived_log where APPLIED’YES’ group by THREAD#;

To stop the MRP.

alter database recover managed standby database cancel;

To start the MRP.

recover managed standby database disconnect from session;

To recover standby manually.

SQL> recover automatic standby database;

SQL> recover managed standby database parallel

a. no. of cpu…
b. no. of thread possible on each cpu…

total threads a*b -1

To enable the in one commmand.

SQL> ALTER SYSTEM SET log_archive_dest_state_2enable scopeboth SID’*’ ;

To start the standby and put in MRP

SQL> startup nomount;

SQL> alter database mount standby database;

recover managed standby database disconnect from session ;

To find the missing logs @ standby

./autofs/cmd_ctr/database/missing_seq.sh
missing_seq.sh Parameter missing: missing_seq.sh low_seq high_seq thread#_if_rac
In case of Non Rac: missing_seq.sh 200 220 No need to give thread#
for Non Rac: missing_seq.sh 200 220 3 Here 3 is the thread#

set pagesize 10000
SELECT A., Round(A.Count#B.AVG#/1024/1024) Daily_Avg_Mb
FROM
(
SELECT thread#,
To_Char(First_Time,’YYYY-MM-DD’) DAY,
Count(1) Count#,
Min(RECID) Min#,
Max(RECID) Max#
FROM
gv$log_history
GROUP BY
thread#, To_Char(First_Time,’YYYY-MM-DD’)
ORDER
BY 2 DESC
) A,
(
SELECT Thread#,
Avg(BYTES) AVG#,
Count(1) Count#,
Max(BYTES) Max_Bytes,
Min(BYTES) Min_Bytes
FROM
gv$log group by thread#
) B where a.thread#b.thread#;

THREAD# DAY COUNT# MIN# MAX# DAILY_AVG_MB


     1 2010-03-24        113     133452     133564        14238
     1 2010-03-23        174     133278     133451        21924
     1 2010-03-22        182     133096     133277        22932
     1 2010-03-21        112     132984     133095        14112
     1 2010-03-20        145     132839     132983        18270
     1 2010-03-19        176     132663     132838        22176
     1 2010-03-18        200     132463     132662        25200
     1 2010-03-17        154     132309     132462        19404
     1 2010-03-16        164     132145     132308        20664
     1 2010-03-15         40     132105     132144         5040

Split a *.gz file and merge again in Linux or Windows.

This post will deal the situation where you have big size of dump of anything and you need to split that into smaller chunks than need to send over ftp/mail etc. After that need to regenerate the same it was before splitting.

Situation: I have a expdp dump of 35 GB, I need to send it via ftp mail which can accept maximum 1 GB file.

Solution:

NOTE: With below command you can expdp without sysdba pwd.

expdp \"/ as sysdba\" FLASHBACK_TIME=\"TO_TIMESTAMP\(TO_CHAR\(SYSDATE,\'YYYY-MM-DD HH24:MI:SS\'\),\'YYYY-MM-DD HH24:MI:SS\'\)\" full=y dumpfile=full_db.dmp logfile=full_db.log DIRECTORY=DATAPUMP_DIR compression=METADATA_ONLY version=latest PARALLEL=4

NOTE: Another way to expdp without password is as under.

expdp \'/ as sysdba\' directory=DATAPUMP_DIR full=y ...

1. Zip the existing dump.
gzip full_db.dmp

2. Split the .gz file into 1 GB files.
split -b 1024m “full_db.dmp.gz” “full_db.dmp.gz_01”

3. Send it using appropriate method like ftp, attachement etc.
ftp/mail etc.

4. Merge splitted files again
Linux: cat full_db.dmp.gz_01a* > full_db.dmp.gz
Windows: copy /b file1 + file2 + file3 + file4 filetogether

5. Unzip the file and now you are ready to do everything on this file, as it was in step 1.
Now unzip the compressed dump and it is ready to use.
gunzip full_db.dmp.gz

Solaris and AIX: prtconf command

prtconf command for Aix and Solaris operating systems.

It provide the information about below ones:

System model.
Machine serial number.
Processor type, number of processors and clock speed of processors.
Network information.
File system information.
Paging space information.
Devices information.
Total memory size.
To Gather General Machine Information

Using the command prtconf alone provides the whole information of machine.
The sample is given below. Some actual values have been replaced with other values for the sake of security.

ask-sanjay10: $ prtconf

To know what is the LPAR partition number and partition name use -L.

ask-sanjay10: $ prtconf -L

If its not LPAR, then “-1 NULL” will be returned.

To know the physical memory size of the machine use -m flag.
ask-sanjay10: $ prtconf -m

To know the Vital Product Data of all physical devices internal or attached to the machine, use -v option.
ask-sanjay10: $prtconf -v

Almost all of the information gathered by above commands is sn above in the output of prtconf command.

To Get The Processor Clock Speed

For this issue the command with -s parameter.
ask-sanjay10: $ prtconf -s

To Get CPU Type

To know if the cpu type is 32 bit or 64 bit, issue the command with -c parameter.
ask-sanjay10: $ prtconf -c

To Know The Type of Kenel bits
ask-sanjay10: $ prtconf -k

Unix: Performance commands at O.S.

Performance related commands iostat , vmstat

Introduction to iostat , vmstat and netstat

This document is primarily written with reference to solaris performance monitoring and tuning but these tools are available in other unix variants also with slight syntax difference.

iostat , vmstat and netstat are three most commonly used tools for performance monitoring . These comes built in with the operating system and are easy to use .iostat stands for input output statistics and reports statistics for i/o devices such as disk drives . vmstat gives the statistics for virtual Memory and netstat gives the network statstics .

Following paragraphs describes these tools and their usage for performance monitoring.

Table of content :
1. Iostat
* Syntax
* example
* Result and Solutions

2. vmstat
* syntax
* example
* Result and Solutions

3. netstat
* syntax
* example
* Result and Solutions

Input Output statistics ( iostat )

iostat reports terminal and disk I/O activity and CPU utilization. The first line of output is for the time period since boot & each subsequent line is for the prior interval . Kernel maintains a number of counters to keep track of the values.

iostat’s activity class options default to tdc (terminal, disk, and CPU). If any other option/s are specified, this default is completely overridden i.e. iostat -d will report only statistics about the disks.

syntax:
Basic synctax is iostat interval count
option – let you specify the device for which information is needed like disk , cpu or terminal. (-d , -c , -t or -tdc ) . x options gives the extended statistics .

interval – is time period in seconds between two samples . iostat 4 will give data at each 4 seconds interval.

count – is the number of times the data is needed . iostat 4 5 will give data at 4 seconds interval 5 times

Example
$ iostat -xtc 10 5

extended disk statistics tty cpu
disk r/s w/s Kr/s Kw/s wait actv svc_t %w %b tin tout us sy wt id
sd0 2.6 3.0 20.7 22.7 0.1 0.2 59.2 6 19 0 84 3 85 11 0
sd1 4.2 1.0 33.5 8.0 0.0 0.2 47.2 2 23
sd2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
sd3 10.2 1.6 51.4 12.8 0.1 0.3 31.2 3 31

The fields have the following meanings:
disk name of the disk
r/s reads per second
w/s writes per second
Kr/s kilobytes read per second
Kw/s kilobytes written per second
wait average number of transactions waiting for service (Q length)
actv average number of transactions actively being serviced
(removed from the queue but not yet completed)
%w percent of time there are transactions waiting
for service (queue non-empty)
%b percent of time the disk is busy (transactions
in progress)
Results and Solutions
The values to look from the iostat output are:
* Reads/writes per second (r/s , w/s)
* Percentage busy (%b)
* Service time (svc_t)

If a disk shows consistently high reads/writes along with , the percentage busy (%b) of the disks is greater than 5 percent, and the average service time (svc_t) is greater than 30 milliseconds, then one of the following action needs to be taken

1.) Tune the application to use disk i/o more efficiently by modifying the disk queries and using available cache facilities of application servers .

2.) Spread the file system of the disk on to two or more disk using disk striping feature of volume manager /disksuite etc.

3.) Increase the system parameter values for inode cache , ufs_ninode , which is Number of inodes to be held in memory. Inodes are cached globally (for UFS), not on a per-file system basis

4.) Move the file system to another faster disk /controller or replace existing disk/controller to a faster one.
Virtual Memory Statistics ( vmstat )

vmstat

vmstat reports virtual memory statistics of process, virtual memory, disk, trap, and CPU activity.

On multicpu systems , vmstat averages the number of CPUs into the output. For per-process statistics .Without options, vmstat displays a one-line summary of the virtual memory activity since the system was booted.

syntax
Basic synctax is vmstat interval count

option – let you specify the type of information needed such as paging -p , cache -c ,.interrupt -i etc.

if no option is specified information about process , memory , paging , disk ,interrupts & cpu is displayed .

interval – is time period in seconds between two samples . vmstat 4 will give data at each 4 seconds interval.

count – is the number of times the data is needed . vmstat 4 5 will give data at 4 seconds interval 5 times.

Example
The following command displays a summary of what the system
is doing every five seconds.

# vmstat 5

procs memory page disk faults cpu
r b w swap free re mf pi p fr de sr s0 s1 s2 s3 in sy cs us sy id
0 0 0 11456 4120 1 41 19 1 3 0 2 0 4 0 0 48 112 130 4 14 82
0 0 1 10132 4280 0 4 44 0 0 0 0 0 23 0 0 211 230 144 3 35 62
0 0 1 10132 4616 0 0 20 0 0 0 0 0 19 0 0 150 172 146 3 33 64
0 0 1 10132 5292 0 0 9 0 0 0 0 0 21 0 0 165 105 130 1 21 78

The fields of vmstat’s display are
procs
r in run queue
b blocked for resources I/O, paging etc.
w swapped
memory (in Kbytes)
swap – amount of swap space currently available
free – size of the free list

page ( in units per second).
re page reclaims – see -S option for how this
field is modified.
mf minor faults – see -S option for how this
field is modified.
pi kilobytes paged in
po kilobytes paged out
fr kilobytes freed
de anticipated short-term memory shortfall (Kbytes)
sr pages scanned by clock algorithm
disk ( operations per second )
There are slots for up to four disks,
labeled with a single letter and number.
The letter indicates the type of disk
(s = SCSI, i = IPI, etc).
The number is the logical unit number.

faults
in (non clock) device interrupts
sy system calls
cs CPU context switches

cpu – breakdown of percentage usage of CPU time.
On multiprocessors this is an a
average across all processors.
us user time
sy system time
id idle time
Results and Solution from iostat

A. CPU issues
Following columns has to be watched to determine if there is any cpu issue

1. Processes in the run queue (procs r)
2. User time (cpu us)
3. System time (cpu sy)
4. Idle time (cpu id)

procs cpu
r b w us sy id
0 0 0 4 14 82
0 0 1 3 35 62
0 0 1 3 33 64
0 0 1 1 21 78
Problem symptoms

A.) Number of processes in run queue
1.) If the number of processes in run queue (procs r) are consistently greater than the number of CPUs on the system it will slow down system as there are more processes then available CPUs .
2.) if this number is more than four times the number of available CPUs in the system then system is facing shortage of cpu power and will greatly slow down the processess on the system.
3.) If the idle time (cpu id) is consistently 0 and if the system time (cpu sy) is double the user time (cpu us) system is facing shortage of CPU resources.

Resolution
Resolution to these kind of issues involves tuning of application procedures to make efficient use of cpu and as a last resort increasing the cpu power or adding more cpu to the system.

B. Memory Issues
Memory bottlenecks are determined by the scan rate (sr) . The scan rate is the pages scanned by the clock algorithm per second. If the scan rate (sr) is continuously over 200 pages per second then there is a memory shortage.

Resolution
1. Tune the applications & servers to make efficient use of memory and cache.
2. Increase system memory .
3. Implement priority paging in s in pre solaris 8 versions by adding line “set priority paging=1? in
/etc/system. Remove this line if upgrading from Solaris 7 to 8 & retaining old /etc/system file.