Tag: database

database
ID: 20190520

Rename a Postgresql database

#database #postgresql

Here’s the procedure to rename a PostgreSQL database: Disconnect from the database that you want to rename and connect to a different database. Check and terminate all active connections to t... Read more

20 May 2019 - 1 minute read
database
ID: 20190420

How to duplicate a Postgresql database

#database #postgresql

If you need to duplicate an existing Postgresql database, and possibly transfer ownership of the database objects to a new user, here’s how to do that in a quick way: -- First, I recommand getting... Read more

20 Apr 2019 - less than 1 minute read
database
ID: 20190320

Forcing ASMM component to shrink

#oracle #database

Here’s the way to force the shared pool to shrink dynamically. Documentation states that ASMM can only increase shared pool, and can’t shrink. When the automatic shared memory management feature i... Read more

20 Mar 2019 - 2 minute read

database
ID: 20180220

How to extract Oracle user DDL

#database #oracle

In some cases, you need to duplicate an Oracle user, along with all it’s privileges. Doing this manually can be tedious. Hopefully, we can use the data dictionary to extract the data we need and du... Read more

20 Feb 2018 - 1 minute read
database
ID: 20180120

Change default schema on Postgresql

#database #postgresql

In PostgreSQL, users can have many namespaces to resolve objects names. These are called schemas like in Oracle, and can be altered through the search_path variable. Here’s how to check current sea... Read more

20 Jan 2018 - less than 1 minute read
database
ID: 20171220

Rename all tables in a Postgresql schema

#database #postgresql

After a conversion usually done through AWS Database Migration Service, you may have a Postgresql database converted with table names in uppercase. These tables needs renaming, because you can’t ac... Read more

20 Dec 2017 - less than 1 minute read

database
ID: 20160120

PostgreSQL Survival Guide

#postgresql #database

PostgreSQL has been gaining a lot of popularity these days, so let’s have a look at the basics of administering a PostgreSQL database. We’ll cover the structure exploration, object manipulation and... Read more

20 Jan 2016 - 3 minute read
database
ID: 20150320

Check database uptime

#database #oracle #mysql

Sometimes you have to check when a database was started for the last time. To get the information, just log on to the database and use the following query to get the last startup time: On Oracle d... Read more

20 Mar 2015 - less than 1 minute read
database
ID: 20150220

Change the default temporary tablespace

#database #oracle #sql

When your temporary tablespace gets full and you can’t resize it, you may consider switching ti a new ont to reclaim disk space. Changing the default temporary tablespace will allows you to discard... Read more

20 Feb 2015 - 1 minute read

database
ID: 20140720

Oracle sqlplus silence output

#oracle #sqlplus #database

Use the following code on your scheduled Oracle scripts to silence terminal output except your data. SET autocommit off; SET echo off; SET feedback off; SET head off; SET heading ... Read more

20 Jul 2014 - less than 1 minute read
database
ID: 20140620

MySQL transaction isolation

#database #mysql #transaction

You can get session-level and global transaction isolation levels using these commands : SELECT @@global.tx_isolation; SELECT @@tx_isolation; SET [SESSION | GLOBAL] TRANSACTION ISOLATION LEVEL ... Read more

20 Jun 2014 - less than 1 minute read
database
ID: 20140520

How to prepare a DML list script

#database #oracle #script

Sometimes, you need to execute a lot of DML instructions on a database. This might look trivial but there are some very important elements to consider before running this kind of script on a produ... Read more

20 May 2014 - 1 minute read

database
ID: 20140320

Resolving the “ERROR 126 Incorrect key file” error

#database #mysql

The Incorrect key file error: ERROR 126 (HY000) at line 3: Incorrect key file for table '/var/tmp/#sql3f5_1b6c4e_1.MYI'; try to repair it This error probably means that you ran out of disk space... Read more

20 Mar 2014 - 1 minute read
database
ID: 20140220

Data export/import on MySQL

#database #mysql #import #export

MySQL provides you with a lot of flexibility when it comes to import or export data between databases. Let’s examine a few possibilities to export/import data: To export a whole database The foll... Read more

20 Feb 2014 - less than 1 minute read
database
ID: 20140120

Check all tables on MySQL

#database #mysql

Data corruption is every DBA’s worst nightmare and can happen anytime. Use this command to check and repair all tables on a MySQL database : mysqlcheck -u root -p --auto-repair --check --optimize ... Read more

20 Jan 2014 - less than 1 minute read