Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to create/drop a database from Java (via JDBC)?

Re: How to create/drop a database from Java (via JDBC)?

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.net>
Date: Sat, 21 Feb 2004 00:19:10 GMT
Message-ID: <2uxZb.26908$4o.42947@attbi_s52>


Niall is correct.

No, they run install.exe (or setup.exe) and with a few mouse clicks they install the instance. (and why one wouldn't want to do that in Oracle is silly.) Why aren't you rewriting the SQLServer install? I don't think the poster is willing to read the docs and understand that an instance in SQL Server is more akin to an Instance/database in Oracle and a Database in SQL Server is very similar to a schema in Oracle. It is very easy to create a new schema in Oracle and very possible to do from a Java program.

You can create an Oracle database from Java, but it would be unnecessarily complicated. You would use dbca to create the scripts and have it create the scripts. Then you can reverse engineer what they do so that you can write a Java program that will create an instance ad the Java program would replace all the instance parameters. There are a ton of scripts to run and you would have to issue all those commands. Ugh, lot of work.(not really useful work, just reinvent the wheel work.)

Alternatively, you could create an Oracle instance at your site (one for each OS that you support) and then just do a restore at the site. That could be Java driven. It is a little more complex than that, but basically we do the same type of thing at work where we take a backup (hot or cold) of our production database and restore it to the test environment and rename the instance. Gosh, then you wouldn't even have to build the tables and indexes unless there were site specific stuff.

"Niall Litchfield" <n-litchfield_at_audit-commission.gov.uk> wrote in message news:40363002$0$10334$ed9e5944_at_reading.news.pipex.net...
> would you create a new sqlserver instance on a machine with no user
> interaction? The same arguments apply
>
> --
> Niall Litchfield
> Oracle DBA
> Audit Commission UK
> "Steffen Siebert" <news_at_SteffenSiebert.de> wrote in message
> news:uy8qxzr7w.fsf_at_SteffenSiebert.de...
> > >>>>> "NL" == Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
> writes:
> >
> > NL> I suspect that you *can* do it, there is after all a CREATE
> > NL> DATABASE statement and a set of steps to be followed including
> > NL> the os stuff. You really, really,really don't want to do it,
> > NL> and if you go to an oracle shop will most probably not be
> > NL> *allowed* to do it - certainly I'd question the competence of
> > NL> those who allowed it to be done like this. It will also take
> > NL> several hours to complete in all likelihood.
> >
> > I'm still puzzled why creating a database seems such a taboo here. In
> > fact, there is a tool/wizard call dbca (which is written in java)
> > coming with oracle 9i which enables me without any oracle knowledge to
> > create a database with a few mouse clicks (and also to drop it
> > again). I've done it, it takes only some minutes and after that
> > verything is working for us (we can create tables and run our
> > application).
> >
> > All I want to do is the same as dbca but without user interaction
> > (mouse clicks) from my own java application.
> >
> > I'm aware that such a database only uses default settings which are
> > not optimal in performance and it needs oracle experts to fine-tune
> > the settings, but this is nothing I want nor need to do.
> >
> > Ciao,
> > Steffen
>
>
Received on Fri Feb 20 2004 - 18:19:10 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US