From de3b52ecf83790f2b6db8845c1a8a943ee374a44 Mon Sep 17 00:00:00 2001 From: Roger Rutishauser Date: Thu, 3 Oct 2024 20:47:28 +0200 Subject: [PATCH] various --- datentransfer/README.md | 41 +++++++++++++ oracle/README.md | 127 ++++++++++++++++++++++++++++++++++++++++ pdf-tools/README.md | 18 ++++++ postgres/README.md | 9 +++ 4 files changed, 195 insertions(+) create mode 100644 datentransfer/README.md create mode 100644 oracle/README.md create mode 100644 pdf-tools/README.md create mode 100644 postgres/README.md diff --git a/datentransfer/README.md b/datentransfer/README.md new file mode 100644 index 0000000..a87a43d --- /dev/null +++ b/datentransfer/README.md @@ -0,0 +1,41 @@ +--- +gitea: none +include_toc: true +--- +# Datentransfer + +## SCP + +### lokal auf server + +``` +scp -oProxyCommand="ssh -W %h:%p ubuntu@jumphost-cosmos.docuteam.cloud" ubuntu@10.0.3.137:/home/ubuntu +``` + +### server auf lokal + +mit Jumphost. + +``` +scp -r -oProxyJump=ubuntu@jumphost-cosmos.docuteam.cloud butler@10.7.1.97:/home/butler/actions/clients/640/workbench/0_preparation/Sefar "/mnt/scratch/640 Sefar" +``` + +## rsync + +https://www.tecmint.com/rsync-local-remote-file-synchronization-commands/ + +### Files und Ordner von Server nach lokalem Verzeichnis kopieren + +``` +rsync -e "ssh -i ~/.ssh/id_rsa" -avzh administrator@33766.hostserv.eu:/var/www/ig_baumfreunde . +``` + +oder + +``` +rsync -e "ssh -i ~/.ssh/id_rsa" -avzhu --ignore-existing administrator@33766.hostserv.eu:/var/www/ig_baumfreunde . +``` + +## robocopy + +ToDo \ No newline at end of file diff --git a/oracle/README.md b/oracle/README.md new file mode 100644 index 0000000..0461da9 --- /dev/null +++ b/oracle/README.md @@ -0,0 +1,127 @@ +--- +gitea: none +include_toc: true +--- +# Oracle DB + +## search for string in entire set of tables of a db + +``` sql +SET SERVEROUTPUT ON SIZE 100000 + +DECLARE + match_count INTEGER; +BEGIN + FOR t IN (SELECT owner, table_name, column_name + FROM all_tab_columns + WHERE owner = 'APLKN_ARCHV_SRG' and data_type LIKE '%CHAR%' AND table_name like 'TB%') LOOP + + EXECUTE IMMEDIATE + 'SELECT COUNT(*) FROM ' || t.owner || '.' || t.table_name || + ' WHERE '||t.column_name||' like :1' + INTO match_count + USING '%Schrank ganz hinten%'; + + IF match_count > 0 THEN + dbms_output.put_line( t.owner ||' --- '||t.table_name ||' --- '||t.column_name||' --- '||match_count ); + END IF; + + END LOOP; + +END; +``` + +or, without owner: + +``` sql +SET SERVEROUTPUT ON SIZE 100000 +DECLARE + match_count INTEGER; +BEGIN + FOR t IN (SELECT TABLE_NAME, COLUMN_NAME + FROM all_tab_columns + WHERE data_type LIKE '%CHAR%' AND TABLE_NAME LIKE 'TB%') LOOP + + EXECUTE IMMEDIATE + 'SELECT COUNT(*) FROM ' || t.TABLE_NAME || + ' WHERE '||t.COLUMN_NAME||' like :1' + INTO match_count + USING 'Conclusion of Peace between Russia and Esthonia%'; + + IF match_count > 0 THEN + dbms_output.put_line( t.TABLE_NAME ||' --- '||t.COLUMN_NAME||' --- '||match_count ); + END IF; + + END LOOP; + +END; +``` + +## get physical storage place of archval description 88176 + +``` sql +SELECT + tbs_bhltn.bhltn_def_stand_ort_cd +FROM + APLKN_ARCHV_SRG.tbs_vrzng_enht a +LEFT OUTER JOIN + APLKN_ARCHV_SRG.tbs_bhltn_vrzng_enht tbs_bhltn_vrzng_enht +ON + a.vrzng_enht_id = tbs_bhltn_vrzng_enht.vrzng_enht_id +INNER JOIN + APLKN_ARCHV_SRG.tbs_bhltn tbs_bhltn +ON + tbs_bhltn.bhltn_id = tbs_bhltn_vrzng_enht.bhltn_id +WHERE + a.vrzng_enht_id = 88176; +``` + +## "limit" in oracle + +``` sql +select * from ( +SELECT * FROM APLKN_ARCHV_SRG.TBS_GSFT_OBJ_DTL +WHERE MEMO_TXT LIKE '%Schrank ganz hinten%'; +) +where ROWNUM <= number; +``` + +## show instance name (SID) + +```sql +select sys_context('userenv','instance_name') from dual; +``` + +## show port and other connection params + +``` sql +select * from v$listener_network; +``` + +## show tables + +``` sql +SELECT owner, table_name FROM all_tables; +``` + +## get all tables with col name xy + +``` sql +select table_name +from all_tab_columns -- or: dba_tab_columns +where column_name like '%GSFT_OBJ_TYP_ID%'; +``` + +## get all physical storage + +``` sql +SELECT tbs_bhltn.* FROM tbs_bhltn WHERE rownum <= 10; +``` + +## sqlplus + +### sql file in sqlplus + +``` +SQL > @/oracle/scripts/script.sql +``` \ No newline at end of file diff --git a/pdf-tools/README.md b/pdf-tools/README.md new file mode 100644 index 0000000..a22319f --- /dev/null +++ b/pdf-tools/README.md @@ -0,0 +1,18 @@ +--- +gitea: none +include_toc: true +--- +# PDF-Tools 3-Heights Converter + +## Errors + +### Fehler bei html und/oder msg Konvertierung + +In `O2PWSC.ini` schauen, dass diese Settings verwendet werden: + +``` +[HTML] +IEPRINT=true +PageSetup = bottom=0.5,top=0.5,left=0.7,right=0.7,Print_Background=Yes,Shrink_To_Fit=Yes,footer=,header= +HTMOPT=true +``` \ No newline at end of file diff --git a/postgres/README.md b/postgres/README.md new file mode 100644 index 0000000..cab71cc --- /dev/null +++ b/postgres/README.md @@ -0,0 +1,9 @@ +--- +gitea: none +include_toc: true +--- +# PostgreSQL + +## Console + +To enter console mode, open CMD, go to `%APPS_PATH%\postgreSQL\bin` and run `psql -U postgres`