Posts

PDB Switchover

  The procedure for remotely refreshing a PDB in Oracle Database 12c was previously discussed in Creating and Refreshing a PDB Remotely . Oracle Database 18c introduced a new capability in this area that enables the roles of the source and destination PDBs to be switched, in other words, it facilitates a switchover between the two PDBs. In this article, we first create a PDB remotely and then demonstrate how to perform a switchover between the source and destination PDBs. 1. Create a User, PDB, and Database Link on the Source and Destination cdb1 (source) SQL > create pluggable database pdbsource admin user u identified by u; Pluggable database created. SQL > alter pluggable database PDBSOURCE open ; Pluggable database altered. SQL > create user db_usef identified by pass; User created. SQL > grant sysoper,dba,sysdba to db_usef container = all ; Grant succeeded. SQL > create public database link LINKclone connect to DB_USEF identified by pass ...

PostgreSQL Table Bloat and Defragmentation: Autovacuum vs VACUUM vs VACUUM FULL

Image
  When rows are updated or deleted in PostgreSQL, the database does not immediately remove the old row versions from the table. Instead, PostgreSQL uses MVCC (Multi-Version Concurrency Control) and creates new row versions when necessary. As a result, a table can contain dead tuples and occupy significantly more disk space than the amount required by its current live data. In this article, we will use the same table and workload to demonstrate how PostgreSQL handles this situation with: Autovacuum: Automatically removes dead tuples in the background and makes their space reusable. It does not require an exclusive table lock and normally does not shrink the table on disk. Manual VACUUM: Does the same cleanup as autovacuum, but you start it manually. It removes dead tuples and makes space reusable, but normally does not shrink the table.It does not require an exclusive table lock. VACUUM FULL: Rebuilds the table using only live rows and physically releases unused disk space. It ...