While discussing a way to delete many rows, but without deleting all of them at the same time (too much transaction logging), we came up with the following… This works pretty well. It’s faster to do it all at once,…
Category: Database
Command line script to print referential integrity constraints
Nothing fancy today, just a quickie as indicated in the subject line of the post… set serverout on format wrapped declare l_level number := 0; –get only tables with no parent tables cursor main is select distinct table_name,constraint_name from user_constraints…
Calculating waits for a session for a given time window
We used this to quickly determine where a specific session was spending its time. This simply creates associative arrays for events, the time waited, and the total number of waits for that event, all at a specific point in time.…
Rolling your own Grid Control with AQ
DBControl can do the same thing, but if you have more than one database on a server, this is where something like this will come in handy. PLSQL setup, you should only have to change the SHOWARD part… begin dbms_aqadm.grant_queue_privilege…
Hive performance parser
With data in the hiveserver2.log file, this awk scriptlet prints the timestamp, SQL, and seconds to run. There is an issue where the parser thread hands off to the executor, and you can’t always tie the two together. However, at a…
Oracle SQL Developer and Apache Hive – Never the twain shall meet
If you have come trying to find out why you can’t connect when you know you haven’t fat fingered your password, take heart, you aren’t going crazy. You likely used instructions in the following post to connect SQL Developer to…
Unable to download to any storage directory
We had an issue in which the secondary namenode was not checkpointing the edits file with updates from the primary namenode. In case you are unaware, the secondary namenode (not in an HA configuration) regularly transfers the edits file from…
How often does YARN purge locally cached resources?
If you are stretched for space locally, this may come in handy. By default, localized resources are purged every ten minutes… [root@cmhlddlkedat01 2.2.4.2-2]# grep -A1 yarn.nodemanager.localizer.cache.cleanup.interval-ms yarn-default.xml yarn.nodemanager.localizer.cache.cleanup.interval-ms 600000 [root@cmhlddlkedat01 2.2.4.2-2]# Of course, this can be overridden.
Phoenix to a secure HBase cluster
This is just a simple example of using a custom JDBC class to connect to an HBase cluster that is secured by kerberos. import java.sql.*; import java.util.*; public class phoenixTest { public static void main(String args[]) throws Exception { Connection…
Nastiness with Hive/ODBC
We ran into an issue that is not documented, although the hive user guide does indicate it should be set. Whenever we issued a statement with the Hive 64-bit ODBC driver through knox, the knox server would truncate anything after…