Friday, August 7, 2020

Custom PS1 Linux Terminal

ex:

export PS1="\[\033[36m\]\D{%Y-%m-%d-%I:%M%p}\[\033[00m\] \[\033[95m\]\u@$WSL_DISTRO_NAME\[\033[00m\]:\[\033[35m\]\w\[\033[00m\] $ "

export PS1="\[\033[33m\]\D{%Y-%m-%d-%I:%M%p}\[\033[00m\] \[\033[32m\]\u@$WSL_DISTRO_NAME\[\033[00m\]:\[\033[36m\]\w\[\033[00m\] $ "

Thursday, August 6, 2020

OGG-01004, OCI Error ORA-04098: trigger 'MEIS.ZONE_TG' is invalid and failed re-validation (status = 4098)

OGG-01004, OCI Error ORA-04098: trigger 'MEIS.ZONE_TG' is invalid and failed re-validation (status = 4098)

Cause:

Triggers are causing issue while data is being loaded to table.



Resolution:

You could use the option “SUPRESSTRIGGERS” in the Replicat processes. 
If it still abends the Replicat process, 
you may have to disable the trigger in the database and restart the process.

sql> alter trigger ‘<User>.<Trigger>’ disable;

Ex:

SQL> alter trigger MEIS.ZONE_TG disable;

Wednesday, July 8, 2020

Oracle Golden Gate Error : Fatal error executing DDL replication: error [Error code [955], ORA-00955

ex: 

2020-07-08 10:32:56  ERROR   OGG-00519  Oracle GoldenGate Delivery for Oracle, rmeis.prm:  Fatal error executing DDL replication: error [Error code [955], ORA-00955: มีออบเจกต์อื่นที่ใช้ชื่อนี้แล้ว
SQL alter table "SERVICES_APP"."CLIENTUSESERVICE"
  add constraint PKCLIENTUSESERVICE primary key (IDCLIENT, SERVICENAME, SERVICES, STARTDATE)
  using index
  tablespace USERS
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    next 1M
    minextents 1
    maxextents unlimited
  )
  /*

Check Constraints:


SELECT CONSTRAINT_NAME, TABLE_NAME, COLUMN_NAMEFROMDBA_CONS_COLUMNSWHEREOWNER LIKE 'SERVICES_APP'ANDTABLE_NAME LIKE 'CLIENTUSESERVICE'


SQL> l
  1  SELECT CONSTRAINT_NAME, TABLE_NAME, COLUMN_NAME
  2  FROM
  3  DBA_CONS_COLUMNS
  4  WHERE
  5  OWNER LIKE 'SERVICES_APP'
  6  AND
  7* TABLE_NAME LIKE 'CLIENTUSESERVICE'
SQL> /

CONSTRAINT_NAME                TABLE_NAME                     COLUMN_NAME
------------------------------ ------------------------------ --------------------
SYS_C0018194                   CLIENTUSESERVICE               IDCLIENT
SYS_C0018196                   CLIENTUSESERVICE               SERVICES
SYS_C0018195                   CLIENTUSESERVICE               SERVICENAME
FKCLIENTUSESERVICE             CLIENTUSESERVICE               IDCLIENT

if constraint SERVICES_APP.PKCLIENTUSESERVICE doesn't exists


check Indexes:

SELECT INDEX_NAME, TABLE_NAMEFROMDBA_INDEXESWHEREOWNER LIKE 'SERVICES_APP'ANDTABLE_NAME LIKE 'CLIENTUSESERVICE'

SQL> l
  1  SELECT INDEX_NAME, TABLE_NAME
  2  FROM
  3  DBA_INDEXES
  4  WHERE
  5  OWNER LIKE 'SERVICES_APP'
  6  AND
  7* TABLE_NAME LIKE 'CLIENTUSESERVICE'
SQL> /

INDEX_NAME                     TABLE_NAME
------------------------------ ------------------------------
PKCLIENTUSESERVICE             CLIENTUSESERVICE



if index SERVICES_APP.PKCLIENTUSESERVICE exists
drop index and restart Oracle Goldent Gate

DROP INDEX SERVICES_APP.PKCLIENTUSESERVICE;


Thursday, June 11, 2020

Office365 Powershell example

https://docs.microsoft.com/en-us/office365/enterprise/powershell/connect-to-office-365-powershell#connect-with-the-azure-active-directory-powershell-for-graph-module

Install-Module MSOnline

Connect-MsolService

Get-MsolUser –All

Get-MsolUser -UserPrincipalName admin@demo.onmicrosoft.com

Get-MsolUser –DomainName demo.onmicrosoft.com

Get-MsolUser –UnlicensedUsersOnly

Get-MsolUser -SearchString "user@demo.onmicrosoft.com" | fl IsLicensed, Licenses, ObjectId


IsLicensed : True
Licenses   : {nida365:STANDARDWOFFPACK_IW_FACULTY}
ObjectId   : 37787efb-8c3e-449f-9799-9c636c26a554



(Get-MsolUser -UserPrincipalName user@demo.onmicrosoft.com).Licenses.servicestatus

Set-MsolUserLicense -UserPrincipalName user@demo.onmicrosoft.com -RemoveLicenses demo365:POWER_BI_STANDARD, demo365:POWERAPPS_INDIVIDUAL_USER, demo365:STANDARDWOFFPACK_IW_FACULTY


Set-MsolUserLicense -UserPrincipalName user@demo.onmicrosoft.com -AddLicenses demo365:POWER_BI_STANDARD, demo365:POWERAPPS_INDIVIDUAL_USER, demo365:STANDARDWOFFPACK_IW_FACULTY

(Get-MsolUser -UserPrincipalName user@demo.onmicrosoft.com).Licenses.servicestatus

Thursday, May 28, 2020

Set TimeZone Ubuntu 20

check TimeZone:
$ timedatectl

List TimeZone:
$ timedatectl list-timezones | grep Bangkok

Set TimeZone:
$ sudo timedatectl set-timezone Asia/Bangkok

Check TimeZone:
$ timedatectl


How to fix Ubuntu 20.04 error "sda: failed to get udev uid: Invalid argument"

```
sda: add missing path
sda: failed to get udev uid: Invalid argument
sda: failed to get sysfs uid: Invalid argument
sda: failed to get sgio uid: No such file or directory
```

VM option -> Advance -> Configuration Parameter 

Add Parameter 

disk.EnableUUID=TRUE

How to fix ssh returns “Bad owner or permissions on ~/.ssh/config”

chmod 600 ~/.ssh/config
chown $USER ~/.ssh/config

ALCATEL 6900

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