If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > How to create Oracle database using Php code?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-31-10, 10:20
gens gens is offline
Registered User
 
Join Date: Jan 2010
Posts: 6
Question How to create Oracle database using Php code?

Is that possible to create a new Oracle database using PHP code? I know that it is possible to create MySql database using PHP. I'm new to Oracle database. Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 01-31-10, 10:26
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,298
Quote:
Originally Posted by gens View Post
Is that possible to create a new Oracle database using PHP code?
No.

Quote:
I know that it is possible to create MySql database using PHP. I'm new to Oracle database.
A "database" in Oracle is a completely different beast than a "database" in MySQL.

My guess is that you in fact want to create a user (=schema) in Oracle. That would be possible from within PHP, but you'll need admin privileges to do that.

I doubt that any serious Oracle DBA will give a PHP script access to the database through a user that has admin privileges.
Reply With Quote
  #3 (permalink)  
Old 02-01-10, 03:16
gens gens is offline
Registered User
 
Join Date: Jan 2010
Posts: 6
Lightbulb

Thanks for reply!

I'm MySql + PHP developer for many years. Recently I just trying Oracle db. I have a MySql utility (PHP class) that performs common tasks like CREATE, DROP, ALTER MySql db (for remote servers). I just try to do that for Oracle db.
Reply With Quote
  #4 (permalink)  
Old 02-01-10, 03:38
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,298
Quote:
Originally Posted by gens View Post
I have a MySql utility (PHP class) that performs common tasks like CREATE, DROP, ALTER MySql db (for remote servers). I just try to do that for Oracle db.
As I said: you can't do that.

But again: you most probably want to create a user, not a database in Oracle.

You might want to start with reading the basics:

http://download.oracle.com/docs/cd/B28359_01/server.111/b28318/intro.htm#i60813
Reply With Quote
  #5 (permalink)  
Old 02-01-10, 03:49
gens gens is offline
Registered User
 
Join Date: Jan 2010
Posts: 6
Oh, I just stated my intention and I understand your reply.

But Donald K. Burleson (the book author of "Oracle Tuning: The Definitive Reference") said it is possible.

Please take a look at How to create Oracle database using Php code? - Oracle DBA Forums

Do you believe that he just try to trick me into buying his recommended book?
Reply With Quote
  #6 (permalink)  
Old 02-01-10, 04:07
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,298
Believe me: you do not want to create a database.

In MySQL terms that would be the same as installing MySQL

I suggest you talk with your customer's DBA first...
Reply With Quote
  #7 (permalink)  
Old 02-01-10, 04:24
gens gens is offline
Registered User
 
Join Date: Jan 2010
Posts: 6
Hi, thanks for your reply. The matter solved.

I just wonder why that author want to do some hard selling promoting maybe his best friend book
Reply With Quote
  #8 (permalink)  
Old 02-01-10, 20:32
artacus72 artacus72 is offline
Registered User
 
Join Date: Aug 2009
Location: Olympia, WA
Posts: 337
Not his best friend's book. He owns the company that publishes that book.

I'm sure what he means is that you can use PHP to generate database objects. But an Oracle "schema" is roughly equivalent to a MySQL "database." An Oracle "database" is a completely different beast.
Reply With Quote
  #9 (permalink)  
Old 02-02-10, 13:33
gens gens is offline
Registered User
 
Join Date: Jan 2010
Posts: 6
Question

Hi all,

there was one Oracle DBA said it is * possible * to do that. Please take a look here OraFAQ Forum: Open Database Interfaces How to create Oracle database using Php code?
Reply With Quote
  #10 (permalink)  
Old 02-02-10, 14:20
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 6,153
using PHP to do DDL is like using a hammer to produce 2 boards from 1 piece of lumber.
It can be done,but there are different tools that take less effort to accomplish the desired task.
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Reply With Quote
  #11 (permalink)  
Old 02-02-10, 18:28
artacus72 artacus72 is offline
Registered User
 
Join Date: Aug 2009
Location: Olympia, WA
Posts: 337
*sigh*

Ok, you're not getting it. On Oracle you get one and only one database per instance. So creating a new database in Oracle is NOTHING like creating a new database in most other databases where you can simply issue the CREATE DATABASE command.

Here is a example of what you need to do to create a new Oracle instance.
Creating an Oracle 10g database from the command line only
Now can you use PHP command line (perl/python/ruby/etc) to issue like commands? Sure you can. Would we want or try to? Heck no. Like anacedent said, use the right tool for the job.

Conversely, it's pretty easy to use PHP to create database objects (tables, views, indexes), which is probably what you and the folks saying you can create a database from PHP are talking about.
Reply With Quote
  #12 (permalink)  
Old 02-03-10, 06:28
gens gens is offline
Registered User
 
Join Date: Jan 2010
Posts: 6
Exclamation

hi all,

I just completed my first ever PHP + Oracle project (a small $500 project) .

I understand the * standard * way of using Oracle including creating Oracle db using command line. There are plenty of books/tutorials regarding to this.

However, I just explore the possibility to do it via PHP code exclusively. If someone said it is possible then he/she should prove it by action. Otherwise it was just a political talk on climate change .
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On