Skip to main content

Truncate Logs on SQL Server 2008


Truncation of Logs in SQL Server 2008 is different from SQL Server 2000/2005. The Truncate_only Option has been terminated (I guess this was to save the integrity of Data). Until Microsoft makes an option to right click on the Database and Select "Truncate Database". Follow the steps below for now.

Do you have a SQL Server 2008 Database with Truncating Logs that are out of control, the Event Viewer is showing Event 9002 MSSQLServer. Then you need to immediately truncate your logs for your database. This will allow you to be able to access, login and use your database. If you are unable to login to vCenter, the first thing you need to do is check your error logs for Event 9002 MSSQLServer and see if you have a message for the database being Full.

1. Verify if you have the following Error under “Application” in Event Viewer on your Windows 2008 Server:
  • Event 9002, MSSQLServer
Event 9002, MSSQLServer



2. After verification, open the SQL Server 2008 Management Studio. Login and select the database. (Need Microsoft SQL Server 2008 Management Studio? - Click Here)

3. You will need to temporarily switch the Database to “Simple” in order to manually truncate the logs. Right-click on your database and select PROPERTIES.
  • Simple DB
Simple DB


4. Select OPTIONS and then Switch the Database to “Simple” and click OK.
  • Options Change for "Simple"
Options Change for "Simple"


5. After you have changed the Database to “Simple”. You can begin your cleanup. Click on the Database and run the following commands (You can highlight the text and click F5 key to run the commands or click on EXECUTE in the toolbar:
SELECT name, size FROM sys.database_files;
GO

6. You will see two lines that tell you the actual name of your database (if it has been changed or is somehow different from a backup, etc. You never know so CHECK FIRST!)

7. After you have the correct log file database name run the following command:
DBCC SHRINKFILE (DATABASE_log, 2);
GO
  • The Truncanatorrrr!
The Truncanatorrrr!


8. After completing the maintenance. Follow Steps 1-4 to Change the Database back to “Full”.
FYI. Make certain that you have Maintenance Plans Setup for Full AND Transaction Log Backups!

9. Immediately Perform a Full Backup of the Database after you have completed all of your operations.

Popular posts from this blog

How to Configure HP ILO 4 for Active Directory Login

1. Make sure that your Windows Active Directory Domain Controller has an SSL Certificate to support port 636 (HP's authentication doesn't like 389)

2. Use Softerra LDAP Administrator (or whatever is your preferred tool to get the OU path) if you don't know how to do it by heart (which...um...sometimes its better to verify).

3. Make sure that you have a way to authenticate users by adding in the OU where your restricted accounts are located. You don't want anyone in the domain to be able to login to the server.

ILO Login > Administration > User Administration - Click New and Add the Group DN Only:



Click Add Group and then you will see your group added. (*Make sure it's a security group)


4. Add in your Windows Active Directory DC to authenticate against (Verified against 2008R2):

ILO Login > Administration > Security - Directory (*Make sure it's the OU where the security group is)


5. Sign Out (Log off) and then Log Back in (If you don't see Direct…

How to Fix /storage/core filesystem Out of Disk Space Error on VCSA 6.0U1

How to fix the error of "The /storage/core filesystem is out of disk space or inodes"


Step 1: Login to the new VCSA 6.0U1 HTML5 web client. https://ip address:5480



Step 2: Enable SSH and Bash Shell
Step 3: Login as root and type "shell" at Command> shell
Step 4: df -h (Check if it's out of space)
/dev/mapper/core_vg-core               50G   50G     0 100% /storage/core
Step 5: Stop the services of VCSA: 
hostname: # service vmware-vpxd stop hostname: # service vmware-vpxd status (make sure it is stopped)
Step 6:  cd /storage/core
Step 7: rm -rf *.tgz (be CAREFUL...do this in the wrong directory and you will be retrieving from a backup.)


If you need help. Go to Cybercity (http://www.cyberciti.biz/faq/delete-all-files-folder-linux/
Step 8: service vmware-vpxd restart

Step 9: history -c
Step 10: Refresh the browser (https://ip address:5480). Now it's all green


VMware KB: (

VCSA vmware-vpxd Service Won't Restart After Upgrading to 6.0 U2

You navigate to the VMware Web Client and you get this 503 Error:
503 Service Unavailable (Failed to connect to endpoint: [N7Vmacore4Http20NamedPipeServiceSpecE:0x7fe4a805cc90] _serverNamespace = / _isRedirect = false _pipeName =/var/run/vmware/vpxd-webserver-pipe)
Cause:(SSL Certificates wouldn’t issue automatically after reboot for service vmware-vpxd
Compounded Problem:(Clearing logs under ~/.* **root**) – Specifically, clearing ~/.pgpass 
(Lesson Learned: NEVER EVER CLEAR FILES UNDER ~/. Except .bash_history on templates creation only!!!)
Fix: Kill all the services running vpxd
1. ps -ef | grep vpxd 2. kill ### 3. Re-add the ~/.pgpass file with the PostGreSQL password 4. vi /et c/vmware-vpx/embedded_db.cfg 5. Copy the password you see between PGUSER_PASSWORD=’password here‘ 6. Put the password back in ~/.pgpass
localhost:5432:VCDB:postgres: password here localhost:5432:postgres:postgres: password here localhost:5432:VCDB:vc: password here
7. Check /etc/hosts and make sure config is there. 10.…