Friday, March 30, 2012
how to shrink the logfile
My log file is of more than 2gb,
i want to shrink the size of this , without taking my server offline.
i've tried
DBCC SHRINKFILE ( 2, EMPTYFILE )
still no use.
This is the info of my database
Status=ONLINE, Updateability=READ_WRITE, UserAccess=MULTI_USER,
Recovery=FULL, Version=539, Collation=SQL_Latin1_General_CP1_CI_AS,
SQLSortOrder=52, IsTornPageDetectionEnabled, IsAutoCreateStatistics,
IsAutoUpdateStatistics, IsFullTextEnabled
thanks in advance
regards
Lara
Hi
Check out
http://msdn.microsoft.com/library/de...r_da2_1uzr.asp
John
"Lara" wrote:
> hi,
> My log file is of more than 2gb,
> i want to shrink the size of this , without taking my server offline.
> i've tried
> DBCC SHRINKFILE ( 2, EMPTYFILE )
> still no use.
> This is the info of my database
> Status=ONLINE, Updateability=READ_WRITE, UserAccess=MULTI_USER,
> Recovery=FULL, Version=539, Collation=SQL_Latin1_General_CP1_CI_AS,
> SQLSortOrder=52, IsTornPageDetectionEnabled, IsAutoCreateStatistics,
> IsAutoUpdateStatistics, IsFullTextEnabled
>
> thanks in advance
> regards
> Lara
>
>
|||Hi,
How to reduce the Transaction log size
1. Backup the transaction log (Use BACKUP Log dbname to
disk='c:\backup\dbname.tr1' or use enterprise manager)
or (Since you done have the hard disk space truncate the trasaction log)
backup log <dbname> with truncate_only
3. Shrink the transaction log file.
DBCC SHRINKFILE('logical_transactioXn_log file name','truncateonly')
Have a look into the below link.
Shrinking the Transaction Log in SQL Server 2000 with DBCC
http://www.support.microsoft.com/?id=272318
Thanks
Hari
SQL Server MVP
"Lara" <lara@.hotmail.com> wrote in message
news:%23uQQ0KKqFHA.3404@.TK2MSFTNGP11.phx.gbl...
> hi,
> My log file is of more than 2gb,
> i want to shrink the size of this , without taking my server offline.
> i've tried
> DBCC SHRINKFILE ( 2, EMPTYFILE )
> still no use.
> This is the info of my database
> Status=ONLINE, Updateability=READ_WRITE, UserAccess=MULTI_USER,
> Recovery=FULL, Version=539, Collation=SQL_Latin1_General_CP1_CI_AS,
> SQLSortOrder=52, IsTornPageDetectionEnabled, IsAutoCreateStatistics,
> IsAutoUpdateStatistics, IsFullTextEnabled
>
> thanks in advance
> regards
> Lara
>
Friday, March 23, 2012
How to setup Operator for sending alerts?
I've setup an Operator using the management studio and properly configured
it's settings. However, when I test it by running a job that fires an alert
to the Operator, the alert fails and gives me back the following error.
The job succeeded. The Job was invoked by User XXX. The last step to run
was step 1 (X). NOTE: Failed to notify 'John Doe' via email. NOTE: Failed
to notify 'John Doe' via pager.
Not sure if this helps but I've properly setup Database Mail via the wizard
along with a default profile and have successfully sent e-mails using the
system sproc for sending emails.
Is there a guide for properly setting up and testing Operator alerts?
P.S - I am using SQL 2005 April CTP. Didnt post on the SQL 2005 forums cause
they are practically dead.
Johnny
I'd run profiler to see what is happening. Does it *try* to send email? If it does, does the TSQL it
submit execute correctly from a query window?
I had problems with Agent Mail in June CTP, so I decided to wait with Agent Mail testing to a later
build.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Johnny" <Johnny@.discussions.microsoft.com> wrote in message
news:E671A826-D5C3-45AA-95AA-E7EF913E84AE@.microsoft.com...
> Hello,
> I've setup an Operator using the management studio and properly configured
> it's settings. However, when I test it by running a job that fires an alert
> to the Operator, the alert fails and gives me back the following error.
> The job succeeded. The Job was invoked by User XXX. The last step to run
> was step 1 (X). NOTE: Failed to notify 'John Doe' via email. NOTE: Failed
> to notify 'John Doe' via pager.
> Not sure if this helps but I've properly setup Database Mail via the wizard
> along with a default profile and have successfully sent e-mails using the
> system sproc for sending emails.
> Is there a guide for properly setting up and testing Operator alerts?
> P.S - I am using SQL 2005 April CTP. Didnt post on the SQL 2005 forums cause
> they are practically dead.
> Johnny
|||Yahtzee!!!!!!! I found the problem, right before I was getting ready to give
up. I put together some instructions on how to get it to work for those
interested.
Note: With SQL Server Agent Alerts, you have the option of using "Database
Mail" (recommended) or the soon to be removed "SQL Mail" as the mail system.
These instructions show you how to use "Database Mail".
1. Enable "Database Mail" by using the "SQL Server 2005 Surface Area
Configuration" tool.
2. Install "Database Mail" objects in the msdb database.
3. Create a "Database Mail" profile and name it "Default Profile" or
whatever you like.
NOTE: The next step is to tell "SQL Server Agent" that you want to use
"Database Mail" as the mail system and specify a default profile to use. You
are suppose to do this by going to the Alert System page in the SQL Server
Agent Properties. However, the "Database Mail" option is not available in the
drop down menu and therefore you are unable to properly configure this, even
after rebooting the server. We will have to bypass the "UI" provided by the
SQL Server Management Studio and go straight to the registry to specify our
settings.
4. Open the registry editor by going to Start > Run > regedit.
5. Browse to the "SQLServerAgent" section. The path is something like
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microso ft SQL
Server\MSSQL.1\SQLServerAgent".
6. Modify the following entries with the corresponding values listed below.
KeyValue
UseDatabaseMail1
DatabaseMailProfileDefault Profile
7. Restart the "SQL Server Agent" service and voila!!
- Johnny
"Tibor Karaszi" wrote:
> I'd run profiler to see what is happening. Does it *try* to send email? If it does, does the TSQL it
> submit execute correctly from a query window?
> I had problems with Agent Mail in June CTP, so I decided to wait with Agent Mail testing to a later
> build.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Johnny" <Johnny@.discussions.microsoft.com> wrote in message
> news:E671A826-D5C3-45AA-95AA-E7EF913E84AE@.microsoft.com...
>
Wednesday, March 21, 2012
How to setup cluster ?
I've 3 PC. 2 x Win2K AS and 1 Win2K Pro. Is it possible to cluster the 2
Win2K AS as Primary & Secondary while the Win2K Pro serves as the shared disk
server ?
Do I need to get a Raid card for Win2K Pro PC ?
Advice pls.
You might be able to use iSCSI on the XP box, though I have not tested it.
Other then that, you are asking for instructions that probably don't exist,
and if they did would probably not be supported. If you are in need of a
test environment, may I suggest VS 2005?
Cheers,
Rod
MVP - Windows Server - Clustering
http://www.nw-america.com - Clustering
http://msmvps.com/clustering - Blog
"Desmond" <Desmond@.discussions.microsoft.com> wrote in message
news:BD968661-3225-4791-A263-2AEC7212A1A4@.microsoft.com...
> Hi,
> I've 3 PC. 2 x Win2K AS and 1 Win2K Pro. Is it possible to cluster the 2
> Win2K AS as Primary & Secondary while the Win2K Pro serves as the shared
> disk
> server ?
> Do I need to get a Raid card for Win2K Pro PC ?
> Advice pls.
|||Forget about using the Win2K Pro as the 'shared disk server' (I took 'shared
disk server' to mean file server). Get an external RAID controller and some
disks to serve as the shared disks, and use the two Win2K AS as the nodes.
Linchi
"Desmond" <Desmond@.discussions.microsoft.com> wrote in message
news:BD968661-3225-4791-A263-2AEC7212A1A4@.microsoft.com...
> Hi,
> I've 3 PC. 2 x Win2K AS and 1 Win2K Pro. Is it possible to cluster the 2
> Win2K AS as Primary & Secondary while the Win2K Pro serves as the shared
> disk
> server ?
> Do I need to get a Raid card for Win2K Pro PC ?
> Advice pls.
|||If this is for production please be sure that you have read the following
KB article and are aware of the limitations of a non-dertified solution:
327518 INF: The Microsoft Support Policy for a SQL Server Failover Cluster
http://support.microsoft.com/?id=327518
To setup a test enviroment you will need at least one external SCSI drive
or ability to setup using iSCSI
Dave Whitney
SQL Support
This posting is provided "AS IS" with no warranties, and confers no rights.
Monday, March 19, 2012
How to set up a SQL Server for storing Chinese characters
different character set and it's still not displaying the characters
correctly. I could insert the Chinese characters into a table using
INSERT with no error, but the SELECT statement shows "?"
Thanks for any help in advance.
John
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
John,
Are you using the Unicode datatypes of Nchar, Nvarchar, Ntext to store your
Chinese characters?
Also, you might want to read the MSDN article "International Features in
Microsoft SQL Server 2000" at:
http://msdn.microsoft.com/library/de...Server2000.htm
as it has a lot of info on how to setup and use Chinese characters.
Regards,
John
"John Lee" <john.lee104@.verizon.net> wrote in message
news:#JAsC#3HEHA.3356@.TK2MSFTNGP11.phx.gbl...
> Any idea what is the set up process is? I've tried a couple of
> different character set and it's still not displaying the characters
> correctly. I could insert the Chinese characters into a table using
> INSERT with no error, but the SELECT statement shows "?"
> Thanks for any help in advance.
> John
>
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!
|||Now I'm all set with saving and displaying the data. My next question
is how to script that for setting up a MSDE SQL server.
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
|||If you have access to SQL Server 2000 Standard or Developer Editions (or
above), you can use the Enterprise Manager to "generate SQL scripts" for
your database. If you don't have access to these Editions, there are several
"free" or low-cost "Enterprise Manager-like" tools, such as the following:
TOAD for SQL Server at http://www.toadsoft.com/toadss.html
and Microsoft's new SQL Server Web Data Administrator at:
http://www.microsoft.com/downloads/d...displaylang=en
Regards,
John
"John Lee" <john.lee104@.verizon.net> wrote in message
news:uMLEEBBIEHA.2836@.TK2MSFTNGP11.phx.gbl...
> Now I'm all set with saving and displaying the data. My next question
> is how to script that for setting up a MSDE SQL server.
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!
How to set the ReportPath for the reportviewer control
In my solution I've got 2 projects. ABCWeb is my website and ABCReports is a Report Server project.
In ABCWeb I have an aspx page that has a single reportviewer control on it which is intended to display the various reports that are in ABCReports . I am not using the Reports Server. I just simply want to set the property of the reportviewer control under LocalReport.ReportPath to the location of the report in ABCReports .
I keep getting this error no matter how I try to reference it.
what am I doing wrong
try something like this
RVcl.LocalReport.ReportPath ="ABCReports/Reports/rptNoticeOfDecision.rdl";
-remove the first /
I assume ABCreports is a sub folder of the application root
Monday, March 12, 2012
How to set SQL Server and VS default folder paths?
Ive just installed VS2005 Pro and SQL Server Developer edition.
Now I want to set the default paths for project, templates, settings. But I want for both VS and SQL files.
For example, right now the default folders for SQL Studio are:
.\My Documents\SQL Server Management Studio\Projects
.\My Documents\SQL Server Management Studio\Settings
.\My Documents\SQL Server Management Studio\Templates
.\My Documents\SQL Server Management Studio\Backup Files
... and so on.
For VS Studio:
.\My Documents\Visual Studio 2005\Projects
.\My Documents\Visual Studio 2005\Templates
.\My Documents\Visual Studio 2005\Code Snippets
... and so on.
I would like for all sub-folders(from SQL Server and VS) to be in one same folder(Development), for example:
.\My Documents\Development\Projects
.\My Documents\Development\Settings
.\My Documents\Development\Templates
.\My Documents\Development\Backup Files
.\My Documents\Development\Code Snippets
... and so on.
I have tried changing in each application′s options the default path for each one, pointing to each folder I listed above.
My problem is that both VS and SQL Server still keeps creating folders in the old locations, for example: ".\My Documents\SQL Server Management Studio\Projects". This example happens when I create a new query, and try to save it, it automatically creates that folder.
It only works for a few of them, like the settings folder. Ive managed to create a single folder for SQL and VS setting files.
Is there a way I can join both Application folders? I want to keep both projects files in one folder, both setting files in one folder, and so on...
I hope I explained well my situation.
Thanks!
In VS 2005 you can change default directories by going to Tools >> Options menu then selecting Projects and Solutions.In SQL Management Studio I believe it opens your last known file path you opened.
Justin King
|||SQL Server Managemetn Studio does not retain your file location between sessions. As far as I can tell there is no way to change this and the MS help facility neither confirms nor denies this assumption.
|||
So its not possible to change that?
Ive changed all places in the registry (all the keys I think might change that)
Still it creates the folders. Are there other places I can change that?
Thanks for the help.
Friday, February 24, 2012
How to set datetime?>
question.. In Access, I used to use the paramter Get() to have a datetime
field to default to the server's date/time each time a new record was
inserted. Anyone know how I can do this in SQL Server?
Default the column to GETDATE()
"Adrian Leontovich" <adrian@. lionsmaneproductions.com> wrote in message
news:emj1XGjsEHA.532@.TK2MSFTNGP10.phx.gbl...
> I've mined through the support files but without finding an answer to my
> question.. In Access, I used to use the paramter Get() to have a datetime
> field to default to the server's date/time each time a new record was
> inserted. Anyone know how I can do this in SQL Server?
>
|||CREATE TABLE blat
(
id INT,
dt SMALLDATETIME DEFAULT GETDATE()
)
GO
INSERT blat(id) SELECT 1
GO
SELECT * FROM blat
GO
DROP TABLE blat
GO
http://www.aspfaq.com/
(Reverse address to reply.)
"Adrian Leontovich" <adrian@. lionsmaneproductions.com> wrote in message
news:emj1XGjsEHA.532@.TK2MSFTNGP10.phx.gbl...
> I've mined through the support files but without finding an answer to my
> question.. In Access, I used to use the paramter Get() to have a datetime
> field to default to the server's date/time each time a new record was
> inserted. Anyone know how I can do this in SQL Server?
>
|||I'm assuming you mean on the Formula line.. but doing that changes ALL
entries in the table in the DATETIME field to the same entry! (the
latest)... each entry should be unique..
|||How do you expect to back-fill rows that already exist?
"Adrian Leontovich" <adrian@. lionsmaneproductions.com> wrote in message
news:%23BYqwausEHA.1400@.TK2MSFTNGP11.phx.gbl...
> I'm assuming you mean on the Formula line.. but doing that changes ALL
> entries in the table in the DATETIME field to the same entry! (the
> latest)... each entry should be unique..
>
|||This is a new table, so all data entered so far is strictly garbage data
that will be removed before anything goes live..
|||The DEFAULT constraint will be evaluated upon insertion; so if you have your
DEFAULT set to GETDATE(), the current date at the time the row is inserted
is used.
"Adrian Leontovich" <adrian@. lionsmaneproductions.com> wrote in message
news:elKZo1usEHA.2956@.TK2MSFTNGP12.phx.gbl...
> This is a new table, so all data entered so far is strictly garbage data
> that will be removed before anything goes live..
>
|||Then why do you care what is being applied to the existing data, if it's
just going to be thrown away?
Anyway, don't use the formula line, and STOP "designing" tables in
Enterprise Manager.
To quote myself:
...
There are subtle differences in what happens to rows that existed prior to
the column addition, depending on whether you define the new column as NULL
or NOT NULL.
CREATE TABLE Adam
(id INT)
GO
INSERT Adam(id) SELECT 1
GO
ALTER TABLE Adam
ADD InsertedDate DATETIME NOT NULL DEFAULT (GETDATE())
GO
INSERT Adam(id) SELECT 1
GO
SELECT * FROM Adam
GO
DROP TABLE Adam
GO
CREATE TABLE Adam
(id INT)
GO
INSERT Adam(id) SELECT 1
GO
ALTER TABLE Adam
ADD InsertedDate DATETIME DEFAULT (GETDATE())
GO
INSERT Adam(id) SELECT 2
GO
SELECT * FROM Adam
GO
DROP TABLE Adam
GO
Note the slight difference in the output.
http://www.aspfaq.com/
(Reverse address to reply.)
"Adrian Leontovich" <adrian@. lionsmaneproductions.com> wrote in message
news:elKZo1usEHA.2956@.TK2MSFTNGP12.phx.gbl...
> This is a new table, so all data entered so far is strictly garbage data
> that will be removed before anything goes live..