PHP Default to Specific Schema

We are moving from a PHP(5.2.6)-mySQL environment to a PHP-Oracle environment. I am being supplied with one database which I am to set up 2 schemata one for development and one for production. Is it possible to set up my development and production intranet servers (sun solarus) to default to the receptive schemata so I don't have to maintain different PHP code.
I saw on http://us2.php.net/manual/en/function.oci-connect.php I can define ORACLE_SID and TWO_TASK so it can default to a specific database but how can it be done to a specific schema?
Thank you very much,
Shmuel

I'm sorry if I'm not following it seems from http://wiki.oracle.com/page/PHP+Oracle+FAQ Q.27 "Can I do Operating System Authentication?" that external authentication is for user name and passwords how will it help me with the schema?
I have 2 intranet server instances each with there own set of variables, that is how we dealt with the mySQL we set the variables in the php.ini for development to point to the development database sever and production to production. Since everything else was the same db names, tables, user names, and passwords I never had to worry about juggling different files for connecting to the databases.
Thanks,
Shmuel
Edited by: user6434254 on Aug 25, 2009 7:44 AM

Similar Messages

  • Allow user to create objects in specific schema

    I would like to be able to grant a user/role permission to create/drop tables/views/etc.. in a specific schema, other than their own.
    It appears like I can do either
    grant create table to role
    or
    grant create any table to role
    the former allowing them to create tables in their own schema, the latter allowing them to create tables anyplace.
    Is there really nothing in the middle?
    Why....
    In my application i have a couple of "users" that are really just schemas. They are not used for users to login.
    We have actual user account(s) that are used for connecting to the db by the application.
    We have a role that all of these users belong to.
    At certain points in our application, our use needs to modify one of these application schemas.
    I do not want the user to be able to modify any other schema in the database.
    I can't be the first person to have encountered this. I'm hoping that there is some clever solution that I have just missed thus far.
    10g would be ideal, 11g only would be ok.
    Thanks.
    Edited by: 854248 on Apr 23, 2011 8:54 AM

    854248 wrote:
    I would like to be able to grant a user/role permission to create/drop tables/views/etc.. in a specific schema, other than their own.
    It appears like I can do either
    grant create table to role
    or
    grant create any table to role
    the former allowing them to create tables in their own schema, the latter allowing them to create tables anyplace.
    Is there really nothing in the middle?
    Why....
    In my application i have a couple of "users" that are really just schemas. They are not used for users to login.
    We have actual user account(s) that are used for connecting to the db by the application.
    We have a role that all of these users belong to.
    At certain points in our application, our use needs to modify one of these application schemas.
    I do not want the user to be able to modify any other schema in the database.
    I can't be the first person to have encountered this. I'm hoping that there is some clever solution that I have just missed thus far.
    10g would be ideal, 11g only would be ok.
    Thanks.
    Edited by: 854248 on Apr 23, 2011 8:54 AMYou can give them CREATE ANY TABLE/VIEW privileges and then limit their actions by DDL triggers:
    http://psoug.org/reference/ddl_trigger.html
    http://www.java2s.com/Tutorial/Oracle/0560__Trigger/AFTERDDLONSCHEMA.htm
    Regards
    Gokhan

  • Having the connection object for the specific schema

    hi
    My application interacting with the database of having many no of schema's. I need to create a connection object which is pointing to the specific schema in my database. This is help me to avoid writing schema name in the query every time.
    Thanks
    Siva

    How to specify the schema name in properties file?
    Say for example, i created properties file like that,
    Properties props = new Properties();
    props.setProperty("user", "username");
    props.setProperty("password", "password');
    In which property i can set for schema?

  • How grant all the privilege of a specific schema to a user?

    How grant all the privilege of a specific schema to a user?
    I already create a new schema and import the neccessary data for that schema.
    Now I want to assign all the privilege for that schema to user HR (let user HR become the owner of that schema). How to deal with it?
    Edited by: qkc on May 13, 2011 10:45 AM

    qkc wrote:
    How grant all the privilege of a specific schema to a user?
    I already create a new schema and import the neccessary data for that schema.
    Now I want to assign all the privilege for that schema to user HR (let user HR become the owner of that schema). How to deal with it?
    Edited by: qkc on May 13, 2011 10:45 AMThere is no way - by definition - that one user can "become the owner" of another schema. A schema is, by definition, the collection of objects that belong to one owner.
    but perhaps that is just semantics in the context of what you really want.
    use sql to build sql:
    spool doit.sql
    select 'grant select on someuser.' || table_name || ' to someotheruser;'
    from dba_tables
    where owner = 'SOMEUSER';
    spool off

  • How to connect and export specific schemas in SQL plus

    Hello,
    Wanted to clarify on a few things.
    - Can an Oracle 10g Release 10.2 client be used to connect to a oracle 10.1 database?
    - Is there an option to "connect" (not refer) to a specific schema, say "SchemaA" in SQL plus in order to run a specific sql code on this schema alone?
    - How can we export a specific schema as a dump file in SQL plus-what is the syntax? Assuming username=U;password = PW; Database=DB and schema = Sch
    Thanks a lot.

    - Can an Oracle 10g Release 10.2 client be used to connect to a oracle 10.1 database?
    Yes. O10gR2 client can be used to connect all version of Oracle instance.
    - Is there an option to "connect" (not refer) to a specific schema, say "SchemaA" in SQL plus in order to run a specific sql code on this schema alone?
    connect ShcemaA/pwd@hoststring.
    for e.g.
    connect scott/tiger@oradev
    conn scott/tiger@oradev
    - How can we export a specific schema as a dump file in SQL plus-what is the syntax? Assuming username=U;password = PW; Database=DB and schema = Sch
    Export can be done on Command promt not on SQLPLUS prompt.
    try the following to know all the parameters and usage of exp command.
    c:\> exp help=y
    exp scott/tiger FILE=scott.dmp OWNER=scott GRANTS=y ROWS=y COMPRESS=y

  • Creating directory under specific schema

    What is the syntax to create a directory under a specific schema?
    Here is what I've tried and I get an error:
    CREATE OR REPLACE DIRECTORY test.utl_dir AS 'D:/utl_dir' ;
    Here is the error:
    Error starting at line 1 in command:
    CREATE OR REPLACE DIRECTORY rcdtpump.novus_dir AS 'D:/Novus/novus_dir'
    Error at Command Line:1 Column:36
    Error report:
    SQL Error: ORA-00905: missing keyword
    +00905. 00000 - "missing keyword"+
    *Cause:+
    *Action:+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    You can't, directories are database wide objects, see:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_5007.htm#i2061958
    ...+All directories are created in a single namespace and are not owned by an individual schema+...
    HTH
    Enrique

  • Accessing a specific schema with JDBC

    My database has several schemas and I'm trying to access a specific schema using the following code snipet:
    Class driverClass = Class("oracle.jdbc.driver.OracleDriver");
    Connection jdbcConnection = Drivermanager.getConnection("jdbc:oracle:thin:@datastore:1527:dbname","username","password");
    IDatabaseConnection connection = new DatabaseConnection(jdbcConnection);
    Is there a way to access schema mike27 on dbname? I keep getting the schema pointed to by the public synonyms.

    Hi,
    I would think that you have to override the doDML method in ADF BC to then insert/update the values in the scott schema. For this the main schema must have privileges on teh Scott schema to perform the operation
    Frank

  • How to impdp data only into a specific schema

    Hello,
    How to impdp Tables and Materialized Views only into a specific schema. Also, how to exclude certain tables in particular schemas from being imported. Thank you.

    Pl Check the link
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14215/dp_import.htm#i1007865
    Thanks

  • Exclude specific schema using EXPDP

    Hello ,
    Can anyone tell me have to exclude specific schema in full expdp of the database
    i am using aix 5.3 and 10.2.0.4.0
    Regard

    hi
    exclude.par contains below statement
    userid=system/oracle10g
    directory=dumplocation
    dumpfile=expexcludeschema.dmp
    logfile=expexcludeschema.log
    exclude=schema:" = 'TEST'"
    but i am getting following error
    ORA-39001: invalid argument value
    ORA-39038: Object path "SCHEMA" is not supported for SCHEMA jobs.
    Regards

  • Impdp specific schema from dump which has been created using full=y

    Hi,
    I have received a dump (expdp) which has been created using the parameter FULL=Y. I just want to import (impdp) only one schema into my database. I have used remap_schema and exclude=grants. The schema i want to import is carried out successfully, but in my import log i keep getting the messages such as :
    ORA-31684: Object type TABLESPACE:"TS_BCST1" already exists
    ORA-31684: Object type USER:"OUTLN" already exists
    ORA-31684: Object type SEQUENCE:"SYSTEM"."MVIEW$_ADVSEQ_GENERIC" already exists
    How can i use impdp only to import objects under my specific schema and not have impdp attempt to create system/sys users and its objects, create tablespaces, etc etc.
    Kindly assist.
    Regards,
    Karan

    Use SCHEMAS parameter in the impdp command to import the scpecific schema.
    Eg.
    impdp system/password schemas=user1 remap_schema=user1:user2 directory=dir dumpfile=user1.dmp...........
    You can specify list of schemas you want to import with , (comma) saperated in the SCHEMAS parameter.

  • Set the role to allow to do anything in a specific schema

    Hi all,
    I'm not sure which role or right a I must set to my users.
    I want that all users can do anything in the a specific schema. Users can create, alter, drop, insert, delete, ... a table, index, sequence, etc.
    My users are of developpers. But, I want to be sure that a developper won't alter another schema excepted his schemas.
    I'm not sure the good role to choose to allow theses rights.
    Anyone could help me please?
    Jimmy

    I would think that the resource and connect roles would be the best for your needs:
    select * from dba_sys_privs
    where grantee = 'RESOURCE';
    GRANTEE PRIVILEGE ADM
    RESOURCE CREATE TYPE NO
    RESOURCE CREATE TABLE NO
    RESOURCE CREATE CLUSTER NO
    RESOURCE CREATE TRIGGER NO
    RESOURCE CREATE OPERATOR NO
    RESOURCE CREATE SEQUENCE NO
    RESOURCE CREATE INDEXTYPE NO
    RESOURCE CREATE PROCEDURE NO
    Note that the role does not include the "create view" privilege, so you will need to grant this as well.
    You will also need to give them privileges on tablespaces.
    On 9.2 and before, the connect role would have most of these privileges, but since 10.1 (or 10.2) that role has only "create session" privilege.

  • Sql to show all roles object privileges owned by a specific schema

    maybe this is simple but i'm just not getting it...
    i need sql to show me all of the distinct roles that have privileges granted against objects in a specific schema.
    thanks in advance.

    Feel free to modify the script to reduce the rows to only what you need.
    In terms of Oracle users, roles and privileges, it is just that complicated. Internally, a user and role exist in the same structure (user$). And privileges can be granted to users or roles. Roles can be granted to users and other roles. This means that a privilege (object or system) may have been granted to a user multiple times. USER1 can have 'SELECT' on 'TABLEA' that has been granted directly or via ROLE1, ROLE2 and ROLE3 (since ROLE1 is granted to ROLE3).

  • Import specific schema from exported full database dump...

    In my application if I take backup expdp using full=y and during impdp if I want some specific schemas only then it will fine? or It recommended to specify full=y also in impdp.
    suggest me..

    In my application if I take backup expdp using full=y and during impdp if I want some specific schemas only then it will fine? or It recommended to specify full=y also in impdp.
    Hi,
    Yes it is fine.
    you have three option.
    1. full
    2. schema level
    3. table level
    it is up to you how you want to import your database.
    please refer: http://tahiti.oracle.com === import/export chapter
    Regards,
    Taj

  • How to find invalid objects in specific schema?

    Please let me know hoe to find invalid objects in specific schema such as SYS?
    Please help and guide
    Thanks,
    Waheed.

    Ok i get invalid objects now if i want to delete these invalid objects which query i have to run?
    also let me know there is no harm if i del invalid objects from SYS schema?
    Please help and guide
    Thanks,
    Waheed.

  • How to export objects of specific schema?

    I need to export object of specific schema so please let me know how?
    Thanks,
    Waheed.

    First thing you want to do - decide whether you will use the exp/imp or the expdp/impdp (data pump) routines.
    To make THAT decision for 10g/11g look at CHapter 11 of the Concepts manual. (no decision in 9i - no data pump)
    Once that decision is made, use the appropriate parameters as found in the Utilities manual - for every version from Oracle version 5 on. The parameters are different between exp and expdp

Maybe you are looking for

  • K9N Platinum Problem

    Hello, I have a K9N Platinum 7250-020 and I read from a different forum to make a new thread about the shutdown issues since it said it wasn't affected. Funny thing is, I'm getting the same exact problem. My specs: CPU: AM2 4200+ (2.4ghz, memory is n

  • Idoc for Customer to Customer Posting

    Hi I want to upload finance data in SAP using IDOCS through XI I'm using the following idocs 1) GL to GL Posting ........ ACC_GL_POSTING01 (Accounting: General G/L Account Posting) 2) GL to Customer Posting ..... ACLREC01 (Posting in accounting: Bill

  • Cant Accept funds?

    I recently recieved a payment for an item I sold. The funds have sent but PayPal wont let me accept the funds because I am not verified. I have been using PayPal for a long time both purchasing and selling and have never had a problem until today? Wh

  • Trying to export footage in h.264 but having trouble with heavy compression artefacts. Help please!

    Hey there, I'm trying to export my 10 min short from Premiere Pro in the h.264 codec for Vimeo and Youtube. The problem is, that every time I try to export it, there are some heavy compression artefacts in the exported file. Mostly pixelation and noi

  • Will I be able to put all my programs on my new MacBookPro?

    I recently purchased a MacBookPro 13" retina, 8GB ram, 128GB flash storage 2014. My old MacBook (2008) had 200GB of storage capacity but obviously much slower in speed, they stopped making them rather quickly. It died today, but I had backups of my h