Notepad++ User Defined Language for TNSNAMES.ORA

Use this to add color coding and block collapse to a TNSNAMES.ORA file for Oracle.

<NotepadPlus>
<UserLang name="TNSNAMES" ext="ora" udlVersion="2.1">
<Settings>
<Global caseIgnored="yes" allowFoldOfComments="yes" foldCompact="no" forcePureLC="2" decimalSeparator="2" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">00# 01 02 03 04</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
<Keywords name="Numbers, extras1"></Keywords>
<Keywords name="Numbers, extras2"></Keywords>
<Keywords name="Numbers, suffix1"></Keywords>
<Keywords name="Numbers, suffix2"></Keywords>
<Keywords name="Numbers, range"></Keywords>
<Keywords name="Operators1">=</Keywords>
<Keywords name="Operators2"></Keywords>
<Keywords name="Folders in code1, open">(</Keywords>
<Keywords name="Folders in code1, middle"></Keywords>
<Keywords name="Folders in code1, close">)</Keywords>
<Keywords name="Folders in code2, open"></Keywords>
<Keywords name="Folders in code2, middle"></Keywords>
<Keywords name="Folders in code2, close"></Keywords>
<Keywords name="Folders in comment, open">##https://docs.oracle.com/database/121/NETRF/tnsnames.htm#NETRF007</Keywords>
<Keywords name="Folders in comment, middle"></Keywords>
<Keywords name="Folders in comment, close"></Keywords>
<Keywords name="Keywords1">#DESC_LIST_OR_DESC_OR_ADDR_LIST source_route failover load_balance </Keywords>
<Keywords name="Keywords2">#DESCRIPTION enable sdu type_of_service connect_timeout retry_count retry_delay transport_connect_timeout compression compression_levels  security ssl_server_cert_dn</Keywords>
<Keywords name="Keywords3">#KEYWORDS </Keywords>
<Keywords name="Keywords4">#ADDRESS_PARAMS protocol host community service pipe port </Keywords>
<Keywords name="Keywords5">#DESCRIPTION_OR_ADDRESS_PROTOCOL  recv_buf_size send_buf_size </Keywords>
<Keywords name="Keywords6">#CONNECT_DATA sid server srvr service_name server instance_name ur global_name hs rdb_database </Keywords>
<Keywords name="Keywords7">#FAILOVER_PARMS backup type method transaction retries delay commit_outcome</Keywords>
<Keywords name="Keywords8">#FIXED_OPTS select basic tcp nmp spx on off yes no true false shared pooled dedicated low high preconnect session none ok</Keywords>
<Keywords name="Delimiters">00description_list 01 02= 03description 04 05= 06address_list 07 08= 09address 10 11= 12connect_data 13 14= 15failover_mode 16 17= 18IFILE 19 20(( EOL )) 21 22 23</Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="COMMENTS" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="LINE COMMENTS" fgColor="68DF11" bgColor="FFFFFF" fontStyle="2" nesting="0" />
<WordsStyle name="NUMBERS" fgColor="FF00FF" bgColor="FFFFFF" fontStyle="1" nesting="0" />
<WordsStyle name="KEYWORDS1" fgColor="A97C21" bgColor="FFFFFF" fontStyle="1" nesting="0" />
<WordsStyle name="KEYWORDS2" fgColor="FF8000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS3" fgColor="FF0000" bgColor="FFFF00" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS4" fgColor="008040" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS5" fgColor="AF9116" bgColor="FFFFFF" fontStyle="1" nesting="0" />
<WordsStyle name="KEYWORDS6" fgColor="0000FF" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS7" fgColor="5555FF" bgColor="FFFFFF" fontStyle="2" nesting="0" />
<WordsStyle name="KEYWORDS8" fgColor="0080C0" bgColor="FFFFFF" fontStyle="1" nesting="0" />
<WordsStyle name="OPERATORS" fgColor="FF8040" bgColor="FFFFFF" fontStyle="1" nesting="0" />
<WordsStyle name="FOLDER IN CODE1" fgColor="FF0000" bgColor="FFFFFF" fontStyle="1" nesting="0" />
<WordsStyle name="FOLDER IN CODE2" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS1" fgColor="400080" bgColor="DFDFFF" fontStyle="2" nesting="0" />
<WordsStyle name="DELIMITERS2" fgColor="7429B8" bgColor="FFFFFF" fontStyle="1" nesting="1" />
<WordsStyle name="DELIMITERS3" fgColor="800000" bgColor="FFFFFF" fontStyle="3" nesting="16777219" />
<WordsStyle name="DELIMITERS4" fgColor="008000" bgColor="D5FFDC" fontStyle="1" nesting="7" />
<WordsStyle name="DELIMITERS5" fgColor="0000FF" bgColor="FFFFFF" fontStyle="1" nesting="16" />
<WordsStyle name="DELIMITERS6" fgColor="5555FF" bgColor="DFDFFF" fontStyle="3" nesting="0" />
<WordsStyle name="DELIMITERS7" fgColor="FF0000" bgColor="FFFF00" fontStyle="1" nesting="16777216" />
<WordsStyle name="DELIMITERS8" fgColor="408080" bgColor="FFFFFF" fontStyle="0" nesting="0" />
</Styles>
</UserLang>
</NotepadPlus>

