Showing posts with label Oracle. Show all posts
Showing posts with label Oracle. Show all posts

Wednesday, June 11, 2008

Staring SQL Developer or JDeveloper fails due to hidden messagebox

Can you spot why Oracle SQL Developer and JDeveloper aren't starting in this scenario?

You can't even see it on a white background (and there is no window in the taskbar) but there is a question box right behind the slash screen :-). Pay attention to the right edge of the splash...



Still, I love the new Java look.



Saturday, March 08, 2008

Kicking it up a gear with Oracle Rdb Server on OpenVMS

$ show system
OpenVMS V8.3 on node DEIMOS 8-MAR-2008 16:15:25.04 Uptime 0 13:09:50

Time to install a database server on this box :-). And nothing says "database" quite like Oracle Rdb (ex DEC product btw).

Grab Oracle Rdb, unzip it (unzip SYS$SYSROOT:[SYSMGR.RDBKIT]rdbv72200kit_amv.zip;1), and install it :-).

@SYS$UPDATE:VMSINSTAL RDBV72200AM SYS$SYSROOT:[SYSMGR.rdbkit]

Now we can restart the service, and create our database.

$ @SYS$MANAGER:RMONSTOP72.com
$ @SYS$STARTUP:RMONSTART72.COM

$ UCX show services

Service Port Proto Process Address State

BIND 53 TCP,UDP TCPIP$BIND 0.0.0.0 Disabled
FTP 21 TCP TCPIP$FTP 0.0.0.0 Enabled
IMAP 143 TCP TCPIP$IMAP 0.0.0.0 Enabled
POP 110 TCP TCPIP$POP 0.0.0.0 Enabled
RDBSERVER 611 TCP RDB72 0.0.0.0 Enabled
SSH 22 TCP TCPIP$SSH 0.0.0.0 Enabled
TELNET 23 TCP not defined 0.0.0.0 Enabled

$ run SYS$SYSTEM:SQL$72.exe
SQL> SHOW VERSION
Current version of SQL is: Oracle Rdb SQL V7.2-200
SQL> DROP DATABASE filename PRODUCTS;
SQL> CREATE DATABASE filename PRODUCTS;
SQL> CREATE TABLE clients
cont> (
cont> ClientID char(9)
cont> CONSTRAINT CL_ID
cont> PRIMARY KEY,
cont> FirstName varchar(25),
cont> LastName varchar(25)
cont> );
SQL> INSERT INTO clients VALUES ('1','Some','Guy');
1 row inserted
SQL> INSERT INTO clients VALUES

('2','Other','Bloke');
1 row inserted
SQL> SELECT * from clients;
CLIENTID FIRSTNAME LASTNAME
1 Some Guy
2 Other Bloke
2 rows selected
SQL>

All we have to do now is fire up Phobos and cluster them :-).

If you install SQL Services on the database server, you can install the Rdb Client on your Windows box in order to administer Oracle Rdb on OpenVMS.

Sunday, February 03, 2008

Accessing PostgreSQL and Oracle with Access and SQL Developer

Microsoft Office Access is a RDBMS that uses a GUI interface and RAD tools and a Jet Database Engine backend. It can also use external data stored in SQL servers such as MSSQL or Oracle, PostgreSQL, DB2, etc. via ODBC.

PostgreSQL is "the most advanced" open source database. It is a BSD-style licensed ORDBMS that supports advanced SQL features such as referential integrity constraints (foreign keys, column checks, etc), full ACID compliance, ANSI SQL compliance, views, rules, sub-selects, transactions, triggers, sequences, inheritance and has a built in language (PL/pgSQL) similar to Oracle PL/SQL. It also exhibits almost linear scalability up to 16 cores, being much more scalable then say, MySQL. As of version 8.3 it gets a performance and scalability boost too. The pgbench benchmark here shows an almost 50% performance boost (under certain workloads) from 8.1.

Using an ODBC connection you can use Access as a Rapid Application Development interface to develop Forms, Reports and Applications using PostgreSQL as a backend database, via PSQLODBC.

