Category Archives: Database

How to Change Authentication Method in MySQL

First, to check what is being used run this, SELECT user, authentication_string, plugin, host FROM mysql.user; If the user you are having issues with is set to auth_socket then you may need to change it to method with mysql_native_password Like this, mysql> ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘password’; Change root to the user… Read More »

ORA-27121: unable to determine size of shared memory segment

If when you are trying to login to Oracle 10G on linux you get : ORA-01034: ORACLE not available ORA-27121: unable to determine size of shared memory segment Linux Error: 13: Permission denied This is caused by Oracle installer not setting setuid on $ORACLE_HOME/bin/oracle. To fix do: $ cd $ORACLE_HOME/bin $ chmod 6751 oracle via… Read More »

Grid Control access to a Windows server

If you are trying to get Grid Control to access a Windows server and having trouble here’s a few things to check. Check that the host name credentials you are providing are the same as the user who install the database software on the Windows server. Check that the user is a member of the… Read More »

Managing Oracle RMAN backups

Every now and again something will go screwy with my automatic RMAN backups and I’ll to find any that are expired or obsolete and delete them manually.

Creating a link between two SQL servers

To create a link between two SQL Servers you need to use the sp_addlinkedserver and sp_addlinkedsrvlogin stored procedures. First, sp_addlinkedserver @server=’DBLINK01′,@srvproduct=”,@provider=’SQLOLEDB’,@datasrc=’SQL-HOU-01′; Where, @server is the name of the link @srvproduct is the type of product, by default SQL Server @datasrc is the server you link to Then, you need to set the username and password… Read More »

Manually adding a mail account to SQL2005/2008

I was having trouble adding configuring Database Mail on a SQL2005 server today. I followed the wizard just like I had done on the previous 6 servers, but this one just didn’t want to add it. It was giving me an error about not being able to insert a NULL into the server name field,… Read More »

Simple script to backup all SQL Server databases

DECLARE @name VARCHAR(50) — database name DECLARE @path VARCHAR(256) — path for backup files DECLARE @fileName VARCHAR(256) — filename for backup DECLARE @fileDate VARCHAR(20) — used for file name SET @path = ‘C:Backup’ SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112) DECLARE db_cursor CURSOR FOR SELECT name FROM master.dbo.sysdatabases WHERE name NOT IN (‘master’,’model’,’msdb’,’tempdb’) OPEN db_cursor FETCH NEXT FROM… Read More »