Cycle SQL Error Log when it reaches a certain size

Add this as a SQL Agent job.  This is useful for preventing very large error log files and can also help alert on errors due to frequent cycling.

 

/*

            Cycle error log when exceeds given size

            Ron Klimaszewski

            2015-09-30

            https://ronthepolymath.wordpress.com/

*/

SET NOCOUNT ON

DECLARE       @limit float, @mailto nvarchar(150), @mailsubject nvarchar(100), @mailquery nvarchar(100), @v varchar(15)

SELECT @v = CAST(serverproperty(‘productversion’) as varchar)

 

— Set the limit to 3MB

SET @limit = 3000000

SET @mailto = ‘sqldbas@somecompany.com’

SET @mailsubject = ‘SQL Farm Warning: Error logs cycled on ‘ + @@SERVERNAME

SET @mailquery = ‘SELECT * FROM ##logs order by Lognum’

 

IF OBJECT_ID(‘tempdb..##logs’) IS NOT NULL drop table ##logs

create table ##logs ( Lognum int, Logdate datetime, [Size (bytes)] float)

insert into ##logs exec master..xp_enumerrorlogs

if ( select [Size (bytes)] from ##logs where LogNum = 0) > @limit

begin

            exec master.dbo.sp_cycle_errorlog

            IF (LEFT(@V,4) = ‘8.00’)

            BEGIN

                        exec master.dbo.xp_sendmail @recipients= @mailto, @subject = @mailsubject, @query = @mailquery, @width = 300

            END

            ELSE BEGIN

                        exec msdb..sp_send_dbmail @recipients= @mailto, @subject = @mailsubject, @query = @mailquery

            END

 end

drop table ##logs

Chain too long? Here’s a quick fix.

Say you are connecting safety chains from a trailer to a vehicle, but comes close to or touches the road.  If you drive like that, you might not have much chain left.  Of say you are using a loading ramp on a pickup truck, and its chains are too long.  The purpose of the safety chain is to prevent the ramp from slipping off the tailgate–too long and they serve no purpose.

How do you remedy these situations?  Simple.  Follow Chubby Checker’s advice and do The Twist!

Just take the chain and twist it a few times and it will shorten up.

http://www.youtube.com/watch?v=pHGXwQeUk7M

Hello world!

A polymath (Greek: πολυμαθής, polymathēs, “having learned much”)[1] is a person whose expertise spans a significant number of different subject areas; such a person is known to draw on complex bodies of knowledge to solve specific problems.

When I get the time, I will post things I find important for others to know, primarily relating to Enterprise IT, but also on cooking, making beer, home improvements, camping, automotive, motorcycling, and religion.