Install psqlodbc on your Access machine, and all you need to get started now is a PosgreSQL server (if you don't have one on your network you can install one on your Windows machine from:
http://www.postgresql.org/download/

Fire up Access and open up a database. We are going to create the ODBC connection and save the settings. First, let's export some table to the PostgreSQL database via ODBC. We can later link or import the table (in any database).



Create a new Data Source using the "PostgreSQL Unicode" driver. The goods database was created using "CREATE DATABASE goods OWNER cmihai ENCODING 'UTF8'" and we are planning on storing Unicode data.




Once you've selected a Server hostname (or IP), username, password and database (like the newly created "goods" database in your PostgreSQL server) you need to set some advanced options. Uncheck the "Bools as Char" box.



Check "True is -1":



Now we can Import a table using an external data source (it will import the structure and data of a Table in PostgreSQL as a table in Access. The tables will not be linked).

We can also Link tables using an external data source. This means that the data and structure of the table (schema) is only modified in the PostgreSQL database. We can link multiple applications to the same database (and tables). Just use Get External Data - Link to Data Source and select the PostgreSQL ODBC connection.




As you have noticed, PostgreSQL is case sensitive.

The linked tables are shown in the Table view with a sphere icon.



While you can use the Query Builder (in Design view or SQL view) to query data in the Access database (it can use both access tables and ODBC connected tables), there is an option to pass the SQL query directly to PostgreSQL, in Pass-Through mode.




SELECT public_clienti.nume, public_clienti.prenume, public_tari.tara
FROM public_clienti INNER JOIN public_tari ON public_clienti.tara = public_tari.tara
WHERE (((public_clienti.nume)="Gigi"))
ORDER BY public_clienti.nume, public_clienti.prenume;

The PostgreSQL query wouldn't use the public_clienti prefix, we can just do a simple Pass-Through query:



You can use Pass-Through queries in your Forms and Reports too.

Of course, you can also use Access with Microsoft SQL Server 2005 Express (freely available) or even the free Oracle 10g Express, using the SQL Developer Quick Migration tool to export MDB files to Oracle.



You can use the Quick Migration Wizzard:



Or the full blown "Oracle Migration Workbench Exporter for Access" to export your .mdb file for SQL Developer and Oracle Application Express.

Wednesday, January 16, 2008

Sun Microsystems buys MySQL for 1 billion USD


" We announced big news today - our preliminary results for our fiscal second quarter, and as importantly, that we're acquiring MySQL AB." - Jonathan Schwartz - CEO of Sun Microsystems, Inc.

Read more here. Sun & MySQL AB press conference here.

I'm also not quite sure on how will this impact Sun's long term policy on PostgreSQL. Sun offers PostgreSQL support (PostgresSQL on Solaris even has native DTrace probes), and was a big contributor to the project. I don't think they would drop PostgreSQL support though. Maybe port PostgreSQL to MySQL as a storage engine? :-).

I'd still like to know how Sun expects to make money off MySQL. Well, enough money to justify the 1 billion investment. Sun does tend to make money off support contracts, services, hardware and all that, but MySQL AB hardly managed to pull in $50 million last year. And they have around 350 employees. And besides, nothing stopped Sun from selling MySQL support and all that before.

http://finance.google.com/finance?q=NASDAQ:JAVA

Sun Microsystems also released the Preliminary Results for Second Quarter Fiscal Year 2008 Report:

"Sun expects to report revenues for the second quarter of fiscal 2008 of approximately $3.60 billion, an increase of approximately 1 percent as compared with $3.57 billion for the second quarter of fiscal 2007. Net bookings for the second quarter of fiscal 2008 were approximately $3.85 billion, an increase of approximately 7% year over year."

I'm waiting to see how Oracle (who already bought Open Source databases Berkeley DB2 and the MySQL InnoDB engine) will react to this one. Remember what Oracle did when RedHat bought JBoss? Shortly after, Oracle "Unbreakable" Enterprise Linux (based on RHEL sources) "just happened". What now? OracleSolaris? :-). Oracle also tried to buy MySQL AB before.

On a side note, Oracle bought BEA today, for $8.5 billion, after BEA turned down their original offer of $6.7 billion. Here's the Oracle Press Release. A nice addition to their "strategic acquisition" list, which already gathered almost 40 entries since 2005.

Tuesday, January 15, 2008

Most Oracle Admins don't patch security flaws

As of January 2005, Oracle provides Critical Patch Updates on Metalink every quarterly schedule to address significant security flaws and recommended updates (required for security fixes). So, how is this all working out? Well, see for yourself...

"Complexity of task makes admins not want to bother":
This research shows that "Two-thirds of Oracle DBAs don't apply security patches"

2/3? IMHO it's more like 9 out of.. 8.

""In fact, a good two-thirds of all Oracle DBAs appear not to be installing Oracle's security patches at all, no matter how critical the vulnerabilities may be, according to survey results from Sentrigo Inc., a Woburn, Mass.-based vendor of database security products.""

Thursday, January 03, 2008

Unconventional Oracle Database installation in a straitjacket

Bored? http://blogs.oracle.com/otn/2008/01/03#a1182

Saturday, December 01, 2007

Sun openxVM Virtualization

Xen + OpenSolaris - OpenxVM
Xen + Oracle Linux - Oracle VM
Xen + RHEL - RedHat Virtualization
VMware + RHEL + VirtualCenter - VMware Infrastructure / VMware ESX, etc.
Xen technology + Windows 2008 + Stuff - Windows 2008 Server Virtualization.
KVM + Linux + modified qemu - Kernel Based Virtual Machine

VMware Server, Microsoft VirtualPC / Virtual Server and VirtualBox - free!

Anyone see a pattern here? ;-\.

Virtualization is the new Java!!! There's hypervisors and emulators everywhere!

Wednesday, November 14, 2007

Virtualization - the new old thing everyone hypes about

Oracle has built their own virtualization technology, Oracle VM, on top of Xen.

Saturday, October 27, 2007

X forwarding with ssh -X and XMing

Redirecting X over tcp / udp and using something like "XWin -query machine" is insecure. So are most VNC solutions. You can use X forwarding over ssh:


% ssh -X -C -c blowfish MachineHostname xterm


(Blowfish encryption tends to be a bit faster, and -C enforces compression, though it should be enabled by default. If you have issues with X forwarding, check your /etc/ssh/sshd_config for "X11Forwarding yes" and "ForwardX11 yes").

Sometimes you _have_ to run a graphical interface on a UNIX machine, and do so from your Windows box. Examples include the Oracle Installer and some other Java applications.

While you could install Cygwin to provide you with an XOrg server implementation, Cygwin tends to be quite big. A lighter and faster option would be to use XMing. It's small, fast and just works. Just fire up XWin, and it will listen on 0:0 by default.



Now you can use "ssh -X machineIP xterm" and it will start a remote XTerm right on your machine. Or if you use putty, make sure you redirect X:




Now run your favorite GUI application.

Friday, October 19, 2007

Backup and Recovery Primer - Part I: Backup Strategy

Backup Basics and best practice. Developing a backup strategy.

A proper backup strategy should be part of every disaster recovery plan. Every company should have at least a basic DRP, business continuity plan and employ risk management techniques.

Data backup and recovery falls in the prevention against data loss category, along side surge protection, interruptible power supplies (UPS), fire prevention systems, data security software (IDS, Antivirus Software, etc).

A backup is not a simple thing. You can't just throw your files on some random storage array every now and then and expect things to work out. A proper backup requires planning, a backup strategy, risk assessment and team work.

1) What does a backup strategy help us mitigate against?

  • Disk failure. - Face it, disks fail. Often.
  • Filesystem corruption or disk corruption, or other events that leave our disk in an inconsistent state. - I've seen this one too many times. You run out of inodes on a filesystem and you also need to run fsck on it, but you cannot. And you cannot mount it either. Or your filesystem decides to break, and corrupts your data. Filesystem corruption is more often in the case of power failures and forced shutdowns.
  • File deletion and accidents: I've seen things like "# rm -rf $HOME/*" on a UNIX system (where the default root $HOME is /, of course) and various other accidents using pipes or dd. And it's usually easier to restore files from backup than to try to restore them after you've erased them. Also, allowing testing and development on production systems will eventually lead to such accidents taking down your main production database sooner or later...
  • Stolen or destroyed disks / machines. Laptops are especially vulnerable to this.
  • Tampering with the data: Viruses, exploits, hackers may modify and tamper with your data. You may need to perform a roll-back to a previous state of your data.
