MSSQL Database

Commands to shrink the database:

DBCC SHRINKFILE(databasename_log, 2)

BACKUP LOG databasename WITH TRUNCATE_ONLY

EG

BACKUP LOG golden_netnuke WITH TRUNCATE_ONLY
DBCC SHRINKDATABASE (golden_netnuke)

————————————————————————————————————————————————-

Commands to shrink the database Logs:

DBCC SHRINKFILE (logfilename, size)

BACKUP LOG databasename WITH TRUNCATE_ONLY

————————————————————————————————————————————————-

Commands to change the MSSQL ‘SA’ Password:

Changing password MSSQL – SA User.
osql -E -Q “exec sp_password NULL,’new_password’,’sa'”

http://kb.parallels.com/en/870     Click

————————————————————————————————————————————————-

Command to bring database to offline and online:

ALTER DATABASE database-name  SET OFFLINE WITH NO_WAIT

ALTER DATABASE database-name SET ONLINE

—————----------------------------------------------------------------------------------

Unable to Sink the database with hsphere panel:

Error:

Login failed for user ‘(null)’. reason: Not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error : 18452)

If you face this kind of error. Follow the following steps to fix it.

Fix:

Login to MSSQl Server Client Network Utility > Alias > Server Alias Configurations and set the given values.

*Server Alias : ipaddress,1433 & mssql.servername.com,1433

*Network Library : Named Pipes

*Pipe Names : \\.\pipe\sql\query
Login failed for user '(null)'. reason: Not associated with a trusted SQL
Server connection. (Microsoft SQL Server, Error : 18452)

—————————————————————————————————————————————————-

Changing MYSQL Root Password:

update user set password=PASSWORD(“newrootpassword”) where User=’root’;

—————————————————————————————————————————————————————————-

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s