Tag: troubleshooting

[Solved] Dell Precision M3800 sleep issue: does not wake up after sleep

[Solved] Dell Precision M3800 sleep issue: does not wake up after sleep

Introduction

If you own a Dell Precision M3800, you may have faced the common Dell Precision M3800 sleep issue, where your laptop freezes at a black screen when you try to wake it from sleep.

The symptoms

I bought my M3800 and upgraded it to Windows 10. Everything worked fine until one day. I believed that after some Windows Auto Updates, the problem began.

At first, I noticed that if I left the laptop sleep through the night, when I opened the lid the day after, sometimes it froze at a black screen. This happened more and more frequently over time.

Then after some other Windows Updates, I believe, the problem became more serious. Whenever the laptop went to sleep, it wouldn’t wake up even if I opened it only several minutes later. If I held the power button for 10-20 seconds, it might wake up if it wanted to, or just kept staying dead if it decided that it needed some more sleep. Then I had to hold the power button for 10-20 seconds several times to do a hard shutdown, then started it up again.

Some approaches

Obviously, I went to ask Dr. Google for the solution. Good thing was a lot of other people had the same issue as mine (Am I a little bit mean to think that it’s good because people have problems? :D).

Here are some of the solutions:

  • Some said that turning “Allow hybrid sleep” in “Edit power plan” to either On or Off worked for them.
  • Some said that upgrading the BIOS solved their problem.
  • Some said that after upgrading the Display Driver (both Intel and Nvidia), the problem disappeared.
  • Some said that rolling back the Nvidia Driver to a previous stable version fixed their problem.
  • Some said that disabling the Nvidia Display Adapter (in Device Manager console) fixed their problem.
  • Some said that Dell told them the problem was because of the motherboard, and they sent their laptop to Dell for motherboard replacement. After that, the problem was fixed.

Unfortunately, none of the solutions above worked for me. However, they may work for you, so you may want to give them a try.

What worked for me

Too desperate, I went to BIOS settings to see if there’s anything that I could do. Surprisingly, I came up with this solution which worked for me:

  • Go to BIOS settings (press F2 at the boot screen).
  • Find the Option “USB Wake Support” and change it to “Enabled” (from the manual: this option allows you to enable USB devices to wake the system from Standby).
  • Save and quit (press F10).

Then when I restart the laptop, the wake-up thing is back to normal.

I did try to disable that option later on just to be sure, and the problem really happened again.

So, I re-applied the solution and the laptop woke up perfectly again.

Now when I restart the laptop, everything works beautifully, except for one thing: the laptop wakes up whenever I move my mouse.

The laptop wakes up every time I move my mouse?

Now that I enable “USB Wake Support“, another headache appears. Whenever I move my wireless mouse, or click on it, the laptop wakes up.

Fortunately, I can turn that feature off for my wireless mouse and still keep the BIOS setting enabled.

  • Go to Device Manager
  • Expand Mice and other pointing devices
  • Find your wireless mouse and right click, choose Properties
  • In the mouse properties window, click to Power Management tab
  • Uncheck “Allow this device to wake the computer

That’s it. Now my laptop works normally again.

If your mouse does not have the Power Management tab, you may have to turn off your mouse every time you put your computer to sleep.

Do these tips work for you? Let me know in the comment! 😀

Troubleshooting long transaction and failed transaction in SQL Server

Troubleshooting long transaction and failed transaction in SQL Server

When a transaction runs for too long, it may block other queries to your database. Here’s how we can find and kill it.

1. View which transactions are running

execute sp_who2

or

DBCC OPENTRAN

 

2. View information of running transactions

SELECT
    r.[session_id],
    c.[client_net_address],
    s.[host_name],
    c.[connect_time],
    [request_start_time] = s.[last_request_start_time],
    [current_time] = CURRENT_TIMESTAMP,
    r.[percent_complete],
    [estimated_finish_time] = DATEADD
        (
            MILLISECOND,
            r.[estimated_completion_time],
            CURRENT_TIMESTAMP
        ),
    current_command = SUBSTRING
        (
            t.[text],
            r.[statement_start_offset]/2,
            COALESCE(NULLIF(r.[statement_end_offset], -1)/2, 2147483647)
        ),
    module = COALESCE(QUOTENAME(OBJECT_SCHEMA_NAME(t.[objectid], t.[dbid]))
        + '.' + QUOTENAME(OBJECT_NAME(t.[objectid], t.[dbid])), ''),
    [status] = UPPER(s.[status])
FROM
    sys.dm_exec_connections AS c
    INNER JOIN sys.dm_exec_sessions AS s ON c.session_id = s.session_id
    LEFT OUTER JOIN sys.dm_exec_requests AS r ON r.[session_id] = s.[session_id]
    OUTER APPLY sys.dm_exec_sql_text(r.[sql_handle]) AS t
WHERE
    c.session_id = 59;

where 59 is the transaction’s id that can be acquired using the commands in the previous part – view which transactions are running.
 

3. Kill a running transaction

KILL 59;

where 59 is the transaction’s id that can be acquired using the commands in the previous part.

SQL Server – Log file too big and disk is full, now what?

SQL Server – Log file too big and disk is full, now what?

Have you ever faced the problem when your transaction log grows too big and your disk is full?

You cannot shrink the transaction log file unless you do transaction log backup first. You cannot do the transaction log backup because your disk doesn’t have enough free space. The transaction log is getting bigger every minute. The clock is ticking. What will you do?

Normally, SQL Server would make you backup the transaction log first, only then would allow you to shrink transaction log file. If you want to look more into this process, take a look at this blog.

However in this case, there’s not enough space to write the log backup file. So that wouldn’t work.

After spending a lot of time googling, I ended up this solution

BACKUP LOG DBNAME TO DISK ='NUL'

where DBNAME should be changed to the database name that we are dealing with.

What this piece of code does is that it backups the transaction log to ‘NUL’ file, which means the backup process will be executed but there’s no writing to disk. After this process completes, SQL Server will think that all the transaction log has been backed up to disk and allow us to shrink the transaction log file.

This solution is perfect, except for one thing: during this process, all transaction log will be thrown away, which means if we can’t make a full backup of the data after this process, we might face a data loss if the server crash.

Therefore, use this solution at your own risk. And remember to do a full backup of the database right after this process, just to be sure. After the full backup of the database, you’re safe.

Hope this helps!

Cheers.