Skip to content

Instantly share code, notes, and snippets.

View nochmu's full-sized avatar
🐒
Bananas!

Christian Mühlhaus nochmu

🐒
Bananas!
  • Germany / Munich
View GitHub Profile
@nochmu
nochmu / plsql_notes_nested_table.sql
Created May 31, 2019 20:18
Some basic notes about PL/SQL Nested Tables (aka. List, Set, Bag)
DECLARE
-- This example shows the basic usage and behavior of the Nested List.
TYPE t_list IS table of integer;
v_list t_list;
v_max_size integer := 0;
PROCEDURE print_count_and_last IS
@nochmu
nochmu / export_ddl.js
Created May 30, 2019 15:33
SQLcl Script to export an database schema into multiple files
// This script exports exports the current schema into files
// based on https://gist.github.com/krisrice/de6f694b5241682059968bd5beadbcf7
//
// Usage: SQL> script export_ddl
(function(){
var verbose = false;
var CopyOption = Java.type("java.nio.file.StandardCopyOption");
var ddlPath = java.nio.file.FileSystems.getDefault().getPath('ddl');
@nochmu
nochmu / fetch.js
Created May 30, 2019 09:47
FETCH Command for SQLcl
/* FETCH Command for SQLcl
* FETCH is like EXEC but for functions instead of procedures.
* Usage:
* SQL> script fetch.js
* SQL> fetch SYS_CONTEXT('USERENV', 'CURRENT_SCHEMA')
* SYS_CONTEXT('USERENV','CURRENT_SCHEMA')
* ---------------------------------------
* CMU
*/
@nochmu
nochmu / oracle19_install_create_db.md
Last active May 2, 2023 14:34
Install Oracle Database 19c EE
@nochmu
nochmu / lvm_raid10
Last active May 16, 2019 00:42
LVM: Move the root Filesystem to RAID 1 without downtime!
# Move the root filesystem from single disk to a RAID 1 without downtime
root$ df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 7.7G 0 7.7G 0% /dev
tmpfs 7.7G 0 7.7G 0% /dev/shm
tmpfs 7.7G 8.8M 7.7G 1% /run
tmpfs 7.7G 0 7.7G 0% /sys/fs/cgroup
/dev/mapper/vg-root 5.2G 1.4G 3.5G 29% /
/dev/sdb1 922M 143M 732M 17% /boot
@nochmu
nochmu / oracle_dbfs.sql
Created February 5, 2019 07:36
Oracle DBFS
-- https://docs.oracle.com/en/database/oracle/oracle-database/18/adlob/using-DBFS.html#GUID-8735D535-2E13-4702-95F9-01F931F2BF46
-- see: https://oracle-base.com/articles/12c/dbfs-enhancements-12cr1
-- https://docs.oracle.com/database/121/ADLOB/adlob_client.htm#ADLOB46187
-- AS SYSDBA
-- Create Tablespace
CREATE TABLESPACE dbfs_ts
DATAFILE '/opt/oracle/oradata/XE/XEPDB1/dbfs01.dbf'
SIZE 1M AUTOEXTEND ON NEXT 1M;
@nochmu
nochmu / path_completion.sh
Last active January 11, 2019 21:20
Bash 4.2: Restore the path completion
# /etc/bash_completion.d/disable
# Disables the new behaviorfor bash completion (>=4.2)
#
# $ ls $HOME/.bash<tab><tab>
#
# new behavior:
# $ ls \$HOME/.bash
#
# old behaivor:
# .bash_history .bash_logout .bash_profile .bashrc
@nochmu
nochmu / bash_template.sh
Last active November 24, 2018 13:39
Template for new bash scripts without getopts
#!/usr/bin/env bash
# The following variables are used to describe this script in detail
description="$(basename $0): DESCRIPTION"
version="0.0.1-dev"
author="AUTHOR"
usage_info="
Usage: $(basename $0) ARGS
Arguments:
...
@nochmu
nochmu / README-Template.md
Created March 14, 2018 09:34 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@nochmu
nochmu / pom.xml
Last active February 22, 2018 19:11
call utPLSQL-CLI with exec-maven-plugin
<project>
...
<properties>
<!-- Datbase -->
<db.host>oradev</db.host>
<db.port>1521</db.port>
<db.service>dev.loc</db.service>
<db.user.test>TEST</db.user.test>
<db.pw.test>test</db.pw.test>