But, most important, a proper backup strategy will save you and your company money. Data loss and downtime will lead to financial losses due to lost customers, wasted money, image and reputation loss, morale going down among your staff or even legal problems. Not to mention there are things that simply cannot be recreated once lost, like access logs and such.

You must fully understand why you need a backup strategy, what it is you're protecting (don't just think of data, think of your companies reputation, your job security, loss of revenue and such).

2) Who is responsible for the integrity of the data

The data owner. Which, in most cases, is upper management. It's management's responsibility to do a risk assessment, and deploy the proper business continuity and disaster recovery plans. They often decide to delegate permissions and responsibility to such tasks down the chain of command.

3) What do you make backup copies of?

Just your production database? The whole system? Just the critical data tables?
It's your responsibility to asses what data is critical, how long it would take to restore a system in case of a disaster (hope for the best, but expect the worse. Can you cope with a fire? How about and earthquake? How about a disgruntled employee purposely altering or erasing your data?).

4) How often do you backup?

Do you need continuous data protection (CDP)? Can you accept loosing a day's work? How about losing one day of everyone's work? If you have 1000 users, that may as well be 3 years worth of work right there, in a single day. What will that cost you?

5) How do you backup?

Will you be using tapes? Will you purchase a storage array and use it for backup purposes? Will you be using optical media? Are you going to do this across the network? How will the network cope with the load generated by the backup?

