Home |  MySQL Buzz |  FAQ |  Feeds |  Submit your blog feed |  Feedback |  Archive |  Aggregate feed RSS 2.0 English Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 24

Displaying posts with tag: Oracle 11g (reset)

Add User Defined Types
+0 Vote Up -0Vote Down

Somebody asked me if there was a cheaper alternative to using the Embarcadero Data Architect (a data modeling tool). I said sure, you can use the MySQL Workbench. My friend laughed and said, it’s to model Oracle databases and they use different data types. I broke the news to him that he can create his own user defined types and use MySQL Workbench to model problems for the Oracle Database 11g.

For example, you can launch the MySQL Workbench, and click on the Model menu option, and in the menu window click on the User Defined Types choice, as shown in the following:

Choosing the User Defined Type option, launches the following

  [Read more...]
Mac Mini to the rescue
+0 Vote Up -0Vote Down

In teaching, I had a problem because my students have different base operating systems, like Windows 7, Windows 8, Linux, and Mac OS X. I needed a teaching and lecture platform that would let me teach it all (not to mention support their environments). That meant it had to virtualize any of the following with a portable device:

  • Windows 7 or 8 hosting natively an Oracle Database 11g XE, 11g, or 12c and MySQL Database 5.6
  • Windows 7 or 8 hosting a Fedora or Oracle Unbreakable Linux VM (3 or 4 GB) with Oracle Database 11g XE, 11g, or 12c and MySQL Database 5.6
  • Mac OS X hosting a Fedora or Oracle Unbreakable Linux VM (3 or 4 GB) with Oracle Database 11g XE,
  [Read more...]
Excel PowerPivot & DAX
+0 Vote Up -0Vote Down

I’ve worked with every release of Microsoft Excel, and I know it takes effort to keep up to date with certain releases. Clearly, the Data Analysis eXpression (DAX) Language introduced in Excel 2010 went unnoticed by many, which was sad. DAX is truly a powerful extension to the analytical and modeling approaches in Microsoft Excel.

I’d like to recommend Microsoft Excel 2013 Building Data

  [Read more...]
Zend 6 & Timezones
+0 Vote Up -0Vote Down

Just went through all my PHP testing against a fresh instance of Oracle with Zend Server Community Edition 6, and found these warnings, guess that’s pretty clean for the Oracle part of the installation. I didn’t notice it before because generally I do most of my PHP development against a MySQL database. I should have been configuring the php.ini file routinely, as qualified in this PHP forum discussion.

