sed - Linux

Remove first 5000 lines from a big file

1
sed -i 1,5000d /var/log/pacemaker/pacemake.log

Replace , with new line

1
sed -i 's/,/\n/g' filename

Oracle - GG

Check GG status

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
cradmin1@ppuxesdb01:/root # su - oracle
[oracle@ppuxesdb01 oracle]$ cd $OGG_HOME
[oracle@ppuxesdb01 ogg]$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 19.1.0.0.220222 OGGCORE_19.1.0.0.0OGGBP_PLATFORMS_220228.2155_FBO
AIX 7, ppc, 64bit (optimized), Oracle 19c on Mar 3 2022 22:53:28
Operating system character set identified as UTF-8.

Copyright (C) 1995, 2022, Oracle and/or its affiliates. All rights reserved.



GGSCI (ppuxesdb01) 1> info all

Program Status Group Lag at Chkpt Time Since Chkpt XAG


MANAGER RUNNING MANAGED/xag.gg_inq.goldengate/ppuxesdb01
EXTRACT RUNNING E_INQ_B 00:00:04 00:00:07 NON-CRITICAL
EXTRACT RUNNING E_INQ_ES 00:00:02 00:00:08 NON-CRITICAL
EXTRACT RUNNING E_INQ_I 00:00:03 00:00:08 NON-CRITICAL
REPLICAT RUNNING R_GG 00:00:06 00:00:01 NON-CRITICAL
REPLICAT RUNNING R_OPR_B 00:00:11 00:00:02 NON-CRITICAL
REPLICAT RUNNING R_OPR_ES 00:00:00 00:00:08 NON-CRITICAL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
cradmin1@ppuxifdb01:/root# su - oracle
[oracle@ppuxifdb01 oracle]$ cd $OGG_HOME
[oracle@ppuxifdb01 ogg]$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 19.1.0.0.220222 OGGCORE_19.1.0.0.0OGGBP_PLATFORMS_220228.2155_FBO
AIX 7, ppc, 64bit (optimized), Oracle 19c on Mar 3 2022 22:53:28
Operating system character set identified as US-ASCII.

Copyright (C) 1995, 2022, Oracle and/or its affiliates. All rights reserved.



GGSCI (ppuxifdb01) 1> info all

Program Status Group Lag at Chkpt Time Since Chkpt XAG


MANAGER RUNNING MANAGED/xag.gg_opr.goldengate/ppuxifdb01
EXTRACT RUNNING E_GG 00:00:03 00:00:07 NON-CRITICAL
EXTRACT RUNNING E_OPR_B 00:00:03 00:00:08 NON-CRITICAL
EXTRACT RUNNING E_OPR_ES 00:00:04 00:00:09 NON-CRITICAL
REPLICAT RUNNING R_INQ_B 00:00:11 00:00:04 NON-CRITICAL
REPLICAT RUNNING R_INQ_ES 00:00:00 00:00:04 NON-CRITICAL
REPLICAT RUNNING R_INQ_I 00:00:05 00:00:02 NON-CRITICAL

sar - Linux

Installation

Collect CPU performance data

Collect memory performance data

Collect file system performance data

Oracle - ASM

Check ASM status

1
2
3
4
5
6
7
8
# su - grid
[grid@uxesdb01 grid]$ asmcmd lsdg
State Type Rebal Sector Logical_Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 512 4096 4194304 40960 880 0 880 0 N ACFSDG/
MOUNTED EXTERN N 512 512 4096 4194304 204800 189260 0 189260 0 N ARCHDG/
MOUNTED EXTERN N 512 512 4096 4194304 2048000 260540 0 260540 0 N DATADG/
MOUNTED EXTERN N 512 512 4096 4194304 2048000 1715824 0 1715824 0 N FRADG/
MOUNTED NORMAL N 512 512 4096 4194304 122880 121896 40960 40468 0 Y OCRDG/

vHMC on x86 upgrade from V10R1M1010 to V10R3M1050

Install pre-requisite fix, vMH70430

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
hscroot@suapvhmc01:~> sha1sum vMF70430_x86.iso
e3d9450aea41d3e9aadb077bad752951dcd89a6e vMF70430_x86.iso

hscroot@suapvhmc01:~> updhmc -t disk -f ./vMF70430_x86.iso -c
Verifying Certificate Information
Authenticating Install Packages
Installing Packages...
The corrective service file was successfully applied.

