Skip to content

Instantly share code, notes, and snippets.

View hemantkchitale's full-sized avatar

Hemant K Chitale hemantkchitale

View GitHub Profile
@hemantkchitale
hemantkchitale / Collatz_Conjecture.ipynb
Created September 12, 2021 10:16
Collatz Conjecture (Jupyter Python Notebook)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hemantkchitale
hemantkchitale / Pro*C example code
Created May 1, 2021 10:57
Oracle Pro*C example code, with compiler commands
############
This part is the shell scrip to compile the Pro*C source "instancedbinfo.pc" into "instancedbinfo.c and then into an executable
echo "*****Set LD_LIBRARY_PATH"
LD_LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/4.8.2/include:/usr/include/linux:/opt/oracle/product/19c/dbhome_1/precom/lib:/opt/oracle/product/19c/dbhome_1/lib
export LD_LIBRARY_PATH
echo "*****Set C_INCLUDE_PATH"
C_INCLUDE_PATH=/usr/lib/gcc/x86_64-redhat-linux/4.8.2/include:/usr/include/linux:/opt/oracle/product/19c/dbhome_1/precom/lib:/opt/oracle/product/19c/dbhome_1/lib:/opt/oracle/product/19c/dbhome_1/precomp/public
@hemantkchitale
hemantkchitale / Java Code in Oracle Database Session
Created April 28, 2021 03:31
Loading Java code into OJVM for execution in an Oracle Database Session
-- see demo at https://hemantoracledba.blogspot.com/2021/04/ojvm-loading-java-code-and-running-it.html
-- grant Java Code permission to only READ only /home/oracle/tmp
-- this should have been provided by the DBA
begin
dbms_java.grant_permission('HEMANT',
'SYS:java.io.FilePermission',
'/home/oracle/tmp', 'read');
@hemantkchitale
hemantkchitale / set_session_longops
Created April 4, 2021 11:13
Sample PL/SQL code to use dbms_application_info.set_session_longops to populate v$session_longops
-- see https://hemantoracledba.blogspot.com/2021/04/using-sessionlongops-view-with.html for a demo
DECLARE
rindex BINARY_INTEGER;
slno BINARY_INTEGER;
target_count number;
updated_count number;
product_row products%rowtype;
@hemantkchitale
hemantkchitale / Create_MultiGB_File.c
Created April 17, 2019 03:53
Create MultiGB File
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>
@hemantkchitale
hemantkchitale / create_proc_autonomous_comment_ddl.sql
Created August 23, 2017 09:36
Autonomous Comment in Oracle
set echo on
set pages600
set linesize 132
spool create_proc_autonomous_comment_ddl
create or replace procedure proc_autonomous_comment_ddl
(in_table_name in varchar , in_comment_28char in varchar)
is
pragma autonomous_transaction;