Warning: oci_set_client_info(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your
  [Read more...]
Verifying a Socket w/Perl
+1 Vote Up -0Vote Down

Using a lowercase hostname is typical but I got sloppy on a Windows 7 installation, after all Windows is case insensitive, and I used a mixed case hostname. It raised an interesting error when installing Oracle Database 11g Release 2.

Enterprise manager configuration failed due to the following error -

Failed to allocate port(s) in the specified range(s) for the following process(es): JMS
[5540-5559], RMI [5520-5539], Database Control [5500-5519], EM Agent [3938] | [1830-1849]

Refer to the log file at C:\app\McLaughlinM\cfgtoollogs\dbca\orcl\emConfig.log for more details.

You can retry configuring this database with Enterprise Manager
  [Read more...]

Oracle and Java Tutorial
+0 Vote Up -1Vote Down

I’m posting this because of a question raised against this older post on how to configure the %CLASSPATH% to find the ojdbc6.jar file. This is the lab file I use in my Database 1 class to expose students to the moving parts of writing Java programs against the Oracle database. That’s why I choose to use a CLOB data type, which requires Oracle’s DBMS_LOB package and wrapping stored procedures.

If you want the same content for MySQL, here’s the link. The full program in either blog entry is available by clicking on the fold/unfold Java Source Code Program widget at the bottom of the respective posts.

This

  [Read more...]
Free Oracle PHP Book
+1 Vote Up -0Vote Down

Six years ago, I wrote Oracle Database 10g Express Edition PHP Web Programming for the release of the express edition. It was a lot of fun to write because I enjoy the PHP programming language, but unfortunately sales didn’t measure up too well. That’s probably because the population of PHP developers working with Oracle was small.

Today it seems there are more PHP developers working with Oracle 11g. While the population of PHP community for Oracle 11g is still smaller than for MySQL, it continues to grow

  [Read more...]
Derived Table Aliases
+0 Vote Up -0Vote Down

In my database class, students write solutions as group exercises against the Oracle 11g XE database and then they port the solution individually to the MySQL 5.5 database. One of the students copied over a query like the one below to MySQL (a query used to track the expected number of row returns).

SELECT   COUNT(*)
FROM    (SELECT   DISTINCT
                  k.kingdom_id
         ,        kki.kingdom_name
         ,        kki.population
         FROM     kingdom_knight_import kki LEFT JOIN kingdom k
         ON       kki.kingdom_name = k.kingdom_name
         AND      kki.population = k.population);

It got an error they didn’t understand:

ERROR 1248 (42000): Every derived TABLE must have its own alias

Providing a dt query alias fixes the problem in MySQL for the following query. The fact that it

  [Read more...]
Single Wildcard Operator
+0 Vote Up -0Vote Down

Somebody wanted to understand why you can backquote a single wildcard operator (that’s the underscore _ character) in MySQL, but can’t in Oracle. The answer is you can in Oracle when you know that you required an additional clause.

While I prefer using regular expression resolution, the LIKE operator is convenient. Here’s an example of backquoting an underscore in MySQL, where it looks for any string with an underscore anywhere in the string:

SELECT   common_lookup_type
FROM     common_lookup
WHERE    common_lookup_type LIKE '%\_%';

You can gain the same behavior in Oracle by appending the ESCAPE '\' clause, like this:

SELECT   common_lookup_type
FROM     common_lookup
WHERE    common_lookup_type LIKE '%\_%' ESCAPE '\';

The ESCAPE '\' clause is one of those

  [Read more...]
Result Cache Functions
+0 Vote Up -0Vote Down

I finally got around to cleaning up old contact me messages. One of the messages raises a question about RESULT_CACHE functions. The writer wanted an example implementing both a standalone schema and package RESULT_CACHE function.

The question references a note from the Oracle Database 11g PL/SQL Programming book (on page 322). More or less, that note points out that at the time of writing a RESULT_CACHE function worked as a standalone function but failed inside a package. When you tried it, you raised the following error message:

PLS-00999: Implementation Restriction (may be temporary)

It’s no longer true in Oracle 11gR2, but it was true in Oracle 11gR1. I

  [Read more...]
Oracle Within Group
+0 Vote Up -0Vote Down

Somebody asked me for a useful example of Oracle 11gR2′s new analytical LISTAGG function that uses a WITHIN GROUP syntax. They’d noticed an update to the askTom that showed how to use it. This post shows how to list values without a displayed aggregation column and how to use a JOIN and GROUP BY clause with the new analytical feature.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
COLUMN list      FORMAT A10
COLUMN last_name FORMAT A10
COLUMN names     FORMAT A42
COLUMN members   FORMAT 9,990
 
 
SELECT   m.account_number AS account
,        c.last_name AS last_name
,        LISTAGG(c.first_name||DECODE(c.middle_name,NULL,NULL,' '||SUBSTR(c.middle_name,1,1)||'.'),', ')
           WITHIN GROUP (ORDER BY 2) AS
  [Read more...]
Oracle CSV Imports
+0 Vote Up -0Vote Down

The first step in creating an effective import plan for comma-separated value (CSV) files is recognizing your options in a database. There are several options in an Oracle database. You can read the file with Java, C/C++, C#, PL/SQL (through the UTL_FILE package), PHP, Perl, or any other C-callable programming language; or you can use SQL*Loader as a standalone utility or through externally managed tables (known as external tables). The most convenient and non-programming solution is using external tables.

Adopting external tables as your import solution should drive you to consider how to manage the security surrounding this type of methodology. Host hardening is a critical security step because it shuts down most, hopefully all, unauthorized use of the operating system where the database and external files reside. Next, you need to manage the access to the external

  [Read more...]
How to use object types?
+0 Vote Up -0Vote Down

A tale of Oracle SQL object types, their constructors, and how you use them. This demonstrates what you can and can’t do and gives brief explanations about why.

The following creates a base SAMPLE_OBJECT data type and a sample_table
collection of the base SAMPLE_OBJECT data type.

CREATE OR REPLACE TYPE sample_object IS OBJECT
(id       NUMBER
,name     VARCHAR2(30));
/
 
CREATE OR REPLACE TYPE sample_table IS TABLE OF sample_object;
/

If the base SAMPLE_OBJECT data type were a Java object, the default constructor of an empty call parameter list would allow you to construct an instance variable. This doesn’t work for an Oracle object type because the default constructor is a formal parameter list of the object attributes in the positional order of their appearance


  [Read more...]
Book Review: OCA Oracle Database 11g: SQL Fundamentals I: A real-world Certification Guide
Employee +2 Vote Up -0Vote Down

Good books on databases are rare. So permit me to step out of my normal MySQL-centric role and review a new book that is very good and covers a lot of generic relational database territory while also teaching the basics of Oracle 11g. I would estimate that 10% of the book is 11g and the rest would be valuable to new DBAs of other database systems. Besides, seeing how other databases perform some tasks differently may spur you to improve your own.

OCA Oracle Database 11g: SQL Fundamentals I: A real-world Certification Guide
Author: Steve Reis

Database books are hard to write. Databases are not warm, easy to understand and the many concepts can require a student on the subject to concentrate on many obtuse factors all at one time. Presenting the material in a clear and concise fashion


  [Read more...]
Function or Procedure?
+0 Vote Up -0Vote Down

Somebody asked for a simple comparison between a PL/SQL pass-by-value function and pass-by-reference procedure, where the procedure uses only an OUT mode parameter to return the result. This provides examples of both, but please note that a pass-by-value function can be used in SQL or PL/SQL context while a pass-by-reference procedure can only be used in another anonymous of named block PL/SQL program.

The function and procedure let you calculate the value of a number raised to a power of an exponent. The third parameter lets you convert the exponent value to an inverse value, like 2 to 1/2.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
CREATE OR REPLACE FUNCTION find_root_function
( pv_number   BINARY_DOUBLE
, pv_power    BINARY_DOUBLE
, pv_inverse  BINARY_INTEGER DEFAULT 0 ) RETURN BINARY_DOUBLE IS
 
  -- Declare local
  [Read more...]
Java Generics in Oracle
+0 Vote Up -0Vote Down

Somebody posed the question about using a Comparator in the sorting examples provided in this earlier post on Updating Table View Columns (columns using a Varray or Nested Table of a single scalar data type). It seems the individual thought that you can’t use Java Generics inside an Oracle Database 11g’s Java libraries. It’s seems odd since they’ve been around since Java 5.

You can use Generics like those shown in the following example. It builds on explanation from the prior post. If you want to get the whole set of facts click the link above but you should have all the code you need in this post.

An example like this requires you first define a collection of strings in the database. This one uses the following

  [Read more...]
Oracle 11gR2 on Windows 7
+0 Vote Up -0Vote Down

Here are step-by-step instructions for installing Oracle Database 11g Release 2 on Windows 7. It’s provided in response to questions posted on my step-by-step instructions for installing Oracle 11gR1 on Windows 7. For reference, I posted the former because it didn’t work without intervention. I hadn’t updated step-by-step instructions because Oracle Database 11g Release 2 has always worked for me when installing on Windows 7.

A number of students and blog readers have mentioned that it didn’t work for them. My guess is that they had configuration issues within the Windows 7 environment. There are some Windows 7 configuration caveats before you perform this installation, and they are:

Windows 7 Configuration Steps

  • Make sure you
  •   [Read more...]
    Log Buffer #205, A Carnival of the Vanities for DBAs
    +0 Vote Up -0Vote Down

    A very warm welcome to the Log Buffer, the premier medley of fresh information culled from the blogs related to the technology which stores the world, yes, the databases.

    In this edition, the Log Buffer #205, we have yet again found the pulse of the industry.

    Oracle:

    On the Oracle front, leading Oracle technologist Andrey Goryunov carries on his hands-on experiments of newest version of the Oracle database. This time he slices away chopt.

    It’s always very informative and exciting to know about internals of RAC Stuff like what actually is maintained in the Voting Disk . Riyaj has it

      [Read more...]
    Log Buffer #204, A Carnival of the Vanities for DBAs
    +0 Vote Up -0Vote Down

    Welcome to Log Buffer, the weekly roundup of happenings in the database world.

    Lots to cover this week, so let’s get on with Log Buffer #204. Enjoy!

    Oracle:

    Pythian’s Gwen Shapira dabbles with MySQL and explores MySQL troubleshooting for the Oracle DBA.

    Venkat Janakiraman explores how connectivity works for BI EE 11g

      [Read more...]
    Installing Oracle 11g on Ubuntu 8.04 LTS (Hardy Heron)
    +0 Vote Up -0Vote Down

    Note: Installing Oracle 11gR1 on Ubuntu 8.10 Intrepid Ibex is now published.

    After our last post about installing Oracle 11g on Ubuntu 7.10 (November, 6th), and considering Ubuntu 8.04 LTS was released on April 21st, I spent some time reviewing and putting together this new HOWTO for the installation.

    Please note: I’ve used the x86 server version of Ubuntu 8.04, but the same steps should work without any problems for the Desktop version. Also notice that this whole procedure can easily take over six hours to complete, so don’t

      [Read more...]
    Oracle 11g: Another New SQL*Plus Command
    +0 Vote Up -0Vote Down

    I have been using this SQL*Plus command for a while now:

    SQL> show spparameter service_names
    
    SID      NAME          TYPE        VALUE
    -------- ------------- ----------- ---------
    *        service_names string      REDX
    

    And guess what ?

    • The right syntax is actually show spparameters (with a “s” at the end of it).
    • It’s an 11g New Feature!

    It doesn’t work with 10g:

    SQL> show spparameters service_names
    
    SP2-0735: unknown SHOW option beginning "spparamete..."
    SP2-0735: unknown SHOW option beginning "service_na..."
    

    I thought MySQL was trying to become as big as Oracle but it could be that Oracle is trying to become as cool as MySQL — it has had something like this for a long time! Now Oracle should add SHOW TABLES too.

    Anyway, this is really 11g’s most useful feature so far, though.

    Installing Oracle 11g on Ubuntu Linux 7.10 (Gutsy Gibbon)
    +0 Vote Up -0Vote Down

    Note: Installing Oracle 11gR1 on Ubuntu 8.10 Intrepid Ibex is now published.

    After many requests from readers, I’ve put together new, revised version of the Oracle 11g on Ubuntu recipe. This new version is a little different than the first one published: it’s based on a bare-bones install of Ubuntu 7.10 (Gutsy Gibbon) server version instead of the desktop version. As an improvement, I’ve tried to pare down dependencies to a minimal set.

    Your feedback is more than welcome — it’s the main reason why I wrote a new version of this HOWTO. I’ve also tested and repeated this procedure twice. Even so, it might still have

      [Read more...]
    Oracle 11g: New Pivot Table Feature
    +0 Vote Up -0Vote Down

    I was very pleased when I heard about Oracle adding pivot functionality in select statements. Finally — we wouldn’t have to copy the data to a spreadsheet or code a ton of sum(case when col1 = 'X' then amount else 0 end) total_X for each column we would want to display.

    I am basically looking for three things in a pivot-style query:

  • the ability to specify which column will be pivoted as one or more columns in the resulting query
  • row subtotals
  • column subtotals
  • The first item is the only one that really matters. I can work around the other two, so let’s get started.

    Create a test table with a few rows:

    create table bob_pivot_test( id number, cost number, tx_date date, product_type varchar2(50));
    insert into bob_pivot_test values (1,10.99,sysdate-10,'Toy');
    insert into bob_pivot_test values
      [Read more...]
    Installing Oracle 11g on Ubuntu Linux 7.04
    +0 Vote Up -0Vote Down

    Note: Installing Oracle 11gR1 on Ubuntu 8.10 Intrepid Ibex is now published.

    Note: I have now published “Installing Oracle 11g on Ubuntu Linux 7.10 (Gutsy Gibbon)”

    Note: This page focuses on Ubuntu installs. Oracle has published a web page for successfully installing Linux on unsupported platforms that you may find helpful.

    I come from a MySQL background, and I have been given the challenge of learning Oracle. I can’t just play around with our customers’ databases, but I remembered that Paul Vallée

      [Read more...]
    Showing entries 1 to 24

    Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

    Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.