2026-03-12 21:01:38

This commit is contained in:
2026-03-12 22:01:38 +01:00
parent 3bd1db26cc
commit 26296b6d6a
336 changed files with 27507 additions and 0 deletions

96
tmp/2_nested_loop_01.txt Normal file
View File

@@ -0,0 +1,96 @@
SELECT /*+ GATHER_PLAN_STATISTICS QB_NAME(main) */ employees.*
FROM HR.employees,
( SELECT /*+ QB_NAME(iv1) */
trunc(hire_date, 'YYYY'), MAX(employee_id) employee_id
FROM HR.employees
GROUP BY trunc(hire_date, 'YYYY')) x
WHERE employees.employee_id=x.employee_id
/
EMPLOYEE_ID FIRST_NAME LAST_NAME EMAIL PHONE_NUMBER HIRE_DATE JOB_ID SALARY MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- ------------------- ---------- ---------- ---------- -------------
206 William Gietz WGIETZ 515.123.8181 2002-06-07 00:00:00 AC_ACCOUNT 8300 205 110
102 Lex De Haan LDEHAAN 515.123.4569 2001-01-13 00:00:00 AD_VP 17000 100 90
197 Kevin Feeney KFEENEY 650.507.9822 2006-05-23 00:00:00 SH_CLERK 3000 124 50
201 Michael Hartstein MHARTSTE 515.123.5555 2004-02-17 00:00:00 MK_MAN 13000 100 20
199 Douglas Grant DGRANT 650.507.9844 2008-01-13 00:00:00 SH_CLERK 2600 124 50
200 Jennifer Whalen JWHALEN 515.123.4444 2003-09-17 00:00:00 AD_ASST 4400 101 10
198 Donald OConnell DOCONNEL 650.507.9833 2007-06-21 00:00:00 SH_CLERK 2600 124 50
202 Pat Fay PFAY 603.123.6666 2005-08-17 00:00:00 MK_REP 6000 201 20
8 rows selected.
--------------------------------------------------------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Starts | E-Rows |E-Bytes| Cost (%CPU)| A-Rows | A-Time | Buffers | OMem | 1Mem | Used-Mem |
--------------------------------------------------------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | | | 4 (100)| 8 |00:00:00.01 | 19 | | | |
| 1 | NESTED LOOPS | | 1 | 107 | 15622 | 4 (25)| 8 |00:00:00.01 | 19 | | | |
| 2 | NESTED LOOPS | | 1 | 107 | 15622 | 4 (25)| 8 |00:00:00.01 | 11 | | | |
| 3 | VIEW | | 1 | 107 | 1391 | 4 (25)| 8 |00:00:00.01 | 7 | | | |
| 4 | HASH GROUP BY | | 1 | 107 | 2354 | 4 (25)| 8 |00:00:00.01 | 7 | 1116K| 1116K| 894K (0)|
| 5 | TABLE ACCESS FULL | EMPLOYEES | 1 | 107 | 2354 | 3 (0)| 107 |00:00:00.01 | 7 | | | |
|* 6 | INDEX UNIQUE SCAN | EMP_EMP_ID_PK | 8 | 1 | | 0 (0)| 8 |00:00:00.01 | 4 | | | |
| 7 | TABLE ACCESS BY INDEX ROWID| EMPLOYEES | 8 | 1 | 133 | 0 (0)| 8 |00:00:00.01 | 8 | | | |
--------------------------------------------------------------------------------------------------------------------------------------------------------
Query Block Name / Object Alias (identified by operation id):
-------------------------------------------------------------
1 - MAIN
3 - IV1 / X@MAIN
4 - IV1
5 - IV1 / EMPLOYEES@IV1
6 - MAIN / EMPLOYEES@MAIN
7 - MAIN / EMPLOYEES@MAIN
Predicate Information (identified by operation id):
---------------------------------------------------
6 - access("EMPLOYEES"."EMPLOYEE_ID"="X"."EMPLOYEE_ID")
SELECT /*+ GATHER_PLAN_STATISTICS QB_NAME(iv1) */
trunc(hire_date, 'YYYY'), MAX(employee_id) employee_id
FROM HR.employees
GROUP BY trunc(hire_date, 'YYYY')
/
TRUNC(HIRE_DATE,'YY EMPLOYEE_ID
------------------- -----------
2002-01-01 00:00:00 206
2001-01-01 00:00:00 102
2006-01-01 00:00:00 197
2004-01-01 00:00:00 201
2008-01-01 00:00:00 199
2003-01-01 00:00:00 200
2007-01-01 00:00:00 198
2005-01-01 00:00:00 202
8 rows selected.
------------------------------------------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Starts | E-Rows |E-Bytes| Cost (%CPU)| A-Rows | A-Time | Buffers | OMem | 1Mem | Used-Mem |
------------------------------------------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | | | 4 (100)| 8 |00:00:00.01 | 7 | | | |
| 1 | HASH GROUP BY | | 1 | 107 | 2354 | 4 (25)| 8 |00:00:00.01 | 7 | 1116K| 1116K| 892K (0)|
| 2 | TABLE ACCESS FULL| EMPLOYEES | 1 | 107 | 2354 | 3 (0)| 107 |00:00:00.01 | 7 | | | |
------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Starts | E-Rows |E-Bytes| Cost (%CPU)| A-Rows | A-Time | Buffers | OMem | 1Mem | Used-Mem |
--------------------------------------------------------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | | | 4 (100)| 8 |00:00:00.01 | 19 | | | |
| 1 | NESTED LOOPS | | 1 | 107 | 15622 | 4 (25)| 8 |00:00:00.01 | 19 | | | |
| 2 | NESTED LOOPS | | 1 | 107 | 15622 | 4 (25)| 8 |00:00:00.01 | 11 | | | |
| 3 | VIEW | | 1 | 107 | 1391 | 4 (25)| 8 |00:00:00.01 | 7 | | | |
|* 6 | INDEX UNIQUE SCAN | EMP_EMP_ID_PK | 8 | 1 | | 0 (0)| 8 |00:00:00.01 | 4 | | | |
| 7 | TABLE ACCESS BY INDEX ROWID| EMPLOYEES | 8 | 1 | 133 | 0 (0)| 8 |00:00:00.01 | 8 | | | |
--------------------------------------------------------------------------------------------------------------------------------------------------------

51
tmp/openssl_orapki_01.txt Normal file
View File

@@ -0,0 +1,51 @@
# How to Create a New Wallet from an Existing Private Key and Certificates using OpenSSL and orapki (Doc ID 2769138.1)
openssl pkcs12 -export \
-in /app/oracle/staging_area/TLS_poc/openssl_files/togoria.swgalaxy.crt \
-inkey /app/oracle/staging_area/TLS_poc/openssl_files/togoria.swgalaxy.key \
-certfile /app/oracle/staging_area/TLS_poc/openssl_files/rootCA.pem \
-out /app/oracle/staging_area/TLS_poc/openssl_files/togoria.swgalaxy.p12
# create an empty wallet
orapki wallet create -wallet /app/oracle/staging_area/TLS_poc/wallet -pwd "Secret00!" -auto_login_local
# we can import directly both user / trusted certificate from .p12 file
orapki wallet import_pkcs12 -wallet /app/oracle/staging_area/TLS_poc/wallet -pwd "Secret00!" \
-pkcs12file /app/oracle/staging_area/TLS_poc/openssl_files/togoria.swgalaxy.p12
# or we can add separately trusted certificate and user certificate
orapki wallet add -wallet /app/oracle/staging_area/TLS_poc/wallet -pwd "Secret00!" \
-trusted_cert -cert /app/oracle/staging_area/TLS_poc/openssl_files/rootCA.pem
-> THIS fails
orapki wallet add -wallet /app/oracle/staging_area/TLS_poc/wallet -pwd "Secret00!" \
-user_cert -cert /app/oracle/staging_area/TLS_poc/openssl_files/togoria.swgalaxy.crt
orapki wallet import_private_key -wallet /oracle/wallet/location -pwd oracle_wallet_password -pvtkeyfile /tmp/encrypted.key -pvtkeypwd long_key_encryption_password -cert /etc/pki/tls/private/servername.crt
# How to Remove Trusted Certificate From Oracle Wallet (Doc ID 2257925.1)
orapki wallet remove -trusted_cert_all -wallet /app/oracle/staging_area/TLS_poc/wallet -pwd "Secret00!"
# display wallet contents
orapki wallet display -wallet /app/oracle/staging_area/TLS_poc/wallet -pwd "Secret00!"
export TNS_ADMIN=/app/oracle/staging_area/TLS_poc/tnsadmin
# client side
orapki wallet add -wallet /app/oracle/staging_area/TLS_poc/wallet -pwd "Secret00!" \
-user_cert -cert /app/oracle/staging_area/TLS_poc/openssl_files/wayland.swgalaxy.fullchain.crt
# listener registration
alter system set local_listener="(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCPS)(HOST = togoria.swgalaxy)(PORT = 24000))
(ADDRESS = (PROTOCOL = TCP)(HOST = togoria.swgalaxy)(PORT = 1521))
)
)"
scope=both sid='*';
alter system register;

30
tmp/postgres_01.txt Normal file
View File

@@ -0,0 +1,30 @@
export PATH=$PATH:/app/postgres/rdbms/17.2/bin
export PGDATA=/app/postgres/data/db01
export PGLOG=/app/postgres/log/db01.log
export PGPORT=5501
alias restart='pg_ctl stop; pg_ctl start --pgdata $PGDATA --log $PGLOG'
initdb -D $PGDATA
# in $PGDATA/postgresql.conf
listen_addresses='*'
port=5501
pg_ctl start --pgdata $PGDATA --log $PGLOG
create role jabba login password 'secret';
create database jabba;
alter database jabba owner to jabba;
https://smallstep.com/hello-mtls/doc/combined/postgresql/psql
SELECT backend_start,ssl,version,datname as "Database name", usename as "User name",client_addr, application_name, backend_type
FROM pg_stat_ssl
JOIN pg_stat_activity
ON pg_stat_ssl.pid = pg_stat_activity.pid
ORDER BY backend_start DESC,ssl;

2
tmp/vacances.txt Normal file
View File

@@ -0,0 +1,2 @@
Club Lookéa Torrequebrada - Choix Flex / Malaga
Club Marmara Sandy Beach / Corfou