Database

Linux firewall rules for RAC

Saturday, February 18, 2012
By Steve

Most notes on the Oracle MOS support site suggest disabling the firewall supplied in most Linux distros as managed by the iptables program. I think this is a bit drastic, and results in lazy thinking at best, and an exposed database server subject to all sorts of hacker invasion at worst. If you don’t... »

Query SQL Server stored procedure text with JDBC

Wednesday, February 8, 2012
By Steve

I needed to quickly print the text associated with several stored procedures across multiple database servers to individual files. I used what is below. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30... »

Poor man’s partitioning with instead of triggers – PART 1

Tuesday, February 7, 2012
By Steve

The Enterprise Edition of Oracle Corp’s. flagship database has many features. One of these is partitioning. Partitioning allows a user to segment table rows into separate physical storage structures. This can improve things such as performance and manageability. Performance can be improved by utilizing what Oracle terms “partition pruning”. For example, let’s assume you... »

Connecting to SQL Server using internal authentication

Tuesday, January 31, 2012
By Steve

We use java for a lot of our jobs, and using it to access SQL Server is no exception. We wanted to have controlled access, and avoid “user sprawl” across servers. As such, we use Windows authentication from our java programs. Below is an example: 1 2 3 4 5 6 7 8 9... »

Why won’t my VIP start?

Wednesday, January 18, 2012
By Steve

After restarting a test server, I found the RAC VIP would not start. This post is just a quick note as to how I troubleshot the problem, as well as its ultimate resolution. I frequently use the find -mmin 5 -type f | xargs grep -i "whatever you want" command to find any recently... »

Getting DDL for a scheduler job

Wednesday, January 11, 2012
By Steve

If you need to copy the DDL to create a scheduler job from one schema to another, what is below works well… 13:28:56 oracle@oh1xpwcdb01 ~ >./dynColumns.py "select dbms_metadata.get_ddl('PROCOBJ','CHECK_TEMP_FREE','HOWARDS') from dual" -----------------------------------------------   BEGIN dbms_scheduler.create_job('"CHECK_TEMP_FREE"', job_type=>'PLSQL_BLOCK', job_action=> 'begin oclc_checks.check_temp_free(10); end;' , number_of_arguments=>0, start_date=>TO_TIMESTAMP_TZ('03-OCT-2009 04.40.00.000000000 PM AMERICA/NEW_YORK','DD-MON-RRRR HH.MI.SSXFF AM TZR','NLS_DATE_LANGUAGE=english'), repeat_interval=> 'FREQ=MINUTELY;INTERVAL=5' , end_date=>NULL, job_class=>'"DEFAULT_JOB_CLASS"', enabled=>FALSE,... »

Standard exception pragmas

Friday, January 6, 2012
By Steve

Oracle provides several standard exception pragmas (essentially, a compiler directive) for exceptions found on a fairly frequent basis. These are documented in the PL/SQL User Guide and Reference, but you can also get them at runtime using what is below: 1 2 3 4 5 6 7 8 9 10 11 12 13 14... »

Extracting SCN range from an online redo log or archived redo log

Saturday, December 31, 2011
By Steve

I can’t imagine that this would be useful in a well managed system, but if you find yourself with a “raw” log file that is not in the dictionary, you can at least extract the SCN range it encompasses using what is below. $ awk --version GNU Awk 3.1.5 Copyright (C) 1989, 1991-2005... »

ASM device structure

Thursday, December 22, 2011
By Steve

Today, we had an issue where the asmlib disk label was removed from a disk at some point in the past. When we added new storage and issued oracleasm scan disks , the disk was “cleaned”, rendering it unavailable on the server from which the scan command was run. The data itself was OK,... »

Additional cursor trace information in 11.2.0

Sunday, December 11, 2011
By Steve

Oracle has added a lot of additional trace output in the 10046 optimizer trace files. As I have posted previously, I find the output in these files to be useful not only for troubleshooting performance issues, but also understanding the business flow of the application in cases where I don’t have access to the... »