Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

using Sqlpsx functions on a production sql box Expand / Collapse
Author
Message
Posted Friday, August 23, 2013 6:05 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: 2 days ago @ 12:14 PM
Points: 596, Visits: 1,688
There is a very handy cmdlet called Get-sqlerrorlog that I'd like to use but everyone is very strict about installing anything on a production sql server. I want to use it to save off the sql error logs ( specific entries ). I wish there was a way to "embed" the function in the powershell sql agent job so it wasn't dependent on something installed on the server.
http://sqlpsx.codeplex.com/releases/view/25394



Post #1488076
Posted Saturday, August 24, 2013 5:03 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 10:28 PM
Points: 35,215, Visits: 31,666
Where are you trying to "save off the SQL Error logs" to? A table or a file?

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1488171
Posted Saturday, August 24, 2013 5:08 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: 2 days ago @ 12:14 PM
Points: 596, Visits: 1,688
Saving to files with timestamp in the name. The request was to keep error log entries ( other than backup/logon messages ) for a year. I could use the xp_ReadErrorLog approach to write to a table, but thought I'd try powershell.


Post #1488172
Posted Sunday, August 25, 2013 2:23 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 10:28 PM
Points: 35,215, Visits: 31,666
Indianrock (8/24/2013)
Saving to files with timestamp in the name. The request was to keep error log entries ( other than backup/logon messages ) for a year. I could use the xp_ReadErrorLog approach to write to a table, but thought I'd try powershell.


Although there are certainly some great benefits to using PowerShell for certain things, I tend to stay within the confines of SQL Server if it can be done there. A lot of people will disagree with it but I have several WMI "collectors" of data written in PowerShell that I call from T-SQL using xp_CmdShell. People will also disagree with this just because I use xp_CmdShell but we have the system very well locked down and we have no under-privileged users that have been proxied out to use it directly.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1488240
Posted Monday, August 26, 2013 12:47 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, September 11, 2014 10:06 PM
Points: 158, Visits: 776
Just a comment, you are not installing anything. it is a open source library, you can check the code and it is only copy and paste the modules It is not intrusive.. It is the same that you copy the code and create your Get-SQLErrorLogMine and paste the code in there and say "I did it. Lets try it and publish in production if it is ok". (not correct to do that of ocurse, but just to exemplify that it is not like you install an application or something like that)

$hell your Experience !!!
Post #1488296
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse