Results 1 to 12 of 12
  1. #1
    Join Date
    Jan 2010
    Posts
    6

    Question Unanswered: 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.

  2. #2
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Quote Originally Posted by gens View Post
    Is that possible to create a new Oracle database using PHP code?
    No.

    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.

  3. #3
    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.

  4. #4
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    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

  5. #5
    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?

  6. #6
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    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...

  7. #7
    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

  8. #8
    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.

  9. #9
    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?

  10. #10
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    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.
    Good judgement comes from experience. Experience comes from bad judgement.

  11. #11
    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.

  12. #12
    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 .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •