Creating a database link to another schema in the same database

Hello,
I'm trying to create a database link to another schema in the same database. It was created without errors, but when I try to use it I receive "ORA-12154: TNS:could not resolve the connect identifier specified" message...
I'm trying to do it because on my production enviroment the databases are separated, so there I can use database links without problem, but in my development environment it's all in one database separated by schemas...
So I'm trying to simulate the same system to not need to rewrite the query every time I move from development to production environment.
Any ideas?
Thanks

Hi,
Yes, you can create a database link to your own database. I've done it before for exactly the same reason you want to.
(By the way, I think it's a good reason. What are the alternatives?
Having different versions of code for Development and Production? Absolutely not! Terrible idea!
Using synonyms or substitution variables that are set differently in the different databases? That might be more efficient than a database link, but efficiency probably isn't such a big issue in Development.
[Conditional compilation|http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/fundamentals.htm#sthref250]? This might be good; it has all the efficienty of the above options, with more clarity.)
Assuming you do want to stick with a database link, not all errors are caught when you create the link.
Is the Development database in the tnsnames.ora file of the Development server? Do you have other database links, either in the Development server or pointing to it, that work? What is different about the ones that work, and the one that doesn't?
Edited by: Frank Kulash on Oct 14, 2009 1:58 PM
The more I think about this, the more I agree with the earlier respondent: synonymns are a good solution for this.
To that suggestion you replied:
On this way I might use "select * from SCHEMA.table" instead of "select * from table@SCHEMA"... I looking for an option to use the second way...Actually, the suggestion was that you say:
select  *
from    SCHEMA_table_ptr;where schema_table_ptr is a synonym.
In Development, that synonym is defined as schema.table.
In Production, that synonym is defined as table@SCHEMA
Why are you "looking for an option to use the second way"?
If you think that people reading the code should realize that the query is being done via a database link (at least in Production), then add a comment.

Similar Messages

  • DBlink between two schema on the same database.

    Hello,
    I am facing a troublesome situation here regarding a database link. Usually I create my db links between two databases hosted on two different servers but in this current situation, am in short of machines. The database informations are contained in two different schema that were suppoded to be imported on two different databases(servers). As only one machine is available,I would like to know given the situation, whether I can create two schemas on the same database and link both schema using a database link. Is it possible? If yes, how do I achieve that?
    Thanks in advance.

    adomi wrote:
    Hello,
    I am facing a troublesome situation here regarding a database link. Usually I create my db links between two databases hosted on two different servers but in this current situation, am in short of machines. The database informations are contained in two different schema that were suppoded to be imported on two different databases(servers). As only one machine is available,I would like to know given the situation, whether I can create two schemas on the same database and link both schema using a database link. Is it possible? If yes, how do I achieve that?
    Thanks in advance.Cann't understand you. If you transfer data between two databases, then use database link. If you use only one database, then you don't need to use database link. Please elaborate more

  • How do I link to another page in the same iBook?

    I am trying to link from within the text of my book to another page in the same iBook. How do I do that in iBooks Author?
    For example...
    The text on page 1 might read.... "If you'd like to jump to the page on herbivores, click here". And that text would be linked to page 49, which is about herbivored.
    Any ideas? Greatly appreciated!!

    It looks like I figured this out by playing around with it.
    The reason that I couldn't bookmark the text earlier is that I had created a text box and entered text in there. When you create a text box, that text is not recognized by the bookmark widget. However when you type directly into the page template itself, it recognizes the text just fine. I'm able to set bookmarks and then link to those bookmarks using the hyperlink featuer. Looks like it's solved, I was just trying to use the wrong tool for text entering.
    Thanks for your help Don, you've been great!

  • DUPLICATE DATABASE IN ANOTHER HOST WITH THE SAME DATABASE NAME

    Hi all.
    I want duplicate a database(dbteste1 host:wander) to another host(magda) with the same database name.
    My tnsnames in host wander is this:
    DBTESTE1 =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = wander)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = dbteste1)
    DBTEST1 =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = magda)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = dbteste1)
    Tnsping is ok !!!
    Follow the rman command;
    RMAN> run
    duplicate target database to dbtest1 nofilenamecheck;
    and i get the following message:
    RMAN-06136: ORACLE error from auxiliary database: ORA-01503: CREATE CONTROLFILE falhou
    ORA-01504: o nome 'dbtest1' do banco de dados nÒo corresponde ao parÔmetro db_name 'dbteste1'
    If i run this command:
    RMAN> run
    duplicate target database to dbteste1 nofilenamecheck;
    and i get the following message:
    RMAN-03015: error occurred in stored script Memory Script
    RMAN-06136: ORACLE error from auxiliary database: RMAN-20021: database not set
    RMAN-06031: could not translate database keyword
    I´m using oracle 9.2.0.7 on Windows

    Wrong procedure and connection command,
    check Oracle document,
    Duplicating a Database with Recovery Manager
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96566/rcmdupdb.htm#RCMUG012
    Follow all steps listed.

  • Two ifs schemas on the same database?

    Can I use two different ifs schemas on the same oracle DB for two different IFS instances on two different machines? I don't want to run two databases due to memory issues, but I wanted to run two different ifs schemas (one for development/testing, and one for production). Are there any issues associated with this?

    I am not aware of any iFS-specific issues if you are running the database on a separate machine from your middle-tier iFS boxes.
    But you will have the standard problems of having one database for development and production (e.g. if you need to bring down the development database for any reason, you impact the production database, since they're the same).
    The only problem I can think of related to iFS is that you will be sharing one Context queue, so that if you have any documents loading in from your development environment which cause problems in the queue, your production iFS will suffer.

  • Rman backup and restore on another box with the same database name

    Hi,
    I am using the following script to backup the database, I want to restore the backup on another server with same database name but different datafile locations , Can some one help me in the restoration please.
    #set oracle_sid=LIVE
    run {
    allocate channel t1 type disk;
    backup database plus archivelog delete input format 'D:\Backup\ORACLE\LIVE\df_t%t_s%s_p%p';
    backup current controlfile;
    release channel t1;
    Thanks

    You need to use "set newname" before you restore your database.
    You can refer this http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmdupad.htm
    RMAN> connect target /
    connected to target database: TEST (DBID=2033933270)
    RMAN> run
    2> {
    3> startup nomount;
    4> restore controlfile from 'location/DF_T770331608_S104_P1';
    5> alter database mount;
    6> restore database;
    7> recover database;
    8> alter database open resetlogs;
    9> }Also, you have connected to the database TEST, so is the TEST database the new database that you want to create using restore method ?
    If yes, then how the status of the database is OPEN ? The database status should be nomount before you restore the controlfile.
    If the database is not started, then:
    RMAN shows as "connected to target database: TEST (not started)
    If the database is in nomount stage, then
    RMAN shows as "connected to target database: TEST (not mounted)
    If the database is in mount stage, then
    RMAN shows as "connected to target database: TEST (DBID=xxxxxxxx, not open)
    If the database is open mode, then
    RMAN shows as "connected to target database: TEST (DBID=xxxxxx)
    In the output you mentioned, RMAN is showing the status of the database as opened. So if TEST is the database you are creating, then it has to be in nomount stage. In your case, it looks like TEST is the primary database from which you have taken the backup.

  • Go back to previous location after linking to another page in the same document

    I have set up links in a pdf file and would like to have the form go to the page view attached to the link and then return to the location that initiated the link.  I usually use bookmarks to move around pdf forms, but the user didn't want to see the bookmarks and wanted the look of html.   Please let me know how I can link to a location and then go back where I came from.
    Thanks for the help!
    Ken K. - 2191

    Yes. Use a JavaScript action with this code:
    app.goBack();

  • Creating a link to another sheet within the same file in Numbers

    I have a spreadsheet in Numbers that contains many detail sheets with a seperate Summary sheet.
    I want to be able to click on an entry (within a cell) in the summary sheet and (just like a hyperlink) it take me to the detail sheet of that name.
    There is a hyperlink option within the Inspector, but it is only to goto a url or email message.
    Can anyone help, or is this a request I should make for the next version?

    New features means new high version num.
    Version 1 for instance was updated as version 1.0.2 then 1.0.3
    At this time we just got the upgrade to version 2
    Some day we will get an update to version 2.0.2 with oddities corrections.
    Maybe later we will get an update to version 2.0.3 with other corrections.
    For new features we will have to wait for the upgrade to version 3 included in what I named NiWork '10.
    Prepare your bucks
    Yvan KOENIG (from FRANCE jeudi 5 février 2009 18:21:58)

  • Unable to get another schema for the same Report!

    Hi All,
    I've created a report with data retrieved from three different schema's, but when I add a fourth schema with it's name before the query retrieved and run the report, it gives me that: table or view does not exist!
    Why does the report get the three schema's and refused the fourth one!? and how to solve the problem?
    Note: I am using reports 6i.

    HI,
    Make sure the connected user has sufficient privilege on that table.
    Regards,
    Manu.

  • How to view tables in another schema in the database

    I am starting to use the SQl Developer 1.5.
    We can connect to an oracle database successfully, expanding the tables, it shows the list of tables of one schema.
    We have other schema in the database. In the query panel, when we type in the name of the other schema such as tcs. then some table names will popup in the intellisense.
    How can we show the list tables in other schema within the same database.

    In SQL Developer left panel, there's a browse tree. There's a 'Other Users' branch under each database, expand that you will see all the option to check user's objects. Your user need to have check dictionary privilege

  • Creating a new user in the same database

    I have a user in my database who owns all the objects of application.This user has sysdba privilege.
    I want to create a user(schema) in the same database which should also contain exactly the same objects.
    But at the same time the newly created user should not have sysdba privilege.
    What would be the best possible way to do this?
    Can I use expdp/impdp?If yes which options should I use for expdp and impdp?

    Hello,
    Can I use expdp/impdp?If yes which options should I use for expdp and impdp?After exporting the source Schema (with Datapump), you may create a User on the Database with specific Tablespace and Roles / Privileges (without the DBA role).
    Then, with the Parameter REMAP_SCHEMA=source_schema:target_schema, you may Import with Datapump the exported Objects into the User/Schema newly created:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e16536/dp_import.htm#SUTIL927
    Hope this help.
    Best regards,
    Jean-Valentin

  • Export & Import in the same DataBase

    Hi,
    I'm trying to export and import in the same DataBase but in different User/Tablespace, the imp procces create the objects in the same Tablespace of the export. What can I do to create a copy of a schema in the same database?
    Thanks. JEA

    I am not sure if I am reading your question correctly, Create a new user in your database.
    Use the command line (DOS) command 'exp80 username/password@hoststring'
    there are a number of parameters here, you can find their meanings online if you search for 'export ORACLE command line parameters', I don't know what your requirements are but you have to set the FILE parameter with the name of the file you wish to store your output in(ext should be .dmp).
    To import, use imp80 and log on as the new user you created then the following parameters need to be set:
    File= your file name
    SHOW = n
    IGNORE = n
    GRANTS = y
    ROWS = y
    FROMUSER = old user name
    TOUSER = new user name
    TABLES = *
    I hope this helps.
    SE

  • Database link to the same database

    I'm trying to create a database link to the same database.
    It doesn't seem to be working ...
    basically, the target system will have 2 separate database instances.
    I need to emulate this in a single instance database (actually, I don't want to try running 2 oracle instances on my laptop...).
    so I want to do select * from fred@MYOTHERDB
    when I try and create the alias it succeeds, but then selects don't work.
    Lets say my current logon / schema is JOHN (in ORCL) and the other SCHEMA (in ORCL) is JIM
    I tried
    create public database link MYOTHERDB connect to JIM identified by "Password";
    creation worked, couldn't access it.
    Thanks in advance
    Iain

    The machine with the database has tnsnames.ora as
    # tnsnames.ora Network Configuration File: D:\oracle\product\10.1.0\Db_1\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    INVMAN =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = xplaptop)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = ORCL)
    ORCL =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = xplaptop.mshome.net)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    and the local (TOAD) machine has
    # TNSNAMES.ORA Network Configuration File: S:\Oracle\product\NETWORK\ADMIN\tnsnames.ora
    # Generated by Oracle configuration tools.
    INVMAN =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = idc-server)(PORT = 1521))
    (CONNECT_DATA =
    (SID = INVMAN)
    INVMANLAP =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = xplaptop)(PORT = 1521))
    (CONNECT_DATA =
    (SID = ORCL)
    ORCL =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = idc-server)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = ORCL)
    Now I've tried this both from TOAD and from iSQL on the machine with the database.
    It's INVMANLAP which I'm using from the TOAD machine, of course!
    I appreciate your help. It has been the only bright spark in a DREADFUL day (among other things the IDC-SERVER mentioned above has a trashed system disk which has taken out email and my main oracle server). And I have to install this system tomorrow!
    Iain

  • Database link in forms 6i stopped working in database 10g release 2.

    Hi,
    We have Forms 6i with all patches added.
    We were able to recompile the form that contains database link in database 10g release 1 environment. Recently we migrated to database 10g release 2.
    We still can run the form (previously compiled in database 10g release 1), but when we tried to modify the form and recompile it in databbase 10g release 2,
    the forms developer closed down without giving any error message.
    When we removed any reference to the database link from the form, we were able to recompile the form with no problem. Database Linkd in SQL works.
    The question: what do we need to do in the database 10g release 2 to make the link in forms 6i work?
    Thank you. Lev.

    I recently upgraded my development environment from Forms 10.1.2.0.2 to Forms 10.1.2.3 and am experiencing the same problem -- not able to COMPILE a form that references a database link. The error is: "Error 352 at line 99, column 3 Unable to access another database 'LINKNAME'". This occurs on an UPDATE statement within PL/SQL code in a form trigger that used to compile and work fine.
    I tried the database link in SQL Plus and the link is working fine.
    Database environment is 10g 10.2.0.3 on Windows Server 2003.
    Is anyone able to do this?

  • Database link in forms is different that actual database name

    I am using a database link in Oracle Forms 6i, however, the database link name for the referenced database is not the same as the actual databse service/instance name.
    It does not work, and I suppose its something to do with the global names feature which is true in the source database it is in a replication group.
    I would like to know whether the dblink name which I am using in oracle forms, does it have to have the same name as an entry in the tnsnames.ora file, or can be substituted thgrough any so-calld alias from within oracle forms?
    Windows 2k Ad svr, Oracle Forms 6i, DB 9.2.0.1

    I recently upgraded my development environment from Forms 10.1.2.0.2 to Forms 10.1.2.3 and am experiencing the same problem -- not able to COMPILE a form that references a database link. The error is: "Error 352 at line 99, column 3 Unable to access another database 'LINKNAME'". This occurs on an UPDATE statement within PL/SQL code in a form trigger that used to compile and work fine.
    I tried the database link in SQL Plus and the link is working fine.
    Database environment is 10g 10.2.0.3 on Windows Server 2003.
    Is anyone able to do this?

