How to create Oracle database using Php code? [message #441399] |
Sun, 31 January 2010 08:17 |
gens
Messages: 6 Registered: January 2010 Location: malaysia
|
Junior Member |
|
|
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.
|
|
|
|
|
|
|
|
|
Re: How to create Oracle database using Php code? [message #441561 is a reply to message #441422] |
Mon, 01 February 2010 23:03 |
oratab
Messages: 5 Registered: April 2008 Location: Atlanta and/or Kansas Cit...
|
Junior Member |
|
|
I have been an Oracle DBA for several years, supporting many
different environments + applications... I am not a PHP coder.
( so, take this answer in context )
I would think that if PHP can connect to Oracle and execute dynamic SQL+DDL on the database, ans uses a DB-Session that has proper Oracle-DB permissions... that you should be able to do all those things, and more.
HOWEVER, I would also suggest that it is easier to create SQL scripts/files that contain all of the CREATE statements, and run them directly with Oracle's 'sqlplus" script tool, rather than try to get each SQL statement to run separately via PHP.
Besides, there are several more things that you need to setup, rather than just tables,indexes, and data. You should create a separate UserID+Schema to own the tables, which is NOT the SYSTEM/DBA account. You need to create tablespace storage areas, to properly use disk space, and give you better control of storage, so you are NOT creating application tables in the SYSTEM tablespace storage (and making a cluttered mess). Preferably, you will want to have your indexes and data stored in separate tablespaces, on different drives... unless you database is really small -or- your server is very large and using SAN storage.
THEN, after you have organized your user permissions, and storage areas, you can create the tables & such, using sqlplus.
NOW you are ready to start having your web/PHP application start working with the tables & database contents, to read/write data(select/insert/update) using the pre-defined structures in your Oracle database.
SO, my answer is "Yea, you could do that..." but why make it harder than it needs to be? Run the SQL directly from the DB-sserver, with sqlplus to get the structure/DB-objects and base data setup. Only after that, let your PHP work with the data.
|
|
|
|
|
Re: How to create Oracle database using Php code? [message #441689 is a reply to message #441685] |
Tue, 02 February 2010 11:40 |
|
Michel Cadot
Messages: 68728 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote:I'm so confusing here . Some said it is possible. Some said otherwise
You have for what you pay, forum is free, answers are free.
Quote:can you prepare a real example using PHP?
can YOU prepare a real example using PHP? It is your problem if the forum can't answer you, you have to do it by yourself.
Anyway, Oracle is not MySQL, you don't create a database on the fly.
Regards
Michel
[Updated on: Tue, 02 February 2010 11:41] Report message to a moderator
|
|
|
|
|