|
|
-
|
|
A very useful approach to clearing down data from tables. This will truncate a specific table, without it being logged.
Use with caution!
ALTER TABLE schema.table_name activate not logged initially with empty table
Republished from http://www.dba-db2.com/.......
|
|
-
|
|
Useful code to gather the rowcount of all tables, worth doing a reindex prior to this code
############START#################
SELECT
SCHEMA_NAME(t1.schema_id) AS [schema],
t1.name AS [table],
i1.rows AS [row_count]
FROM sys.tables AS t1 INNER JOIN
sys.sysindexes AS i1 ON t1.object_id = i1.......
|
|
-
|
|
This is a useful script I use to list the space used for all databases on a given sql server
EXEC sp_msforeachdb @command1="use ? exec sp_spaceused @updateusage = N'TRUE';"
The purpose of passing the argument: @updateusage, is it updates the usage information
Republished from http://www.sqlserver......
|
|
-
|
|
The following command line brings up all instance names and asks to select
an instance and then a few button clicks.
C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\ARPWrapper.exe"
/Remove
Ensure you have backed up registry settings PRIOR to running the code.
For more information, chec......
|
|
-
|
|
To force connections of a specific database in DB2, the following will work.
db2 connect to MYDB
QUIESCE DATABASE IMMEDIATE FORCE CONNECTIONS
db2 terminate
---do what you need to do
Republished from http://www.dba-db2.com/.......
|
|
-
|
|
The BACKUP team requested a report outlining the last backup of every database on every SQL Server instance, covering: full, incremental and log type backups. The idea was to compare this against their schedule, checking for differences.
The SQL Server inventory in the organisation is 750 SQL Serve......
|
|
-
|
|
I ran the command
EXEC sp_msforeachdb @command1="use ? exec sp_spaceused"
which returned all the relevant information per database on a SQL Server instance I was troubleshooting.
On the basis of the information I adjusted one of the db sizes.
I then ran the same command and notices that the info......
|
|
-
|
|
The SQL Server Surface Area Configuration command-line interface, sac.exe, allows you to import and export settings.
In a recent server consolidation exercise I exported the setting and used it as a form of backup, in case of any errors
during the consolidation process.
You can import and expor......
|
|
-
|
|
Rename a DB2 database with these instructions.
1.) Create a configuration file, e.g MYCONFIG.CFG:
DB_NAME = OLDDB, NEWDB
DB_PATH = provide the path
INSTANCE = provide the instance
NODENUM = 0
2.) Save the configuration file as relocate.cfg
3.) use the following command to make the changes to ......
|
|
-
|
|
There was a requirement to allow Ole Automation Procedures within SQL Server 2005,
this code will enable the feature.
-------------------CODE START------------------------
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Ole Automation Procedures', 1;
GO
RECONFIGURE......
|
|