Friday Aug 23, 2013

copy&paste multi-line SQL from sqlplus on Windows

Copy & paste multi-line SQL from sqlplus in one PuTTy window to another putty window is clumsy
because, as you see below, real SQL text is prefixed by line#.

Here's example#1. You can suppress line# by "set sqlnumber off" , though.

Autotrace running total : autotrace « SQL Plus « Oracle PL / SQL

SQL> create table t
  2  as
  3  select object_name ename,
  4         mod(object_id,50deptno,

Here's example#2. "set sqlnumber off" won't help.

Simple Pleasures…rlwrap and SQL*Plus Command Line editing on Linux | The Anti-Kyte

SQL> l
  SELECT name, wkts, average
  FROM top_bowlers
  3* WHERE country = 'AUSTRALIA'

You can copy&paste to notepad and edit but there's quicker way on Windows if Cygwin is installed.

After hitting Ctrl+C, go to bash prompt and ...

$ cut -c6- /dev/clipboard >/dev/clipboard

Now, Ctrl+V will paste SQL statements with line numbers removed.
You can use 'sed' also and be more creative.

Or if you don't have bash prompt open, you can use Windows "Run..." prompt.

I'm sure there's similar way for Mac OS.

Thursday Aug 22, 2013

DB12c: Multi-tenant(PDB) Resource Manager calculation

I think the 'share' calculation in DB12c Multitenant architecture's resource management looks new to many
seasoned Oracle DBAs.

Using Oracle Resource Manager for PDBs

shows that the total number of shares is seven (3+3+1). The salespdb and the servicespdb PDB are each guaranteed 3/7th of the resources

But it really is not.

CPU Share Definition - Oracle Solaris Administration: Oracle Solaris Zones, Oracle Solaris 10 Zones, and Resource Management

Shares are used
to define the relative importance of workloads in relation to other workloads.


This way of specifying resource has been used since at least Solaris 10.

I think there are other vendors' products which use this method.

About

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Search

Archives
« August 2013 »
SunMonTueWedThuFriSat
    
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
24
25
26
27
28
29
30
31
       
Today