Posts tagged ‘backup’

MSSQL transaction log problems

so the transaction log of this stupid piece of software has completely filled up once again… that’s what worked for me last time:

1) DB -> Tasks -> BackUp

  • Backup Type: Transactional
  • Backup To: Disk
  • -> OK

2) DB -> Tasks -> Shrink -> Files

  • File Type: Data
  • press the “Script” button
  • press “OK”
  • hit “F5”

duplicating a postgresql DB

e.g. for testing purposes before touching valuable data…


  1. set the DB names

    ORIG_DB="orig_db_name"
    NEW_DB="new_db_name"


  2. create a dump (make sure to use a user having access rights to the db)

    TSTAMP=$(date +%F_%H-%M)
    FILE_ORIG="${ORIG_DB}_${TSTAMP}.sql"
    pg_dump -f ${FILE_ORIG} --blobs --create ${ORIG_DB}


  3. adjust the DB name in the dump and check everything went ok (the diff should be just in CREATE, ALTER and \connect statements)

    FILE_NEW="${NEW_DB}_based-on_${ORIG_DB}_${TSTAMP}.sql"
    sed "s/${ORIG_DB}/${NEW_DB}/g" ${FILE_ORIG} > ${FILE_NEW}
    vimdiff ${FILE_ORIG} ${FILE_NEW}


  4. adjust permissions for the new db (add the new DB name to the desired user(s)) and reload the postgres config

    sudo vim /etc/postgresql/8.4/main/pg_hba.conf
    sudo /etc/init.d/postgresql-8.4 reload


  5. load the new DB’s SQL-code into postgres

    psql -f ${FILE_NEW}


  6. to set identical permissions on the new DB, create a full dump using pg_dumpall, check the GRANT commands in the dump and apply them to the new DB as well…

worth a glimpse: ubuntu as time machine volume

might be interesting for the unfortunate minds that are stuck with one of those MacOS computers:

HowTo: Make Ubuntu A Perfect Mac File Server And Time Machine Volume

backup / sync

recovering JPGs from a corrupted filesystem

as usually, we took tons of pictures during our last vacation, so eventually the memory card (a SD card) ran out of space. luckily, I had another SD within reach, so we just swapped them and went on…
arriving at home, I started downloading the pictures. when I plugged in the second card, loads of error-messages appeared, indicating a badly broken FAT32 filesystem. none of the newly taken pictures was there :-( Continue reading ‘recovering JPGs from a corrupted filesystem’ »

restoring a MySQL dump on a freshly installed debian/ubuntu system

to restore a dump from a MySQL database created on a debianish Linux system, just feed the dumped SQL to the command-line mysql client like this:

mysql -u root -p < mysql-all-2010-03-28-0515.sql

since the whole content of all MySQL databases are overwritten with that stored in the dump, credentials are affected as well. that’s the reason why debian’s system tools won’t work any more after restoring the old dump, since debian creates a maintenance-user called “debian-sys-maint” during the installation and stores the randomly generated credentials in “/etc/mysql/debian.cnf” so it’s sufficient to just copy the “password” values from the old file into the new one and restart mysql. otherwise, you will run into an error like this:

/etc/mysql/debian-start[3181]: Running 'mysqlcheck'...
/etc/mysql/debian-start[3181]: /usr/bin/mysqlcheck: Got error: 1045: Access denied for user 'debian-sys-maint'@'localhost' (using password: YES) when trying to connect
/etc/mysql/debian-start[3181]: FATAL ERROR: Upgrade failed

hotplugging SATA harddisks in Linux

That’s just a few records on my personal experience regarding the hot-swapping/hot-plugging capabilities of SATAContinue reading ‘hotplugging SATA harddisks in Linux’ »

find changes in config files (debian/ubuntu)

want to know which files in /etc have been changed on your debian-like Linux system?

one part can be done with the package debsums, which compares the md5sums delivered with a debian-package with those of the current files:

$ sudo debsums -a -s
.
.
debsums: checksum mismatch apache2.2-common file /etc/apache2/sites-available/default
debsums: checksum mismatch apache2.2-common file /etc/apache2/ports.conf
.
.

Note 1: this does NOT cover configuration files that are not part of the .deb-package itself, e.g. those manually created by a user AND as well those built by a package’s configuration/post-install scripts. You have been warned!

Note 2: debsums can give hints about a compromised system, but it’s absolutely no guarantee that a non-suspicious output comes from a clean system – if the system’s compromised, an attacker could as well change the md5sums-database of a package (residing in /var/lib/dpkg/info/PKGNAME.md5sums)

TSM and pathnames

wow, note this difference:

/opt/tivoli/tsm/client/ba/bin/dsmc incr /home/backups/
.
.
Total number of objects inspected:    2.314
.
.
Elapsed processing time:           00:00:01

and the same command without the trailing slash:

/opt/tivoli/tsm/client/ba/bin/dsmc incr /home/backups
.
.
Total number of objects inspected:   32.378
.
.
Elapsed processing time:           00:00:28

Tivoli Storage Manager and passwords

ever wondered where TSM stores its passwords? Documentation and lots of websites are talking about the file TSM.PWD, but where is it?

VoilĂ : /etc/adsm/TSM.PWD