tag:blogger.com,1999:blog-15554977854943452952024-03-13T09:49:44.647-07:00Barry McGillinOracle SQL Developer and Database Migration, with lots of core Oracle tech as well!Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.comBlogger91125tag:blogger.com,1999:blog-1555497785494345295.post-40585925176409430572019-10-11T08:15:00.000-07:002019-10-11T08:15:47.011-07:00git bash completionTry this in bash<br />
<br />
<code>git p<tab></tab></code><br />
<br />
You get a file names p or a list of them. Thats not much good, but there is a great bash completion library which you can source in your .bashrc to give you valid completion targets<br />
<br />
<code>$git p<tab></tab><br />
pull<br />
push<br />
$git p</code><br />
<br />
Pull this <a href="https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash" target="_blank">file</a> and source it in your .bashrc<br />
<br />
<br />
<code>$wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash<br />$echo . $PWD/git-completion.bash >> ~/.bashrc</code><br />
<br />
Open up a new terminal window and enjoy.<br />
<br />Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com064 Letfern Rd, Seskinore, Omagh BT78 2QA, UK54.524464221455823 -7.261699017968794654.519856221455825 -7.2717840179687947 54.52907222145582 -7.2516140179687945tag:blogger.com,1999:blog-1555497785494345295.post-4164403347341884942018-08-03T11:36:00.000-07:002019-10-11T08:21:23.576-07:00Migrating Subversion to Git with LFS<script src="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/run_prettify.min.js"></script>
When a project has been on the go for a while theres going to be all sorts of stuff in there from jars to zips and everything in between. We went though this a while ago and wanting to keep all the history, we needed a way to prune the history of all the big files and weird things we were not going to move to git. <br />
<br />
Now we knew we had some large files, namely binary files like jars which were build dependencies before we moved to artifactory for a lot of it. So, before we start we need to make sure that git is installed, and git-lfs. Git-lfs should be on the path so git can find it and you'll need to make sure git svn can run. You'll need perl and to run cpan (Comprehensive Perl Archive Network) to install the SVN::Core modules.<br />
<br />
<h2>
Initialisation</h2>
As a test to start, make sure git and git lfs are on the path and that git svn runs.<br />
<br />
<div style="background-color: #dfdbc3; color: #4324d4; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: #ee1807; font-variant-ligatures: no-common-ligatures;">bamcgill</span><span style="color: black; font-variant-ligatures: no-common-ligatures;">@</span><span style="font-variant-ligatures: no-common-ligatures;">bamcgill-mac[</span><span style="color: #00a3af; font-variant-ligatures: no-common-ligatures;">~</span><span style="color: black; font-variant-ligatures: no-common-ligatures;">] </span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">- $ git --version</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">git version 2.15.2 (Apple Git-101.1)</span></div>
<div style="background-color: #dfdbc3; color: #4324d4; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: #ee1807; font-variant-ligatures: no-common-ligatures;">bamcgill</span><span style="color: black; font-variant-ligatures: no-common-ligatures;">@</span><span style="font-variant-ligatures: no-common-ligatures;">bamcgill-mac[</span><span style="color: #00a3af; font-variant-ligatures: no-common-ligatures;">~</span><span style="color: black; font-variant-ligatures: no-common-ligatures;">] </span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">- $ git lfs version</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">git-lfs/2.3.4 (GitHub; darwin amd64; go 1.9.1)</span></div>
<div style="background-color: #dfdbc3; color: #4324d4; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: #ee1807; font-variant-ligatures: no-common-ligatures;">bamcgill</span><span style="color: black; font-variant-ligatures: no-common-ligatures;">@</span><span style="font-variant-ligatures: no-common-ligatures;">bamcgill-mac[</span><span style="color: #00a3af; font-variant-ligatures: no-common-ligatures;">~</span><span style="color: black; font-variant-ligatures: no-common-ligatures;">] </span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">- $ git svn</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">git-svn - bidirectional operations between a single Subversion tree and git</span></div>
<div style="background-color: #dfdbc3; color: #4324d4; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
</div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">usage: git svn <command></command> [options] [arguments]</span></div>
<div>
<span style="font-variant-ligatures: no-common-ligatures;"><br /></span></div>
<h2>
<span style="font-variant-ligatures: no-common-ligatures;">Clone Empty GIT Repository</span></h2>
Before the migration, we should create an empty repository for importing the subversion repository into. Then we can clone it to start the migration<br />
<br />
<pre class="prettyprint"><code class="language-sh">git clone git@gitlab.yourcompany.com:group-name/gitrepo.git </code></pre>
<pre class="prettyprint"><code class="language-sh">
</code></pre>
<h2>
Clone the subversion repository into the empty git repository</h2>
<div>
Before we do the clone, we need to build a file of the authors on the svn</div>
<br />
<pre class="prettyprint"><code class="language-sh">svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors.txt </code></pre>
<br />
Now we need to edit that file which has a format like this<br />
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">bamcgill = bamcgill <bamcgill></bamcgill></span></div>
<div>
<span style="font-variant-ligatures: no-common-ligatures;">to a format like this</span></div>
<div>
<span style="font-variant-ligatures: no-common-ligatures;"></span><br />
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-variant-ligatures: no-common-ligatures;">bamcgill = Barry McGillin <barry mcgillin.com=""></barry></span></span></div>
<span style="font-variant-ligatures: no-common-ligatures;">
</span>
<br />
<div>
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-variant-ligatures: no-common-ligatures;">This file is then used to map the users in subversion to the new decorated users in git.</span></span></div>
<span style="font-variant-ligatures: no-common-ligatures;">
</span>
<div>
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-variant-ligatures: no-common-ligatures;"><br /></span></span></div>
<span style="font-variant-ligatures: no-common-ligatures;">
</span></div>
<pre class="prettyprint"><code class="language-sh">git svn clone https://server.company.com/svn/project/trunk gitrepo --authors-file=authors.txt > loglog 2>&1 </code></pre>
<pre class="prettyprint"><code class="language-sh">
</code></pre>
We push the output into a log file because it takes ages and you can scroll back and see where the actual clone is. This pulls the entire history from revision 1 to HEAD and drops it into the git repository<br />
<br />
<h2>
Clean up the GIT Repository Metadata </h2>
Now, we use a really handy utility: BFG: Removes large or troublesome blobs like git-filter-branch does. For this exercise we run the utility twice. Once to strip blobs larger than 1M
<br />
<br />
<pre class="prettyprint"><code class="language-sh">java -jar bfg-1.13.0.jar --strip-blobs-bigger-than 1M git-repo </code></pre>
<pre class="prettyprint"><code class="language-sh">
</code></pre>
<pre class="prettyprint"><code class="language-sh">Now fix the changes into the repository. </code></pre>
<pre class="prettyprint"><code class="language-sh">
</code></pre>
<pre class="prettyprint"><code class="language-sh">cd git-repo && git reflog expire --expire=now --all && git gc --prune=now --aggressive && cd - </code></pre>
<pre class="prettyprint"><code class="language-sh">
</code></pre>
Now for the second run of the BFG, we want to convert a bunch of things like binary files to Large File Storage
<br />
<br />
<pre class="prettyprint"><code class="language-sh">java -jar bfg-1.13.0.jar --convert-to-git-lfs "*.{rar,dll,zip,war,gz,jar,tar,opar,dmp,serial,exe,mde,gif,msg,oxd_db,dylib,so}" --no-blob-protection git-repo</code> </pre>
<pre class="prettyprint"><code class="language-sh">
</code></pre>
<pre class="prettyprint"><code class="language-sh">And fix that into the repository too.</code></pre>
<pre class="prettyprint"><code class="language-sh">
</code></pre>
<pre class="prettyprint"><code class="language-sh">cd sql-developer && git reflog expire --expire=now --all && git gc --prune=now --aggressive && cd - </code></pre>
<br />
<h2>
Install and Configure GIT LFS</h2>
<div>
Create an file called .lfsconfig which has your preconfigured LFS server<br />
<br /></div>
<pre class="prettyprint"><code class="language-sh">$cp lfsconfig git/.lfsconfig
$cat .lfsconfig
[lfs]
url = https://artifactory.yourcorp.com/api/lfs/git-lfs
</code></pre>
<pre class="prettyprint"><code class="language-sh"> </code></pre>
Now, you need to install lfs into the repository.<br />
<br />
<pre class="prettyprint"><code class="language-sh">cd git-repo && git lfs install </code></pre>
<br />
and then track all the binary and large files you want<br />
<br />
<pre class="prettyprint"><code class="language-sh">git lfs track *.{rar,dll,zip,war,gz,jar,tar,opar,dmp,serial,exe,mde,gif,msg,oxd_db,dylib,so} </code></pre>
<br />
<h2>
Commit and Push</h2>
Next we need to add the files we just edited AND the base directory of the git repository as all the binary files will be swapped out to LFS on push<br />
<br />
<pre class="prettyprint"><code class="language-sh">git add .lfsconfig .gitattributes && git add .</code></pre>
<br />
<pre class="prettyprint"><code class="language-sh">git commit -m "initial commit to git" && git push origin master </code></pre>
<br />
Depending on the security setting of your artifactory repository you may be prompted for a username and password for pushing the binary files to LFS and then the references and files will be pushed to your remote git repository<br />
<br />
<h2>
Summary</h2>
It took us a couple of goes to get this right so we put it in a file to rerun when it died (it will til you get all the large file extensions listed)<br />
Heres the contents of that script you can grab and use for your migration.<br />
Have fun.<br />
<br />
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">git clone git@gitlab.yourcompany.com:group-dev/git-repo.git && \</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">git svn clone https://svn.yourcompany.com/svn/project/trunk git-repo --authors-file=authors.txt > loglog 2>&1 && \</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">java -jar bfg-1.13.0.jar --strip-blobs-bigger-than 1M git-repo && \</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">cd git-repo && git reflog expire --expire=now --all && git gc --prune=now --aggressive && cd - && \</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">java -jar bfg-1.13.0.jar --convert-to-git-lfs "*.{rar,dll,zip,war,gz,jar,tar,opar,dmp,serial,exe,mde,gif,msg,oxd_db,dylib,so}" --no-blob-protection git-repo && \</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">cd git-repo && git reflog expire --expire=now --all && git gc --prune=now --aggressive && cd - && \</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">cp lfsconfig git-repo/.lfsconfig && \</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">cd git-repo && \</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">git lfs install && \</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">git lfs track *.{rar,dll,zip,war,gz,jar,tar,opar,dmp,serial,exe,mde,gif,msg,oxd_db,dylib,so} && \</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">git add .lfsconfig .gitattributes && \</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">git add . && \</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">git commit -m "initial commit to git" && \</span></div>
<br />
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">git push origin master</span></div>
<div>
<span style="font-variant-ligatures: no-common-ligatures;"><br /></span></div>
Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com6Letfern Rd, Seskinore, Omagh BT78 2QA, UK54.5223114 -7.265603100000021254.513095899999996 -7.2857731000000214 54.5315269 -7.2454331000000209tag:blogger.com,1999:blog-1555497785494345295.post-73672599646428214852018-06-11T09:02:00.000-07:002018-06-11T09:02:20.077-07:00Git installing on windows, 'Nix and applications<h1 style="background-color: white; border-bottom-color: rgb(135, 34, 37); line-height: 1.25; margin: 0px;">
<span style="color: #333333; font-family: "arial" , sans-serif;"><span style="caret-color: rgb(51, 51, 51); font-size: 14px; font-weight: normal;">Getting Git installed in lots of places for a team can be a irksome. Part of your team is running windows, maybe with Cygwin, others with various flavours on unix and osx. Layered on top of that are the applications that we use with git services embedded in them. This should serve as a sample page to show where we can get access to the clients and how we set them up for ssh which is our default.</span></span></h1>
<div>
<span style="color: #333333; font-family: "arial" , sans-serif;"><span style="caret-color: rgb(51, 51, 51); font-size: 14px; font-weight: normal;"><br /></span></span></div>
<div>
<span style="color: #333333; font-family: "arial" , sans-serif;"><span style="caret-color: rgb(51, 51, 51); font-size: 14px; font-weight: normal;"><br /></span></span></div>
<h1 style="background-color: white; border-bottom-color: rgb(135, 34, 37); caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 24px; font-weight: normal; line-height: 1.25; margin: 0px;">
Installing git</h1>
<h1 style="background-color: white; border-bottom-color: rgb(135, 34, 37); caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 24px; font-weight: normal; line-height: 1.25; margin: 0px;">
<div style="font-size: 14px; margin-top: 10px; word-wrap: break-word;">
Overview of install at <a data-mce-href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git" href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git" style="color: rgb(59, 115, 175) !important; text-decoration: none;">https://git-scm.com/book/en/v2/Getting-Started-Installing-Git</a>. Theres lots of different versions, but boiled up to basics are these below.</div>
</h1>
<h2 style="background-color: white; border-bottom-color: rgb(135, 34, 37); caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 20px; font-weight: normal; line-height: 1.5; margin: 30px 0px 0px;">
Unix </h2>
<h1 style="background-color: white; border-bottom-color: rgb(135, 34, 37); caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 24px; font-weight: normal; line-height: 1.25; margin: 0px;">
<ul style="font-size: 14px; margin: 10px 0px 0px;">
<li>sudo yum install git-all</li>
<li>sudo dnf install git-all (RH)</li>
<li>sudo apt install git-all (debian)</li>
</ul>
</h1>
<h2 style="background-color: white; border-bottom-color: rgb(135, 34, 37); caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 20px; font-weight: normal; line-height: 1.5; margin: 30px 0px 0px;">
windows</h2>
<h1 style="background-color: white; border-bottom-color: rgb(135, 34, 37); caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 24px; font-weight: normal; line-height: 1.25; margin: 0px;">
<ul style="font-size: 14px; margin: 10px 0px 0px;">
<li>download and install <a data-mce-href="https://gitforwindows.org/" href="https://gitforwindows.org/" style="color: rgb(59, 115, 175) !important; text-decoration: none;">https://gitforwindows.org/</a></li>
</ul>
</h1>
<h2 style="background-color: white; border-bottom-color: rgb(135, 34, 37); caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 20px; font-weight: normal; line-height: 1.5; margin: 30px 0px 0px;">
mac</h2>
<h1 style="background-color: white; border-bottom-color: rgb(135, 34, 37); caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 24px; font-weight: normal; line-height: 1.25; margin: 0px;">
<ol style="font-size: 14px; margin: 10px 0px 0px;">
<li>brew install git</li>
<li>or download and install from <a data-mce-href="http://git-scm.com/download/mac" href="http://git-scm.com/download/mac" style="color: rgb(59, 115, 175) !important; text-decoration: none;">http://git-scm.com/download/mac</a> </li>
</ol>
</h1>
<h1 style="background-color: white; border-bottom-color: rgb(135, 34, 37); caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 24px; font-weight: normal; line-height: 1.25; margin: 30px 0px 0px;">
Connections to GitHub</h1>
<div>
We are specifically only looking at SSH connections so, heres some ways to get your keys sorted</div>
<h1 style="background-color: white; border-bottom-color: rgb(135, 34, 37); caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 24px; font-weight: normal; line-height: 1.25; margin: 0px;">
<ul style="font-size: 14px; margin: 10px 0px 0px;">
<li>generate an ssh key</li>
<li>add the public key to Orahub</li>
<li>Clone your repository</li>
</ul>
</h1>
<h2 style="background-color: white; border-bottom-color: rgb(135, 34, 37); caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 20px; font-weight: normal; line-height: 1.5; margin: 30px 0px 0px;">
SSH Key Generation</h2>
<h3 style="background-color: white; caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5; margin: 10px 0px 0px;">
Unix</h3>
<h1 style="background-color: white; border-bottom-color: rgb(135, 34, 37); caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 24px; font-weight: normal; line-height: 1.25; margin: 0px;">
<div style="font-size: 14px; margin-top: 10px; word-wrap: break-word;">
ssh-keygen -t rsa</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/-_wA50eO1g_k/Wx6LYbHP3qI/AAAAAAAADNQ/WWTPeEDe5uY-J2rtByRXa3GXI9krUZ7lwCLcBGAs/s1600/Screen%2BShot%2B2018-06-08%2Bat%2B14.27.05.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="502" data-original-width="604" height="265" src="https://2.bp.blogspot.com/-_wA50eO1g_k/Wx6LYbHP3qI/AAAAAAAADNQ/WWTPeEDe5uY-J2rtByRXa3GXI9krUZ7lwCLcBGAs/s320/Screen%2BShot%2B2018-06-08%2Bat%2B14.27.05.png" width="320" /></a></div>
<div style="font-size: 14px; margin-top: 10px; word-wrap: break-word;">
<br /></div>
</h1>
<h3 style="background-color: white; caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5; margin: 30px 0px 0px;">
Windows</h3>
<h1 style="background-color: white; border-bottom-color: rgb(135, 34, 37); caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 24px; font-weight: normal; line-height: 1.25; margin: 0px;">
<div style="font-size: 14px; margin-top: 10px; word-wrap: break-word;">
Use Putty-gen . This is installed as part of the putty installation available here: <a data-mce-href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" style="color: rgb(59, 115, 175) !important; text-decoration: none;">http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html</a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/-fdlUc2h0GTs/Wx6Ll8UN9mI/AAAAAAAADNU/kWA4EzYAB94V5uIYETbKa4nDay6yTAUvwCLcBGAs/s1600/Capture.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="290" data-original-width="300" src="https://2.bp.blogspot.com/-fdlUc2h0GTs/Wx6Ll8UN9mI/AAAAAAAADNU/kWA4EzYAB94V5uIYETbKa4nDay6yTAUvwCLcBGAs/s1600/Capture.png" /></a></div>
</h1>
<h2 style="background-color: white; border-bottom-color: rgb(135, 34, 37); caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 20px; font-weight: normal; line-height: 1.5; margin: 30px 0px 0px;">
Add your keys to GitHub or your Enterprise Git Repo</h2>
<div>
In order to do this, its pretty specific. You need to go to the your user settings page and click on ssh keys, There, you can paste in your public key. This will then let you clone your repositories with SSH as below.</div>
<h2 style="background-color: white; border-bottom-color: rgb(135, 34, 37); caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 20px; font-weight: normal; line-height: 1.5; margin: 30px 0px 0px;">
Clone Repository to local Repository</h2>
<h3 style="background-color: white; caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5; margin: 10px 0px 0px;">
unix terminal / cygwin </h3>
<h1 style="background-color: white; border-bottom-color: rgb(135, 34, 37); caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 24px; font-weight: normal; line-height: 1.25; margin: 0px;">
<div style="font-size: 14px; margin-top: 10px; word-wrap: break-word;">
git clone git@orahub.oraclecorp.com/restofyourrepo.git destination</div>
</h1>
<h3 style="background-color: white; caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5; margin: 30px 0px 0px;">
tortoisegit</h3>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-9aeAtYJtLvQ/Wx6YeE_ePXI/AAAAAAAADOo/xddZKXPgWzMgBUYkbJ59qcWYPBNGcnW3ACLcBGAs/s1600/Capture3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="388" data-original-width="709" height="175" src="https://3.bp.blogspot.com/-9aeAtYJtLvQ/Wx6YeE_ePXI/AAAAAAAADOo/xddZKXPgWzMgBUYkbJ59qcWYPBNGcnW3ACLcBGAs/s320/Capture3.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-_nXrU78svrw/Wx6YjpsHtDI/AAAAAAAADOs/toJMsxADH_kxaiQqQ9V25QGAadr91PKbgCLcBGAs/s1600/Capture4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="463" data-original-width="611" height="241" src="https://4.bp.blogspot.com/-_nXrU78svrw/Wx6YjpsHtDI/AAAAAAAADOs/toJMsxADH_kxaiQqQ9V25QGAadr91PKbgCLcBGAs/s320/Capture4.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3 style="background-color: white; caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5; margin: 10px 0px 0px;">
sqldeveloper</h3>
<h1 style="background-color: white; border-bottom-color: rgb(135, 34, 37); caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 24px; font-weight: normal; line-height: 1.25; margin: 0px;">
<div style="font-size: 14px; margin-top: 10px; word-wrap: break-word;">
team → Connect to git<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-YRYcDpiL_Do/Wx6Yssc9JuI/AAAAAAAADO4/pSw1MsA5tC8DRbG_-7mnP_Q_RSMX7sKsgCLcBGAs/s1600/Capture5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="477" data-original-width="639" height="297" src="https://1.bp.blogspot.com/-YRYcDpiL_Do/Wx6Yssc9JuI/AAAAAAAADO4/pSw1MsA5tC8DRbG_-7mnP_Q_RSMX7sKsgCLcBGAs/s400/Capture5.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-LfMp0-YMZvI/Wx6YsgJF07I/AAAAAAAADOw/K-a3N5pw80YFrLMuwVjA-LLDQDm67EO0ACLcBGAs/s1600/Capture6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="480" data-original-width="663" height="288" src="https://1.bp.blogspot.com/-LfMp0-YMZvI/Wx6YsgJF07I/AAAAAAAADOw/K-a3N5pw80YFrLMuwVjA-LLDQDm67EO0ACLcBGAs/s400/Capture6.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-3g4RPtrBekw/Wx6YssiUcHI/AAAAAAAADO0/hQdcopuXQyMkmx2YPX5r1UhHkyRiREAYQCLcBGAs/s1600/Capture7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="477" data-original-width="666" height="285" src="https://1.bp.blogspot.com/-3g4RPtrBekw/Wx6YssiUcHI/AAAAAAAADO0/hQdcopuXQyMkmx2YPX5r1UhHkyRiREAYQCLcBGAs/s400/Capture7.png" width="400" /></a></div>
</div>
<br />
<div style="font-size: 14px; margin-top: 10px; word-wrap: break-word;">
view → files</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-YReapp2H5CI/Wx6ZISfckCI/AAAAAAAADPM/CfbVkL4A1r4Gs-FVGYKg5bTbp-zTV9ynwCLcBGAs/s1600/Capture8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="368" data-original-width="686" height="171" src="https://4.bp.blogspot.com/-YReapp2H5CI/Wx6ZISfckCI/AAAAAAAADPM/CfbVkL4A1r4Gs-FVGYKg5bTbp-zTV9ynwCLcBGAs/s320/Capture8.png" width="320" /></a></div>
</h1>
<h3 style="background-color: white; caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5; margin: 30px 0px 0px;">
eclipse</h3>
<div>
<h1 style="background-color: white; border-bottom-color: rgb(135, 34, 37); color: #333333; font-family: arial, sans-serif; font-size: 24px; font-weight: normal; line-height: 1.25; margin: 0px;">
<div style="font-size: 14px; margin-top: 10px; word-wrap: break-word;">
window → perspective → open perspective → git repositories</div>
<div style="font-size: 14px; margin-top: 10px; word-wrap: break-word;">
click clone git repository</div>
</h1>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-6qj1m1ObRBw/Wx6ZIIgHetI/AAAAAAAADPI/WSQHAlIpSMkkuO1oIon5zobneqKTBYQfgCLcBGAs/s1600/Capture9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="537" data-original-width="658" height="261" src="https://3.bp.blogspot.com/-6qj1m1ObRBw/Wx6ZIIgHetI/AAAAAAAADPI/WSQHAlIpSMkkuO1oIon5zobneqKTBYQfgCLcBGAs/s320/Capture9.png" width="320" /></a></div>
<h3 style="background-color: white; caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5; margin: 30px 0px 0px;">
github desktop</h3>
<h1 style="background-color: white; border-bottom-color: rgb(135, 34, 37); caret-color: rgb(51, 51, 51); color: #333333; font-family: Arial, sans-serif; font-size: 24px; font-weight: normal; line-height: 1.25; margin: 0px;">
<div style="font-size: 14px; margin-top: 10px; word-wrap: break-word;">
Download it from <a data-mce-href="https://desktop.github.com/" href="https://desktop.github.com/" style="color: rgb(59, 115, 175) !important; text-decoration: none;">https://desktop.github.com/</a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-kVU2UEwH1rU/Wx6ZIIcs0jI/AAAAAAAADPQ/XOQDnqJwVFc0IBhNduiMu-Mtsq3ESaR9gCLcBGAs/s1600/Capture10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="429" data-original-width="739" height="185" src="https://3.bp.blogspot.com/-kVU2UEwH1rU/Wx6ZIIcs0jI/AAAAAAAADPQ/XOQDnqJwVFc0IBhNduiMu-Mtsq3ESaR9gCLcBGAs/s320/Capture10.png" width="320" /></a></div>
<div style="font-size: 14px; margin-top: 10px; word-wrap: break-word;">
<br /></div>
</h1>
Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com1 Seskinore, Omagh BT78 2QA, UK54.523805820267143 -7.261998211084005654.514590320267139 -7.2821682110840058 54.533021320267146 -7.2418282110840053tag:blogger.com,1999:blog-1555497785494345295.post-89275778865738518612018-04-27T10:44:00.000-07:002018-04-27T10:44:06.245-07:00Making Git cmd line fancy - ish :)So, we're having a great time with git, fighting over how branches should work and what policy is best in our environment, which I suppose I'll talk about in another post, but for today, I wanted to share a little bit of usefulness.<br />
<br />
Most of our repositories have several branches for various releases and its often confusing and terse to 1. remember where you are and 2, run git branch to see. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-0HVO3c8H84M/WuNbvWlUYWI/AAAAAAAADMI/PvHVVdVwBm0k81SJswQKHzga0szDmoFtwCLcBGAs/s1600/Screen%2BShot%2B2018-04-27%2Bat%2B18.18.30.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="207" data-original-width="493" height="267" src="https://4.bp.blogspot.com/-0HVO3c8H84M/WuNbvWlUYWI/AAAAAAAADMI/PvHVVdVwBm0k81SJswQKHzga0szDmoFtwCLcBGAs/s640/Screen%2BShot%2B2018-04-27%2Bat%2B18.18.30.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
This for example, I have changed to my repository in GitHub, but unless you know that you're in a repository you couldn't be sure. Long story short, lets say we've had one or two boo-boos along the way. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Now, imported projects in eclipse will have the branch of the code you're working on so today, we're going to bring it to the terminal. Cut the following and put it in your .bashrc or .bash_profile and see your repository and branch pop out on the prompt. Now, I have decorated the prompt with some colours, which you might want to change. (search for bash unix colors for details)</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">parse_git_branch() {</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"> git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/'</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">}</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal; min-height: 17px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">parse_git_repo() {</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"> git rev-parse --show-toplevel 2> /dev/null | xargs basename| sed 's/\(.*\)/[\1]/'</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">}</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal; min-height: 17px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">export PS1="\[\033[91m\]\u\[\033[30m\]@\[\033[34m\]\h[\[\033[36m\]\w\[\033[30m\]] \</span></div>
<div class="separator" style="clear: both;">
</div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">\n\r\[\033[31m\]\$(parse_git_repo)\[\033[00m\]-\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "</span></div>
<div>
<span style="font-variant-ligatures: no-common-ligatures;"><br /></span></div>
<div>
<span style="font-variant-ligatures: no-common-ligatures;">What you get from all this, the next time you start a terminal is this (without my adornments).</span></div>
<div>
<span style="font-variant-ligatures: no-common-ligatures;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-QUtn2SyFM2I/WuNfKNQLSjI/AAAAAAAADMY/hhxE7p2gF08OwIc3tvXX1mYsL-LSYWNtwCLcBGAs/s1600/Screen%2BShot%2B2018-04-27%2Bat%2B18.29.10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="214" data-original-width="545" height="249" src="https://3.bp.blogspot.com/-QUtn2SyFM2I/WuNfKNQLSjI/AAAAAAAADMY/hhxE7p2gF08OwIc3tvXX1mYsL-LSYWNtwCLcBGAs/s640/Screen%2BShot%2B2018-04-27%2Bat%2B18.29.10.png" width="640" /></a></div>
<div>
<span style="font-variant-ligatures: no-common-ligatures;">So, as soon as you enter a repository, the prompt now tells you which repository and which branch you are on too, in this case I have branch called flatten which I used for the previous post. </span></div>
<div>
<span style="font-variant-ligatures: no-common-ligatures;">Finally, if you dont want the colour, strip the escape codes and while your PS1 export will look more sane, it'll lack a certain bedazzling...</span></div>
<div>
<span style="font-variant-ligatures: no-common-ligatures;"><br /></span></div>
<div>
<span style="font-variant-ligatures: no-common-ligatures;"><div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">export PS1="\u@\h[\w] \n\r\$(parse_git_repo)-\$(parse_git_branch) $ "</span></div>
</span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-yQy0U1SdpSE/WuNhCOFnDkI/AAAAAAAADMk/y3JMNhwjP1kyI1ZZkRpcXmLjWhiMLsgAQCLcBGAs/s1600/Screen%2BShot%2B2018-04-27%2Bat%2B18.42.13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="158" data-original-width="458" height="220" src="https://3.bp.blogspot.com/-yQy0U1SdpSE/WuNhCOFnDkI/AAAAAAAADMk/y3JMNhwjP1kyI1ZZkRpcXmLjWhiMLsgAQCLcBGAs/s640/Screen%2BShot%2B2018-04-27%2Bat%2B18.42.13.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Have fun!</div>
Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com1Letfern Rd, Seskinore, Omagh BT78 2QA, UK54.5223114 -7.265603100000021254.513095899999996 -7.2857731000000214 54.5315269 -7.2454331000000209tag:blogger.com,1999:blog-1555497785494345295.post-72812101554028473352018-04-25T13:58:00.000-07:002018-04-25T13:58:24.922-07:00Maven Duplicated Versions consolidated with flattenWe had the situation lately where we have a bunch of modules in a project and a common parent. Now when we go to update the project version we need to update the parent version in EVERY pom.<br />
<br />
Lets take a look at a simple project<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-QD9f_84vP1w/WuDL9ohnYMI/AAAAAAAADK8/RsVEu-RKfeMgyIFLks9DEFQP3ZzL0DnfQCLcBGAs/s1600/Screen%2BShot%2B2018-04-25%2Bat%2B19.41.06.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="453" data-original-width="1009" height="143" src="https://4.bp.blogspot.com/-QD9f_84vP1w/WuDL9ohnYMI/AAAAAAAADK8/RsVEu-RKfeMgyIFLks9DEFQP3ZzL0DnfQCLcBGAs/s320/Screen%2BShot%2B2018-04-25%2Bat%2B19.41.06.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
This project has three simple modules which have a common parent</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<pre style="background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">1: <project>
3: <modelVersion>4.0.0</modelVersion>
4: <packaging>pom</packaging>
5: <name>Three Stooges</name>
6: <groupId>oracle.blogger</groupId>
7: <artifactId>stooges</artifactId>
8: <version>1.0.0-SNAPSHOT</version>
9: <properties>
10: <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
11: </properties>
12: <modules>
13: <module>larry</module>
14: <module>curley</module>
15: <module>moe</module>
16: </modules>
17: </project>
</code></pre>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
Each module inherits from the parent including the version. Lets take a look at Larrys module.<br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">1: <project>
3: <modelVersion>4.0.0</modelVersion>
4: <packaging>jar</packaging>
5: <name>Larry</name>
6: <artifactId>larry</artifactId>
7: <parent>
8: <groupId>oracle.blogger</groupId>
9: <artifactId>stooges</artifactId>
10: <version>1.0.0-SNAPSHOT</version>
11: </parent>
12: </project>
</code></pre>
<br />
In our larger project, we had over 20 of these to change at once when we branched for release<br />
<br />
Instead, we introduced a revision property in the parent pom, which was then used to be the version in all the pom's. Here's the modified parent pom with the revision in place.<br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">1: <project>
3: <modelVersion>4.0.0</modelVersion>
4: <packaging>pom</packaging>
5: <name>Three Stooges</name>
6: <groupId>oracle.blogger</groupId>
7: <artifactId>stooges</artifactId>
8: <version>${revision}</version>
9: <properties>
10: <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
11: <flatten.version>1.0.1</flatten.version>
12: <!-- Build Revision -->
13: <revision>1.0.1-SNAPSHOT</revision>
14: </properties>
15: <modules>
16: <module>larry</module>
17: <module>curley</module>
18: <module>moe</module>
19: </modules>
</code></pre>
<br />
and in each of the children, that change propagates like this.<br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">1: <project>
2: <modelVersion>4.0.0</modelVersion>
3: <packaging>jar</packaging>
4: <name>Larry</name>
5: <artifactId>larry</artifactId>
6: <parent>
7: <groupId>oracle.blogger</groupId>
8: <artifactId>stooges</artifactId>
9: <version>${revision}</version>
10: </parent>
11: </project>
</code></pre>
<br />
Now, for most things, this all works and we can see that in the build.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-krbHAxZzX80/WuDTOL4JYOI/AAAAAAAADLM/uEQS66hkAZYmcSJMeRndUzcEQLrbOxGuwCLcBGAs/s1600/Screen%2BShot%2B2018-04-25%2Bat%2B20.12.11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="403" data-original-width="749" height="215" src="https://1.bp.blogspot.com/-krbHAxZzX80/WuDTOL4JYOI/AAAAAAAADLM/uEQS66hkAZYmcSJMeRndUzcEQLrbOxGuwCLcBGAs/s400/Screen%2BShot%2B2018-04-25%2Bat%2B20.12.11.png" width="400" /></a></div>
<br />
But, when we deploy these builds to artifactory, we need to flatten the poms with the versions so that they can be used for versioning. We can use the <a href="https://www.mojohaus.org/flatten-maven-plugin/" target="_blank">Maven Flatten Plugin </a>from <a href="https://www.mojohaus.org/" target="_blank">mojoHaus</a> to help with this. What this does to the pom is:<br />
<br />
<br />
<li style="color: #404040; line-height: 20px;">Build specific elements are removed</li>
<li style="color: #404040; line-height: 20px;">Development specific elements are removed by default</li>
<li style="color: #404040; line-height: 20px;">It only contains elements required for users of your artifact</li>
<li style="color: #404040; line-height: 20px;">Its variables are resolved</li>
<li style="color: #404040; line-height: 20px;">Its parent relationship is resolved, flattened and removed</li>
<li style="color: #404040; line-height: 20px;">Its build time driven profiles <b>can</b> be evaluated so their impact gets embedded</li>
<li style="color: #404040; line-height: 20px;">JDK or OS driven profiles still remain allowing dynamic dependencies if needed</li>
<br />
<br />
Add it to your parent pom pluginManagement section.<br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">1: <build>
2: <pluginManagement>
3: <plugins>
4: <plugin>
5: <groupId>org.codehaus.mojo</groupId>
6: <artifactId>flatten-maven-plugin</artifactId>
7: <version>${flatten.version}</version>
8: <configuration>
9: <updatePomFile>true</updatePomFile>
10: </configuration>
11: <executions>
12: <execution>
13: <id>flatten</id>
14: <phase>process-resources</phase>
15: <goals>
16: <goal>flatten</goal>
17: </goals>
18: </execution>
19: <execution>
20: <id>flatten.clean</id>
21: <phase>clean</phase>
22: <goals>
23: <goal>clean</goal>
24: </goals>
25: </execution>
26: </executions>
27: </plugin>
28: <plugin>
29: <groupId>org.eclipse.m2e</groupId>
30: <artifactId>lifecycle-mapping</artifactId>
31: <version>${lifecycle-mapping.version}</version>
32: <configuration>
33: <lifecycleMappingMetadata>
34: <pluginExecutions>
35: <pluginExecution>
36: <pluginExecutionFilter>
37: <groupId>org.codehaus.mojo</groupId>
38: <artifactId>flatten-maven-plugin</artifactId>
39: <versionRange>[0,)</versionRange>
40: <goals>
41: <goal>flatten</goal>
42: </goals>
43: </pluginExecutionFilter>
44: <action>
45: <ignore></ignore>
46: </action>
47: </pluginExecution>
48: </pluginExecutions>
49: </lifecycleMappingMetadata>
50: </configuration>
51: </plugin>
52: </plugins>
53: </pluginManagement>
54: <plugins>
55: <plugin>
56: <groupId>org.codehaus.mojo</groupId>
57: <artifactId>flatten-maven-plugin</artifactId>
58: </plugin>
59: </plugins>
60: </build>
</code></pre>
<br />
This will run as part of the build like this<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/-jeCb1tU6dJI/WuDYBgm6phI/AAAAAAAADLY/VaBQvcqH0MQ-x8gmeFBTrOH-GJSb1naGgCLcBGAs/s1600/Screen%2BShot%2B2018-04-25%2Bat%2B20.32.31.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="230" data-original-width="727" height="126" src="https://2.bp.blogspot.com/-jeCb1tU6dJI/WuDYBgm6phI/AAAAAAAADLY/VaBQvcqH0MQ-x8gmeFBTrOH-GJSb1naGgCLcBGAs/s400/Screen%2BShot%2B2018-04-25%2Bat%2B20.32.31.png" width="400" /></a></div>
<br />
and will produce a flattened pom for you<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-O3tZIpJiGcM/WuDYd3AM9tI/AAAAAAAADLg/izpjtFGVDisih5OPNhNfq7fhYT8ox984wCLcBGAs/s1600/Screen%2BShot%2B2018-04-25%2Bat%2B20.34.35.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="391" data-original-width="709" height="220" src="https://3.bp.blogspot.com/-O3tZIpJiGcM/WuDYd3AM9tI/AAAAAAAADLg/izpjtFGVDisih5OPNhNfq7fhYT8ox984wCLcBGAs/s400/Screen%2BShot%2B2018-04-25%2Bat%2B20.34.35.png" width="400" /></a></div>
without all the variables and so on as detailed above.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/-4WGB4hkk87Q/WuDYyf3XXTI/AAAAAAAADLo/_g-UGRvc3UYIf0bocQbUmvQe3G6wiqSrACLcBGAs/s1600/Screen%2BShot%2B2018-04-25%2Bat%2B20.35.57.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="393" data-original-width="667" height="235" src="https://2.bp.blogspot.com/-4WGB4hkk87Q/WuDYyf3XXTI/AAAAAAAADLo/_g-UGRvc3UYIf0bocQbUmvQe3G6wiqSrACLcBGAs/s400/Screen%2BShot%2B2018-04-25%2Bat%2B20.35.57.png" width="400" /></a></div>
mvn clean will remove all created files afterwards to leave your original pom.xml. The pull request in the repo looked like this before merge.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-aK8Op88SOts/WuDcBAocRTI/AAAAAAAADL0/akmW0pGgEtke269OaJ98I4IrMrpZwSMKACLcBGAs/s1600/Screen%2BShot%2B2018-04-25%2Bat%2B20.49.45.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="949" data-original-width="1089" height="347" src="https://3.bp.blogspot.com/-aK8Op88SOts/WuDcBAocRTI/AAAAAAAADL0/akmW0pGgEtke269OaJ98I4IrMrpZwSMKACLcBGAs/s400/Screen%2BShot%2B2018-04-25%2Bat%2B20.49.45.png" width="400" /></a></div>
<br />Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com1tag:blogger.com,1999:blog-1555497785494345295.post-76939562422329527472018-04-13T14:18:00.000-07:002018-04-13T14:18:44.832-07:00Run your SQL script from java NOWRun them with the code we use for Oracle SQL Developer, SQLcl and REST Data Services.<br />
We've just released some of the code that underpins these tools in an attempt to help others run SQL, PLSQL and SQL*Plus scripts confidently and repeatably from java.<br />
<br />
From Github, look for the repository <a href="https://github.com/oracle/dbtools-commons" target="_blank">dbtools-commons</a>. Look at my <a href="http://barrymcgillin.blogspot.co.uk/2018/04/sqlcl-code-aka-dbtools-common-is-now.html" target="_blank">previous post</a> to build it.<br />
<br />
The code below is one simple example to run sql code with the common jars we ship with sqlcl and sqldeveloper.<br />
<br />
Further down, I stuck in a pom file you can use to build with maven.<br />
<br />
<h2>
Demo using Script executor to run SQL</h2>
<br />
<pre style="background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">1: import java.io.BufferedOutputStream;
2: import java.io.ByteArrayOutputStream;
3: import java.io.UnsupportedEncodingException;
4: import java.sql.Connection;
5: import java.sql.DriverManager;
6: import java.sql.SQLException;
7: import oracle.dbtools.db.ResultSetFormatter;
8: import oracle.dbtools.raptor.newscriptrunner.ScriptExecutor;
9: import oracle.dbtools.raptor.newscriptrunner.ScriptRunnerContext;
10: /**
11: * @author bamcgill
12: */
13: public class DemoScriptRunner {
14: /**
15: * @param args
16: * @throws ClassNotFoundException
17: * @throws SQLException
18: * @throws UnsupportedEncodingException
19: */
20: public static void main(String[] args) throws ClassNotFoundException, SQLException, UnsupportedEncodingException {
21: Class.forName("oracle.jdbc.driver.OracleDriver");
22: Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/ORCL", "barry", "oracle");
23: ScriptRunnerContext ctx = new ScriptRunnerContext();
24: ctx.setBaseConnection(conn);
25: ScriptExecutor executor = new ScriptExecutor(conn);
26: ByteArrayOutputStream bout = new ByteArrayOutputStream();
27: BufferedOutputStream bs = new BufferedOutputStream(bout);
28: executor.setOut(bs);
29: executor.setScriptRunnerContext(ctx);
30: executor.setStmt("select * from all_objects where rownum < 10 ");
31: ResultSetFormatter.setMaxRows(Integer.MAX_VALUE);
32: executor.run();
33: String results = bout.toString("UTF8");
34: System.out.println(results);
35: }
</code></pre>
<br />
<h2>
Pom File to build Code</h2>
<pre style="background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">1: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2: xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3: <modelVersion>4.0.0</modelVersion>
4: <groupId>oracle.dbtools</groupId>
5: <artifactId>demo-common</artifactId>
6: <version>0.0.1-SNAPSHOT</version>
7: <packaging>jar</packaging>
8: <name>demo-common</name>
9: <url>http://maven.apache.org</url>
10: <properties>
11: <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
12: </properties>
13: <dependencies>
14: <dependency>
15: <groupId>junit</groupId>
16: <artifactId>junit</artifactId>
17: <version>3.8.1</version>
18: <scope>test</scope>
19: </dependency>
20: <dependency>
21: <groupId>oracle.dbtools</groupId>
22: <artifactId>dbtools-common</artifactId>
23: <version>LATEST</version>
24: </dependency>
25: <dependency>
26: <groupId>com.oracle.jdbc</groupId>
27: <artifactId>orai18n</artifactId>
28: <version>12.2.0.1</version>
29: </dependency>
30: <dependency>
31: <groupId>com.oracle.jdbc</groupId>
32: <artifactId>orai18n-mapping</artifactId>
33: <version>12.2.0.1</version>
34: </dependency>
35: </dependencies>
36: </project>
</code></pre>
<div>
<br /></div>
<br />Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com1Letfern Rd, Seskinore, Omagh BT78 2QA, UK54.5223114 -7.265603100000021254.513095899999996 -7.2857731000000214 54.5315269 -7.2454331000000209tag:blogger.com,1999:blog-1555497785494345295.post-37951572736874998582018-04-13T04:28:00.002-07:002018-04-13T04:28:39.323-07:00SQLCL 18.1.1 Release installing jars to local maven repository<br />
Here we are again releasing Oracle SQLcl. We released Oracle SQLDeveloper SQLcl 18.1.1 yesterday with only one significant change.<br />
<br />
Why? Well, we haven't changed the SQLcl code in this release but we've made it easier for you to use the libraries we ship with it. We've added a <a href="https://maven.apache.org/guides/introduction/introduction-to-the-pom.html">pom.xml</a> into the lib directory. On a day to day use of SQLcl, this will not affect your use of SQLcl, however, it will allow you to install the libraries we ship with SQLcl into your local <a href="https://maven.apache.org/guides/introduction/introduction-to-repositories.html">maven repository</a>.<br />
<div>
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-0qK9SnhS94E/WtB1ajmQb6I/AAAAAAAADJs/2H0IPfOL868kUJxM2Acua7RUa9kzmKOFQCLcBGAs/s1600/Screen%2BShot%2B2018-04-13%2Bat%2B10.15.58.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="340" data-original-width="720" height="188" src="https://4.bp.blogspot.com/-0qK9SnhS94E/WtB1ajmQb6I/AAAAAAAADJs/2H0IPfOL868kUJxM2Acua7RUa9kzmKOFQCLcBGAs/s400/Screen%2BShot%2B2018-04-13%2Bat%2B10.15.58.png" width="400" /></a></div>
<br />
<br />
How does that work? Well, you need to have <a href="http://maven.apache.org/download.cgi">maven</a> installed in order to run the install. You can check you have it like this.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-QVw28apFP8U/WtB2Uxi7_OI/AAAAAAAADJ0/4sHIfEhfTDQ54M5L5CUgY1NFqXYop8JcgCLcBGAs/s1600/Screen%2BShot%2B2018-04-13%2Bat%2B10.20.02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="253" data-original-width="771" height="130" src="https://4.bp.blogspot.com/-QVw28apFP8U/WtB2Uxi7_OI/AAAAAAAADJ0/4sHIfEhfTDQ54M5L5CUgY1NFqXYop8JcgCLcBGAs/s400/Screen%2BShot%2B2018-04-13%2Bat%2B10.20.02.png" width="400" /></a></div>
<br />
With confirmed you can run the install by invoking the command 'mvn validate' in the sqlcl/lib directory.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/--tP3r38Snbg/WtCKNjcvmgI/AAAAAAAADKE/wexfwUWhkpU4yF5v4b-2eVFspXA8nngSACLcBGAs/s1600/Screen%2BShot%2B2018-04-13%2Bat%2B11.24.57.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1152" data-original-width="909" height="400" src="https://4.bp.blogspot.com/--tP3r38Snbg/WtCKNjcvmgI/AAAAAAAADKE/wexfwUWhkpU4yF5v4b-2eVFspXA8nngSACLcBGAs/s400/Screen%2BShot%2B2018-04-13%2Bat%2B11.24.57.png" width="315" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
which will take each jar and install it into your local maven repository. By default, this will be ~/.m2</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/-PdBIHt42yyc/WtCLNSH_OAI/AAAAAAAADKM/ToDIkiRKQD0B5OfxvthnXkBlS3Qsxa96gCLcBGAs/s1600/Screen%2BShot%2B2018-04-13%2Bat%2B11.48.05.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="423" data-original-width="781" height="216" src="https://2.bp.blogspot.com/-PdBIHt42yyc/WtCLNSH_OAI/AAAAAAAADKM/ToDIkiRKQD0B5OfxvthnXkBlS3Qsxa96gCLcBGAs/s400/Screen%2BShot%2B2018-04-13%2Bat%2B11.48.05.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
While a lot of these jars are available in maven.oracle.com and maven.org, there are several that aren't. We're working on getting our production jars published externally. The ones we dont have published publicly yet are:<br />
<br />
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
low-level-api.jar ojdbc8.jar</div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">dbtools-common.jar oraclepki.jar</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">dbtools-http.jar orai18n-mapping.jar</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">dbtools-net.jar orai18n-utility.jar</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">dbtools-sqlcl.jar orai18n.jar</span></div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">orajsoda.jar </span>httpcore.jar </div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
osdt_cert.jar osdt_core.jar</div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
ucp.jar. jdbcrest.jar </div>
<div style="background-color: #dfdbc3; color: #4d2f2d; font-family: Courier; font-size: 14px; font-stretch: normal; line-height: normal;">
xdb6.jar xmlparserv2-sans-jaxp-services.jar</div>
<br />
if you want to add these to your project, take the following dependency management and prune it for your needs. <br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">1: <dependencyManagement>
2: <dependencies>
3: <dependency>
4: <groupId>com.oracle.jdbc</groupId>
5: <artifactId>ojdbc8</artifactId>
6: <version>12.2.0.1</version>
7: </dependency>
8: <dependency>
9: <groupId>oracle.soda</groupId>
10: <artifactId>orajsoda</artifactId>
11: <version>12.2.0.1.0</version>
12: </dependency>
18: <dependency>
19: <groupId>com.oracle.jdbc</groupId>
20: <artifactId>xdb6</artifactId>
21: <version>12.2.0.1</version>
22: </dependency>
23: <dependency>
24: <groupId>com.oracle.jdbc</groupId>
25: <artifactId>xmlparserv2-sans-jaxp-services</artifactId>
26: <version>12.2.0.1</version>
27: </dependency>
28: <dependency>
49: <groupId>com.oracle.jdbc</groupId>
50: <artifactId>orai18n</artifactId>
51: <version>12.2.0.1</version>
52: </dependency>
53: <dependency>
54: <groupId>com.oracle.jdbc</groupId>
55: <artifactId>orai18n-collation</artifactId>
56: <version>12.2.0.1</version>
57: </dependency>
58: <dependency>
59: <groupId>com.oracle.jdbc</groupId>
60: <artifactId>orai18n-mapping</artifactId>
61: <version>12.2.0.1</version>
62: </dependency>
68: <dependency>
69: <groupId>com.oracle.jdbc</groupId>
70: <artifactId>orai18n-utility</artifactId>
71: <version>12.2.0.1</version>
72: </dependency>
710: <dependency>
111: <groupId>oracle.dbtools</groupId>
112: <artifactId>dbtools-common</artifactId>
113: <version>18.1.1</version>
114: </dependency>
115: <dependency>
116: <groupId>oracle.dbtools</groupId>
117: <artifactId>dbtools-http</artifactId>
118: <version>18.1.1</version>
119: </dependency>
120: <dependency>
121: <groupId>oracle.dbtools</groupId>
122: <artifactId>dbtools-sqlcl</artifactId>
123: <version>18.1.1</version>
124: </dependency>
125: <dependency>
126: <groupId>oracle.dbtools</groupId>
127: <artifactId>jdbcrest</artifactId>
128: <version>18.1.1</version>
129: </dependency>
130: <dependency>
131: <groupId>com.oracle.jdbc</groupId>
132: <artifactId>osdt_cert</artifactId>
133: <version>12.2.0.1</version>
134: </dependency>
135: <dependency>
136: <groupId>com.oracle.jdbc</groupId>
137: <artifactId>osdt_core</artifactId>
138: <version>12.2.0.1</version>
139: </dependency>
140: <dependency>
141: <groupId>com.oracle.jdbc</groupId>
142: <artifactId>oraclepki</artifactId>
143: <version>12.2.0.1</version>
144: </dependency>
160: <dependency>
161: <groupId>oracle.cloudstorage</groupId>
162: <artifactId>low-level-api</artifactId>
163: <version>13.0.0</version>
164: </dependency>
170: </dependencies>
171: </dependencyManagement>
</code></pre>
<br />
Stay tuned, you'll have a project you can use this on soon!Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com2Letfern Rd, Seskinore, Omagh BT78 2QA, UK54.5223114 -7.265603100000021254.513095899999996 -7.2857731000000214 54.5315269 -7.2454331000000209tag:blogger.com,1999:blog-1555497785494345295.post-61176882200204068132018-03-14T14:17:00.000-07:002018-03-14T14:17:16.540-07:00Docker Oracle and local installsSo you want Docker and to install and Oracle Database locally. So did I and while I have <a href="https://www.virtualbox.org/">VirtualBox</a> and the <a href="https://gist.github.com/cdivilly/8082bece0ad8f819a6b4a3630699ed46">Oracle Developer Day VM</a>, I wanted to setup docker and the Oracle Database<br />
Well <a href="https://twitter.com/cdivilly">Colm Divilly (@cdivilly)</a> has cleared it up for me. His <a href="https://gist.github.com/cdivilly/8082bece0ad8f819a6b4a3630699ed46">Gist</a> on on Github had me up and running. Very little work on my part here, following Colm's detailed instructions, (barring time for downloads) I had docker up on mac in about 30 mins. <br />
<br />
Take a look.....<br />
<br />
<h2 style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; border-bottom-color: rgb(234, 236, 239); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 1.5em; font-style: normal; font-variant-caps: normal; font-weight: 600; letter-spacing: normal; line-height: 1.25; margin-bottom: 16px; margin-top: 24px; orphans: auto; padding-bottom: 0.3em; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
Download Database Binaries from Oracle Technology Network</h2>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
Download the linux x86-64 ZIP archive from<span class="Apple-converted-space"> </span><a href="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html" rel="nofollow" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration: none;">here</a>.</div>
<h2 style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; border-bottom-color: rgb(234, 236, 239); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 1.5em; font-style: normal; font-variant-caps: normal; font-weight: 600; letter-spacing: normal; line-height: 1.25; margin-bottom: 16px; margin-top: 24px; orphans: auto; padding-bottom: 0.3em; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<a class="anchor" href="https://gist.github.com/cdivilly/8082bece0ad8f819a6b4a3630699ed46#check-out-the-oracle-docker-images-from-github" id="user-content-check-out-the-oracle-docker-images-from-github" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration: none;"><svg class="octicon octicon-link" height="16" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>Check out the Oracle Docker Images from Github</h2>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
There's a few ways to do this using an SVN or GIT client, but I just go to the project's<span class="Apple-converted-space"> </span><a href="https://github.com/oracle/docker-images" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration: none;">home page</a>, and click the button on the right hand side labeled 'Clone or Download' and then click 'Download Zip'.</div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
Next unzip this archive of the project that you just downloaded, for example:</div>
<pre style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #f6f8fa; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 1.45; margin-bottom: 16px; margin-top: 0px; orphans: auto; overflow: auto; padding: 16px; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; word-wrap: normal;"><code style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; line-height: inherit; margin: 0px; overflow: visible; padding: 0px; white-space: pre; word-break: normal; word-wrap: normal;">cd ~/work/docker
unzip ~/Downloads/docker-images-master.zip
</code></pre>
<h2 style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; border-bottom-color: rgb(234, 236, 239); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 1.5em; font-style: normal; font-variant-caps: normal; font-weight: 600; letter-spacing: normal; line-height: 1.25; margin-bottom: 16px; margin-top: 24px; orphans: auto; padding-bottom: 0.3em; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<a class="anchor" href="https://gist.github.com/cdivilly/8082bece0ad8f819a6b4a3630699ed46#move-the-database-binaries-to-the-correct-location" id="user-content-move-the-database-binaries-to-the-correct-location" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration: none;"><svg class="octicon octicon-link" height="16" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>Move the Database Binaries to the correct location</h2>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
To build the Docker image, you'll use a script named<span class="Apple-converted-space"> </span><code style="background-color: rgba(27, 31, 35, 0.0470588); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin: 0px; padding: 0.2em 0.4em;">buildDockerImage.sh</code>, for this script to work the Oracle Database binaries need to be placed in the correct location, for example:</div>
<pre style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #f6f8fa; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 1.45; margin-bottom: 16px; margin-top: 0px; orphans: auto; overflow: auto; padding: 16px; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; word-wrap: normal;"><code style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; line-height: inherit; margin: 0px; overflow: visible; padding: 0px; white-space: pre; word-break: normal; word-wrap: normal;">cd ~/work/docker/docker-images-master/OracleDatabase/
mv ~/Downloads/linuxx64_12201_database.zip ./12.2.0.1
</code></pre>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
This places the ZIP archive containing the Oracle Database binaries in the expected<span class="Apple-converted-space"> </span><code style="background-color: rgba(27, 31, 35, 0.0470588); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin: 0px; padding: 0.2em 0.4em;">12.2.0.1</code><span class="Apple-converted-space"> </span>sub-folder</div>
<h2 style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; border-bottom-color: rgb(234, 236, 239); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 1.5em; font-style: normal; font-variant-caps: normal; font-weight: 600; letter-spacing: normal; line-height: 1.25; margin-bottom: 16px; margin-top: 24px; orphans: auto; padding-bottom: 0.3em; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<a class="anchor" href="https://gist.github.com/cdivilly/8082bece0ad8f819a6b4a3630699ed46#configure-the-proxy-if-necessary" id="user-content-configure-the-proxy-if-necessary" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration: none;"><svg class="octicon octicon-link" height="16" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>Configure the Proxy if necessary</h2>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
If you're behind a proxy, you'll need to ensure the<span class="Apple-converted-space"> </span><code style="background-color: rgba(27, 31, 35, 0.0470588); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin: 0px; padding: 0.2em 0.4em;">http_proxy</code><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><code style="background-color: rgba(27, 31, 35, 0.0470588); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin: 0px; padding: 0.2em 0.4em;">https_proxy</code><span class="Apple-converted-space"> </span>environment variables are set, so the proxy configuration can be propagated to the created Docker Container. If this is not done correctly then<span class="Apple-converted-space"> </span><code style="background-color: rgba(27, 31, 35, 0.0470588); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin: 0px; padding: 0.2em 0.4em;">yum</code><span class="Apple-converted-space"> </span>will not be able to reach any repositories.</div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
For example:</div>
<pre style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #f6f8fa; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 1.45; margin-bottom: 16px; margin-top: 0px; orphans: auto; overflow: auto; padding: 16px; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; word-wrap: normal;"><code style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; line-height: inherit; margin: 0px; overflow: visible; padding: 0px; white-space: pre; word-break: normal; word-wrap: normal;">export http_proxy=http://someproxy.corpdomain.com:80
export https_proxy=http://someproxy.corpdomain.com:80
</code></pre>
<h2 style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; border-bottom-color: rgb(234, 236, 239); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 1.5em; font-style: normal; font-variant-caps: normal; font-weight: 600; letter-spacing: normal; line-height: 1.25; margin-bottom: 16px; margin-top: 24px; orphans: auto; padding-bottom: 0.3em; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<a class="anchor" href="https://gist.github.com/cdivilly/8082bece0ad8f819a6b4a3630699ed46#build-the-docker-image" id="user-content-build-the-docker-image" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration: none;"><svg class="octicon octicon-link" height="16" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>Build the Docker Image</h2>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
To build the Docker image use the<span class="Apple-converted-space"> </span><code style="background-color: rgba(27, 31, 35, 0.0470588); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin: 0px; padding: 0.2em 0.4em;">buildDockerImage.sh</code><span class="Apple-converted-space"> </span>script, it's usage is described in the<span class="Apple-converted-space"> </span><a href="https://github.com/oracle/docker-images/blob/master/OracleDatabase/README.md" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration: none;">README</a>. First let's ensure the script is executable:</div>
<pre style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #f6f8fa; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 1.45; margin-bottom: 16px; margin-top: 0px; orphans: auto; overflow: auto; padding: 16px; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; word-wrap: normal;"><code style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; line-height: inherit; margin: 0px; overflow: visible; padding: 0px; white-space: pre; word-break: normal; word-wrap: normal;">cd ~/work/docker/docker-images-master/OracleDatabase/
chmod +x ./buildDockerImage.sh
</code></pre>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
Next invoke the script to build the image, to build a 12.2.0.1 enterprise edition image:</div>
<pre style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #f6f8fa; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 1.45; margin-bottom: 16px; margin-top: 0px; orphans: auto; overflow: auto; padding: 16px; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; word-wrap: normal;"><code style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; line-height: inherit; margin: 0px; overflow: visible; padding: 0px; white-space: pre; word-break: normal; word-wrap: normal;">cd ~/work/docker/docker-images-master/OracleDatabase/
./buildDockerImage.sh -v 12.2.0.1 -e
</code></pre>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
Go get a coffee, this step takes a while, for me it took about 16 minutes.</div>
<h2 style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; border-bottom-color: rgb(234, 236, 239); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 1.5em; font-style: normal; font-variant-caps: normal; font-weight: 600; letter-spacing: normal; line-height: 1.25; margin-bottom: 16px; margin-top: 24px; orphans: auto; padding-bottom: 0.3em; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<a class="anchor" href="https://gist.github.com/cdivilly/8082bece0ad8f819a6b4a3630699ed46#run-the-docker-image" id="user-content-run-the-docker-image" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration: none;"><svg class="octicon octicon-link" height="16" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>Run the Docker Image</h2>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
When it comes to running the Docker Image, you have several choices to make, read the<span class="Apple-converted-space"> </span><a href="https://github.com/oracle/docker-images/tree/master/OracleDatabase#running-oracle-database-in-a-docker-container" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration: none;">docs</a><span class="Apple-converted-space"> </span>for more detail on this. I'm only going to change a few things:</div>
<ul style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; padding-left: 2em; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<li style="box-sizing: border-box;">set the name of the PDB created to<span class="Apple-converted-space"> </span><code style="background-color: rgba(27, 31, 35, 0.0470588); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin: 0px; padding: 0.2em 0.4em;">ORCL</code></li>
<li style="box-sizing: border-box; margin-top: 0.25em;">Store the database data on the host machine, this enables me to blow away the docker container at any time and re-create it without losing any data. In effect I'm separating the database 'engine' (the docker container) from the database storage (the volume on the host where the database storage is persisted).</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">Configure the Database to use Extended Data Types (increase max VARCHAR2 to 32767 bytes).</li>
</ul>
<h3 style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 1.25em; font-style: normal; font-variant-caps: normal; font-weight: 600; letter-spacing: normal; line-height: 1.25; margin-bottom: 16px; margin-top: 24px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<a class="anchor" href="https://gist.github.com/cdivilly/8082bece0ad8f819a6b4a3630699ed46#prepare-the-storage-volume" id="user-content-prepare-the-storage-volume" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration: none;"><svg class="octicon octicon-link" height="16" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>Prepare the storage volume</h3>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
I created a folder within my home folder:</div>
<pre style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #f6f8fa; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 1.45; margin-bottom: 16px; margin-top: 0px; orphans: auto; overflow: auto; padding: 16px; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; word-wrap: normal;"><code style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; line-height: inherit; margin: 0px; overflow: visible; padding: 0px; white-space: pre; word-break: normal; word-wrap: normal;">cd ~/work/docker
mkdir oradata
</code></pre>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
Note the documentation states this folder must be owned by an operating system user named<span class="Apple-converted-space"> </span><code style="background-color: rgba(27, 31, 35, 0.0470588); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin: 0px; padding: 0.2em 0.4em;">oracle</code>. On my Mac OS host, I found I didn't need to create an<span class="Apple-converted-space"> </span><code style="background-color: rgba(27, 31, 35, 0.0470588); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin: 0px; padding: 0.2em 0.4em;">oracle</code><span class="Apple-converted-space"> </span>user or give it ownership of this folder.</div>
<h3 style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 1.25em; font-style: normal; font-variant-caps: normal; font-weight: 600; letter-spacing: normal; line-height: 1.25; margin-bottom: 16px; margin-top: 24px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<a class="anchor" href="https://gist.github.com/cdivilly/8082bece0ad8f819a6b4a3630699ed46#extended-data-types" id="user-content-extended-data-types" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration: none;"><svg class="octicon octicon-link" height="16" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>Extended Data Types</h3>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
In 12.1 and later VARCHAR2 fields can be configured to hold up to 32K bytes. However this feature is off by default, so we need to do some scripting to reconfigure the database to use extended data types. We want these scripts to run after the database is first setup, so we'll mount a volume as part of the<span class="Apple-converted-space"> </span><code style="background-color: rgba(27, 31, 35, 0.0470588); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin: 0px; padding: 0.2em 0.4em;">docker run</code><span class="Apple-converted-space"> </span>command which will cause those scripts to be executed.</div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
The script needed is attached to this gist, so first ensure you have downloaded this script into a folder. The easiest way to do this is to click the 'Download ZIP' button at the top right of this page and then unzip the downloaded archive into a folder, for example:</div>
<pre style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #f6f8fa; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 1.45; margin-bottom: 16px; margin-top: 0px; orphans: auto; overflow: auto; padding: 16px; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; word-wrap: normal;"><code style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; line-height: inherit; margin: 0px; overflow: visible; padding: 0px; white-space: pre; word-break: normal; word-wrap: normal;">cd ~/work/docker
mkdir db_setup_scripts
cd db_setup_scripts
unzip -j ~/Downloads/8082bece*.zip
</code></pre>
<ul style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; padding-left: 2em; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<li style="box-sizing: border-box;">We use the<span class="Apple-converted-space"> </span><code style="background-color: rgba(27, 31, 35, 0.0470588); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin: 0px; padding: 0.2em 0.4em;">-j</code><span class="Apple-converted-space"> </span>option to tell unzip not to bother recreating the directory structure of the archive</li>
</ul>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
We want to make sure any shell scripts are executable in the docker container, and remove unecessary files:</div>
<pre style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #f6f8fa; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 1.45; margin-bottom: 16px; margin-top: 0px; orphans: auto; overflow: auto; padding: 16px; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; word-wrap: normal;"><code style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; line-height: inherit; margin: 0px; overflow: visible; padding: 0px; white-space: pre; word-break: normal; word-wrap: normal;">cd ~/work/docker/db_setup_scripts
chmod +x *.sh
rm *.md
</code></pre>
<h3 style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 1.25em; font-style: normal; font-variant-caps: normal; font-weight: 600; letter-spacing: normal; line-height: 1.25; margin-bottom: 16px; margin-top: 24px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<a class="anchor" href="https://gist.github.com/cdivilly/8082bece0ad8f819a6b4a3630699ed46#run-the-container" id="user-content-run-the-container" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration: none;"><svg class="octicon octicon-link" height="16" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>Run the container</h3>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
Now we are all prepared, we can tell Docker to run the image, we'll give the container a name as well:</div>
<pre style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #f6f8fa; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 1.45; margin-bottom: 16px; margin-top: 0px; orphans: auto; overflow: auto; padding: 16px; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; word-wrap: normal;"><code style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; line-height: inherit; margin: 0px; overflow: visible; padding: 0px; white-space: pre; word-break: normal; word-wrap: normal;">docker run --name oracle -p 1521:1521 -e ORACLE_PDB=ORCL \
-v ~/work/docker/oradata:/opt/oracle/oradata \
-v ~/work/docker/db_setup_scripts:/opt/oracle/scripts/setup \
oracle/database:12.2.0.1-ee
</code></pre>
<ul style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; padding-left: 2em; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<li style="box-sizing: border-box;">The<span class="Apple-converted-space"> </span><code style="background-color: rgba(27, 31, 35, 0.0470588); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin: 0px; padding: 0.2em 0.4em;">-name</code><span class="Apple-converted-space"> </span>argument names the container</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">The<span class="Apple-converted-space"> </span><code style="background-color: rgba(27, 31, 35, 0.0470588); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin: 0px; padding: 0.2em 0.4em;">-e</code><span class="Apple-converted-space"> </span>arguments passed an environment variable that renames the created PDB to<span class="Apple-converted-space"> </span><code style="background-color: rgba(27, 31, 35, 0.0470588); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin: 0px; padding: 0.2em 0.4em;">ORCL</code><span class="Apple-converted-space"> </span>(the default is<span class="Apple-converted-space"> </span><code style="background-color: rgba(27, 31, 35, 0.0470588); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin: 0px; padding: 0.2em 0.4em;">ORCLPDB1</code>)</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">The first<span class="Apple-converted-space"> </span><code style="background-color: rgba(27, 31, 35, 0.0470588); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin: 0px; padding: 0.2em 0.4em;">-v</code><span class="Apple-converted-space"> </span>argument mounts the folder to store the database data</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">The second<span class="Apple-converted-space"> </span><code style="background-color: rgba(27, 31, 35, 0.0470588); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin: 0px; padding: 0.2em 0.4em;">-v</code><span class="Apple-converted-space"> </span>argument mounts the folder containing the scripts to convert the database to use extended data types</li>
</ul>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
Time for another coffee, creating the initial database takes time. After a while the database will have been created, and the script to enable extended data types will have been executed</div>
<h2 style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; border-bottom-color: rgb(234, 236, 239); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 1.5em; font-style: normal; font-variant-caps: normal; font-weight: 600; letter-spacing: normal; line-height: 1.25; margin-bottom: 16px; margin-top: 24px; orphans: auto; padding-bottom: 0.3em; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<a class="anchor" href="https://gist.github.com/cdivilly/8082bece0ad8f819a6b4a3630699ed46#managing-the-container" id="user-content-managing-the-container" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration: none;"><svg class="octicon octicon-link" height="16" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>Managing the Container</h2>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
Once the initial setup of the database has completed, I like to stop the container and then start it again to leave it running in the background. To do this, in another terminal do the following:</div>
<pre style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #f6f8fa; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 1.45; margin-bottom: 16px; margin-top: 0px; orphans: auto; overflow: auto; padding: 16px; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; word-wrap: normal;"><code style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; line-height: inherit; margin: 0px; overflow: visible; padding: 0px; white-space: pre; word-break: normal; word-wrap: normal;">docker stop oracle
docker start oracle
</code></pre>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
or simply:</div>
<pre style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #f6f8fa; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 1.45; margin-bottom: 16px; margin-top: 0px; orphans: auto; overflow: auto; padding: 16px; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; word-wrap: normal;"><code style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; line-height: inherit; margin: 0px; overflow: visible; padding: 0px; white-space: pre; word-break: normal; word-wrap: normal;">docker restart oracle
</code></pre>
<h3 style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 1.25em; font-style: normal; font-variant-caps: normal; font-weight: 600; letter-spacing: normal; line-height: 1.25; margin-bottom: 16px; margin-top: 24px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<a class="anchor" href="https://gist.github.com/cdivilly/8082bece0ad8f819a6b4a3630699ed46#deleting-the-container" id="user-content-deleting-the-container" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration: none;"><svg class="octicon octicon-link" height="16" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>Deleting the Container</h3>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
If you ever need to get rid of the container, then the following will remove the container, you can recreate it again using docker run:</div>
<pre style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #f6f8fa; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 1.45; margin-bottom: 16px; margin-top: 0px; orphans: auto; overflow: auto; padding: 16px; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; word-wrap: normal;"><code style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; line-height: inherit; margin: 0px; overflow: visible; padding: 0px; white-space: pre; word-break: normal; word-wrap: normal;">docker stop oracle
docker rm oracle
</code></pre>
<h2 style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; border-bottom-color: rgb(234, 236, 239); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 1.5em; font-style: normal; font-variant-caps: normal; font-weight: 600; letter-spacing: normal; line-height: 1.25; margin-bottom: 16px; margin-top: 24px; orphans: auto; padding-bottom: 0.3em; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<a class="anchor" href="https://gist.github.com/cdivilly/8082bece0ad8f819a6b4a3630699ed46#connecting-to-the-database" id="user-content-connecting-to-the-database" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration: none;"><svg class="octicon octicon-link" height="16" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>Connecting to the Database</h2>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
You can use the<span class="Apple-converted-space"> </span><code style="background-color: rgba(27, 31, 35, 0.0470588); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin: 0px; padding: 0.2em 0.4em;">sqlplus</code><span class="Apple-converted-space"> </span>as described in the<span class="Apple-converted-space"> </span><a href="https://github.com/oracle/docker-images/tree/master/OracleDatabase#running-oracle-database-in-a-docker-container" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration: none;">docker images documentation</a><span class="Apple-converted-space"> </span>but it's a bit hard to use because it can only read from the filesystem within the container. Much better to use it's more modern relative,<span class="Apple-converted-space"> </span><a href="http://www.oracle.com/technetwork/developer-tools/sqlcl/overview/index.html" rel="nofollow" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration: none;">SQLcl</a>, which will run anywhere you can run Java, and doesn't require an Oracle Client install, so it's super easy to get working, and especially handy for Mac users.</div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
Since we have port forwarded the container's 1521 port to our host's 1521 port, we can use<span class="Apple-converted-space"> </span><code style="background-color: rgba(27, 31, 35, 0.0470588); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin: 0px; padding: 0.2em 0.4em;">sqlcl</code><span class="Apple-converted-space"> </span>to connect to the database as follows:</div>
<h3 style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 1.25em; font-style: normal; font-variant-caps: normal; font-weight: 600; letter-spacing: normal; line-height: 1.25; margin-bottom: 16px; margin-top: 24px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<a class="anchor" href="https://gist.github.com/cdivilly/8082bece0ad8f819a6b4a3630699ed46#connect-to-the-cdb" id="user-content-connect-to-the-cdb" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration: none;"><svg class="octicon octicon-link" height="16" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>Connect to the CDB</h3>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
To Connect to the CDB, just do the following:</div>
<pre style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #f6f8fa; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 1.45; margin-bottom: 16px; margin-top: 0px; orphans: auto; overflow: auto; padding: 16px; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; word-wrap: normal;"><code style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; line-height: inherit; margin: 0px; overflow: visible; padding: 0px; white-space: pre; word-break: normal; word-wrap: normal;">sql system
SQLcl: Release 4.2.0.16.043.0306 RC on Fri Sep 08 18:10:52 2017
Copyright (c) 1982, 2017, Oracle. All rights reserved.
Password? (**********?) ******
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL>
</code></pre>
<h3 style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 1.25em; font-style: normal; font-variant-caps: normal; font-weight: 600; letter-spacing: normal; line-height: 1.25; margin-bottom: 16px; margin-top: 24px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<a class="anchor" href="https://gist.github.com/cdivilly/8082bece0ad8f819a6b4a3630699ed46#connect-to-the-pdb" id="user-content-connect-to-the-pdb" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration: none;"><svg class="octicon octicon-link" height="16" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>Connect to the PDB</h3>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 16px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
To connect to the PDB, just do the following:</div>
<pre style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #f6f8fa; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: 1.45; margin-bottom: 0px !important; margin-top: 0px; orphans: auto; overflow: auto; padding: 16px; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; word-wrap: normal;"><code style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; line-height: inherit; margin: 0px; overflow: visible; padding: 0px; white-space: pre; word-break: normal; word-wrap: normal;">sql system@//localhost:1521/orcl
SQLcl: Release 4.2.0.16.043.0306 RC on Fri Sep 08 18:12:29 2017
Copyright (c) 1982, 2017, Oracle. All rights reserved.
Password? (**********?) ******
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> </code></pre>
Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com5Letfern Rd, Seskinore, Omagh BT78 2QA, UK54.5223114 -7.265603100000021254.513095899999996 -7.2857731000000214 54.5315269 -7.2454331000000209tag:blogger.com,1999:blog-1555497785494345295.post-80997912635365472782017-09-07T07:09:00.003-07:002017-09-07T07:09:59.985-07:00Oracle REST JDBC Driver and SQLclOracle just released its first REST JDBC driver on OTN, in conjunction with the 17.3.0 Oracle REST Data Services Beta release.<br />
<br />
<a href="http://dermotoneill.blogspot.co.uk/2017/09/getting-started-with-rest-enabled-sql.html" target="_blank">Dermot posted this morning</a> about how to setup ORDS and Enable REST SQL Statements. The JDBC driver connects to this service and allows you to connect your JDBC based program to a REST services.<br />
<br />
As an example of this working with a standard application we can download the driver and drop it into Oracle SQLcl and connect to a service out of the box.<br />
<br />
<br />
<ul>
<li>Firstly download <a href="http://www.oracle.com/technetwork/developer-tools/sqlcl/downloads/index.html" target="_blank">SQLcl from OTN</a> </li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/-C6pw9h1dCrE/WbFPJJtm6AI/AAAAAAAADG8/EWnwkT64D-Id_CiRC8gCaAvUZ4wqv5zSgCLcBGAs/s1600/Screen%2BShot%2B2017-09-07%2Bat%2B11.52.29.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="434" data-original-width="759" height="364" src="https://2.bp.blogspot.com/-C6pw9h1dCrE/WbFPJJtm6AI/AAAAAAAADG8/EWnwkT64D-Id_CiRC8gCaAvUZ4wqv5zSgCLcBGAs/s640/Screen%2BShot%2B2017-09-07%2Bat%2B11.52.29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li>Unzip the sqlcl-17.2.0.184.1230-no-jre.zip</li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /><a href="https://3.bp.blogspot.com/-gDK2XlqfZi4/WbFPJCe2YII/AAAAAAAADHA/-AmJ7-8LxiEHi4C9fkTYuPx0CqLZgDPpwCLcBGAs/s1600/Screen%2BShot%2B2017-09-07%2Bat%2B12.00.38.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="382" data-original-width="821" height="296" src="https://3.bp.blogspot.com/-gDK2XlqfZi4/WbFPJCe2YII/AAAAAAAADHA/-AmJ7-8LxiEHi4C9fkTYuPx0CqLZgDPpwCLcBGAs/s640/Screen%2BShot%2B2017-09-07%2Bat%2B12.00.38.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<ul>
<li style="text-align: left;">Download the <a href="http://www.oracle.com/technetwork/developer-tools/rest-data-services/downloads/ords-beta-173-3873522.html" target="_blank">JDBC Beta Driver from OTN </a></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-2a_checL4Dw/WbFPJSaG2HI/AAAAAAAADHE/-j5aI2iGQQoRwoV0znhkKfAJlKIbCl96ACLcBGAs/s1600/Screen%2BShot%2B2017-09-07%2Bat%2B11.39.59.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="559" data-original-width="783" height="456" src="https://4.bp.blogspot.com/-2a_checL4Dw/WbFPJSaG2HI/AAAAAAAADHE/-j5aI2iGQQoRwoV0znhkKfAJlKIbCl96ACLcBGAs/s640/Screen%2BShot%2B2017-09-07%2Bat%2B11.39.59.png" width="640" /></a></div>
<br />
<ul>
<li> and drop it into the SQLcl lib directory</li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://2.bp.blogspot.com/-qT-ykGvPeCA/WbFRRqXWYmI/AAAAAAAADHQ/KmgpJE4N6dUBAKfyGthQgUPw49ER-rmUQCLcBGAs/s1600/Screen%2BShot%2B2017-09-07%2Bat%2B15.00.43.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="85" data-original-width="1341" height="40" src="https://2.bp.blogspot.com/-qT-ykGvPeCA/WbFRRqXWYmI/AAAAAAAADHQ/KmgpJE4N6dUBAKfyGthQgUPw49ER-rmUQCLcBGAs/s640/Screen%2BShot%2B2017-09-07%2Bat%2B15.00.43.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li>Lastly start sqlcl with your appropriate URL, in my case is demo/demo@http://<myhost:port>/ords/<schema>/</schema></myhost:port></li>
</ul>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-Ko0c-6WHc1I/WbFPCDZ4ecI/AAAAAAAADG4/v7ys_0Q1Nv8d5OIelsN8LWkHYSjJm9q4gCLcBGAs/s1600/Screen%2BShot%2B2017-09-07%2Bat%2B12.35.54.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="907" data-original-width="1256" height="460" src="https://4.bp.blogspot.com/-Ko0c-6WHc1I/WbFPCDZ4ecI/AAAAAAAADG4/v7ys_0Q1Nv8d5OIelsN8LWkHYSjJm9q4gCLcBGAs/s640/Screen%2BShot%2B2017-09-07%2Bat%2B12.35.54.png" width="640" /></a></div>
<br />
<br />Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com0Omagh, UK54.5977149 -7.309959700000035854.5609239 -7.390640700000036 54.6345059 -7.2292787000000356tag:blogger.com,1999:blog-1555497785494345295.post-50157833957536624602017-09-07T03:09:00.000-07:002017-09-07T03:09:28.548-07:00SQLcl Embedded JREsWhen you are restrained in the JRE that you can use with SQLcl, you can embed your own in the sqlcl directory tree. We currently support 1.8 meaning that if you run with 1.7, you're going to have problems.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-9cA0BR3wzCY/WbEYbUZol9I/AAAAAAAADGg/kBwzefRZLh4rA7sqYb9c4FXS0j4VGZZkACLcBGAs/s1600/Screen%2BShot%2B2017-09-07%2Bat%2B10.52.19.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="197" data-original-width="567" height="111" src="https://3.bp.blogspot.com/-9cA0BR3wzCY/WbEYbUZol9I/AAAAAAAADGg/kBwzefRZLh4rA7sqYb9c4FXS0j4VGZZkACLcBGAs/s320/Screen%2BShot%2B2017-09-07%2Bat%2B10.52.19.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
When you look inside a sqlcl distribution, you will see the bin and lib directory. </div>
<div class="separator" style="clear: both; text-align: left;">
Go grab a jre from somewhere, In my case, I'm getting it from my installed jdk</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-x2PeP-xiJk4/WbEYba9rehI/AAAAAAAADGc/PPPPwDAIwHolOyq0RrBl_bHVw_vmXCU5QCLcBGAs/s1600/Screen%2BShot%2B2017-09-07%2Bat%2B10.54.57.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="283" data-original-width="1197" height="75" src="https://4.bp.blogspot.com/-x2PeP-xiJk4/WbEYba9rehI/AAAAAAAADGc/PPPPwDAIwHolOyq0RrBl_bHVw_vmXCU5QCLcBGAs/s320/Screen%2BShot%2B2017-09-07%2Bat%2B10.54.57.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Zip up the JRE and unzip it in the top level sqlcl directory. You should have a structure like this now.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-kHAPhCG5Z5Y/WbEYbqECA_I/AAAAAAAADGk/EF0pyrt9yTUhTVnSQM6d-68cbHTuKNiUwCLcBGAs/s1600/Screen%2BShot%2B2017-09-07%2Bat%2B10.57.40.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="143" data-original-width="594" height="77" src="https://1.bp.blogspot.com/-kHAPhCG5Z5Y/WbEYbqECA_I/AAAAAAAADGk/EF0pyrt9yTUhTVnSQM6d-68cbHTuKNiUwCLcBGAs/s320/Screen%2BShot%2B2017-09-07%2Bat%2B10.57.40.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Test what you have now by running SQLcl. I'm doing a silent run to test it works for a start and also to check where the java is coming from. If you type 'show java' you'll get a lot of information about what is running and where it is.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-AP7Q6LjFpJE/WbEYb0N8BwI/AAAAAAAADGo/kDccTRHiKLgLXbnNFOMCvFeMIw-d11CfACLcBGAs/s1600/Screen%2BShot%2B2017-09-07%2Bat%2B10.58.40.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="290" data-original-width="683" height="135" src="https://4.bp.blogspot.com/-AP7Q6LjFpJE/WbEYb0N8BwI/AAAAAAAADGo/kDccTRHiKLgLXbnNFOMCvFeMIw-d11CfACLcBGAs/s320/Screen%2BShot%2B2017-09-07%2Bat%2B10.58.40.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
You can see here that the JRE from the installtion is being used so you can now drop this in another environment and run normally.</div>
<br />Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com0Omagh, UK54.5977149 -7.309959700000035854.5609239 -7.390640700000036 54.6345059 -7.2292787000000356tag:blogger.com,1999:blog-1555497785494345295.post-16460683753431583162016-06-16T05:19:00.000-07:002016-06-16T05:19:01.281-07:00Developer Days VM Startup and Shutdown, SQLclIf you're developing on a remote platform, chances are that you are using a Virtual Machine. (VM) In Oracle, we release a virtual machine called the "<a href="http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html" target="_blank">Oracle Developer Days</a>". This is available on the <a href="http://www.oracle.com/technetwork/index.html" target="_blank">Oracle Technology Network</a> and ala <a href="http://bfy.tw/6IUN" target="_blank">google</a>. Todays hack is setting up headless vm's, ports and aliases to speed up your day. (This post took a lot longer to write that the aliases we set up!)<br />
<br />
For this virtual machine on <a href="https://www.virtualbox.org/" target="_blank">Virtual Box</a>, we have a bunch of cool stuff to get your teeth into, prebuilt and configured, ready to go. Most of the time, we all start our VM from the virtual box front end like this from the application and use the guy front end into the VM.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-Y_FOP0KlxIg/V2KITkNHiYI/AAAAAAAADA8/z-Gg_6Cbnh4rZZhnYFXazMDh0VZuZYZ2wCK4B/s1600/Screen%2BShot%2B2016-06-16%2Bat%2B12.06.24.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="163" src="https://2.bp.blogspot.com/-Y_FOP0KlxIg/V2KITkNHiYI/AAAAAAAADA8/z-Gg_6Cbnh4rZZhnYFXazMDh0VZuZYZ2wCK4B/s320/Screen%2BShot%2B2016-06-16%2Bat%2B12.06.24.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
You can click on the network tab and click port forwarding to see how you are allowing access to this virtual machine.<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-hUcaABA3b2U/V2KJ_AinjEI/AAAAAAAADBI/oAxziTZoH908zHxzojHmy4XAmn6LsPGaQCK4B/s1600/Screen%2BShot%2B2016-06-16%2Bat%2B12.13.24.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="237" src="https://4.bp.blogspot.com/-hUcaABA3b2U/V2KJ_AinjEI/AAAAAAAADBI/oAxziTZoH908zHxzojHmy4XAmn6LsPGaQCK4B/s320/Screen%2BShot%2B2016-06-16%2Bat%2B12.13.24.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-hUcaABA3b2U/V2KJ_AinjEI/AAAAAAAADBI/oAxziTZoH908zHxzojHmy4XAmn6LsPGaQCK4B/s1600/Screen%2BShot%2B2016-06-16%2Bat%2B12.13.24.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a><a href="http://3.bp.blogspot.com/-bgoXPHA8Ffg/V2KKnYjpoaI/AAAAAAAADBY/iJ_af0LPGs4P8l2v1DgAuEjBWEE2ZCjMgCK4B/s1600/Screen%2BShot%2B2016-06-16%2Bat%2B12.13.34.png" imageanchor="1"><img border="0" height="205" src="https://3.bp.blogspot.com/-bgoXPHA8Ffg/V2KKnYjpoaI/AAAAAAAADBY/iJ_af0LPGs4P8l2v1DgAuEjBWEE2ZCjMgCK4B/s320/Screen%2BShot%2B2016-06-16%2Bat%2B12.13.34.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Clicking on your VM in the user interface, you can start it up and get the full GUI to work from.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-cOxc1BxjD8I/V2KNBB3gHyI/AAAAAAAADBo/oICwRMJOiEwyULABcDePAjd-8e4evrlfwCK4B/s1600/Untitled.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="" border="0" height="273" src="https://1.bp.blogspot.com/-cOxc1BxjD8I/V2KNBB3gHyI/AAAAAAAADBo/oICwRMJOiEwyULABcDePAjd-8e4evrlfwCK4B/s400/Untitled.gif" title="" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Normal VM startup within the GUI</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: left;">
This takes a while and has to be done every time you are starting up which is too many times. Like any engineer, we are all trying to reduce the number of times we have to do the same thing so I like to make these into command line calls and make the GUI disappear so we can ssh into the virtual machine.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
From above, we can see that ssh is mapped to port 2222 on the host for this guest virtual machine so there should be no issues in working this way. To startup your VM from the command line like above, run this below (obviously changing the name of your VM before you do!) This will open a window and startup your VM.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">vboxmanage startvm "Oracle DB Developer VM" --type=gui</span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
You can also start up your virtual machine in a headless session, you can run this command, very similar to the one above to do that.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="background-color: black; color: #34bd26; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="color: #828282; font-variant-ligatures: no-common-ligatures;">(</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">bamcgill</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">@</span><span style="font-variant-ligatures: no-common-ligatures;">daedalus</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">)–(</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">0</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">|</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">ttys001</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">|</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">-bash</span><span style="color: whitesmoke; font-variant-ligatures: no-common-ligatures;">)</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="color: #828282; font-variant-ligatures: no-common-ligatures;">(</span><span style="color: #d53bd3; font-variant-ligatures: no-common-ligatures;">~</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">)</span><span style="font-variant-ligatures: no-common-ligatures;"> $vboxmanage startvm "Oracle DB Developer VM" --type headless</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">Waiting for VM "Oracle DB Developer VM" to power on...</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">VM "Oracle DB Developer VM" has been successfully started.</span></div>
<div style="background-color: black; color: #34bd26; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="color: #828282; font-variant-ligatures: no-common-ligatures;">(</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">bamcgill</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">@</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;"><span style="color: #34bd26;"> daedalus</span>)–(</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">0</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">|</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">ttys001</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">|</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">-bash</span><span style="color: whitesmoke; font-variant-ligatures: no-common-ligatures;">)</span></div>
<div class="separator" style="clear: both;">
</div>
<div style="background-color: black; color: #828282; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">(</span><span style="color: #d53bd3; font-variant-ligatures: no-common-ligatures;">~</span><span style="font-variant-ligatures: no-common-ligatures;">)</span><span style="color: whitesmoke; font-variant-ligatures: no-common-ligatures;"> $</span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
and thats it. the machine will boot, start the database and start the listeners. you can then ssh into your machine like this.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="background-color: black; color: #34bd26; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="color: #828282; font-variant-ligatures: no-common-ligatures;">(</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">bamcgill</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">@</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;"><span style="color: #34bd26;"> daedalus</span>)–(</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">0</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">|</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">ttys001</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">|</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">-bash</span><span style="color: whitesmoke; font-variant-ligatures: no-common-ligatures;">)</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="color: #828282; font-variant-ligatures: no-common-ligatures;">(</span><span style="color: #d53bd3; font-variant-ligatures: no-common-ligatures;">~</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">)</span><span style="font-variant-ligatures: no-common-ligatures;"> $ssh -p 2222 oracle@localhost</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">oracle@localhost's password: </span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">Last login: Thu Jun 16 07:35:21 2016</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">[oracle@vbgeneric ~]$ sqlplus barry/oracle</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal; min-height: 17px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">SQL*Plus: Release 12.1.0.2.0 Production on Thu Jun 16 07:38:20 2016</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal; min-height: 17px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">Copyright (c) 1982, 2014, Oracle. All rights reserved.</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal; min-height: 17px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">Last Successful login time: Thu Jun 16 2016 06:30:17 -04:00</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal; min-height: 17px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">Connected to:</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal; min-height: 17px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">SQL> Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">[oracle@vbgeneric ~]$ logout</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">Connection to localhost closed.</span></div>
<div style="background-color: black; color: #34bd26; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="color: #828282; font-variant-ligatures: no-common-ligatures;">(</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">bamcgill</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">@</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;"><span style="color: #34bd26;">daedalus</span>)–(</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">0</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">|</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">ttys001</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">|</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">-bash</span><span style="color: whitesmoke; font-variant-ligatures: no-common-ligatures;">)</span></div>
<div class="separator" style="clear: both;">
</div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="color: #828282; font-variant-ligatures: no-common-ligatures;">(</span><span style="color: #d53bd3; font-variant-ligatures: no-common-ligatures;">~</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">)</span><span style="font-variant-ligatures: no-common-ligatures;"> $</span></div>
<div>
<span style="font-variant-ligatures: no-common-ligatures;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
All very cool and means I can have aliases setup to do this too so I don't have to remember all the long bits of a vboxmanage statement!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="background-color: black; color: #34bd26; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="color: #828282; font-variant-ligatures: no-common-ligatures;">(</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">bamcgill</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">@</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;"><span style="color: #34bd26;">daedalus</span>)–(</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">0</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">|</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">ttys001</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">|</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">-bash</span><span style="color: whitesmoke; font-variant-ligatures: no-common-ligatures;">)</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="color: #828282; font-variant-ligatures: no-common-ligatures;">(</span><span style="color: #d53bd3; font-variant-ligatures: no-common-ligatures;">~</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">)</span><span style="font-variant-ligatures: no-common-ligatures;"> $alias | grep vbox</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">alias headless='vboxmanage startvm "Oracle DB Developer VM" --type headless'</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">alias poweroff='vboxmanage controlvm "Oracle DB Developer VM" poweroff'</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">alias startvm='vboxmanage startvm "Oracle DB Developer VM" --type=gui'</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">alias vboxsave='vboxmanage controlvm "Oracle DB Developer VM" savestate'</span></div>
<div style="background-color: black; color: #34bd26; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="color: #828282; font-variant-ligatures: no-common-ligatures;">(</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">bamcgill</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">@</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;"><span style="color: #34bd26;">daedalus</span>)–(</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">0</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">|</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">ttys001</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">|</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">-bash</span><span style="color: whitesmoke; font-variant-ligatures: no-common-ligatures;">)</span></div>
<div class="separator" style="clear: both;">
</div>
<div style="background-color: black; color: #828282; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">(</span><span style="color: #d53bd3; font-variant-ligatures: no-common-ligatures;">~</span><span style="font-variant-ligatures: no-common-ligatures;">)</span><span style="color: whitesmoke; font-variant-ligatures: no-common-ligatures;"> $</span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>poweroff</b> rips the rug from under the VM and it is reset</div>
<div class="separator" style="clear: both; text-align: left;">
<b>savestate</b> saves the VM like a most recent snapshot and when started again, the VM is refreshed with this state.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
When all this is setup, you can connect with <a href="http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html" target="_blank">SQLcl</a>. By default, sqlcl will look at a few connect strings when you connect, so you can try sql user/password in your host machine.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="background-color: black; color: #34bd26; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="color: #828282; font-variant-ligatures: no-common-ligatures;">(</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">bamcgill</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">@</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;"><span style="color: #34bd26;"> daedalus</span>)–(</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">0</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">|</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">ttys001</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">|</span><span style="color: #ff3b1d; font-variant-ligatures: no-common-ligatures;">-bash</span><span style="color: whitesmoke; font-variant-ligatures: no-common-ligatures;">)</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="color: #828282; font-variant-ligatures: no-common-ligatures;">(</span><span style="color: #d53bd3; font-variant-ligatures: no-common-ligatures;">~</span><span style="color: #828282; font-variant-ligatures: no-common-ligatures;">)</span><span style="font-variant-ligatures: no-common-ligatures;"> $sql barry/oracle</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal; min-height: 17px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">SQLcl: Release 4.2.0.16.167.1601 RC on Thu Jun 16 13:01:44 2016</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal; min-height: 17px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">Copyright (c) 1982, 2016, Oracle. All rights reserved.</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal; min-height: 17px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">Last Successful login time: Thu Jun 16 2016 13:01:44 +01:00</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal; min-height: 17px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">Connected to:</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options</span></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal; min-height: 17px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<div style="background-color: black; color: whitesmoke; font-family: Monaco; font-size: 13px; line-height: normal; min-height: 17px;">
<span style="font-variant-ligatures: no-common-ligatures;"></span><br /></div>
<div class="separator" style="clear: both;">
</div>
<div style="background-color: black; color: #5330e1; font-family: Monaco; font-size: 13px; line-height: normal;">
<span style="color: #c33720; font-variant-ligatures: no-common-ligatures;">BARRY</span><span style="color: whitesmoke; font-variant-ligatures: no-common-ligatures;">@</span><span style="color: #34bd26; font-variant-ligatures: no-common-ligatures;">orcl</span><span style="font-variant-ligatures: no-common-ligatures;">🍻🍺 ></span></div>
<div>
<span style="font-variant-ligatures: no-common-ligatures;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
Fantastic. Look out for more great features on <a href="http://www.oracle.com/technetwork/developer-tools/sql-developer/overview" target="_blank">Oracle SQLcl and SQLDeveloper </a>with <a href="http://krisrice.blogspot.com/" target="_blank">Kris</a>, <a href="http://www.thatjeffsmith.com/" target="_blank">Jeff</a> , <a href="http://dermotoneill.blogspot.co.uk/" target="_blank">Dermot</a> and <a href="http://totierne.blogspot.co.uk/" target="_blank">Turloch</a> </div>
<span style="-webkit-font-smoothing: antialiased; background-color: #bd081c; background-image: url(data:image/svg+xml; background-position: 3px 50%; background-repeat: no-repeat no-repeat; background-size: 14px; border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; border-top-left-radius: 2px; border-top-right-radius: 2px; border: none; color: white; cursor: pointer; display: none; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: bold; left: 153px; line-height: 20px; opacity: 0.85; padding: 0px 4px 0px 0px; position: absolute; text-align: center; text-indent: 20px; top: 917px; width: auto; z-index: 8675309;">Save</span><span style="-webkit-font-smoothing: antialiased; background-color: #bd081c; background-image: url(data:image/svg+xml; background-position: 3px 50%; background-repeat: no-repeat no-repeat; background-size: 14px; border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; border-top-left-radius: 2px; border-top-right-radius: 2px; border: none; color: white; cursor: pointer; display: none; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: bold; left: 153px; line-height: 20px; opacity: 0.85; padding: 0px 4px 0px 0px; position: absolute; text-align: center; text-indent: 20px; top: 917px; width: auto; z-index: 8675309;">Save</span>Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com6Omagh, Omagh, Omagh, UK54.5977149 -7.309959599999956554.5609239 -7.3906405999999567 54.6345059 -7.2292785999999563tag:blogger.com,1999:blog-1555497785494345295.post-47373010191520096482015-10-15T02:19:00.001-07:002015-10-15T02:22:23.533-07:00Wheres my TNS connection? SHOW TNSLots of users have been head scratching as to which tnsnames.ora is being found and used when connecting to the database with SQLDeveloper and with SQLcl.<br />
<br />
In the latest release we've added another new command.<br />
<br />
<div style="text-align: center;">
<b>SHOW TNS</b></div>
<br />
What this will do is walk the locations where we look for tnsnames.ora and list these out in order. Then it will tell you which one the tool will actually use and list the entries for you.<br />
<br />
So, with nothing set, no ORACLE_HOME, no TNS_ADMIN, here's what you get. TNS is going to look in your home directory for a file called tnsnames.ora or .tnsnames.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-UdYeae8THSU/Vh9lb5PbsrI/AAAAAAAAC94/OUlsbUf6OQ4/s1600/Screen%2BShot%2B2015-10-15%2Bat%2B09.35.20.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="http://3.bp.blogspot.com/-UdYeae8THSU/Vh9lb5PbsrI/AAAAAAAAC94/OUlsbUf6OQ4/s400/Screen%2BShot%2B2015-10-15%2Bat%2B09.35.20.png" width="400" /></a></div>
<br />
Now, if we have an ORACLE_HOME set, we'll look for $ORACLE_HOME/network/admin/tnsnames.ora<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-OnpastFr9lg/Vh9l-p-UtOI/AAAAAAAAC-A/pRw_Wjuttlk/s1600/Screen%2BShot%2B2015-10-15%2Bat%2B09.37.53.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="288" src="http://1.bp.blogspot.com/-OnpastFr9lg/Vh9l-p-UtOI/AAAAAAAAC-A/pRw_Wjuttlk/s400/Screen%2BShot%2B2015-10-15%2Bat%2B09.37.53.png" width="400" /></a></div>
<br />
Further, if we set TNS_ADMIN, it will override ORACLE_HOME and go to that location as shown here.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-q6Z6Ou44Du4/Vh9nMMRng_I/AAAAAAAAC-M/WKHl54enLzc/s1600/Screen%2BShot%2B2015-10-15%2Bat%2B09.42.57.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="311" src="http://4.bp.blogspot.com/-q6Z6Ou44Du4/Vh9nMMRng_I/AAAAAAAAC-M/WKHl54enLzc/s400/Screen%2BShot%2B2015-10-15%2Bat%2B09.42.57.png" width="400" /></a></div>
<br />
Lastly, we'll come back to the User directory. If you have a tnsnames.ora there or a .tnsnames, it will override everything and this is what will be used.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-sH5ydJ2SPm0/Vh9oNfSO3wI/AAAAAAAAC-U/GrBlYwfMo2c/s1600/Screen%2BShot%2B2015-10-15%2Bat%2B09.47.28.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="293" src="http://4.bp.blogspot.com/-sH5ydJ2SPm0/Vh9oNfSO3wI/AAAAAAAAC-U/GrBlYwfMo2c/s400/Screen%2BShot%2B2015-10-15%2Bat%2B09.47.28.png" width="400" /></a></div>
<br />
<br />
Now, go ahead and make a connection. You can then do another new command called<br />
<br />
<div style="text-align: center;">
<b>SHOW CONNECTION</b></div>
<br />
which will show you how you are connected and what you are connected to.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-7uui-ls34MQ/Vh9t-qifABI/AAAAAAAAC-g/sSQxGbqPAHg/s1600/2015-10-15%2B10_09_06.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="350" src="http://3.bp.blogspot.com/-7uui-ls34MQ/Vh9t-qifABI/AAAAAAAAC-g/sSQxGbqPAHg/s640/2015-10-15%2B10_09_06.gif" width="640" /></a></div>
<br />
Finally, you can get a look at which driver you are using for a connection using<br />
<br />
<div style="text-align: center;">
<b>SHOW JDBC</b></div>
<br />
which will show something like this, detailing types, versions and the URL of the connection you have.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-xwWQoGzDgrw/Vh9ugloKzGI/AAAAAAAAC-o/R0SYhzz5cP4/s1600/Screen%2BShot%2B2015-10-15%2Bat%2B10.14.13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="221" src="http://2.bp.blogspot.com/-xwWQoGzDgrw/Vh9ugloKzGI/AAAAAAAAC-o/R0SYhzz5cP4/s400/Screen%2BShot%2B2015-10-15%2Bat%2B10.14.13.png" width="400" /></a></div>
<br />Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com1Omagh, UK54.545901281875018 -7.275610379931663454.536690781875016 -7.2957803799316636 54.55511178187502 -7.2554403799316631tag:blogger.com,1999:blog-1555497785494345295.post-75596420792346123752015-05-03T16:39:00.001-07:002015-05-03T16:39:34.306-07:00SQLcl - Cloud connections via Secure Shell tunnelsWe're always trying to make SQLcl easier to connect to your database, whether its at your place or in the cloud. So, one other thing we have added to enable you to drill into your cloud databases is an <b>SSHTUNNEL</b> command. Lets take a look at the help for it, which you can get as follows.<br />
<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>SQL> help sshtunnel
SSHTUNNEL
---------
Creates a tunnel using standard ssh options
such as port forwarding like option -L of the given port on the local host
will be forwarded to the given remote host and port on the remote side. It also supports
identity files, using the ssh -i option
If passwords are required, they will be prompted for.
SSHTUNNEL <username>@<hostname> -i <identity_file> [-L localPort:Remotehost:RemotePort]
Options
-L localPort:Remotehost:Remoteport
Specifies that the given port (localhost) on the local (client) host is to be forwarded to
the given remote host (Remotehost) and port (Remoteport) on the remote side. This works by
allocating a socket to listen to port on the local side.
Whenever a connection is made to this port, the connection is forwarded over
the secure channel, and a connection is made to remote host & remoteport from
the remote machine.
-i identity_file
Selects a file from which the identity (private key) for public key authentication is read.
SQL>
</code></pre>
<br />
So for this to work we need to decide which ports locally we are going to use and which remote machine and port we want to use to map our ports from local to remote. We also need a RSA file from the target host. In this example, we have created one with the default name of <b>id_rsa. </b><br />
<b><br /></b>
The format of the flags follow the standard ssh rules and options, so -i for identity files and -L for port forwarding. Heres an example connecting to a remote host via a tunnel.<br />
<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>(bamcgill@daedalus.local)–(0|ttys000|-bash)–(Mon May 04|12:16:46)
(~/.ssh) $sql /nolog
SQLcl: Release 4.1.0 Release Candidate on Mon May 04 00:16:58 2015
Copyright (c) 1982, 2015, Oracle. All rights reserved.
SQL> sshtunnel bamcgill@gbr30060.uk.oracle.com -i ./id_rsa -L 8888:gbr30060.uk.oracle.com:1521
Password for bamcgill@gbr30060.uk.oracle.com ********
ssh tunnel connected
SQL> <b>connect barry/oracle@localhost:8888/DB11GR24</b>
Connected
SQL> select 'test me' as BLRK from dual weirdtable
BLRK
-------
test me
SQL>
</code></pre>
<br />
You can download SQLcl from OTN <a href="http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/sqldev-41ea-2372780.html" target="_blank">here</a> and give this a try when the next EA is released.<br />
<br />Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com3tag:blogger.com,1999:blog-1555497785494345295.post-43573615652869352982015-05-01T11:08:00.000-07:002015-05-01T11:08:17.550-07:00SQLcl - Code editing on the consoleWe've been playing with our console drawing in SQLcl for a while now and this week, we hooked up some keys to make editing and running much easier. The video will show the following keys for managing your buffer in the console. This will make it into the next Early Access candidate soon.<br />
<br />
<ul>
<li><b>up arrow</b> - previous history (this will continue to show you the next history unless you move into the text to edit it.</li>
<li><b>down arrow</b> - next history which is the same as above.</li>
</ul>
<div>
If we are editing and not showing history, then the up and down arrow will move up and down the buffer. </div>
<div>
<ul>
<li><b>ctrl-W</b> will take you to the top left of the buffer and <b>ctrl-S</b> will take you to the bottom of the buffer.</li>
<li>left arrow moves right, with <b>ctrl-A</b> taking you to extreme left of that line</li>
<li><b>right arrow</b> moves right and <b>ctrl-E</b> takes you to the extreme right of that line</li>
<li><b>ESC</b> takes you out of edit mode, back to the SQL> prompt</li>
<li><b>ctrl-R</b> will execute your buffer if you are editing it.</li>
</ul>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-Gona3PP7OJc/VUJodktPiyI/AAAAAAAAC68/y3EQL9OvDLc/s1600/2015-04-30%2B18_30_45.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://2.bp.blogspot.com/-Gona3PP7OJc/VUJodktPiyI/AAAAAAAAC68/y3EQL9OvDLc/s1600/2015-04-30%2B18_30_45.gif" height="258" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-size: x-small;">Editing SQL in SQLcl</span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-size: x-small;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
At the start of the video, we paste in a large piece of SQL from <a href="http://krisrice.blogspot.co.uk/2015/04/repeating-another-sqlcl-ea-release.html" target="_blank">Kris' blog </a>and all NBSP get stripped out so you get the full SQL and none of the dross. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
If you are at the end of the buffer and terminate your statement correctly, the next <b>CR</b> will run the contents of your buffer. If you are anywhere else in the buffer,<b> ctrl-R</b> will run the buffer for you.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Check out the latest one on OTN and come back for these features when we drop the new version of SQLcl on OTN.</div>
<div>
<br /></div>
</div>
Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com1Ulster (null)54.545443 -7.275251tag:blogger.com,1999:blog-1555497785494345295.post-20691064799269069062015-04-30T09:30:00.000-07:002015-04-30T09:30:32.665-07:00SQLcl connections - Lazy mans SQL*Net completionTurloch posted <a href="http://totierne.blogspot.in/2015/04/net-command-persistently-store-network.html" target="_blank">this</a> today, which is like aliases for SQL*Net connection URL's which are used to connections like this:<br />
<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>connect <USERNAME>/<Password>@URL
</code></pre>
<br />
This works great and you can simplify your connection strings that you use. Vadim wired this into the code completion and we can now code complete via <tab> key, a connection string that you have used before or you can set up a new now using the net command.</tab><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-7nlhCJMbIck/VUJXTx2iZ9I/AAAAAAAAC6s/nqj64gt-230/s1600/2015-04-30%2B17_17_16.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-7nlhCJMbIck/VUJXTx2iZ9I/AAAAAAAAC6s/nqj64gt-230/s1600/2015-04-30%2B17_17_16.gif" height="257" width="640" /></a></div>
<br />Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com1tag:blogger.com,1999:blog-1555497785494345295.post-81910098293409988752015-02-20T03:07:00.000-08:002015-02-20T03:07:22.588-08:00Connections Types in SQLcl<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
We support many ways to connect in SQLcl, including lots from SQL*Plus which we need to support to make sure all your SQL*Plus scripts work exactly the same way using SQLcl as with SQL*Plus.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I've added several ways to show how to connect to SQLcl. If there is one you want to see added that is not here, let me know and I'll add it to the list. So far, We have below:</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li>EZConnect</li>
<li>TWO_TASK</li>
<li>TNS_ADMIN</li>
<li>LDAP</li>
</ul>
At any time when connected you can use the command '<b>SHOW JDBC</b>' to display what the connection is and how we are connected. Here's some details of the types above.<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<u><b>EZCONNECT</b></u></div>
<div class="separator" style="clear: both; text-align: left;">
<u><b><br /></b></u></div>
<div class="separator" style="clear: both; text-align: left;">
The easy connect naming method eliminates the need for service name lookup in the tnsnames.ora files for TCP/IP environments. It extends the functionality of the host naming method by enabling clients to connect to a database server with an optional port and service name in addition to the host name of the database:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> $<b>sql barry/oracle@localhost:1521/orcl</b>
SQLcl: Release 4.1.0 Beta on Fri Feb 20 10:15:12 2015
Copyright (c) 1982, 2015, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
SQL>
</code></pre>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b><u>TWO_TASK</u></b></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The TWO_TASK (on UNIX) or LOCAL (on Windows) environment variable can be set to a connection identifier. This removes the need to explicitly enter the connection identifier whenever a connection is made in SQL*Plus or SQL*Plus Instant Client. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In SQLcl, we can set this up as a jdbc style connection like this</div>
<span style="color: #222222; font-family: Helvetica Neue, Neue Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 19px;"><br /></span></span>
<br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">$<b>export TWO_TASK=localhost:1521/orcl </b>
</code></pre>
<span style="color: #222222; font-family: Helvetica Neue, Neue Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 19px;"><br /></span></span>
<span style="color: #222222; font-family: Helvetica Neue, Neue Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 19px;"><br /></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-0ZT2zulik8Q/VOcEvgwPNKI/AAAAAAAAC3Q/llBod_rfD-c/s1600/bamcgill_%E2%80%94_java_%E2%80%94_bash_%E2%80%94_Novel_%E2%80%94_ttys000_%E2%80%94_102%C3%9733_%E2%80%94_%E2%8C%981_and_Java_-_Eclipse_-__Users_bamcgill_code_workspace.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-0ZT2zulik8Q/VOcEvgwPNKI/AAAAAAAAC3Q/llBod_rfD-c/s1600/bamcgill_%E2%80%94_java_%E2%80%94_bash_%E2%80%94_Novel_%E2%80%94_ttys000_%E2%80%94_102%C3%9733_%E2%80%94_%E2%8C%981_and_Java_-_Eclipse_-__Users_bamcgill_code_workspace.jpg" height="356" width="640" /></a></div>
<span style="color: #222222; font-family: Helvetica Neue, Neue Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 19px;"><br /></span></span>
<span style="color: #222222; font-family: Helvetica Neue, Neue Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 19px;"><u><b>TNS_ADMIN</b></u></span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Neue Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 19px;"><br /></span></span>
<span style="color: #222222; font-family: Helvetica Neue, Neue Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 19px;"></span></span><br />
Local Naming resolves a net service name stored in a tnsnames.ora file stored on a client. We can set the location of that in the <b>TNS_ADMIN</b> variable.<br />
<br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><span style="color: #222222; font-family: Helvetica Neue, Neue Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 19px;"><code style="color: black; word-wrap: normal;"> $export TNS_ADMIN=~/admin </code></span></span></pre>
<br />
An example tons entry is shown here below.<br />
<br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> $cat tnsnames.ora
BLOG =
(DESCRIPTION =
(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521) )
(CONNECT_DATA=
(SERVICE_NAME=orcl) ) )
</code></pre>
<br />
we can then use the entry to connect to the database.<br />
<br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> $sql barry/oracle@BLOG
SQLcl: Release 4.1.0 Beta on Fri Feb 20 10:29:14 2015
Copyright (c) 1982, 2015, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
SQL>
</code></pre>
<br />
<u><b>LDAP</b></u><br />
<br />
We've already written about LDAP connections <a href="http://barrymcgillin.blogspot.co.uk/2015/01/sqlcl-ldap-anyone.html" target="_blank">here</a>. Here's a quick review.<br />
<br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> set LDAPCON jdbc:oracle:thin:@ldap://scl58261.us.oracle.com:389/#ENTRY#,cn=OracleContext,dc=ldapcdc,dc=lcom
</code></pre>
<br />
<br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> $export LDAPCON=jdbc:oracle:thin:@ldap://scl58261.us.oracle.com:389/#ENTRY#,cn=OracleContext,dc=ldapcdc,dc=lcom
$sql /nolog
SQLcl: Release 4.1.0 Beta on Fri Feb 20 10:37:02 2015
Copyright (c) 1982, 2015, Oracle. All rights reserved.
SQL> connect barry/oracle@orclservice_test(Emily's Desktop)
Connected
SQL>
</code></pre>
<br />
If we have more types to add, then they will appear here. Let us know what you want to see.<br />
<br />Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com10tag:blogger.com,1999:blog-1555497785494345295.post-27769887448506783632015-02-19T15:29:00.000-08:002015-02-19T15:29:15.310-08:00Code Insight on SQLclHere's a little preview of the code insight we have in SQLcl. These changes are part of EA2 which are coming out very soon. This also shows the buffer and cursor management which was introduced in SQLcl<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-EHxQgPChYGY/VOZvqLfqwwI/AAAAAAAAC24/gqkZQ-D7fkM/s1600/codeinsight.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-EHxQgPChYGY/VOZvqLfqwwI/AAAAAAAAC24/gqkZQ-D7fkM/s1600/codeinsight.gif" /></a></div>
<br />
This allows you to move around the buffer easily and add and change text as you would in a normal text editor, not a console window like this.<br />
<br />
We're also adding hotkeys to run the buffer from anywhere or to jump out of the buffer to do something else without losing the contents of the buffer.<br />
<br />
Stayed tuned for this soon.<br />
B<br />
<br />Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com1Omagh, Omagh, Omagh BT78, UK54.59657 -7.306910000000016235.4502025 -48.615504000000016 73.7429375 34.001683999999983tag:blogger.com,1999:blog-1555497785494345295.post-19736582255821727612015-01-23T07:02:00.000-08:002015-01-23T07:02:16.071-08:00SQLCl - LDAP anyone?since we released our first preview of SDSQL, we've made a lot of changes to it and enhanced a lot of things too in there so it would be more useable. One specific one was the use of LDAP which some customers on SQLDeveloper are using in their organisations as a standard and our first release precluded them from working with this.<br />
<br />
Well, to add this, we wanted a way that we could specify the LDAP strings and then use them in a connect statement. We introduced a command called SET LDAPCON for setting the LDAP connection. You can set it like this at the SQL> prompt<br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> set LDAPCON jdbc:oracle:thin:@ldap://scl58261.us.oracle.com:389/#ENTRY#,cn=OracleContext,dc=ldapcdc,dc=lcom
</code></pre>
<br />
or set it as an environment variable<br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> (~/sql) $export LDAPCON=jdbc:oracle:thin:@ldap://scl58261.us.oracle.com:389/#ENTRY#,cn=OracleContext,dc=ldapcdc,dc=lcom
</code></pre>
<br />
Then you can come along and as long as you know your service name, we're going to swap out the ENTRY delimiter in the LDAP connection with your service. We're working on a more permanent way to allow these to be registered and used so they are more seamless.<br />
<br />
In the meantime, you can then connect to your LDAP service like this<br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> BARRY@ORCL>set LDAPCON jdbc:oracle:thin:@ldap://scl58261.us.oracle.com:389/#ENTRY#,cn=OracleContext,dc=ldapcdc,dc=lcom
BARRY@ORCL>connect barry/oracle@orclservice_test(Emily's Desktop)
Connected
BARRY@PDBOH12>tables
Command=tables
TABLES
TEST
</code></pre>
<br />
Here's a qk little video of it in action! You can then use the 'SHOW JDBC' command to show what you are connected to.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-yfwVLrhLcJw/VMJdpRrck-I/AAAAAAAAC2Q/rGc3AWli5S8/s1600/2015-01-23%2B14_30_03.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-yfwVLrhLcJw/VMJdpRrck-I/AAAAAAAAC2Q/rGc3AWli5S8/s1600/2015-01-23%2B14_30_03.gif" height="332" width="640" /></a></div>
<br />
This is the latest release which should be online soon, and you can download it from <a href="http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/sqldev-41ea-2372780.html" target="_blank">here</a>.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-433h112vBK4/VMJiSejg8SI/AAAAAAAAC2Y/3VG8OdiemaU/s1600/SQL_Developer_4_1_Early_Adopter.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-433h112vBK4/VMJiSejg8SI/AAAAAAAAC2Y/3VG8OdiemaU/s1600/SQL_Developer_4_1_Early_Adopter.png" height="191" width="400" /></a></div>
<br />Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com3Omagh, UK54.605955048900157 -7.322216033935546954.60480554890016 -7.3247375339355472 54.607104548900153 -7.3196945339355466tag:blogger.com,1999:blog-1555497785494345295.post-13972507546468794002014-12-12T10:05:00.001-08:002014-12-12T10:06:52.199-08:00SDSQL - Editing Anyone?Since we dropped our beta out of <a href="http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/sqldev-41ea-2372780.html" target="_blank">SQLDeveloper 4.1</a> and announced <a href="http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/sqldev-41ea-2372780.html" target="_blank">SDSQL</a>, we've been busy getting some of the new things out to users. We support SQL*plus editing straight out of the box, but one thing that was always annoying was the time when you make a mistake and can't fix it to you have finished typing to go back and add a line like this.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-Dx9OdL6XlnM/VIspJ2ICZdI/AAAAAAAAC1I/b2LSOXcrKP4/s1600/2014-12-12%2B17_42_03.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-Dx9OdL6XlnM/VIspJ2ICZdI/AAAAAAAAC1I/b2LSOXcrKP4/s1600/2014-12-12%2B17_42_03.gif" height="499" width="640" /></a></div>
<span id="goog_139618025"></span><span id="goog_139618026"></span><br />
This was always the way as console editors didn't let you move around, the best you could hope for on the command line was a decent line editor and anything above was printed to the screen and not accessible unless through commands like you see here in the images about.. <br />
<br />
Well, not any more. In SDSQL we've taken a look at several things like history, aliases and colors and we've now added a separate multiline console editor which allows you to walk up and down your buffer and make all the changes you want before executing? Sounds normal, right? So, thats what we did. Have a look and tell us what you think.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-ZaDkYFrH54c/VIstcNPGOkI/AAAAAAAAC1U/k1gQnDgOzAE/s1600/2014-12-12%2B18_01_04.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-ZaDkYFrH54c/VIstcNPGOkI/AAAAAAAAC1U/k1gQnDgOzAE/s1600/2014-12-12%2B18_01_04.gif" height="363" width="640" /></a></div>
<br />Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com0tag:blogger.com,1999:blog-1555497785494345295.post-50131900787737218462014-05-28T06:45:00.000-07:002014-05-28T06:45:26.815-07:00SQLDev: How unshared worksheets should work!<div class="separator" style="clear: both; text-align: left;">
Unshared worksheets are created to have a private connection to the database. When that unshared worksheet is closed, the connection and session for it should disappear as well.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
This graphic shows what should happen!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-LkgFmXclHBg/U4XnlNPkuhI/AAAAAAAACuQ/fo7AgvE-udY/s1600/testunshareclose.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-LkgFmXclHBg/U4XnlNPkuhI/AAAAAAAACuQ/fo7AgvE-udY/s1600/testunshareclose.gif" /></a></div>
<br />
<div>
<br /></div>
Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com1Omagh, UK54.547195700948855 -7.2759537026855754.537985700948852 -7.29612370268557 54.556405700948858 -7.2557837026855694tag:blogger.com,1999:blog-1555497785494345295.post-47017844477849837362014-05-02T08:49:00.000-07:002014-05-02T08:49:43.423-07:00Setting up Eclipse with SVN on OSX Mavericks So My macbook pro died the other day and much to my wife's amusement, my dell laptop died 30 minutes later with disk errors as I hadn't used in it in forever. She wasn't laughing long though cos I swiped her Macbook Air to get me out of a hole while the Apple store replace the magsafe card. (Don't worry, though, cos Lisa grabbed one of the kids laptops and now they are the only ones fuming. )<br />
<br />
So, here we are, no development environment to speak of on this laptop, not even Xcode tools or anything and a release to go out! First thing out of the box was to down load eclipse, from eclipse.org, which at time of writing is still <a href="https://www.eclipse.org/downloads/index-developer.php?release=kepler" target="_blank">keplar</a>. <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-tU07TbSh22w/U2Nvs84kD-I/AAAAAAAACpg/JKiNtHrwaxY/s1600/Screen+Shot+2014-05-02+at+11.12.06.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-tU07TbSh22w/U2Nvs84kD-I/AAAAAAAACpg/JKiNtHrwaxY/s1600/Screen+Shot+2014-05-02+at+11.12.06.png" height="103" width="400" /></a></div>
Download it, and expand it. then take the complete eclipse folder and drop it into your /Applications folder. It'll look like this.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-dT1j-Sz4SVA/U2Nxulz6QAI/AAAAAAAACps/a9xNkFrT5GI/s1600/Screen+Shot+2014-05-02+at+11.21.03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-dT1j-Sz4SVA/U2Nxulz6QAI/AAAAAAAACps/a9xNkFrT5GI/s1600/Screen+Shot+2014-05-02+at+11.21.03.png" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Also, when you click on the Launcher, you'll see eclipse added to the list of applications.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-hDGUIsvMm3I/U2Nxvl6ENPI/AAAAAAAACp0/WJTN58ZWSls/s1600/Screen+Shot+2014-05-02+at+11.21.15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-hDGUIsvMm3I/U2Nxvl6ENPI/AAAAAAAACp0/WJTN58ZWSls/s1600/Screen+Shot+2014-05-02+at+11.21.15.png" height="291" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Now, When you run it, you may be asked if you want to install java 1.6 to run Eclipse. Accept the install and sit back until it completes. When its installed, you'll be able to run eclipse, so click the icon in the launcher, as above.</div>
<div class="separator" style="clear: both; text-align: left;">
Eclipse will appear like this below. </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-RLXx82c1Ldw/U2Nz4Zek-TI/AAAAAAAACqQ/CeFi5ePLzM4/s1600/Screen+Shot+2014-05-02+at+11.29.36.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-RLXx82c1Ldw/U2Nz4Zek-TI/AAAAAAAACqQ/CeFi5ePLzM4/s1600/Screen+Shot+2014-05-02+at+11.29.36.png" height="310" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
We'll want to see what java versions we have installed and for that you can go to preferences and type jdk into the filter box which will show a number of java related options. </div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://2.bp.blogspot.com/-wu03JnwkkiA/U2N0ec5BqtI/AAAAAAAACqY/iUuuHZUCG0c/s1600/Screen+Shot+2014-05-02+at+11.32.52.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-wu03JnwkkiA/U2N0ec5BqtI/AAAAAAAACqY/iUuuHZUCG0c/s1600/Screen+Shot+2014-05-02+at+11.32.52.png" /></a>As you can see, we have a preference called installed JRE's which, when we click on it will only have the apple JDK we installed when we first tried to start eclipse. I want <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html" target="_blank">JDK 8 </a>and <a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html" target="_blank">JDK 7</a> and I got them on the oracle site for Java. Download both dmg files from Oracle, double click them and follow the instructions on the installer to drop them in. If you restart eclipse, and go back to the preferences, to this page you will now see the appropriate JDKs installed and you can choose your default for your project. </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-_Y_ehcMPha4/U2N17S6b4WI/AAAAAAAACqk/QxuN_KFMCps/s1600/Screen+Shot+2014-05-02+at+11.39.21.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-_Y_ehcMPha4/U2N17S6b4WI/AAAAAAAACqk/QxuN_KFMCps/s1600/Screen+Shot+2014-05-02+at+11.39.21.png" height="194" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Now, part two. Getting subversion into your eclipse, which turns out to be kinda difficult when you are trying to figure out which path to do. There are various schools of thought on how to get subversion on to your mac, but for me so far, I have found Brew to be one of the best of the latest package installers out there. If you do not have Brew installed you can do that really quickly by running this command in a terminal window.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-H8aLmA6TJi4/U2N3VDkOGDI/AAAAAAAACqw/SLIgkcYyF30/s1600/Screen+Shot+2014-05-02+at+11.45.07.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-H8aLmA6TJi4/U2N3VDkOGDI/AAAAAAAACqw/SLIgkcYyF30/s1600/Screen+Shot+2014-05-02+at+11.45.07.png" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
which gets you this output.</div>
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>lisas-MacBook-Air:~ bamcgill$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==> Downloading and installing Homebrew...
remote: Counting objects: 169292, done.
remote: Compressing objects: 100% (47341/47341), done.
remote: Total 169292 (delta 120836), reused 169278 (delta 120826)
Receiving objects: 100% (169292/169292), 32.51 MiB | 121 KiB/s, done.
Resolving deltas: 100% (120836/120836), done.
From https://github.com/Homebrew/homebrew
* [new branch] master -> origin/master
HEAD is now at 23e1c24 ansible: fix --HEAD install
==> Installation successful!
You should run `brew doctor' *before* you install anything.
Now type: brew help
lisas-MacBook-Air:~
</code></pre>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
Badda Bing. Now, we can install subversion from the Brew repository and as all homebrew experts know, you keep your home-brews in the Cellar, so look out for /usr/local/Cellar appearing. Now you may be asked for your administrator passwords as you do this because brew setups up the Cellar under /usr/Local and needs to create that there if it does not exist and set the permissions on the directory.<br />
Next, we'll want to install subversion with Brew.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-K-zVwR9G7OM/U2N-JlSqfBI/AAAAAAAACrA/Vw_jS5Y29KY/s1600/Screen+Shot+2014-05-02+at+12.14.23.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-K-zVwR9G7OM/U2N-JlSqfBI/AAAAAAAACrA/Vw_jS5Y29KY/s1600/Screen+Shot+2014-05-02+at+12.14.23.png" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
This will install subversion and its dependencies for you. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Now, lastly, you'll need to install SVN support on eclipse. The best one I've seen and have been using for ages has been <a href="http://subclipse.tigris.org/" target="_blank">Subclipse from Tigris.org</a>. If you go to the <a href="http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA" target="_blank">download page</a>, you'll see some notes on the download pages and sections for each release like this</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-9x1OxHzT718/U2N_N7UG9_I/AAAAAAAACrI/urvN83SXGmA/s1600/Screen+Shot+2014-05-02+at+12.18.24.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-9x1OxHzT718/U2N_N7UG9_I/AAAAAAAACrI/urvN83SXGmA/s1600/Screen+Shot+2014-05-02+at+12.18.24.png" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
What we want to pick up is the Eclipse update Site URL. We can then take that and use it in eclipse to install subclipse for us. <br />
So. Open eclipse again and go to HELP > Install New Software<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-Fqbv67L5sTI/U2OAwRfpooI/AAAAAAAACro/y6uKjxM40XU/s1600/Screen+Shot+2014-05-02+at+12.20.56.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-Fqbv67L5sTI/U2OAwRfpooI/AAAAAAAACro/y6uKjxM40XU/s1600/Screen+Shot+2014-05-02+at+12.20.56.png" height="249" width="320" /></a></div>
This will popup the window below for available software and if you use the drop box, you'll see things like eclipse and myln and other update sites which base eclipse uses.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-Rb55GEVekrs/U2OAW_VlDPI/AAAAAAAACrQ/khkRLKPOl3E/s1600/Screen+Shot+2014-05-02+at+12.21.51.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-Rb55GEVekrs/U2OAW_VlDPI/AAAAAAAACrQ/khkRLKPOl3E/s1600/Screen+Shot+2014-05-02+at+12.21.51.png" height="148" width="640" /></a></div>
We need to add another for Subclipse. Remember we grabbed the update url from the Subclipse site, we can add a new site by clicking add and pasting in the URL and a name for the site as shown.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-Pk6bdEne9Cg/U2OAXTD1X4I/AAAAAAAACrY/pCUk3X-Vhqg/s1600/Screen+Shot+2014-05-02+at+12.22.28.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-Pk6bdEne9Cg/U2OAXTD1X4I/AAAAAAAACrY/pCUk3X-Vhqg/s1600/Screen+Shot+2014-05-02+at+12.22.28.png" height="208" width="400" /></a></div>
This will appear like this and will give you the options that below to install subclipse and the SVNKit.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-UXRmixjcWNg/U2OAXAKUBGI/AAAAAAAACrU/7SCZF3GdJ8w/s1600/Screen+Shot+2014-05-02+at+12.23.20.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-UXRmixjcWNg/U2OAXAKUBGI/AAAAAAAACrU/7SCZF3GdJ8w/s1600/Screen+Shot+2014-05-02+at+12.23.20.png" height="246" width="400" /></a></div>
<br />
Install these and its normally good to restart eclipse after these installs. The last thing you need to do then is to make sure you are using the right svnkit in eclipse once you restart.<br />
You can make sure of this by going to the preferences again and searching for SVN. Click on the main SVN preference and make sure the SVN interface is set to SVNKit instead of javaHL.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-db_JouFtHAM/U2O7SBYbM8I/AAAAAAAACr4/xsUk6OSCjac/s1600/Screen+Shot+2014-05-02+at+16.35.03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-db_JouFtHAM/U2O7SBYbM8I/AAAAAAAACr4/xsUk6OSCjac/s1600/Screen+Shot+2014-05-02+at+16.35.03.png" height="502" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
Now, svn should be all set up and you can go look at adding new repositories and checking out code.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com2Omagh, UK54.546062076368443 -7.274993523681587254.536851576368441 -7.2951635236815875 54.555272576368445 -7.254823523681587tag:blogger.com,1999:blog-1555497785494345295.post-60432521391351856452013-10-07T19:30:00.000-07:002013-10-08T01:36:17.846-07:00Convert SQLServer to Oracle using files - Part 4This, the last part of a four part tutorial goes over the movement of data using files generated by Oracle SQL Developer. In <a href="http://barrymcgillin.blogspot.co.uk/2013/10/convert-sql-server-to-oracle-using.html" target="_blank">part 1</a> we generated the offline capture scripts to take to the SQL Server machine, unloaded the metadata, zipped it up and copied it back to out local machine. In <a href="http://barrymcgillin.blogspot.co.uk/2013/10/convert-sql-server-to-oracle-using_7.html" target="_blank">part 2</a> we used SQL Developer to create a migration project and load the capture files into SQL Developer. We then converted the metadata into its Oracle equivalent. In <a href="http://barrymcgillin.blogspot.co.uk/2013/10/convert-sqlserver-to-oracle-using-files.html" target="_blank">Part 3</a>, we were able to generate DDL and run this DDL against an Oracle database.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-TUYFFZw4liM/UlNhWQkMdEI/AAAAAAAACFM/huKkcAeVuJo/s1600/Screen+Shot+2013-10-08+at+02.31.43.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-TUYFFZw4liM/UlNhWQkMdEI/AAAAAAAACFM/huKkcAeVuJo/s1600/Screen+Shot+2013-10-08+at+02.31.43.png" height="128" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Looking at the data move scripts that we generated in an earlier part. We need to zip up the files and copy them to the SQL Server machine to run. Lets look at that now. The images below show the files moved to our SQLServer machine. We go into the main directory under data move and run the bat file MicrosoftSQLServer_data.bat. This batch file takes a number of parameters <server> <user> <password></password></user></server></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-_pU5EJ2rVB0/UlNlX5g4ilI/AAAAAAAACFY/VdQly2_b7Tk/s1600/Screen+Shot+2013-10-08+at+02.44.54.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-_pU5EJ2rVB0/UlNlX5g4ilI/AAAAAAAACFY/VdQly2_b7Tk/s1600/Screen+Shot+2013-10-08+at+02.44.54.png" height="186" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-tcBhyJkfBZY/UlNlX33g_GI/AAAAAAAACFc/I1_fZsYoeuc/s1600/Screen+Shot+2013-10-08+at+02.45.50.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-tcBhyJkfBZY/UlNlX33g_GI/AAAAAAAACFc/I1_fZsYoeuc/s1600/Screen+Shot+2013-10-08+at+02.45.50.png" height="153" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
This script then unloads the data from the database for the databases selected earlier. We can see the dat files in the image above. Now, we just need to go and transfer the data to the Oracle database machine for loading. We can go back out to the main datamove directory and zip up the entire directory including the scripts. We then need to ftp that to the database machine. </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-ayKX6n46NvA/UlNqXhnhsEI/AAAAAAAACFw/QGthyQMSU5Y/s1600/Screen+Shot+2013-10-08+at+03.07.39.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-ayKX6n46NvA/UlNqXhnhsEI/AAAAAAAACFw/QGthyQMSU5Y/s1600/Screen+Shot+2013-10-08+at+03.07.39.png" height="94" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
The files need to be unzipped on the machine and cd into the main directory until you find a file called oracle_loader.sh.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
We can run the files as below. The output below shows the exact output of running the Oracle_loader.sh script on the data we have taken from SQL Server.</div>
<br />
<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>[oracle@Unknown-08:00:27:c8:2a:1c 2013-10-08_00-05-16]$ sh ./oracle_loader.sh orcl blog blog
/scratch/datamove/2013-10-08_00-05-16/Northwind /scratch/datamove/2013-10-08_00-05-16
/scratch/datamove/2013-10-08_00-05-16/Northwind/dbo_Northwind /scratch/datamove/2013-10-08_00-05-16/Northwind
SQL*Plus: Release 11.2.0.2.0 Production on Mon Oct 7 18:58:42 2013
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Table altered.
Table altered.
Trigger altered.
Trigger altered.
Trigger altered.
Trigger altered.
Trigger altered.
Trigger altered.
Trigger altered.
Table altered.
Table altered.
Table altered.
Table altered.
Table altered.
Table altered.
Table altered.
Table altered.
Table altered.
Table altered.
Table altered.
Table altered.
Table altered.
Table altered.
Table altered.
Table altered.
Table altered.
Table altered.
Table altered.</code></pre>
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL*Loader: Release 11.2.0.2.0 - Production on Mon Oct 7 18:58:43 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Commit point reached - logical record count 1
Commit point reached - logical record count 2
Commit point reached - logical record count 3
Commit point reached - logical record count 4
Commit point reached - logical record count 5
Commit point reached - logical record count 6
Commit point reached - logical record count 7
Commit point reached - logical record count 8
Commit point reached - logical record count 9
SQL*Loader: Release 11.2.0.2.0 - Production on Mon Oct 7 18:58:44 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Commit point reached - logical record count 1
Commit point reached - logical record count 2
Commit point reached - logical record count 3
Commit point reached - logical record count 4
Commit point reached - logical record count 5
Commit point reached - logical record count 6
Commit point reached - logical record count 7
Commit point reached - logical record count 8
SQL*Loader: Release 11.2.0.2.0 - Production on Mon Oct 7 18:58:44 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Commit point reached - logical record count 49
SQL*Loader: Release 11.2.0.2.0 - Production on Mon Oct 7 18:58:44 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Commit point reached - logical record count 53
SQL*Loader: Release 11.2.0.2.0 - Production on Mon Oct 7 18:58:45 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
SQL*Loader: Release 11.2.0.2.0 - Production on Mon Oct 7 18:58:45 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
SQL*Loader: Release 11.2.0.2.0 - Production on Mon Oct 7 18:58:45 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Commit point reached - logical record count 64
Commit point reached - logical record count 77
SQL*Loader: Release 11.2.0.2.0 - Production on Mon Oct 7 18:58:45 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Commit point reached - logical record count 4
SQL*Loader: Release 11.2.0.2.0 - Production on Mon Oct 7 18:58:46 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Commit point reached - logical record count 64
Commit point reached - logical record count 128
Commit point reached - logical record count 192
Commit point reached - logical record count 256
Commit point reached - logical record count 320
Commit point reached - logical record count 384
Commit point reached - logical record count 448
Commit point reached - logical record count 512
Commit point reached - logical record count 576
Commit point reached - logical record count 640
Commit point reached - logical record count 704
Commit point reached - logical record count 768
Commit point reached - logical record count 832
Commit point reached - logical record count 896
Commit point reached - logical record count 960
Commit point reached - logical record count 1024
Commit point reached - logical record count 1088
Commit point reached - logical record count 1152
Commit point reached - logical record count 1216
Commit point reached - logical record count 1280
Commit point reached - logical record count 1344
Commit point reached - logical record count 1408
Commit point reached - logical record count 1472
Commit point reached - logical record count 1536
Commit point reached - logical record count 1600
Commit point reached - logical record count 1664
Commit point reached - logical record count 1728
Commit point reached - logical record count 1792
Commit point reached - logical record count 1856
Commit point reached - logical record count 1920
Commit point reached - logical record count 1984
Commit point reached - logical record count 2048
Commit point reached - logical record count 2112
Commit point reached - logical record count 2155
SQL*Loader: Release 11.2.0.2.0 - Production on Mon Oct 7 18:58:46 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Commit point reached - logical record count 64
Commit point reached - logical record count 128
Commit point reached - logical record count 192
Commit point reached - logical record count 256
Commit point reached - logical record count 320
Commit point reached - logical record count 384
Commit point reached - logical record count 448
Commit point reached - logical record count 512
Commit point reached - logical record count 576
Commit point reached - logical record count 640
Commit point reached - logical record count 704
Commit point reached - logical record count 768
Commit point reached - logical record count 830
SQL*Loader: Release 11.2.0.2.0 - Production on Mon Oct 7 18:58:47 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Commit point reached - logical record count 1
Commit point reached - logical record count 2
Commit point reached - logical record count 3
Commit point reached - logical record count 4
Commit point reached - logical record count 5
Commit point reached - logical record count 6
Commit point reached - logical record count 7
Commit point reached - logical record count 8
Commit point reached - logical record count 9
Commit point reached - logical record count 10
Commit point reached - logical record count 11
Commit point reached - logical record count 12
Commit point reached - logical record count 13
Commit point reached - logical record count 14
Commit point reached - logical record count 15
Commit point reached - logical record count 16
Commit point reached - logical record count 17
Commit point reached - logical record count 18
Commit point reached - logical record count 19
Commit point reached - logical record count 20
Commit point reached - logical record count 21
Commit point reached - logical record count 22
Commit point reached - logical record count 23
Commit point reached - logical record count 24
Commit point reached - logical record count 25
Commit point reached - logical record count 26
Commit point reached - logical record count 27
Commit point reached - logical record count 28
Commit point reached - logical record count 29
SQL*Loader: Release 11.2.0.2.0 - Production on Mon Oct 7 18:58:47 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Commit point reached - logical record count 3
SQL*Loader: Release 11.2.0.2.0 - Production on Mon Oct 7 18:58:47 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Commit point reached - logical record count 64
Commit point reached - logical record count 91
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
/scratch/datamove/2013-10-08_00-05-16/Northwind
/scratch/datamove/2013-10-08_00-05-16
[oracle@Unknown-08:00:27:c8:2a:1c 2013-10-08_00-05-16]$
</code></pre>
<br />
We can now take a look at some data in the Oracle database by going to the dbo_northwind connection we made earlier and look at the data.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/--hmvXJpgQH8/UlNs1WPwt5I/AAAAAAAACF8/3yOmLzNk3Fk/s1600/Screen+Shot+2013-10-08+at+03.23.54.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/--hmvXJpgQH8/UlNs1WPwt5I/AAAAAAAACF8/3yOmLzNk3Fk/s1600/Screen+Shot+2013-10-08+at+03.23.54.png" height="134" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And thats it. In these four parts we have generated capture scripts from SQLDeveloper to unload metadata from SQLServer. In part two, we loaded the metadata and converted it into an Oracle version. In Part three, we generated the DDL and ran it creating the new Oracle users. In part 4, we unloaded the data and copied it to the oracle machine. We then loaded it using the scripts we generated from Oracle SQL Developer.</div>
<br />Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com0Omagh, UK54.545702136833945 -7.275610379931663454.545702136833945 -7.2756103799316634 54.545702136833945 -7.2756103799316634tag:blogger.com,1999:blog-1555497785494345295.post-92232874751540394372013-10-07T18:23:00.000-07:002013-10-08T01:35:34.292-07:00Convert SQLServer to Oracle using files - Part 3In <a href="http://barrymcgillin.blogspot.co.uk/2013/10/convert-sql-server-to-oracle-using.html" target="_blank">part 1</a> we generated the offline capture scripts to take to the SQL Server machine, unloaded the metadata, zipped it up and copied it back to out local machine. In <a href="http://barrymcgillin.blogspot.co.uk/2013/10/convert-sql-server-to-oracle-using_7.html" target="_blank">part 2</a> we used SQL Developer to create a migration project and load the capture files into SQL Developer. We then converted the metadata into its Oracle equivalent.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-0fUj2LCwK-M/UlM8uuKTn3I/AAAAAAAACCw/HoMIObLnRTc/s1600/Screen+Shot+2013-10-07+at+23.58.37.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-0fUj2LCwK-M/UlM8uuKTn3I/AAAAAAAACCw/HoMIObLnRTc/s1600/Screen+Shot+2013-10-07+at+23.58.37.png" height="320" width="177" /></a></div>
In this episode we will try and generate DDL from our migration project. Right now, We can see the Oracle objects in the Converted Database Objects node.<br />
<a href="http://1.bp.blogspot.com/-bQqwW-efo9c/UlNAcaJIUxI/AAAAAAAACC8/fimlJtQMQGw/s1600/Screen+Shot+2013-10-08+at+00.03.22.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://1.bp.blogspot.com/-bQqwW-efo9c/UlNAcaJIUxI/AAAAAAAACC8/fimlJtQMQGw/s1600/Screen+Shot+2013-10-08+at+00.03.22.png" /></a>If we right click on Converted Database objects and choose generate, we can generate DDL to create the Oracle Schema and Objects.<br />
<br />
<a href="http://4.bp.blogspot.com/-N1dwiv7xIgY/UlNAdrjqfLI/AAAAAAAACDI/LRtZQtm5Dew/s1600/Screen+Shot+2013-10-08+at+00.03.34.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://4.bp.blogspot.com/-N1dwiv7xIgY/UlNAdrjqfLI/AAAAAAAACDI/LRtZQtm5Dew/s1600/Screen+Shot+2013-10-08+at+00.03.34.png" height="238" width="320" /></a>The wizard appears again with the introduction screen. Clicking next takes us directly to the Target database Screen.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: left;">
Click on offline to choose generation of files. For specifics of how the files get generated, click on advanced options</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-LKDIVpyPiAo/UlNAdhSeZYI/AAAAAAAACDE/AkqafeNqrU4/s1600/Screen+Shot+2013-10-08+at+00.04.11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-LKDIVpyPiAo/UlNAdhSeZYI/AAAAAAAACDE/AkqafeNqrU4/s1600/Screen+Shot+2013-10-08+at+00.04.11.png" height="239" width="320" /></a></div>
You can select what way you want to generate your files, all in one file, a file per object type or a file per object. You can also choose the types of objects you want to generate and run.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-jU5hi8EUDBc/UlNAdjH149I/AAAAAAAACDM/O64d6YcBaZc/s1600/Screen+Shot+2013-10-08+at+00.04.45.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-jU5hi8EUDBc/UlNAdjH149I/AAAAAAAACDM/O64d6YcBaZc/s1600/Screen+Shot+2013-10-08+at+00.04.45.png" height="226" width="320" /></a></div>
In this demo, I will just generate tables, data and supporting objects. Clicking next will take us to the data move page where we again choose offline to generate files.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-zJAOR5boMJ0/UlNAfEIfgNI/AAAAAAAACDc/NHlGkrY-dCI/s1600/Screen+Shot+2013-10-08+at+00.05.26.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-zJAOR5boMJ0/UlNAfEIfgNI/AAAAAAAACDc/NHlGkrY-dCI/s1600/Screen+Shot+2013-10-08+at+00.05.26.png" height="241" width="320" /></a></div>
Choosing advanced options allows us to be specific about date masks and delimiters for data unload.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-ycSauSG4rSg/UlNAnmMUKcI/AAAAAAAACD8/-h7GT5WdPlk/s1600/Screen+Shot+2013-10-08+at+00.05.39.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-ycSauSG4rSg/UlNAnmMUKcI/AAAAAAAACD8/-h7GT5WdPlk/s1600/Screen+Shot+2013-10-08+at+00.05.39.png" height="228" width="320" /></a></div>
Once we have chosen our options, we click next and review the summary.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-vA3iH4ofQbI/UlNAgVZ_puI/AAAAAAAACDs/PQr1k5iY_B4/s1600/Screen+Shot+2013-10-08+at+00.07.10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-vA3iH4ofQbI/UlNAgVZ_puI/AAAAAAAACDs/PQr1k5iY_B4/s1600/Screen+Shot+2013-10-08+at+00.07.10.png" height="240" width="320" /></a></div>
Finally, we click finish and the files are generated in the output directory we specified when setting up the project in part 2.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-1UP-VYEvU24/UlNAgfKU2QI/AAAAAAAACDw/gc8-16Eq3no/s1600/Screen+Shot+2013-10-08+at+00.08.17.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-1UP-VYEvU24/UlNAgfKU2QI/AAAAAAAACDw/gc8-16Eq3no/s1600/Screen+Shot+2013-10-08+at+00.08.17.png" /></a></div>
Now, Lets go see what we generated. If we go to the output directory we specified in the project, we can see the list of files we generated. Remember the options we chose for generation.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-VrTXE83yteE/UlNKW-uO60I/AAAAAAAACEM/dhytL3ya8nw/s1600/Screen+Shot+2013-10-08+at+00.56.32.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-VrTXE83yteE/UlNKW-uO60I/AAAAAAAACEM/dhytL3ya8nw/s1600/Screen+Shot+2013-10-08+at+00.56.32.png" height="78" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
We also get the master.sql file opened in SQL Developer which looks like this</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>SET ECHO OFF
SET VERIFY OFF
SET FEEDBACK OFF
SET DEFINE ON
CLEAR SCREEN
set serveroutput on
COLUMN date_time NEW_VAL filename noprint;
SELECT to_char(systimestamp,'yyyy-mm-dd_hh24-mi-ssxff') date_time FROM DUAL;
spool democapture_&filename..log
-- Password file execution
@passworddefinition.sql
PROMPT Creating Role
@role.sql
prompt creating user Emulation
@@Emulation/user.sql
prompt creating user dbo_Northwind
@@dbo_Northwind/user.sql
prompt creating user dbo_pubs
@@dbo_pubs/user.sql
prompt Building objects in Emulation
@@Emulation/master.sql
prompt Building objects in dbo_Northwind
@@dbo_Northwind/master.sql
prompt Building objects in dbo_pubs
@@dbo_pubs/master.sql
</code></pre>
<br />
Now, lets try and run this file and create the users and objects. Firstly, we choose a connection to run the script. This user must have the privileges to create users and all their ancillary objects.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-LWXE8AweuP4/UlNOXR-djGI/AAAAAAAACEY/ogLKmLKJa2w/s1600/Screen+Shot+2013-10-08+at+01.13.45.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-LWXE8AweuP4/UlNOXR-djGI/AAAAAAAACEY/ogLKmLKJa2w/s1600/Screen+Shot+2013-10-08+at+01.13.45.png" height="285" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
We can run this script to create the users. Notice the worksheet output showing the output of the files.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-G_q3Y4XPBn8/UlNZOdYzBmI/AAAAAAAACEo/QTGL_7oloqA/s1600/Screen+Shot+2013-10-08+at+01.59.30.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-G_q3Y4XPBn8/UlNZOdYzBmI/AAAAAAAACEo/QTGL_7oloqA/s1600/Screen+Shot+2013-10-08+at+01.59.30.png" height="320" width="178" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Once this is complete, we can create a connection in SQL Developer to one of the users created, dbo_Northwind, dbo_pubs and emulation.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-2oycWMe2-9Q/UlNa1CdJ7qI/AAAAAAAACE0/WGfXiOD3uus/s1600/Screen+Shot+2013-10-08+at+02.06.27.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-2oycWMe2-9Q/UlNa1CdJ7qI/AAAAAAAACE0/WGfXiOD3uus/s1600/Screen+Shot+2013-10-08+at+02.06.27.png" height="281" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-0IxY46pB1Ck/UlNbik_AvuI/AAAAAAAACE8/P9gnhuQTofA/s1600/Screen+Shot+2013-10-08+at+02.09.13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-0IxY46pB1Ck/UlNbik_AvuI/AAAAAAAACE8/P9gnhuQTofA/s1600/Screen+Shot+2013-10-08+at+02.09.13.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Now, we have created the schema from the DDL which was generated. In the next and final episode of this, we will visit the data move. We will run the data move scripts on SQL Server and extract the data which we can load via SQL Loader or external tables.</div>
<br />
<br />Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com0Omagh, UK54.5461999976141 -7.275267057177757154.5369894976141 -7.2954370571777574 54.555410497614105 -7.2550970571777569tag:blogger.com,1999:blog-1555497785494345295.post-16879489124710615552013-10-07T15:47:00.000-07:002013-10-07T15:47:30.060-07:00Convert SQL Server to Oracle using files - Part 2Ok, Now we have the files as generated and moved in <a href="http://barrymcgillin.blogspot.co.uk/2013/10/convert-sql-server-to-oracle-using.html" target="_blank">part 1</a>, we can now start SQL Developer to load the files. Start up SQL Developer and create a connection with the following privileges: CONNECT, RESOURCE and CREATE VIEW.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-PV5nPINykp8/UlMsuMnBDRI/AAAAAAAACAQ/VHilunNzykg/s1600/Screen+Shot+2013-10-07+at+22.15.48.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-PV5nPINykp8/UlMsuMnBDRI/AAAAAAAACAQ/VHilunNzykg/s1600/Screen+Shot+2013-10-07+at+22.15.48.png" height="261" width="320" /></a></div>
When the connection is opened, right click on it and choose Migration Repository then Associate Migration Repository. This will create the repository in the connection.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-pFJx5gHEEWo/UlMsuBSoY0I/AAAAAAAACAE/B4kwX-ZuEe8/s1600/Screen+Shot+2013-10-07+at+22.16.20.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-pFJx5gHEEWo/UlMsuBSoY0I/AAAAAAAACAE/B4kwX-ZuEe8/s1600/Screen+Shot+2013-10-07+at+22.16.20.png" height="115" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-WY5yK89YjWs/UlMsuOqlMZI/AAAAAAAACAA/lAuwZqEQPMs/s1600/Screen+Shot+2013-10-07+at+22.17.08.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-WY5yK89YjWs/UlMsuOqlMZI/AAAAAAAACAA/lAuwZqEQPMs/s1600/Screen+Shot+2013-10-07+at+22.17.08.png" height="98" width="320" /></a></div>
Now, We can start the migration wizard. You can do this by either going to the tools menu and selecting migrate from the migration menu, or you can select the migrate icon from the migration project navigator. The wizard will popup and you can walk through the steps as outlined below.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-FvivoPDqjog/UlMswOyMFQI/AAAAAAAACAY/msydWNZTNSo/s1600/Screen+Shot+2013-10-07+at+22.18.13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-FvivoPDqjog/UlMswOyMFQI/AAAAAAAACAY/msydWNZTNSo/s1600/Screen+Shot+2013-10-07+at+22.18.13.png" height="196" width="320" /></a></div>
Clicking the next button selects the repository page which we can choose the repository connection we just made.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-EJlSwusm4Bk/UlMs0EACLKI/AAAAAAAACA8/sRUuMBjblWE/s1600/Screen+Shot+2013-10-07+at+22.18.26.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-EJlSwusm4Bk/UlMs0EACLKI/AAAAAAAACA8/sRUuMBjblWE/s1600/Screen+Shot+2013-10-07+at+22.18.26.png" height="241" width="320" /></a></div>
Next page and we need to create a project to hold the captured databases.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-m8Dfe_XORBE/UlMs1fnUUmI/AAAAAAAACBI/-rAXRmZdqvM/s1600/Screen+Shot+2013-10-07+at+22.34.20.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-m8Dfe_XORBE/UlMs1fnUUmI/AAAAAAAACBI/-rAXRmZdqvM/s1600/Screen+Shot+2013-10-07+at+22.34.20.png" height="240" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
The output directory in the page above is the directory where any log files or generated files will be placed. When we generate DDL or data move files, this is where they will get generated. Next page is the capture page. For using the files from Part 1, we need to choose offline which will then show the page below, which asks us to select the offline capture file.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-7PfRRFUsyes/UlMsyF8aMsI/AAAAAAAACAo/HeUiXql-eCM/s1600/Screen+Shot+2013-10-07+at+22.35.09.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-7PfRRFUsyes/UlMsyF8aMsI/AAAAAAAACAo/HeUiXql-eCM/s1600/Screen+Shot+2013-10-07+at+22.35.09.png" height="239" width="320" /></a></div>
This offline capture file is in the zip file we brought over from SQL Server. Browse to the sqlserver2008.ocp. This file tells SQL Developer what to expect in the directory. It will look for the databases that have been unloaded.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-4y4Wa6aVmLw/UlMsxHNFXII/AAAAAAAACAg/AUpjv9qqGP8/s1600/Screen+Shot+2013-10-07+at+22.34.55.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-4y4Wa6aVmLw/UlMsxHNFXII/AAAAAAAACAg/AUpjv9qqGP8/s1600/Screen+Shot+2013-10-07+at+22.34.55.png" height="250" width="320" /></a></div>
When its selected, SQL Developer parses the files and shows you a list of the databases you ran the offline capture scripts for in Part 1.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-IikgVZRM05c/UlMsyzmI9SI/AAAAAAAACAw/ih7J1cRi_Tk/s1600/Screen+Shot+2013-10-07+at+22.35.22.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-IikgVZRM05c/UlMsyzmI9SI/AAAAAAAACAw/ih7J1cRi_Tk/s1600/Screen+Shot+2013-10-07+at+22.35.22.png" height="239" width="320" /></a></div>
Choose both databases and click next.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-kniMumw1rsY/UlMszwF9rWI/AAAAAAAACA4/CLr5AvtXRl8/s1600/Screen+Shot+2013-10-07+at+22.35.34.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-kniMumw1rsY/UlMszwF9rWI/AAAAAAAACA4/CLr5AvtXRl8/s1600/Screen+Shot+2013-10-07+at+22.35.34.png" height="240" width="320" /></a></div>
The next page shows a list of the datatypes of SQL Server on the left and a list of equivalent data types on the right. You can choose a different type if you want and you can also create a new mapping by clicking on the "Add new Rule".<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-Fp_QYE3Vk40/UlMs1nOQcxI/AAAAAAAACBQ/5JQZ8SUpSM4/s1600/Screen+Shot+2013-10-07+at+22.35.50.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-Fp_QYE3Vk40/UlMs1nOQcxI/AAAAAAAACBQ/5JQZ8SUpSM4/s1600/Screen+Shot+2013-10-07+at+22.35.50.png" height="240" width="320" /></a></div>
The next page lists the objects to be translated. Because we have not captured anything yet, the best we can do is to tell SQL Developer to translate everything. We can come back later and choose specific stored programs to convert and translate.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-zoL_MYmNDUM/UlMs20ZklMI/AAAAAAAACB0/AaiGQqwumbg/s1600/Screen+Shot+2013-10-07+at+22.36.49.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-zoL_MYmNDUM/UlMs20ZklMI/AAAAAAAACB0/AaiGQqwumbg/s1600/Screen+Shot+2013-10-07+at+22.36.49.png" height="239" width="320" /></a></div>
At this stage, we can click proceed to summary and then finish once you review the summary page.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-Tc3hsW2Mebk/UlMs3QFwJ5I/AAAAAAAACBs/m4sCZpYGcLk/s1600/Screen+Shot+2013-10-07+at+22.37.06.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-Tc3hsW2Mebk/UlMs3QFwJ5I/AAAAAAAACBs/m4sCZpYGcLk/s1600/Screen+Shot+2013-10-07+at+22.37.06.png" height="239" width="320" /></a></div>
When finish is pressed, SQL Developer will capture the database metadata from the files and convert it to its Oracle equivalent.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-kXJnAaFeCNw/UlMs2h59P4I/AAAAAAAACBg/ZIcg3sh56zc/s1600/Screen+Shot+2013-10-07+at+22.37.20.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-kXJnAaFeCNw/UlMs2h59P4I/AAAAAAAACBg/ZIcg3sh56zc/s1600/Screen+Shot+2013-10-07+at+22.37.20.png" height="108" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-F_fSPJT3_KE/UlMs3UeXCdI/AAAAAAAACBo/3SXTAqmfRGA/s1600/Screen+Shot+2013-10-07+at+22.37.55.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-F_fSPJT3_KE/UlMs3UeXCdI/AAAAAAAACBo/3SXTAqmfRGA/s1600/Screen+Shot+2013-10-07+at+22.37.55.png" /></a></div>
When this completes, you will see a new node with the project name you chose earlier. If you click on it, you will get an editor on the right hand side with a summary of the data captured and converted.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-lI6AYaOig9Q/UlMs5G8iHaI/AAAAAAAACCA/fwzsqAUiewI/s1600/Screen+Shot+2013-10-07+at+22.38.56.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-lI6AYaOig9Q/UlMs5G8iHaI/AAAAAAAACCA/fwzsqAUiewI/s1600/Screen+Shot+2013-10-07+at+22.38.56.png" height="183" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-kcspk2mAJuI/UlMs5PSFX-I/AAAAAAAACCE/FZFNSyqfG8g/s1600/Screen+Shot+2013-10-07+at+22.41.00.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-kcspk2mAJuI/UlMs5PSFX-I/AAAAAAAACCE/FZFNSyqfG8g/s1600/Screen+Shot+2013-10-07+at+22.41.00.png" height="222" width="320" /></a></div>
<br />Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com3Omagh, UK54.545502990820786 -7.274408750292991554.536291490820787 -7.2945787502929917 54.554714490820785 -7.2542387502929913tag:blogger.com,1999:blog-1555497785494345295.post-57225085729511516802013-10-07T14:45:00.000-07:002013-10-07T14:45:28.100-07:00Convert SQL Server to Oracle using files - Part 1Many people want to migrate their SQL Server databases and do not have direct network access to the database. In Oracle SQL Developer, we can migrate from SQL Developer to Oracle using a connection to SQL Server or using files to extract the metadata from SQL Server and convert it to an Oracle equivilent.<br />
<br />
Today, we'll show you how to use scripts to convert SQL Server. First we need to start up SQL Developer and choose the Tools menu, then select Migration and Create Offline Capture Scripts<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-mNHtQXpIjo0/UlLnoKoQaZI/AAAAAAAAB9o/NyN7RJb564M/s1600/Screen+Shot+2013-10-07+at+17.55.06.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-mNHtQXpIjo0/UlLnoKoQaZI/AAAAAAAAB9o/NyN7RJb564M/s1600/Screen+Shot+2013-10-07+at+17.55.06.png" height="108" width="320" /></a></div>
<br />
When the dialog appears, choose the SQL Server and the appropriate version you want. You will also need to choose a directory to put the scripts into.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-MBeDCkV_S3Q/UlLon00LPgI/AAAAAAAAB9w/LszvxPSQ3Pw/s1600/Screen+Shot+2013-10-07+at+17.59.31.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-MBeDCkV_S3Q/UlLon00LPgI/AAAAAAAAB9w/LszvxPSQ3Pw/s1600/Screen+Shot+2013-10-07+at+17.59.31.png" height="138" width="320" /></a></div>
This will generate a set of files which we will need to move to our SQL Server machine to run.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-McYyXqssZGM/UlLpzJb78uI/AAAAAAAAB94/kE7MZ-Og7jU/s1600/Screen+Shot+2013-10-07+at+18.00.36.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-McYyXqssZGM/UlLpzJb78uI/AAAAAAAAB94/kE7MZ-Og7jU/s1600/Screen+Shot+2013-10-07+at+18.00.36.png" height="119" width="320" /></a></div>
So on disk, these look like this.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-wV8vAePqRDo/UlLqqH50MfI/AAAAAAAAB-A/AYabM8rxWA0/s1600/Screen+Shot+2013-10-07+at+18.06.56.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-wV8vAePqRDo/UlLqqH50MfI/AAAAAAAAB-A/AYabM8rxWA0/s1600/Screen+Shot+2013-10-07+at+18.06.56.png" height="89" width="320" /></a></div>
Now, we can zip this up and ftp it to the SQL Server machine you want to migrate, or in my case, I'll scp it to the machine.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-7tSlf1_r7vQ/UlLrT1-AVoI/AAAAAAAAB-M/7Ed9MzVGmBI/s1600/Screen+Shot+2013-10-07+at+18.11.12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-7tSlf1_r7vQ/UlLrT1-AVoI/AAAAAAAAB-M/7Ed9MzVGmBI/s1600/Screen+Shot+2013-10-07+at+18.11.12.png" height="167" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-1qKfuZYvBu0/UlLsZmskoeI/AAAAAAAAB-U/OKU8KM4Ai5U/s1600/Screen+Shot+2013-10-07+at+18.15.42.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-1qKfuZYvBu0/UlLsZmskoeI/AAAAAAAAB-U/OKU8KM4Ai5U/s1600/Screen+Shot+2013-10-07+at+18.15.42.png" height="52" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Now, lets go to SQL Server and run the scripts against the SQL Server database. Looking below, I have opened up a command window and created a directory called blog and moved the sqlserver.zip file into that directory.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-noDFjq-4L6E/UlLx9-XgvKI/AAAAAAAAB-k/jX_JfWCr_HM/s1600/Screen+Shot+2013-10-07+at+18.39.08.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-noDFjq-4L6E/UlLx9-XgvKI/AAAAAAAAB-k/jX_JfWCr_HM/s1600/Screen+Shot+2013-10-07+at+18.39.08.png" height="161" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Now, we have the scripts on the SQL Server box and ready to run. Its important that when you run the scripts on a server, that you always run it from the same place. The script which is run takes a number of parameters to run.</div>
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><pre style="border: 1px dashed rgb(204, 204, 204); font-family: arial; height: auto; overflow: auto; padding: 0px; width: 646px;">OMWB_OFFLINE_CAPTURE sa superuser_password databasename server</pre>
</pre>
<br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"> OMWB_OFFLINE_CAPTURE sa saPASSWORD DBNAME_TO_CAPTURE SQLSERVER_SERVER </pre>
<br />
This will unload the metadata from the database to flat files. You need to run this script once for each database you want to migrate. You'll see something like these as you go.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-zlrwNTwYkN8/UlMV8opEMLI/AAAAAAAAB_I/yayBo5NI5fg/s1600/Screen_Shot_2013-10-07_at_21.00.36.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-zlrwNTwYkN8/UlMV8opEMLI/AAAAAAAAB_I/yayBo5NI5fg/s1600/Screen_Shot_2013-10-07_at_21.00.36.png" height="160" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-6i1SzfDdwso/UlMUO81H0sI/AAAAAAAAB-4/tTO4Oz8z8Ls/s1600/Screen+Shot+2013-10-07+at+21.03.50.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-6i1SzfDdwso/UlMUO81H0sI/AAAAAAAAB-4/tTO4Oz8z8Ls/s1600/Screen+Shot+2013-10-07+at+21.03.50.png" height="131" width="320" /></a></div>
This is one run for the northwind database. I've run this again for the pubs database and lets look and see what files exist now.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-34CwqEa9Ng8/UlMX4QZ7VkI/AAAAAAAAB_U/yABGh4iAkJc/s1600/Screen+Shot+2013-10-07+at+21.21.24.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-34CwqEa9Ng8/UlMX4QZ7VkI/AAAAAAAAB_U/yABGh4iAkJc/s1600/Screen+Shot+2013-10-07+at+21.21.24.png" height="160" width="320" /></a></div>
Now, we go up a directory and zip all this up so we can move it to the machine where we will translate it.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-df9zcguCOXU/UlMew5dC1hI/AAAAAAAAB_k/ezx2u9NlzFs/s1600/Screen+Shot+2013-10-07+at+21.43.44.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-df9zcguCOXU/UlMew5dC1hI/AAAAAAAAB_k/ezx2u9NlzFs/s1600/Screen+Shot+2013-10-07+at+21.43.44.png" height="119" width="320" /></a></div>
Now, we can move that zip file. Take a look at it, it is very small in size for this demo, but even for a large system, we are only capturing the metadata structure of the database. If you are working with a partner or SI, this is the file you will want to send them for analysis.<br />
<br />
Ok, for those of you who are doing this right now, read on.<br />
<br />
When you have the capture.zip file transferred, unzip it into a clean directory. We will use SQL Developer on this to convert these metadata files into DDL to create the new Oracle schema and the data move scripts which can be used to unload the data from SQL Server and load it into Oracle.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-OCaeLhXwgmw/UlMhnz6ZckI/AAAAAAAAB_w/f3iUN5UVBBw/s1600/Screen+Shot+2013-10-07+at+22.02.59.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-OCaeLhXwgmw/UlMhnz6ZckI/AAAAAAAAB_w/f3iUN5UVBBw/s1600/Screen+Shot+2013-10-07+at+22.02.59.png" height="159" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Now, we use SQL Developer to load this data. We will need access to an Oracle database to create a schema to use as a repository. The repository is used to hold the source database information and the converted data.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The next post will walk through SQL Developer loading these files and converting the metadata to an Oracle equivalent.</div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />Barry McGillinhttp://www.blogger.com/profile/12215907295974180145noreply@blogger.com3Omagh, UK54.5461999976141 -7.2759537026855754.536990997614105 -7.29612370268557 54.5554089976141 -7.2557837026855694