Skip to content

Instantly share code, notes, and snippets.

View willis7's full-sized avatar
🏠
Working from home

Sion Williams willis7

🏠
Working from home
View GitHub Profile
@willis7
willis7 / env.groovy
Created August 8, 2013 14:23
OSB 11g Gradle deployment scripts
environments {
local {
serverName = 'localVM'
wls {
adminurl = 't3://localhost:7001'
user = 'weblogic'
password = 'welcome1'
targets = 'AdminServer'
upload = 'true'
verbose = 'true'
@rem *************************************************************************
@rem This script is used to set up your environment for development.
@rem It sets the following variables:
@rem
@rem
@rem JAVA_HOME - Location of the version of Java that you want to use for development.
@rem This variable must point to the root directory of a JDK
@rem installation and will be set for you by the installer.
@rem PATH - Adds the JDK and tool directories to the system path.
@rem CLASSPATH - Adds the JDK and tool jars to the classpath.
# *************************************************************************
# This script is used to set up your environment for development.
# It sets the following variables:
#
#
# JAVA_HOME - Location of the version of Java that you want to use for development.
# This variable must point to the root directory of a JDK
# installation and will be set for you by the installer.
# PATH - Adds the JDK and tool directories to the system path.
# CLASSPATH - Adds the JDK and tool jars to the classpath.
buildscript{
repositories{
mavenCentral()
}
dependencies{
classpath 'com.atlassian.jgitflow:jgit-flow-core:0.9'
}
}
import com.atlassian.jgitflow.core.*
# Create a template .jar of an existing domain
# Open an existing domain
readDomain(domainDirName)
# Write the domain configuration information to a domain template
writeTemplate(templateName)
closeDomain(templateName)
# unpack.py: convert from unpack command to wlst script
# This script shows how to convert from the unpack command to a wlst script.
# Note that the domain and template values, and the options to setOption, must be single-quoted
# Specify the template that you want to use
readTemplate('c:\wls9\user_templates\wlst_wls_template.jar')
# If you specified the -username and -password option in the unpack command,
# Specify them here. Otherwise, delete these lines`
# Note that the domain_name field here is just the name of the domain, not the full path as specified in writeDomain below
<target name="bounce-svc" description="Bounce service on HOST">
<bounceService server="${j2ee.host}" service="beasvc ${weblogic.domain.name}_${weblogic.deploy.target}" />
</target>
<macrodef name="bounceService">
<attribute name="server" />
<attribute name="service" />
<sequential>
@willis7
willis7 / plsqlerrors.sql
Created August 23, 2013 12:17
One of the really annoying things about Oracle PL/SQL is the way it tells you something is wrong, gives you a line number and then leaves it up to you to find the statement that caused the error. Well, this little piece of SQL gives you the exact line in error plus the lines immediately before and after it. (Acknowledgements to Ken Atkins of ARI…
set verify off
define obj_name = '&1';
column outline format a105 heading 'Error Listing';
break on err_text skip 2;
set linesize 105;
set pagesize 0;
set pause off;
spool listerr
SELECT
decode(to_char(us.line), to_char(ue.line-7),ue.text,
@willis7
willis7 / recompile.sql
Last active December 21, 2015 14:19
Recompile invalid objects in an Oracle database
set head off
set feedback off
spool compile.lis
select 'alter package '|| owner ||'.'||object_name||' compile;'
from all_objects
where object_type like 'PACKAGE'
and status = 'INVALID'
/
select 'alter package '|| owner ||'.'||object_name||' compile body;'
@willis7
willis7 / invalid.sql
Created August 23, 2013 12:22
Find all invalid objects in Oracle DB
select object_name from user_objects
where status = 'INVALID'
/