Quantcast
Channel: Karl Arao's TiddlyWiki
Viewing all 2097 articles
Browse latest View live

R, python, ruby text processing 2

$
0
0


python data cleaning



python and text



python and ML




python and R




visualization





python - definitive guides



python and databases




python and hadoop

https://www.amazon.com/Hadoop-Python-Donald-Miner-ebook/dp/B07D1MP4HS/ref=sr_1_7?ie=UTF8&qid=1526432174&sr=8-7&keywords=python+hadoop&dpID=512eUcTjkTL&preST=_SY445_QL70_&dpSrc=srch



python and network

Foundations of Python Network Programming https://www.amazon.com/Foundations-Python-Network-Programming-Brandon/dp/1430258543/ref=pd_bxgy_14_img_2?_encoding=UTF8&pd_rd_i=1430258543&pd_rd_r=MGTKMKGFA3SGN0Z8XW2T&pd_rd_w=ppXt3&pd_rd_wg=gKBwL&psc=1&refRID=MGTKMKGFA3SGN0Z8XW2T



python and sysad




python and cloud




python and PL/SQL






bash and sysad








hive CBO, cost based optimizer

$
0
0

SQL*Plus

$
0
0
easy CSV with headings https://www.safaribooksonline.com/library/view/oracle-sqlplus-the/0596007469/re105.html
https://stackoverflow.com/questions/5576901/sqlplus-spooling-how-to-get-rid-of-first-empty-line
set colsep ',' underline off newpage none feedback off term off

easy HTML
SET MARKUP HTML ON 


define variable
COL edb360_bypass NEW_V edb360_bypass;
select 3600 edb360_bypass from dual;

or this 

def edb360_secs2go = 3600

PRELIM
http://laurentschneider.com/wordpress/2011/07/sqlplus-prelim.html

ESCAPE CHARACTER
http://www.orafaq.com/faq/how_does_one_escape_special_characters_when_writing_sql_queries
http://www.orafaq.com/wiki/SQL*Plus_FAQ
Define an escape character:
SET ESCAPE '\'
SELECT '\&abc' FROM dual;


Don't scan for substitution variables:
SET SCAN OFF
SELECT '&ABC' x FROM dual;


NULLIF
https://forums.oracle.com/forums/thread.jspa?threadID=2303647
The simplest way is NULLIF
NULLIF (x, y)
returns NULL if x and y are the same; otherwise, it returns x. So
n / NULLIF (d, 0)
returns NULL if d is 0; otherwise, it returns n/d.


ACCEPT/HIDE
http://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12005.htm
http://www.database-expert.com/white_papers/oracle_sql_script_that_accepts_passwords.htm


SQL*Plus command line history completion - RLWRAP
Doc ID: 460591.1
Purpose

The SQL*Plus, the primary interface to the Oracle Database server, 
provides a powerful yet easy-to-use environment for querying, defining, and controlling data.
However, some command-line utilities, for example bash, provide features such as:

- command history (up/down arrow keys)
- auto completion (TAB key)
- searchable command line history (Ctrl+r)

The scope of this bulletin is to provide these features to SQL*Plus.

Scope and Application

For all SQL*Plus users, but in particular for Linux platforms as this note has been written thinking at that Operating System. In any case this idea can work on other OSs as well.
SQL*Plus command line history completion

SQL*Plus users working on Linux platforms have the opportunity to use a readline wrapper "rlwrap". rlwrap is a 'readline wrapper' that uses the GNU readline library to allow the editing of keyboard input for any other command. Input history is remembered across invocations, separately for each command; history completion and search work as in bash and completion word lists can be specified on the command line. Since SQL*Plus is not built with readline library, rlwrap is just doing the job.

- 'rlwrap' is really a tiny program. It's about 24K in size, and you can download it from the official developper (Hans Lub) website http://utopia.knoware.nl/~hlub/uck/rlwrap/