What software will you use? How much does it cost? What about the total cost of ownership? Will future versions be supported and be able to access older backups?

Are you storing all the relevant information to restoring your systems? How about permissions or disk volume / partition configuration?

6) Where will you store your backup?

Doing a backup on the same disk, or on the same disk on the machine you're backing up is usually a very bad idea. Or leaving the tape in the tape drive or on top of your machine. Think about it. That tape probably contains vital and confidential information. You don't want it to go up in flames with your production systems, or get stolen along with the confidential business records it contains. You really need to evaluate all possibilities in terms of on-site storage (fire-proof tape safe, tape robots or even a simple storage cabinet) as well as off-site storage.

Also, consider online backup vs. offline backup. Consider something as simple as a rsync-snapshot/rsnapshot/rsync-with snapshots or as complex and powerful as Sun's StorageTek Availability Suite.

7) Monitoring and testing

Don't just dump the fs content to a tape and leave it there. Test and monitor your backup and restore procedures.

Test your backup software. Some companies even go so far as to test a new backup solution for years in parallel to the old solution before committing themselves to using only the new backup method.

Always keep your backup policy up to date. Make sure your plans and strategies reflect real life situations.

8) Restoring data

Backups in themselves have little importance. It's restoring the data that matters. How will you get data off those tapes / cds? How long will it take? Will you have your system up and running to a satisfactory baseline, fast? How about restoring individual files from a certain point in time? Say a user requires an 3 month old email. What will you do then, restore the whole mail database, from 23 tapes by restoring a full backup, the incremental, the differentials, etc? That wouldn't be too much fun, now would it...

It's usually a good idea to take a layered approach to backup. Like in Windows, you have System Restore to revert to a previous state of the operating system, Shadow Copies to restore older versions of files, you have ntbackup to do a system state, registry and filesystem backup, and Windows Complete PC Backup (or tools like Norton Ghost) for bare metal recovery.

Make sure your mail server stores emails for a certain period of time. Have your log servers store logs and rotate / archive them at a specific interval. Here is where products like QFS / SAMfs really shine.

