This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set scan off | |
set define off | |
script sqlid.js | |
set statusbar add sqlid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set scan off | |
set define off | |
script | |
var StatusBarComponent = Java.type("oracle.dbtools.raptor.console.StatusBarComponent"); | |
var component = new StatusBarComponent() { | |
getName: function() { | |
return "cmdstatus"; | |
}, | |
getDescription: function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set scan off | |
set define off | |
script | |
var StatusBarComponent = Java.type("oracle.dbtools.raptor.console.StatusBarComponent"); | |
var component = new StatusBarComponent() { | |
getName: function() { | |
return "beer"; | |
}, | |
getDescription: function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from oraclelinux:8 | |
run yum-config-manager --add-repo=http://yum.oracle.com/repo/OracleLinux/OL8/oracle/software/x86_64 | |
run yum -y install ords |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sql() { | |
# REMOTE source this script | |
# | |
# . <(curl -s https://gist.githubusercontent.com/krisrice/fec43fd9f53e4286e5cc360b554e3c0f/raw/62ec382d7511c7cc44703a9a2f75a4a7f233efe2/sqlcl.sh) | |
# Set the stage directory | |
STAGE_DIR=/tmp | |
# Check whether internet connection exists | |
if ping -c 1 -t 3 download.oracle.com > /dev/null; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var OCIProfiles = Java.type("oracle.dbtools.oci.OCIProfiles"); | |
var OCIRESTClient = Java.type("oracle.dbtools.oci.OCIRESTClient"); | |
var OCIRequest = Java.type("oracle.dbtools.oci.OCIRequest"); | |
var Instant = Java.type("java.time.Instant"); | |
var DateTimeFormatter = Java.type("java.time.format.DateTimeFormatter"); | |
var TemporalAccessor = Java.type("java.time.temporal.TemporalAccessor"); | |
var FileUtils = Java.type("oracle.dbtools.common.utils.FileUtils"); | |
var StandardCopyOption = Java.type("java.nio.file.StandardCopyOption"); | |
var Files = Java.type("java.nio.file.Files"); | |
var Paths = Java.type("java.nio.file.Paths"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
script | |
// issue the sql | |
var binds = {} | |
var ret = util.executeReturnList('select help_text,page_name from APEX_APPLICATION_PAGES where rownum=1 and help_text is not null',binds); | |
// loop the results | |
for (i = 0; i < ret.length; i++) { | |
// debug is nice | |
ctx.write( ret[i].PATH+ "\n"); | |
// get the CLOB stream |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/hack-font@3/build/web/hack-subset.css"> | |
<script> | |
var refreshInteval; | |
function poolListing(){ | |
// populate the list of pools | |
fetch('http://localhost:8080/ords/_/instance-api/stable/database-pools-cache/', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
script | |
var dbUser = util.executeReturnOneCol('select user from dual'); | |
var globalName = util.executeReturnOneCol('select global_name from global_name'); | |
var title = "sqlcl " +dbUser + "@" + globalName | |
sqlcl.setStmt('!echo -ne "\033]0;'+title+'\007"'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Print current instances for autonomous db | |
# Uses $OCI_TENANCY for compartment id since that is the "root" | |
# | |
cat > db.jq <<EOF | |
.data[] | | |
."db-name" + "\tocid:" + .id , | |
"\t" + ."db-name" + "_low" , | |
"\tORDS Version: " + ."apex-details"."ords-version", | |
"\tAPEX Version: " + ."apex-details"."apex-version", |