What do you need to compile and run it
A newer (4.2+) GNU readline (you can get it at ftp://ftp.gnu.org/gnu/readline/)
and an ANSI C compiler. 
rlwrap compiles and runs on many Unix systems and on cygwin.

Installation should be as simple as:

./configure
make
make install
 

Compile rlwrap statically

If you don't have the root account you can compile rlwrap statically
and install it under $HOME/bin executing this command:

CFLAGS=-I$HOME/readline-6.0 CPPFLAGS=-I$HOME/readline-6.0 LDFLAGS=-static ./configure --prefix=$HOME/bin
make
make install

where $HOME/readline-6.0 is the 'readline' source location

 



A different option and if your are using Linux, it is to download the newest source rpm package from e.g.: http://download.fedora.redhat.com/pub/epel/5/SRPMS/rlwrap-0.37-1.el5.src.rpm and build the binary rpm package by

# rpm -ivh rlwrap-0.37-1.el5.src.rpm
# cd /usr/src/redhat/SPECS/
# rpmbuild -bb rlwrap.spec
# cd ../RPMS/<arch>/
and then you can install it as any other rpm package by e.g.

# rpm -ivh rlwrap-0.37-1.x86_64.rpm
 

- After installing the package, you should to configure a user's environment so that it makes use of the installed utility, add the following line in '/etc/bashrc' (globally) or in '${HOME}/.bashrc' (locally for the user). Change '<path>' with the right path of your rlwrap:

alias sqlplus='<path>/rlwrap ${ORACLE_HOME}/bin/sqlplus'
The modified .bashrc won't take effect until you launch a new terminal session or until you source .bashrc. So shut down any terminals you already have open and start a new one.

If you now launch SQL*Plus in exactly the way you've used so far, you should be able to type one SQL command and submit it, and then immediately be able to press the up-arrow key and retrieve it. The more SQL commands you issue over time, the more commands rlwrap will remember. As well as just scrolling through your previous SQL commands, you can press 'Ctrl+r' to give you a searchable command line history.


You can also create your own '${HOME}/.sqlplus_completions' file (locally)or '/usr/share/rlwrap/sqlplus' file (globally) with all SQL reserved words (or in case whatever you want) as your auto-completion list (see rlwrap man page for dettails).

And example of '${HOME}/.sqlplus_completions' with some reserved words:

 

COPY PAUSE SHUTDOWN 
DEFINE PRINT SPOOL 
DEL PROMPT SQLPLUS 
ACCEPT DESCRIBE QUIT START 
APPEND DISCONNECT RECOVER STARTUP 
ARCHIVE LOG EDIT REMARK STORE 
ATTRIBUTE EXECUTE REPFOOTER TIMING 
BREAK EXIT REPHEADER TTITLE 
BTITLE GET RESERVED UNDEFINE 
CHANGE HELP RESERVED VARIABLE 
CLEAR HOST RUN WHENEVER 
copy pause shutdown 
define print spool 
del prompt sqlplus 
accept describe quit start 
append disconnect recover startup 
archive log edit remark store 
attribute execute repfooter timing 
break exit repheader ttitle 
btitle get reserved undefine 
change help reserved variable 
clear host run whenever 

ALL ALTER AND ANY ARRAY ARROW AS ASC AT 
BEGIN BETWEEN BY 
CASE CHECK CLUSTERS CLUSTER COLAUTH COLUMNS COMPRESS CONNECT CRASH CREATE CURRENT 
DECIMAL DECLARE DEFAULT DELETE DESC DISTINCT DROP 
ELSE END EXCEPTION EXCLUSIVE EXISTS 
FETCH FORM FOR FROM 
GOTO GRANT GROUP 
HAVING 
IDENTIFIED IF IN INDEXES INDEX INSERT INTERSECT INTO IS 
LIKE LOCK 
MINUS MODE 
NOCOMPRESS NOT NOWAIT NULL 
OF ON OPTION OR ORDEROVERLAPS 
PRIOR PROCEDURE PUBLIC 
RANGE RECORD RESOURCE REVOKE 
SELECT SHARE SIZE SQL START SUBTYPE 
TABAUTH TABLE THEN TO TYPE 
UNION UNIQUE UPDATE USE 
VALUES VIEW VIEWS 
WHEN WHERE WITH 
all alter and any array arrow as asc at 
begin between by 
case check clusters cluster colauth columns compress connect crash create current 
decimal declare default delete desc distinct drop 
else end exception exclusive exists 
fetch form for from 
goto grant group 
having 
identified if in indexes index insert intersect into is 
like lock 
minus mode 
nocompress not nowait null 
of on option or orderoverlaps 
prior procedure public 
range record resource revoke 
select share size sql start subtype 
tabauth table then to type 
union unique update use 
values view views
 

Note: 
You can use 'rlwrap' with all Oracle command line utilities such as Recovery Manager (RMAN) , Oracle Data Pump (expdp), ASM command (asmcmd), etc. 

i.e.: 


alias rman='/usr/bin/rlwrap ${ORACLE_HOME}/bin/rman' 
alias expdp='/usr/bin/rlwrap ${ORACLE_HOME}/bin/expdp'
alias asmcmd='/usr/bin/rlwrap ${ORACLE_HOME}/bin/asmcmd'
References

http://utopia.knoware.nl/~hlub/uck/rlwrap/
ftp://ftp.gnu.org/gnu/readline
http://download.fedora.redhat.com/pub/epel




HEX, DECIMAL, ASCII

Script To Convert Hexadecimal Input Into a Decimal Value
Doc ID: 1019580.6

How to Convert Numbers to Words
Doc ID: 135986.1

Need To Convert A Varchar2 String Into Its Hexadecimal Equivalent
Doc ID: 269578.1









GitHub

$
0
0


watch this first

http://www.git-tower.com/learn/git/videos

read this first

http://nvie.com/posts/a-successful-git-branching-model/

test accounts

emberdev1
emberdev2
emberdevgroup

official documentation, videos, and help

https://guides.github.com/activities/hello-world/
https://guides.github.com/
https://help.github.com/articles/setting-up-teams/
https://www.youtube.com/githubguides
https://help.github.com/
https://guides.github.com/features/mastering-markdown/

version control format

http://git-scm.com/book/en/v2/Git-Basics-Tagging
Semantic Versioning 2.0.0 http://semver.org/

Awesome github walkthrough - video serieshttp://308tube.com/youtube/github/
https://github.com/karlarao
http://git-scm.com/download/win
http://www.javaworld.com/javaworld/jw-08-2012/120830-osjp-github.html?page=1

HOWTO - general workflow




Basic commands and getting started

Git Data Flow
1) Current Working Directory	<-- git init <project>
2) Index (cache)				<-- git add .
3) Local Repository				<-- git commit -m "<comment>"
4) Remote Repository	

Client side setup
http://git-scm.com/downloads   <-- download here 

git config --global user.name "karlarao"
git config --global user.email "karlarao@gmail.com"