The idea is simple. It's a lot easier to restore and manipulate files from lower backup levels than it is to manipulate bare metal recovery backups or full filesystem backups.

9) Scalability

Data within a company grows at an exponential rate. As data grows, so will your backup needs. You will need to plan ahead, make sure all your backup systems are scalable and can handle growth. If you hit some weird limitation (like with some filesystems for example, that can't grow beyond 1-2 TB and so on), that's pretty much it..

Also, make sure that while your systems are scalable, they don't grow beyond your power to manage them. Keep things simple and easy to understand. Document everything.

Tuesday, October 02, 2007

Oracle 10g on Solaris 10 - SUNWsprox dependency

Oracle 10g seems to depend on SUNWsprox - Sun workshop Bundled 64-bit make library. The x termination stood for 64 bit libs in the pre Solaris 10 days, but this no longer applies. The package you actually want is SUNWsprot.


# pkginfo | grep SUNWsprot
system SUNWsprot Solaris Bundled tools


Oracle actually needs libmakestate.so.1. As we can see, that is provided by the SUNWsprot package (part of Solaris 10).


# grep libmakestate.so.1 /var/sadm/install/contents
/usr/lib/amd64/libmakestate.so.1 f none 0755 root bin 12432 31159 1172201465 SUNWsprot
/usr/lib/libmakestate.so.1 f none 0755 root bin 9080 44832 1172201465 SUNWsprot


During the install, it will print out:



SUNWsprox package not installed

If you have the SUNWsprot package installed, you can safely ignore this message.

Wednesday, September 19, 2007

First look at Oracle 11g Database

Oracle has made available parts of Oracle 11g, including the database (Oracle Database 11g Release 1 (11.1.0.6.0) for Linux x86) and I figured I might as well give it a spin. Pity there isn't a Solaris version available yet, but I guess this will do.

I won't go through the trouble of getting a RHEL 4 or reinstalling Oracle Unbreakable Linux. I'll just use an updated CentOS 5 with all the dependencies installed.

After creating the oinstall and dba groups and adding the users (useradd -g oinstall -G dba oracle) it's usually a good idea to do some sysctl tuning unless you have the official Oracle rpm for Unbreakable Linux (see Oracle installation guide for details).

Once that's done, we can just unzip the download and we're off:
database/runInstaller




The list of security related changes in Oracle 11g is pretty impressive, and, as any security professional can tell you, it's about time!

  • Automatic Secure Configuration
  • New Password Protections
  • SYSDBA and SYSOPER Strong Authentication
  • SYSASM Privilege for Automatic Storage Management
  • Encryption Enhancements
  • Fine-Grained Access Control on Network Services on the Database
  • Oracle XML DB Security Enhancements
  • Directory Security Enhancements
  • Oracle Call Interface Security Enhancements
Interesting features include:

  • SQL Developer - Microsoft Access to Application Express migration
  • SQL Performance Analyzer, replay abilities, etc. (similar to Quest software: Spotlight, Foglight) and various tuning tools.
  • Hot patching



The connection to Microsoft Access databases (JET) is quite a nice feature. It allows migration without having to connect it to a MS SQL Server first and then connecting SQL Developer to that. It also keeps things in sync between Oracle SQL Developer and the .mdb file.


(much later that day...)

Well, I just came from the official Oracle Database 11g Launch here. They seem to have quite a strong partnership with HP and Intel. Seems like Intel does have a 80 core CPU in development also... neat.

I must admit, some of the new features look pretty impressive on paper (Flash Back and Total Recall), and Oracle Secure Files (though it does remind me of ZFS in an odd sort of way).

Speaking of which, Oracle Information Lifecycle Mangement (ILM) with policies and all that do remind me of Sun StorEdge QFS and SAM-FS . Interesting how that goes.

From what I've seen so far, the update to Oracle 11g seems worth the trouble (though I'd generally give it more time for testing). They will be stepping on quite a few toes, implementing features that are a bit similar to those found in other products... though, knowing Oracle, they could probably just buy them all. After all, they did acquire like 34 companies since 2005 ;-).