แสดงบทความที่มีป้ายกำกับ PostgreSQL แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ PostgreSQL แสดงบทความทั้งหมด

วันพฤหัสบดีที่ 28 พฤศจิกายน พ.ศ. 2562

การล้างข้อมูลในฐานข้อมูลและโหลด Config ใหม่ให้ DSpace CRIS

การล้างข้อมูลนั้นเราทำหลายครั้งก่อนที่เราจะใช้งาน DSpace CRIS จริงๆ เพราะว่าต้องทดลองใช้งานหลาย ๆ อย่าง จึงทำให้ฐานข้อมูลมีข้อมูลที่เราไม่ใช้จำนวนมาก
sudo su - postgres

psql dspace -c "DROP EXTENSION pgcrypto;"
exit;

sudo /data/dspace/bin/dspace database info
sudo /data/dspace/bin/dspace clean


sudo su - postgres
psql dspace -c "CREATE EXTENSION pgcrypto;"
exit;
# - load-cris-configuration: Load CRIS configuration from an XLS file
# - export-cris-configuration: Export CRIS configuration from an XLS file

sudo /data/dspace/bin/dspace load-cris-configuration -f /data/upload/configuration.xls

การ Load Registry ครั้งแรกเมื่อทำการ Load แล้วให้เราทำการ Restart Server ก่อน 1 ครั้งสำหรับ Registry Schema ใหม่
sudo /data/dspace/bin/dspace registry-loader -metadata /data/upload/patent-types.xml

วันศุกร์ที่ 12 เมษายน พ.ศ. 2562

Install PostgreSQL 11 on Ubuntu 18.04

การติดตั้ง PostgreSQL 11


*ถ้าไม่ต้องการติดตั้ง Version 11 จะลงตาม Version ที่มากับ Repository Linux ให้ข้ามไปตรง #Install PostgreSQL ได้เลยครับ

Official: PostgreSQL Installation
Reference: Install PostgreSQL, Install pgAdmin4, Getting Started
# Install PostgreSQL 
sudo apt update
sudo apt install wget gnupg2

Create the file /etc/apt/sources.list.d/pgdg.list and add repository
deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main
# Import repository signing key, then update package lists
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update

# Install PostgreSQL, ถ้าไม่ทำตามขั้นตอนข้างบนจะติดตั้งตาม Version ที่มากับ Repository ของ Linux
sudo apt install postgresql postgresql-contrib

# Check PostgreSQL Status
sudo systemctl status postgresql

ทำการทดสอบโดยใช้ user postgres
# Connect to PostgreSQL
sudo su - postgres
psql
-- Show your connection information

\connifo
-- You are connected to database "postgres" as user "postgres" 
-- via socket in "/var/run/postgresql" at port "5432".

-- Show help
\?

-- Quit
\q