Common commands
git init awrscripts				<-- or you can just cd on "awrscripts" folder and execute "git init"
git status
git add . 						<-- add all the files under the master folder to the staging area
git <filename>					<-- add just a file
git rm --cached <filename>		<-- remote a file
git commit -m "initial commit"	<-- to commit changes (w/ comment), and save a snapshot of the local repository 
                                             * note that when you modify, you have to do a "git add ." first..else it will say no changes added to commit
git log							<-- show summary of commits
vi README.md        <-- markdown format readme file, header should start with #

git diff
git add .				
git diff --cached				<-- get the differences in the staging area, because you've already executed the "add"..

## shortcuts
git commit -a -m "short commit"		<-- combination of add and commit
git log --oneline					<-- shorter summary
git status -s						<-- shorter show changes

Exclude file
https://coderwall.com/p/n1d-na/excluding-files-from-git-locally

Integration with Github.com

Github.com setup
go to github.com and create a new repository
on your PC go to C:\Users\Karl
open git bash and type in ssh-keygen below
ssh-keygen.exe -t rsa -C "karlarao@gmail.com"		<-- this will create RSA on C:\Users\Karl directory
copy the contents of id_rsa.pub under C:\Users\karl\.ssh directory
go to github.com -> Account Settings -> SSH Keys -> Add SSH Key
ssh -T git@github.com								<-- to test the authentication
Github.com integrate and push
go to repositories folder -> on SSH tab -> copy the key
git remote add origin <repo ssh key from website>
git remote add origin git@github.com:karlarao/awrscripts.git
git push origin master
Github.com integrate with GUI
download the GUI here http://windows.github.com/
login and configure, at the end just hit skip
go to tools -> options -> change the default storage directory to the local git directory C:\Dropbox\CodeNinja\GitHub
click Scan For Repositories -> click Add -> click Update
click Publish -> click Sync
for existing repos, you can do a clone
git clone git@github.com:<name>/<repo>

github pages

sync the repo to github pages
cd ~ubuntu/telegram/
git config --global user.name "karlarao"
git config --global user.email "karlarao@gmail.com"
git add .
git status # to see what changes are going to be commited
git commit -m "."
git remote add origin git@github.com:karlarao/telegram.git
git push origin master
# git branch gh-pages # this is one time
git checkout gh-pages # go to the gh-pages branch
git rebase master # bring gh-pages up to date with master
git push origin gh-pages # commit the changes
git checkout master # return to the master branch
access the page at http://karlarao.github.io/<repo>/

https://github.com/blog/2289-publishing-with-github-pages-now-as-easy-as-1-2-3


render HTML file in github without git pages

http://stackoverflow.com/questions/8446218/how-to-see-an-html-page-on-github-as-a-normal-rendered-html-page-to-see-preview


track a zipfile based script repo, useful for blogs or sites

add this on your crontab 
# refresh git with the <script> scripts
0 4 * * * /home/karl/bin/git_<script>.sh

$ cat /home/karl/bin/git_<script>.sh
cd ~/github/<script directory>
rm <script>.zip
wget http://<site>.com/files/<script>.zip
unzip -o <script>.zip -d ~/github/<script directory>
git config --global user.name "karlarao"
git config --global user.email "karlarao@gmail.com"
git add .
git commit -m "."
#git remote add origin git@github.com:karlarao/<script>.git
git push origin master

then make sure to favorite the repo to get emails!


Branch, Merge, Clone, Fork

Branching	<-- allows you to create a separate working copy of your code 
Merging		<-- merge branches together
Cloning		<-- other developers can get a copy of your code from a remote repo
Forking		<-- make use of someone's code as starting point of a new project


-- 1st developer created a branch r2_index
git branch								<-- show branches
git branch r2_index						<-- create a branch name "r2_index"
git checkout r2_index					<-- to switch to the "r2_index" branch
git checkout <the branch you want to go>	* make sure to close all files before switching to another branch

-- 2nd developer on another machine created r2_misc
git clone <ssh link>					<-- to clone a project
git branch r2_misc
git checkout r2_misc
git push origin <branch name>	<-- to update the remote repo

-- bug fix on master
git checkout master
git push origin master

-- merge to combine the changes from 1st developer to the master project
	* conflict may happen due to changes at the same spot for both branches
git branch r2_index
git merge master

	* conflict looks like the following:
		<<<<<<< HEAD
		1)
		=======
		TOC:
		1) one
		2) two
		3) three>>>>>>> master
git push origin r2_index

-- pull, synchronizes the local repo with the remote repo
	* remember, PUSH to send up GitHub, PULL to sync with GitHub
git pull origin master



Delete files on git permanently

http://stackoverflow.com/questions/1983346/deleting-files-using-git-github< good stuff
http://dalibornasevic.com/posts/2-permanently-remove-files-and-folders-from-a-git-repository
https://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html
cd /Users/karl/Dropbox/CodeNinja/GitHub/tmp
git init
git status
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch *' --prune-empty --tag-name-filter cat -- --all
git commit -m "."
git push origin master --force

delete history

https://rtyley.github.io/bfg-repo-cleaner/
https://help.github.com/articles/remove-sensitive-data/
stackoverflow.com/questions/37219/how-do-you-remove-a-specific-revision-in-the-git-history
https://hellocoding.wordpress.com/2015/01/19/delete-all-commit-history-github/
http://samwize.com/2014/01/15/how-to-remove-a-commit-that-is-already-pushed-to-github/


Deleting a repository

https://help.github.com/articles/deleting-a-repository

rebase

rebase https://www.youtube.com/watch?v=SxzjZtJwOgo

forking