Maybe you are looking for

  • Creative Cloud Subscription & Individual app

    I currently manage 3 creative cloud licenses for 3 employees. I tried adding a single license of Adobe Acrobat but it would not show up in my management console.I was told by customer support that single licenses need to be managed differently. No ex

  • EXTREMELY URGENT : Reinstalling Portal

    By a twist of fate(actually screw-up of the 9iAS installer, wherein deinstalling Discoverer deinstalled everything under the sun), the Oracle Portal version that was installed was removed. The portlets and page-definitions are intact and safe in the

  • Internet Services Are Not Always Connected.​. Help!

    I have a Blackberry Curve 8520 with T-Mobile unlimited internet and Blackberry services. Untill about 2/3 weeks ago I had the blackberry for about 2 months and was working perfectly, however now it's started to have some problems with internet servic

  • Report Designer - Issue in inserting the query

    Hi I'm facing problem when inserting the query in the Report Designer. Following is the steps I take to create new report in report designer. 1. Developed the query in Bex Analyzer. 2. Click on new in Report Desginer. 3. Click on 'Insert Data Provide

  • QuickTime 7.2 error message

    Hello, I've just bought Roxio's Toast 8 and try as I may I cannot get Motion Pictures HD to export small jpeg file images in any movie format. Each time I export either to iMovie or Quicktime as slideshows I get the following error notice after the p