parsed.org

Tips by tag: database

Check for Locks by xinu on Feb 13, 2008 07:29 AM

If you suspect a locking issue with your SQL Server database, this is how you can check with SQL Server 2005.

  1. Launch Microsoft SQL Server Management Studio
  2. In the left panel, click Management > Activity Monitor.
  3. At the top, click the 'Filter...' button.
  4. In the Resources section, enter the name of your database.
  5. Click OK to apply.
  6. Scroll to the far right and check for 'Blocking' and 'Blocked By'.

Thanks to McG for the tip.

activityblockedblockingdatabaselockinglocksmicrosoftmonitorsqlserverstudio
Convert Text to Bytea by cygnus on May 02, 2007 04:38 PM

If you need to convert a TEXT column to a BYTEA column, you can use a cast expression to do the work:

ALTER TABLE mytable ALTER COLUMN col TYPE bytea USING
  decode(replace(col, '\\', '\\\\'), 'escape');

Note that altering the column type of a column is only supported beginning with PostgreSQL version 8.0. For more information, see the manual.

byteacastconversiondatabasemodificationpostgresqlschemasqltext
Determine Database Size by xinu on Feb 06, 2008 09:53 AM

To determine the size of your Oracle database you need to run a few queries and add up the numbers:

sql> select sum(bytes)/1024/1024 from dba_data_files;
sql> select sum(bytes)/1024/1024 from v$log;

Those two queries will tell you how big it is, also if you're in archive log mode, you'll generate files in your archive log destination. Run this query to determine its location:

sql> select * from v$parameter where name = 'log_archive_dest';

If you get something back, you need to add that to the mix as well.

databasedba_data_fileslog_archive_destoracleredosizev$parameter
RSS