forking https://www.youtube.com/watch?v=5oJHRbqEofs
Some notes on forking:
  • Let's say you get assigned as a collaborator on a private repo called REPO1
  • If REPO1 gets forked as a private REPO2 by another guy, instantly you'll also be part of that REPO2
  • When the original creator delete you as a collaborator on REPO1 you will no longer see anything from that but you will still get access to REPO2

pull request

pull request (contributing to the fork) https://www.youtube.com/watch?v=d5wpJ5VimSU

team collaboration

team https://www.youtube.com/watch?v=61WbzS9XMwk

git on dropbox conflicts

http://edinburghhacklab.com/2012/11/when-git-on-dropbox-conflicts-no-problem/
http://stackoverflow.com/questions/12773488/git-fatal-reference-has-invalid-format-refs-heads-master


other references

gitflow http://nvie.com/posts/a-successful-git-branching-model/

master zip
http://stackoverflow.com/questions/8808164/set-the-name-of-a-zip-downloadable-from-github-or-other-ways-to-enroll-google-tr
http://stackoverflow.com/questions/7106012/download-a-single-folder-or-directory-from-a-github-repo
http://alblue.bandlem.com/2011/09/git-tip-of-week-git-archive.html
http://gitready.com/intermediate/2009/01/29/exporting-your-repository.html
http://manpages.ubuntu.com/manpages/intrepid/man1/git-archive.1.html
http://stackoverflow.com/questions/8377081/github-api-download-zip-or-tarball-link

uploading binary files (zip)
https://help.github.com/articles/distributing-large-binaries/
https://help.github.com/articles/about-releases/
https://help.github.com/articles/creating-releases/
https://gigaom.com/2013/07/09/oops-github-did-it-again-relaunches-binary-uploads-after-scuttling-them/
https://github.com/blog/1547-release-your-software

live demos
http://solutionoptimist.com/2013/12/28/awesome-github-tricks/

Git hook to send email notification on repo changes
http://stackoverflow.com/questions/552360/git-hook-to-send-email-notification-on-repo-changes

git rebasehttp://git-scm.com/docs/git-rebase

git gisthttps://gist.github.com/

gitignore.iohttps://www.gitignore.io/<- Create useful .gitignore files for your project, there's also a webstorm plugin for this



git merge upstream

https://www.google.com/search?q=git+merge+upstream+tower+2&oq=git+merge+upstream+tower+2&aqs=chrome..69i57j69i64.9674j0j1&sourceid=chrome&ie=UTF-8


git - contributing to a repo or project


fork and pull model (ideal for large projects)

here you create a branch

direct clone model / collaboration model (ideal for small projects)

here you work on master branch
cb
pb
pbg
pull


git revert / fix a damaging commit

create branch
head
revert
commit


Equivalent of “svn checkout” for git

http://stackoverflow.com/questions/18900774/equivalent-of-svn-checkout-for-git
http://stackoverflow.com/questions/15595778/github-what-does-checkout-do


HOWTO rename a repo

what happens when I rename a git repo? do you have any advice on properly renaming a git repo?
I have pretty good news for you since 2013, GitHub automatically redirects people from the old repo to the new repo. (There are some caveats, so read on.) Please read the Stack Overflow answer that starts with "since May 2013" on this page:

http://stackoverflow.com/questions/5751585/how-do-i-rename-a-repository-on-github

Here is the GitHub announcement of the redirect feature:

https://github.com/blog/1508-repository-redirects-are-here

https://help.github.com/articles/renaming-a-repository/

Note, it is still recommended that you update your local repository to specifically point at the new repository. You can do that with a simple:

git remote set-url origin https://github.com/YourGitHubUserName/NewRepositoryName.git

(where you replace YourGitHubUserName and NewRepositoryName with the appropriate information)

Ideally, your collaborators will also update their local repositories, but it's not an immediate requirement unless you are going to re-use the old repository name (which will break redirects and I don't recommend doing that).



github acquisition

https://blog.github.com/2018-06-04-github-microsoft/
https://news.microsoft.com/2018/06/04/microsoft-to-acquire-github-for-7-5-billion/
https://blogs.microsoft.com/blog/2018/06/04/microsoft-github-empowering-developers/
https://thenextweb.com/dd/2018/06/04/microsoft-buying-github-doesnt-scare-me/

.











SQL*Loader

$
0
0
SQL*LOADER

Doc ID 1012594.6 Useful unix utilities to be used with SQL*Loader
Doc ID 1012726.6 Converting load file from delimited to fixed format
Doc ID 77337.1 How to add blank line to a SQL*Plus spooled output file


  • SQL*Loader will show as INSERT SQL with module SQL Loader conventional path. So if you are qualifying sqls make sure to look at SQL_TEXT and MODULE

http://steve-lyon.blogspot.com/2013/07/sql-loader-step-by-step-basics-example-1.html
NAME, BALANCE, START_DT
"Jones, Joe" ,     14 , "Jan-12-2012 09:25:37 AM"
"Loyd, Lizy" , 187.26 , "Aug-03-2004 03:13:00 PM"
"Smith, Sam" ,  298.5 , "Mar-27-1997 11:58:04 AM"
"Doyle, Deb" ,   5.95 , "Nov-30-2010 08:42:21 PM"


create table hr.sql_loader_demo_simple
  ( customer_full_name   varchar2(50)
  , account_balance_amt  number
  , account_start_date   date
  ) ;


------------------------------------------------------------
-- SQL-Loader Basic Control File
------------------------------------------------------------
options  ( skip=1 )
load data
  infile               'data.csv'           
  truncate into table   scott.sql_loader_demo_simple
