Post

SYS_AUTO_SQL_TUNING_TASK - "Process 0x%p appears to be hung in Auto SQL Tuning task"

Vale dalla versione 11 in poi  Occasionalmente, durante l'esecuzione di "SYS_AUTO_SQL_TUNING_TASK", nel alert log potrebbero comparire messaggi di avviso come il seguente: "Process 0x%p appears to be hung in Auto SQL Tuning task" "Current time = %u, process death time = %u" "Attempting to kill process 0x%p with OS pid = %s" "OSD kill skipped for process %p" "OSD kill succeeded for process %p" "OSD kill failed for process %p" Cosa è SYS_AUTO_SQL_TUNING_TASK? è un task automatico eseguito dal database che seglie un set di SQL ad alto carico ( high-load SQL ) da AWR ed esegue SQL Tuning Advisor su questo SQL.  Il pacchetto DBMS_AUTO_SQLTUNE è l'interfaccia per SQL Tuning Advisor (DBMS_SQLTUNE) quando eseguito all'interno del framework Autotask.  Questo task controlla i profili SQL che trova eseguendo sia i vecchi che i nuovi query plan. Automatic SQL Tuning differisce da manual SQL tuning in questo modo:  Se

Estrarre IP da file di log del LISTENER

Per cercare il log de listener fare: # lsnrctl status Esempio: Da questa riga che è in un file LISTENER.log di interesse 31-JAN-2023 23:58:53 * (CONNECT_DATA=(SID=PROT)(CID=(PROGRAM=JDBC Thin Client)(HOST=__jdbc__)(USER=tomcat))) * (ADDRESS=(PROTOCOL=tcp)(HOST=10.161.2.9)(PORT=41294)) * establish * PROT1 * 0 devo estrarre queste informazioni (PROGRAM=JDBC Thin Client)(HOST=__jdbc__)(USER=tomcat))) * (ADDRESS=(PROTOCOL=tcp)(HOST=10.161.2.9)(PORT=41294)) Questi permette di avere una tabella che puoi portare anche in excel.   Ogni campo è separato da un pipe. echo "SID|PROGRAM|HOST|USER|PROTOCOL|HOST|PORT" &&  cat listener.log | awk -F= '{print $3 "§1§" $5 "§2§" $6 "§3§" $7 "§4§" $9 "§5§" $10 "§6§" $11}' | sed 's/).*§1§/|/' | sed 's/).*§2§/|/' | sed 's/).*§3§/|/'| sed 's/).*§4§/|/'| sed 's/).*§5§/|/'| sed 's/).*§6§/|/'| sed 's/).*$//' > estr

CLONE REMOTE PDB da un Container ad un altro usando DBLINK

--->>>>DOC  2882174.1 --- How to clone remote pdb from one cdb to another cdb using db link We are cloning the pluggable database, PDB1 from root container database, CDB1 to PDB2 in root container database, CDB2. a) Close and Open the PDB1 in READ WRITE mode to create cloneuser. SQL> alter pluggable database pdb1 close; Pluggable database altered. SQL> alter pluggable database pdb1 open; Pluggable database altered. Login to PDB1  e creare l'utente cloneuser usato dal dblink creato su CDB2 SQL> alter session set container=pdb1; SQL> create user cloneuser identified by cloneuser; Grant create session and create pluggable database privileges to cloneuser. SQL> grant create session, create pluggable database to cloneuser; Controlla i privileges granted to the cloneuser. SQL> select * from dba_sys_privs where grantee = 'CLONEUSER'; Aprire PDB1 in modalità read only. SQL> alter session set container=PDB1; SQL> alter pluggable database close; SQ