Monday, November 18, 2019

"tail -f" in Windows PowerShell

"tail -f" in Windows PowerShell


Get-Content .\file_name -wait | Where {$_ -match "search_name"}
Get-Content .\file_name -wait -tail 30 | Where {$_ -match "search_name"}
Get-Content .\file_name -wait | Where {$_ -match "search_name-1" -and $_ -match "search_name-2}

Friday, November 8, 2019

GGATE Error 'OCI Error ORA-01407: cannot update ("HRIS"."SYS_CLIENTIDENTIFIER"."SYS_USER_ID") to NULL (status = 1407)'

Transaction can't update table column to NULL

ex:

table name: "HRIS"."SYS_CLIENTIDENTIFIER"
column name: "SYS_USER_ID"

check constraint in "DBA_CONS_COLUMNS" or "ALL_CONS_COLUMNS"

SELECT
CONSTRAINT_NAME, TABLE_NAME, COLUMN_NAME
FROM
DBA_CONS_COLUMNS
WHERE
OWNER LIKE 'HRIS'
AND
TABLE_NAME LIKE 'SYS_CLIENTIDENTIFIER'

CONSTRAINT_NAME                TABLE_NAME                     COLUMN_NAME
------------------------------ ------------------------------ --------------------
FK_SYS_CLIENTIDENTIFIER_USER   SYS_CLIENTIDENTIFIER           SYS_USER_ID <--------------
PK_SYS_CLIENTIDENTIFIER        SYS_CLIENTIDENTIFIER           ID
SYS_C0024107                   SYS_CLIENTIDENTIFIER           TERMINALIP
SYS_C0024106                   SYS_CLIENTIDENTIFIER           CREATEBY
SYS_C0024105                   SYS_CLIENTIDENTIFIER           CREATEDATETIME
SYS_C0024104                   SYS_CLIENTIDENTIFIER           GUID
SYS_C0024103                   SYS_CLIENTIDENTIFIER           ID
SYS_C00241XXX        SYS_CLIENTIDENTIFIER           SYS_USER_ID <--------------

DROP CONFLICT CONSTRAINT

ALTER TABLE "HRIS"."SYS_CLIENTIDENTIFIER" DROP CONSTRAINT SYS_C00241XXX;

and restart GGATE replicat

Thursday, October 31, 2019

Backup Docker container

Convert Container to Docker images:

docker commit container_name name/tag

Save docker images to files:

docker save name/tag > backupfile.tar

Import docker images from Files

docker load -i backupfile.tar

Wednesday, October 30, 2019

Fix iSCSI DataStore is Connected But inaccessible

Remount a iSCSI datastore in ESXI host after network failure or
iSCSI DataStore is Connected But inaccessible 

:Scan volume
esxcfg-volume -l

[root@esxi-11:/vmfs/volumes] esxcfg-volume -l
Scanning for VMFS-6 host activity (4096 bytes/HB, 1024 HBs).
VMFS UUID/label: 5b9279dd-659af4f5-9f6c-1866daf4b576/QNAP-01:GRAYLOG
Can mount: Yes
Can resignature: Yes
Extent name: naa.6e843b61b1c7f97dd817d4d65d8bddd7:1     range: 0 - 8388351 (MB)
Extent name: naa.6e843b6ab3d267ad2373d43a8d9645da:1     range: 8388352 - 16776703 (MB)

Scanning for VMFS-6 host activity (4096 bytes/HB, 1024 HBs).
VMFS UUID/label: 5b91fa1a-8d4ad5f5-8747-1866daf3466e/QNAP-01:DS-01
Can mount: Yes
Can resignature: Yes
Extent name: naa.6e843b69306f933db3d1d4045da669da:1     range: 0 - 4194047 (MB)

:Mount Volume

esxcfg-volume -m QNAP-01:DS-01
esxcfg-volume -m QNAP-01:GRAYLOG

Wednesday, October 16, 2019

Oracle EXPORT(expdp) by Tables in SCHEMAS

Oracle EXPORT(expdp) by Tables in SCHEMAS

export:
expdp system/manager directory=TEMP tables=SCHEMA1.TABLENAME1,SCHEMA2.TABLENAME2 dumpfile=SCHEMA_TABLES.dmp logfile=expdp_SCHEMATABLES.log

import:
impdp system/manager directory=DATA_PUMP_DIR dumpfile=SCHEMA_TABLES.dmp logfile=impdp_SCHEMATABLES.log

Friday, September 27, 2019

Set TimeZone Ubuntu 18

Set TimeZone Ubuntu

$ timedatectl list-timezones
$ sudo timedatectl set-timezone Asia/Bankok

Thursday, September 26, 2019

Tmux Tips

Tmux Tips

Tmux copy to ClipBoard

- ctrl + b, [ :Enter To Copy Mode
- Move Start/End with Arrow KEY
- ctrl + space :Start select hi-light
- alt + w :Copy To ClipBoard
- ctrl +b, ] :Paste

Tmux Create New windows

- ctrl + b, c :Create New Windows Terminal
- ctrl + b, n :Next Windows
- ctrl + b, 0-n :Select Windows by Number
- ctrl + b, w :List Windows Terminal

Tmux split panes

- ctrl + b, % :Split Vertical
- ctrl + b, " :Split Horizontal

ALCATEL 6900

write memory copy running certified reload from working no rollback-timeout