fields terminated by ","       
optionally enclosed by '"' 
  ( customer_full_name
  , account_balance_amt
  , account_start_date   DATE "Mon-DD-YYYY HH:MI:SS am"
  ) 



sqlldr 'scott/tiger@my_database' control='control.txt' log='results.log








what is parsing schema?

$
0
0
SELECT *
FROM
    (SELECT *
     FROM HR.SQL_LOADER_DEMO_SIMPLE) a,
    (SELECT *
     FROM HR.SQL_LOADER_DEMO_SIMPLE) b,
    (SELECT *
     FROM HR.SQL_LOADER_DEMO_SIMPLE) c

user ids



started with user id 79





then another user executes the SQL , the parsing schema did not change






even if SYS executes the SQL the parsing schema stayed the same. This will only change when the shared pool or SQL_ID is flushed from shared pool and then another executes the same SQL





format SQL_TEXT to one line

$
0
0

from this

20:02:59 SYS@dw1> select sql_id, dbms_lob.substr(sql_text,30,1) sqltext from dba_hist_sqltext where rownum < 100;

SQL_ID        SQLTEXT
------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
bnznj24yxuzah insert into  WRH$_IOSTAT_FILET
467ppfu9jp8ch UPDATE SYS.ILM_RESULTS$ SET JO
357cru8xpxh55 SELECT A.EXECUTION_ID, A.JOBNA
9ctt1scmwbmbg begin dbsnmp.bsln_internal.mai
bb926a5dcb8kr merge into sys.mon_mods$ m
7g29na8v736ns /* SQL Analyze(67,1) */ /* SQL
bk8jk9nzd38uc SELECT count(*) FROM sys.wri$_
7umy6juhzw766 select /*+ connect_by_filterin
60w0bzjajtgmz /* SQL Analyze(1157,1) */ /* S
dgkf7m4g44zz0 /* SQL Analyze(1157,1) */ /* S
cbdfcfcp1pgtp select intcol#, col# , type#,
0avmvd8qaj1md SELECT count(*) FROM sys.wri$_
2wsp95jbfzqts SELECT count(*) FROM sys.wri$_
gx9vnbwq7vu3t /* SQL Analyze(1157,1) */ /* S
4whka0nxtk36f /* SQL Analyze(1157,1) */ /* S
7wv5ruk5nshs0 /* SQL Analyze(1157,1) */ /* S
77wa3wxc661vz SELECT count(*) FROM sys.wri$_
cwb5hrbyu11sm SELECT count(*) FROM sys.wri$_
7qjcqf2q2tw9q SELECT count(*) FROM sys.wri$_
4fxr27su1wn38 /* SQL Analyze(1091,1) */ /* S
496zvdwr6nfnh /* SQL Analyze(1091,1) */ /* S
6y5st0zfb4f93 /* SQL Analyze(1091,1) */ DELE
6ja0rtch4744d SELECT /* DS_SVC */ /*+ dynami
c9umxngkc3byq select sql_id, sql_exec_id, db
7cyaxjygv2cpt /* SQL Analyze(1091,1) */ /* S
c4cr75ud9ujvg SELECT PAR_JOBNAME FROM SYS.IL
96mjb0z08nmp3 /* SQL Analyze(1091,1) */ /* S
adtrr100ucu11 /* SQL Analyze(1091,1) */ /* S
9wqup20cvk9yu SELECT /* DS_SVC */ /*+ dynami
bfbu3kz982s2n /* SQL Analyze(1091,1) */ /* S
6qd7w013bx5bj /* SQL Analyze(1091,1) */ /* S
fuws5bqghb2qh SELECT D.COLUMN_VALUE , NVL(A.
fhz9cq8mw2rh9 SELECT A.OBJ#, A.POLICY#, B.SC
cgtc5gb7c4g07 select dbid, status_flag from
6ajkhukk78nsr begin prvt_hdm.auto_execute( :
7mhq1834c9nza SELECT COUNT(*) FROM SYS.ILM_C
49s332uhbnsma       declare
                       vsn  va

a1xgxtssv5rrp select sum(used_blocks), ts.ts
gwg69nz9j8vvb insert into  wrh$_latch  (dbid
84zqd7a3ap5ud insert into  WRH$_SYSSTAT  (db
f26kbut9pahja SELECT LAST_EXEC_TIME FROM SYS
gdtyuqcyk8x1c SELECT B.EXECUTION_ID, NVL(A.N
6q9zvynq8f0h0 insert into sys.wri$_optstat_h
89nx1vrqtn1q7 SELECT /*+ no_monitor */  CON_
8qn2s8n8ayxvr SELECT /*+ no_monitor */ CON_I
3kywng531fcxu delete from tab_stats$ where o
38243c4tqrkxm select u.name, o.name, o.names
3cd2hy7yx0u2k UPDATE WRI$_OPTSTAT_OPR_TASKS
3wrrjm9qtr2my SELECT T.CLIENT_ID,         T.
0n0000qphr1d2 select /*+ no_monitor */  CON_
6atd17x59rdus SELECT TABOWNER, TABNAME, PART
afcswub17n34t SELECT AO.ATTR1 OBJD, SUM(AR.B
13ys8ux8xvrbm insert into sys.wri$_optstat_o
381t19fqhxdgp MERGE /*+ dynamic_sampling(ST
3axxxnjp5jjwj delete from ind_stats$ where o
cnphq355f5rah DECLARE job BINARY_INTEGER :=
37g281wz56rv3 insert into sys.wri$_optstat_h
4y1y43113gv8f delete from histgrm$ where obj
6wrwqq7jkmv3w INSERT INTO WRI$_HEATMAP_TOPN_
7sx5p1ug5ag12 SELECT SPARE4 FROM SYS.OPTSTAT
f47hz4fd4yyx8  SELECT sqlset_row(sql_id, for
7hu2k3a31b6j7 insert into histgrm$(obj#,intc
3qkhfbf2kyvhk SELECT POS+1 POS, VAL, NONNULL
gsfnqdfcvy33q delete from superobj$ where su
6qg99cfg26kwb SELECT COUNT(UNQ) UNQ, COUNT(P
adzjh275fvvx4 call WWV_FLOW_WORKSHEET_API.DO
97dmg1kjd04rc UPDATE STATS_TARGET$ ST SET ST
axq73su80h4wq select sql_id, plan_hash_value
07n9yv8rac2qq UPDATE ILM_RESULTS$ SET JOB_ST
b6usrg82hwsa3 call dbms_stats.gather_databas
6q42j0018w7t8 insert into sys.wri$_optstat_i
3xjw1ncw5vh27 SELECT OWNER, SEGMENT_NAME, PA
28bgqbzpa87xf       declare
                       policy

74cpnuu24wmx7 SELECT TABLESPACE_ID, HEADER_F
6mcpb06rctk0x call dbms_space.auto_space_adv
14qzpax8518uk SELECT /*+ ordered use_nl(o c
130dvvr5s8bgn select obj#, dataobj#, part#,
7mgr3uwydqq8j       select decode(open_mode,
5t7dh3thzzrfh       begin
                       dbms_rcvm

ba3m1hr5zy5q0 /* SQL Analyze(1) */ select /*
3y9bat7nwcjy5 SELECT ELAPSED_TIME FROM DBA_S
84cdm4tn4qk66 BEGIN    dbms_stats_internal.p
7zfqkasu7cgvy select /*+  no_parallel_index(
231cqwr9u57s0 insert into  WRH$_IOSTAT_DETAI
1qag8bk39f2um /* SQL Analyze(198,1) */ /* SQ
5183s2x0hj4zs /* SQL Analyze(1157,1) */ /* S
2xn8yx0uz75fm SELECT S.SNAP_ID, S.BEGIN_INTE
26wdmuqwqmmpa SELECT count(*) FROM sys.wri$_
8y75j6mh081jh delete /*+ dynamic_sampling(4)
8zc85a8249x81 update obj$ set obj#=:4, type#
a51991cqqyak6 /* SQL Analyze(1) */ select /*
dzxp4mguxfmzr SELECT count(*) FROM sys.wri$_
9sa4fhxz32vtp SELECT count(*) FROM sys.wri$_
1sjp86r761x4b SELECT COUNT(*) FROM (SELECT *
4xa0fqp84dda2 SELECT count(*) FROM sys.wri$_
8wjzcrb6p6tkq SELECT count(*) FROM sys.wri$_
a1zm097zca8qg /* SQL Analyze(1) */ select /*
45h233mys5n3s   UPDATE  wrh$_seg_stat_obj  o
bf7tbka73w96a /* SQL Analyze(1) */ select /*


to this

 select sql_id, REPLACE(REPLACE( dbms_lob.substr(sql_text,30,1), CHR(10) ), CHR(13) ) sqltext from dba_hist_sqltext where rownum < 100

SQL_ID        SQLTEXT
------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
bnznj24yxuzah insert into  WRH$_IOSTAT_FILET
467ppfu9jp8ch UPDATE SYS.ILM_RESULTS$ SET JO
357cru8xpxh55 SELECT A.EXECUTION_ID, A.JOBNA
9ctt1scmwbmbg begin dbsnmp.bsln_internal.mai
bb926a5dcb8kr merge into sys.mon_mods$ m
7g29na8v736ns /* SQL Analyze(67,1) */ /* SQL
bk8jk9nzd38uc SELECT count(*) FROM sys.wri$_
7umy6juhzw766 select /*+ connect_by_filterin
60w0bzjajtgmz /* SQL Analyze(1157,1) */ /* S
dgkf7m4g44zz0 /* SQL Analyze(1157,1) */ /* S
cbdfcfcp1pgtp select intcol#, col# , type#,
0avmvd8qaj1md SELECT count(*) FROM sys.wri$_
2wsp95jbfzqts SELECT count(*) FROM sys.wri$_
gx9vnbwq7vu3t /* SQL Analyze(1157,1) */ /* S
4whka0nxtk36f /* SQL Analyze(1157,1) */ /* S
7wv5ruk5nshs0 /* SQL Analyze(1157,1) */ /* S
77wa3wxc661vz SELECT count(*) FROM sys.wri$_
cwb5hrbyu11sm SELECT count(*) FROM sys.wri$_
7qjcqf2q2tw9q SELECT count(*) FROM sys.wri$_
4fxr27su1wn38 /* SQL Analyze(1091,1) */ /* S
496zvdwr6nfnh /* SQL Analyze(1091,1) */ /* S
6y5st0zfb4f93 /* SQL Analyze(1091,1) */ DELE
6ja0rtch4744d SELECT /* DS_SVC */ /*+ dynami
c9umxngkc3byq select sql_id, sql_exec_id, db
7cyaxjygv2cpt /* SQL Analyze(1091,1) */ /* S
c4cr75ud9ujvg SELECT PAR_JOBNAME FROM SYS.IL
96mjb0z08nmp3 /* SQL Analyze(1091,1) */ /* S
adtrr100ucu11 /* SQL Analyze(1091,1) */ /* S
9wqup20cvk9yu SELECT /* DS_SVC */ /*+ dynami
bfbu3kz982s2n /* SQL Analyze(1091,1) */ /* S
6qd7w013bx5bj /* SQL Analyze(1091,1) */ /* S
fuws5bqghb2qh SELECT D.COLUMN_VALUE , NVL(A.
fhz9cq8mw2rh9 SELECT A.OBJ#, A.POLICY#, B.SC
cgtc5gb7c4g07 select dbid, status_flag from
6ajkhukk78nsr begin prvt_hdm.auto_execute( :
7mhq1834c9nza SELECT COUNT(*) FROM SYS.ILM_C
49s332uhbnsma       declare         vsn  va
a1xgxtssv5rrp select sum(used_blocks), ts.ts
gwg69nz9j8vvb insert into  wrh$_latch  (dbid
84zqd7a3ap5ud insert into  WRH$_SYSSTAT  (db
f26kbut9pahja SELECT LAST_EXEC_TIME FROM SYS
gdtyuqcyk8x1c SELECT B.EXECUTION_ID, NVL(A.N
6q9zvynq8f0h0 insert into sys.wri$_optstat_h
89nx1vrqtn1q7 SELECT /*+ no_monitor */  CON_
8qn2s8n8ayxvr SELECT /*+ no_monitor */ CON_I
3kywng531fcxu delete from tab_stats$ where o
38243c4tqrkxm select u.name, o.name, o.names
3cd2hy7yx0u2k UPDATE WRI$_OPTSTAT_OPR_TASKS
3wrrjm9qtr2my SELECT T.CLIENT_ID,         T.
0n0000qphr1d2 select /*+ no_monitor */  CON_
6atd17x59rdus SELECT TABOWNER, TABNAME, PART
afcswub17n34t SELECT AO.ATTR1 OBJD, SUM(AR.B
13ys8ux8xvrbm insert into sys.wri$_optstat_o
381t19fqhxdgp MERGE /*+ dynamic_sampling(ST
3axxxnjp5jjwj delete from ind_stats$ where o
cnphq355f5rah DECLARE job BINARY_INTEGER :=
37g281wz56rv3 insert into sys.wri$_optstat_h
4y1y43113gv8f delete from histgrm$ where obj
6wrwqq7jkmv3w INSERT INTO WRI$_HEATMAP_TOPN_
7sx5p1ug5ag12 SELECT SPARE4 FROM SYS.OPTSTAT
f47hz4fd4yyx8  SELECT sqlset_row(sql_id, for
7hu2k3a31b6j7 insert into histgrm$(obj#,intc
3qkhfbf2kyvhk SELECT POS+1 POS, VAL, NONNULL
gsfnqdfcvy33q delete from superobj$ where su
6qg99cfg26kwb SELECT COUNT(UNQ) UNQ, COUNT(P
adzjh275fvvx4 call WWV_FLOW_WORKSHEET_API.DO
97dmg1kjd04rc UPDATE STATS_TARGET$ ST SET ST
axq73su80h4wq select sql_id, plan_hash_value
07n9yv8rac2qq UPDATE ILM_RESULTS$ SET JOB_ST
b6usrg82hwsa3 call dbms_stats.gather_databas
6q42j0018w7t8 insert into sys.wri$_optstat_i
3xjw1ncw5vh27 SELECT OWNER, SEGMENT_NAME, PA
28bgqbzpa87xf       declare         policy
74cpnuu24wmx7 SELECT TABLESPACE_ID, HEADER_F
6mcpb06rctk0x call dbms_space.auto_space_adv
14qzpax8518uk SELECT /*+ ordered use_nl(o c
130dvvr5s8bgn select obj#, dataobj#, part#,
7mgr3uwydqq8j       select decode(open_mode,
5t7dh3thzzrfh       begin         dbms_rcvm
ba3m1hr5zy5q0 /* SQL Analyze(1) */ select /*
3y9bat7nwcjy5 SELECT ELAPSED_TIME FROM DBA_S
84cdm4tn4qk66 BEGIN    dbms_stats_internal.p
7zfqkasu7cgvy select /*+  no_parallel_index(
231cqwr9u57s0 insert into  WRH$_IOSTAT_DETAI
1qag8bk39f2um /* SQL Analyze(198,1) */ /* SQ
5183s2x0hj4zs /* SQL Analyze(1157,1) */ /* S
2xn8yx0uz75fm SELECT S.SNAP_ID, S.BEGIN_INTE
26wdmuqwqmmpa SELECT count(*) FROM sys.wri$_
8y75j6mh081jh delete /*+ dynamic_sampling(4)
8zc85a8249x81 update obj$ set obj#=:4, type#
a51991cqqyak6 /* SQL Analyze(1) */ select /*
dzxp4mguxfmzr SELECT count(*) FROM sys.wri$_
9sa4fhxz32vtp SELECT count(*) FROM sys.wri$_
1sjp86r761x4b SELECT COUNT(*) FROM (SELECT *
4xa0fqp84dda2 SELECT count(*) FROM sys.wri$_
8wjzcrb6p6tkq SELECT count(*) FROM sys.wri$_
a1zm097zca8qg /* SQL Analyze(1) */ select /*
45h233mys5n3s   UPDATE  wrh$_seg_stat_obj  o
bf7tbka73w96a /* SQL Analyze(1) */ select /*

99 rows selected.


https://stackoverflow.com/questions/407027/oracle-replace-function-isnt-handling-carriage-returns-line-feeds






Intel BigDL

$
0
0

GDPR and database

coderepo PL/SQL

$
0
0


PL/SQL User's Guide and Reference Release - Sample PL/SQL Programs

https://docs.oracle.com/cd/A97630_01/appdev.920/a96624/a_samps.htm

steve's videos - the plsql channel

http://tutorials.plsqlchannel.com/public/index.php

style guide

http://oracle.readthedocs.org/en/latest/sql/basics/style-guide.html
http://www.williamrobertson.net/documents/plsqlcodingstandards.htlm


bulk collect and forall

https://venzi.wordpress.com/2007/09/27/bulk-collect-forall-vs-cursor-for-loop/


mvc pl/sq/

http://www.dba-oracle.com/oracle_news/2004_10_27_MVC_development_using_plsql.htm
https://github.com/osalvador/dbax
http://it.toolbox.com/blogs/jjflash-oracle-journal/mvc-for-plsql-and-the-apex-listener-42688
http://jj-blogger.blogspot.com/2006/05/plsql-and-faces.html
https://www.rittmanmead.com/blog/2004/09/john-flack-on-mvc-development-using-plsql/
http://www.liberidu.com/blog/2016/11/02/how-you-should-or-shouldnt-design-program-for-a-performing-database-environment/



references/books

http://stevenfeuersteinonplsql.blogspot.com/2014/05/resources-for-new-plsql-developers.html
https://www.safaribooksonline.com/library/view/beginning-plsql-from/9781590598825/
https://www.safaribooksonline.com/library/view/beginning-oracle-plsql/9781484207376/
https://www.safaribooksonline.com/library/view/oracle-and-plsql/9781430232070/
https://www.safaribooksonline.com/library/view/oracle-plsql-for/9780764599576/
https://www.safaribooksonline.com/library/view/oracle-plsql-for/0596005873/

wiki

http://www.java2s.com/Tutorials/Database/Oracle_PL_SQL_Tutorial/index.htm
https://gerardnico.com/wiki/plsql/plsql


implicit cursor attribute

https://www.ibm.com/support/knowledgecenter/en/SS6NHC/com.ibm.swg.im.dashdb.apdv.plsql.doc/doc/c0053881.html
https://www.ibm.com/support/knowledgecenter/SS6NHC/com.ibm.swg.im.dashdb.apdv.plsql.doc/doc/c0053879.html
https://www.ibm.com/support/knowledgecenter/SS6NHC/com.ibm.swg.im.dashdb.apdv.plsql.doc/doc/c0053878.html
https://www.ibm.com/support/knowledgecenter/SS6NHC/com.ibm.swg.im.dashdb.apdv.plsql.doc/doc/c0053607.html
PL/SQL Language Elements https://docs.oracle.com/cd/B28359_01/appdev.111/b28370/langelems.htm#LNPLS013
Cursor Attribute https://docs.oracle.com/cd/B28359_01/appdev.111/b28370/cursor_attribute.htm#LNPLS01311
https://markhoxey.wordpress.com/2012/12/11/referencing-implicit-cursor-attributes-sql/




end









vscode

camtasia

cx_Oracle

jupyter notebooks

hdp on cloud install


SQL*Developer, SQL Developer

$
0
0
Download
http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html
http://www.oracle.com/technetwork/developer-tools/sqlcl/downloads/sqlcl-relnotes-421-3415922.html
http://www.oracle.com/technetwork/developer-tools/sql-developer/sqldev-newfeatures-v42-3211987.html
SQL Developer Data Modeler User's Guide http://docs.oracle.com/database/sql-developer-4.2/DMDUG/toc.htm


Migrate settings to new machine
http://zacktutorials.blogspot.com/2011/02/how-to-copy-oracle-sqldeveloper.html
http://oracledeli.wordpress.com/2011/09/28/sql-developer_migrate_settings_files/
Navigate to the following location,
Step 1: C:\Documents and Settings\\Application Data\SQL Developer
Step 2: C:\Documents and Settings\\Application Data\SQL Developer\systemXX.X.X.X.XX
Step 3: Copy the product-preferences.xml in the location below,
C:\Documents and Settings\\Application Data\SQL Developer\systemXX.X.X.X.XX\o.sqldeveloper.XX.X.X.XX.XX
Step 4: Copy the connections.xml in the location below,
C:\Documents and Settings\\Application Data\SQL Developer\systemXX.X.X.X.XX\o.jdeveloper.db.connection.XX.X.X.X.XX.XX.XX
Copy the 2 files(product-preferences.xml & connections.xml ) to your new machine in the same location

C:\Users\karl\AppData\Roaming\SQL Developer\system4.2.0.17.089.1709\o.jdeveloper.db.connection.13.0.0.1.42.170225.201
C:\Users\karl\AppData\Roaming\SQL Developer\system4.2.0.17.089.1709\o.sqldeveloper.12.2.1.17.89.1709

SetJavaHome
http://stackoverflow.com/questions/7876502/how-can-i-run-oracle-sql-developer-on-jdk-1-6-and-everything-else-on-1-7
version 4.x
%APPDATA%\sqldeveloper\1.0.0.0.0\product.conf

instance viewer
http://www.thatjeffsmith.com/archive/2014/12/sql-developer-4-1-instance-viewer/ , https://www.youtube.com/watch?v=FrdUCdGJEG8




coderepo bash

$
0
0

..bash for ops

Arq Backup

..bash to python, bash2py

$
0
0
Viewing all 2097 articles
Browse latest View live