Wednesday, September 14, 2022

batch copy whole remote folder structure to local

 scp -r username@host:/home/atc/prod/sales/WEB-INF/classes\* ./

Sunday, September 13, 2020

jenkins startup locally

 1) brew install jenkins-lts

2)  jenkins-lts

3 visit http://localhost:8080

Friday, September 11, 2020

 run sonarqube locally with docker


1) docker pull sonarqube

2)  docker run -d --name sonarqube -p 9000:9000 sonarqube

3) access from http://localhost:9000


4)

                       

we can stop container by "docker stop 14eaa0f45f1d "

or start it by "docker start 14eaa0f45f1d"

Thursday, May 28, 2020

how to check if oracle goldengate trandata is enabled for a specific table

select * from DBA_LOG_GROUPS where TABLE_NAME='XXX';

select * from ALL_LOG_GROUPS where TABLE_NAME='XXX';

select * from USER_LOG_GROUPS where TABLE_NAME='XXX';

Friday, May 8, 2020

looks the overview db operations applied into a oracle database table

select * from ALL_TAB_MODIFICATIONS where table_name = 'REALTABLE_NAME'

Wednesday, January 29, 2020

random choose small set of rows from oracle table

1) count total number of record from the table
    select count(*) from customers;

2)100 records out of 100000, is 100/100000 = 0.1 percent

3) use following query
  select * from customers SAMPLE(0.1), which will return 100 records randomly each time


Thursday, January 16, 2020

Oracle nested collection test code

set SERVEROUT ON;
DECLARE

TYPE VARCHAR_TABLE IS TABLE OF VARCHAR2(64);
TYPE VC_VARCHAR_TABLE IS TABLE OF VARCHAR_TABLE INDEX BY VARCHAR2(64);

v_t1 VARCHAR_TABLE := VARCHAR_TABLE ('abc1','abc2','abc3');
v_t2 VARCHAR_TABLE := VARCHAR_TABLE();

v_t3 VC_VARCHAR_TABLE;

BEGIN
    v_t2.EXTEND(4);
    v_t2(1) := 'test1';
    v_t2(2) := 'test2';
    v_t2(3) := 'test3';
   
    DBMS_OUTPUT.PUT_LINE('VALUE in v_t1 3 is ' || v_t1(3));
    DBMS_OUTPUT.PUT_LINE('VALUE in v_t2 3 is ' || v_t2(3));
   
    v_t3('a1') := v_t1;
    v_t3('a2') := v_t2;
   
    DBMS_OUTPUT.PUT_LINE('VALUE in v_t3 2 is ' || v_t3('a2')(2));
   
END;
/



-----------------------------------------------------------------------------------------

VALUE in v_t1 3 is abc3
VALUE in v_t2 3 is test3
VALUE in v_t3 2 is test2


PL/SQL procedure successfully completed.