hscroot@suapvhmc01:~> hmcshutdown -r -t now
Broadcast message from root@suapvhmc01.localdomain (somewhere) (Wed Aug 14 10:1
The system is shutting down for reboot now.

hscroot@suapvhmc01:~> lshmc -V
"version= Version: 10
Release: 1
Service Pack: 1010
HMC Build level 2108131106
MF70430 - Required fix to network install/upgrade HMC to V10R2 M1030
","base_version=V10R1
"

Download network upgrade image

1
https://public.dhe.ibm.com/software/server/hmc/network/v1050/x86/

Save Profile Data

1
hscroot@suapvhmc01:~> lssyscfg -r sys -F type_model*serial_num | while read machine; do bkprofdata -m "$machine" -f Beforeupgrade$(date +%Y%m%d) ; done

Upgrade the HMC to V10R3M1050

1
2
3
hscroot@suapvhmc01:~> getupgfiles -r sftp -h 192.168.233.183 -u root --passwd password -d /tmp/vhmc_10.3.1050/
Fetching network installation images...
Verifying network installation images...

Enable HMC alternative boot

1
hscroot@suapvhmc01:~> chhmc -c altdiskboot -s enable --mode upgrade

Reboot vHMC

1
2
3
hscroot@suapvhmc01:~>  hmcshutdown -t now -r
Broadcast message from root@suapvhmc01.localdomain (somewhere) (Wed Aug 14 10:5
The system is shutting down for reboot now.

Verify

1
2
3
4
5
6
7
hscroot@suapvhmc01:~> lshmc -V
"version= Version: 10
Release: 3
Service Pack: 1050
HMC Build level 2310272020
","base_version=V10R3
"

How to delete a disk partition

How to delete a disk partition

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

PS C:\Windows\system32> get-disk

Number Friendly Name Serial Number HealthStatus OperationalStatus Total Size Partition
Style
------ ------------- ------------- ------------ ----------------- ---------- ----------
1 SAMSUNG MZ... 0025_388B_91BA_DA7C. Healthy Online 476.94 GB GPT
0 WDC WD5000... WD-WXM1E156C3HT Healthy Online 465.76 GB GPT
3 Generic ST... Healthy No Media 0 B RAW
2 SanDisk Sa... AE2B070330C0 Healthy Online 466.27 GB GPT


PS C:\Windows\system32> Get-Partition -DiskNumber 2


DiskPath:
\\?\usbstor#disk&ven_sandisk&prod_sandisk_3.2_gen1&rev_dl17#a2003c8d910ceb73&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}

PartitionNumber DriveLetter Offset Size Type
--------------- ----------- ------ ---- ----
1 1048576 512 MB System


PS C:\Windows\system32> Remove-Partition -DiskNumber 2 -PartitionNumber 1

Confirm
Are you sure you want to perform this action?
This will erase all data on disk 2 partition 1.
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):

Oracle - ADG

Check ADG status

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$ sqlplus / as sysdba
SQL> COL VALUE FOR A17
COL SOURCE_DB_UNIQUE_NAME FOR A22
COL NAME FOR A23
COL UNIT FOR A29
COL TIME_COMPUTED FOR A21
COL DATUM_TIME FOR A21
COL CON_ID FOR 9
SET LINES 300
SQL> SELECT * FROM v$dataguard_stats;
SOURCE_DBID SOURCE_DB_UNIQUE_NAME NAME VALUE UNIT TIME_COMPUTED DATUM_TIME CON_ID
----------- ---------------------- ----------------------- ----------------- ----------------------------- --------------------- --------------------- ------
0 transport lag +00 00:00:00 day(2) to second(0) interval 08/20/2024 17:58:14 08/20/2024 17:58:13 0
0 apply lag +00 00:00:00 day(2) to second(0) interval 08/20/2024 17:58:14 08/20/2024 17:58:13 0
0 apply finish time +00 00:00:00.000 day(2) to second(3) interval 08/20/2024 17:58:14 0
0 estimated startup time 26 second 08/20/2024 17:58:14 0

SQL>

Windows Commands

Show Windows Uptime

1
2
3
4
C:\> systeminfo | findstr /C:"System Boot" /C:"Host Name" /C:"Time Zone"
Host Name: WINDOWS95
System Boot Time: 10/16/2025, 1:49:19 AM
Time Zone: (UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi

vHMC on x86 upgrade from V9R2M950 to V10R1M1010

Download network upgrade image

1
https://public.dhe.ibm.com/software/server/hmc/network/v1010/x86/

Verify the upgrade image

1
2
3
4
5
6
7
8
9
10
11
12
13
14
root@temp02:/tmp/vhmc_10.1.1010 # ls -l
total 9770424
-rw-r--r-- 1 root system 1357365248 Aug 12 12:16 base.img
-rw-r--r-- 1 root system 3559788544 Aug 12 12:24 disk1.img
-rw-r--r-- 1 root system 55 Aug 12 12:24 hmcnetworkfiles.sum
-rwxr-xr-x 1 root system 9480560 Aug 12 12:24 img2a
-rw-r--r-- 1 root system 75816025 Aug 12 12:25 img3a

root@temp02:/tmp/vhmc_10.1.1010 # sum *
25478 1325552 base.img
09703 3476356 disk1.img
26206 1 hmcnetworkfiles.sum
51357 9259 img2a
48043 74040 img3a

Save Partition Profile of all management servers

1
hscroot@suapvhmc02:~> lssyscfg -r sys -F type_model*serial_num | while read machine; do bkprofdata -m "$machine" -f Beforeupgrade$(date +%Y%m%d) ; done

Save vHMC Upgrade Data

1
2
hscroot@suapvhmc02:~> saveupgdata -r disk
Generating archives of subsystem files...

Upgrade the vHMC

1
2
3
hscroot@suapvhmc02:~> getupgfiles -r sftp -h 192.168.233.183 -u root --passwd password -d /tmp/vhmc_10.1.1010/
Fetching network installation images...
Verifying network installation images...

Enable alternative boot

1
hscroot@suapvhmc02:~> chhmc -c altdiskboot -s enable --mode upgrade

Reboot vHMC

1
2
3
hscroot@suapvhmc02:~> hmcshutdown -t now -r
Broadcast message from root@suapvhmc02 (somewhere) (Tue Aug 13 17:06:30 2024):
The system is shutting down for reboot now.

Verify the new vHMC version

1
2
3
4
5
6
7
hscroot@suapvhmc02:~> lshmc -V
"version= Version: 10
Release: 1
Service Pack: 1010
HMC Build level 2108131106
","base_version=V10R1
"