Posts

Showing posts from May, 2024

Oracle: To list and delete inactive patches

 $ORACLE_HOME/OPatch/opatch util DeleteInactivePatches $ORACLE_HOME/OPatch/opatch util ListOrderedInactivePatches

Postgres: to setup FiveTran user

 create user fivetranuser WITH LOGIN NOCREATEDB NOCREATEROLE INHERIT NOREPLICATION CONNECTION LIMIT -1 PASSWORD 'z9jDDZpQpLbkMX_7h'; grant fivetranuser to pgcfadmin; grant connect on database cftest to fivetranuser; grant usage on schema ordadmin to fivetranuser; grant select on ordadmin.ORDER_HEADER to fivetranuser; alter user fivetranuser with replication; CREATE PUBLICATION fivetran_customfit_pub FOR TABLE ordadmin.ORDER_HEADER, tablename2, tablename3; SELECT pg_create_logical_replication_slot('fivetran_customfit_slot', 'pgoutput'); Verify that the Fivetran user can read the replication slot by running the following command SELECT count(*) FROM pg_logical_slot_peek_binary_changes('fivetran_customfit_slot', null, null, 'proto_version', '1', 'publication_names', 'fivetran_customfit_pub'); Additional documentation: ALTER PUBLICATION fivetran_leads_pub ADD TABLE 1ds.landing_table; ALTER PUBLICATION fivetran_leads_pub ADD TA...

Postgres: To find database version

 cftest=> select version();                                          version ------------------------------------------------------------------------------------------  PostgreSQL 14.10 on x86_64-pc-linux-gnu, compiled by Debian clang version 12.0.1, 64-bit (1 row)

Oracle: To delete hash value

Multiple execution plans  To delete hash_value:  SQL> select hash_value, plan_hash_value from v$sql where sql_id='fptdzyv3nqtad';  HASH_VALUE PLAN_HASH_VALUE  ---------- ---------------  1411591584               0     SQL> select address, hash_value from v$sqlarea where sql_id='fptdzyv3nqtad';  ADDRESS          HASH_VALUE  ---------------- ----------  00000004E4F48B20 1411591584     SQL> exec dbms_shared_pool.purge('0000000AEFA6CBE0,1411591584','C');  PL/SQL procedure successfully completed.   ---- ‘C’ (for cursor) or ‘S’ (for SQL) SQL> select address, hash_value from v$sqlarea where sql_id='fptdzyv3nqtad';  no rows selected     SQL> select hash_value, plan_hash_value from v$sql where sql_id='fptdzyv3nqtad';  no rows selected    SQL> select sql_handle, plan_name, enabled, accepted, fixed...