Mensuel Shaarli

Tous les liens d'un mois sur une page.

August, 2024

Oracle datafile

Modification TBS

SELECT tablespace, file_name FROM dba_temp_files;
SELECT tablespace, file_name FROM dba_data_files;

create tablespace STATSPACK datafile '<file>' size 250M reuse extent management local uniform size 1M;

# Temporary
create temporary tablespace STATSTEMP tempfile '<file>' size 50M reuse extent management local uniform size 1M;

ALTER TABLESPACE <tbs> ADD DATAFILE  '<file>'SIZE 25M AUTOEXTEND OFF;
ALTER TABLESPACE <tbs> DROP DATAFILE '<file>' ;

ALTER DATABASE DATAFILE '<file>' RESIZE 225M;
ALTER DATABASE TEMPFILE '<file>' RESIZE 2048M;

DROP tablespace <tbs> INCLUDING CONTENTS and datafiles;
Docker volume permission

On my postgresql docker image :

initdb: error: could not access directory "/home/postgres/pgdata/data": Permission denied

I reused a previous image

volumes:
  - pgsql_data:/data/pgsql
environment:
  PGDATA: /data/pgsql

So actions :

  • start image without setting PGDATA, then execute :

Then :

docker exec myimage id # to check the user (here 1000:1000)
docker exec myimage ls -l /data/ # to check the mount directory
docker volume inspect pgsql_data # give the path of the volume
// update the rights 
chown 1000:1000 -R /home/docker/volumes/pgsql_data
  • stop docker compose up pgsql
  • restore PGDATA parameter
  • restart docker compose up pgsql