link to database with current_user

I logged into the EMSDB database. D710.de and created a link of database at EMSDB. D999.de with current_user (... same user, same credentials I'm connected). When I tried to use this link created, I get the error code: "ORA-01017: Benutzername/Kennwort ungultig; Anmeldung abgelehnt. What I don't understand, why I cannot connect to EMSDB. D999.de - but not access to the same database with a database link?
SELECT     'EMSDB.D999.DE'               REMOTE_DB   --NAME OF DATABASE  
FROM DUAL;

VARIABLE VAR_REMOTE_DB VARCHAR2(15);
BEGIN 
    :VAR_REMOTE_DB := '&REMOTE_DB';
END;
/
SELECT  :VAR_REMOTE_DB                REMOTE_DB     
FROM DUAL;

CREATE DATABASE LINK &REMOTE_DB CONNECT TO CURRENT_USER USING '&REMOTE_DB' ;

SELECT TABLE_NAME FROM ALL_TABLES@&REMOTE_DB;
output
SQL> @test

REMOTE_DB
-------------
EMSDB.D999.DE

REMOTE_DB
--------------------------------
EMSDB.D999.DE
SELECT TABLE_NAME FROM [email protected]
                                  *
FEHLER in Zeile 1:
ORA-01017: Benutzername/Kennwort ungültig; Anmeldung abgelehnt


SQL>
Edited by: user5116754 the 22.02.2011 04:33

user5116754 wrote:
Thank you, John... but would it be possible for me to create this database link then?

As I said, if you are not a global user according to Oracle, you must create a link to the database providing the username and password of the user in the remote database that you want to use. Something like:

CREATE DATABASE LINK EMSDB.D999.DE
CONNECT TO username IDENTIFIED BY password
USING 'EMSDB.D999.DE';

How to spy on, what type of user (GLOBAL...) Am I?

Connect to the database local and do:

SELECT external_name
FROM user_uses;

If that returns null, then you are not a global user, if it returns a value, you are a global user in this database. Connect to the database remote (everything is identified by emsdb.d999.de) and do the same thing. If the external names on the two databases are not null and has the same value, then you're a global user on two databases and the current_user should work, otherwise you're ethe not a global user on one or two databases, or you're a different global user on the two databases.

John

Tags: Database

Similar Questions

  • database link between databases with the same name

    Hello
    I need a link to db between two databases are named the same way on two different servers.
    1 has a dev1 and Server2 database server has a database of dev1. The tnsnames on server2:
    DEV1 =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = server2) (PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = DEV1)
    )
    )

    DEV1_server1 =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = server1) (PORT = 1521))
    )
    (CONNECT_DATA =
    (SERVICE_NAME = dev1)
    )
    )

    Can someone let me know a way to create a data link between the previous two?
    Thank you.

    This should work:

    create the '' link of the public database
    to connect to
    identified by ''.
    using '(DESCRIPTION =)
    (ADDRESS_LIST =
    (ADDRESS =
    (COMMUNITY = tcp.world)
    (PROTOCOL = TCP)
    (Host = )
    (Port = 1521)
    )
    )
    (CONNECT_DATA = (SID = )
    )
    )';

  • Link to database for MySQL with Oracle Express

    Hello Oracle Community,

    I made a post on this topic already in the section general, but here is the best place for my question. My goal is to access a mysql to oracle server. Some info about my system and what I've done so far:

    Windows Vista 64-bit
    Oracle Express 10.2

    -installed 32-bit DNS ODBC driver for the database mysql, tested and it succeeded, the name is CHANCE
    -created a new file in the folder admin/hs initLuck.ora, prameters are: HS_FDS_CONNECT_INFO = CHANCE HS_FDS_TRACE_LEVEL = OFF
    -new section in the listener.ora: (SID_DESC = (SID_NAME = CHANCE) (ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server) (PROGRAM = hsodbc))
    -new section in my tnsnames.ora: CHANCE = (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = GOGAPC01001)(PORT = 1521)) (CONNECT_DATA = (SID = CHANCE)) (HS = OK))
    -inexplicable the listener
    -Do a bit of luck, success of tnsping
    -created a link of database: CREATE DATABASE LINK LUCK24 CONNECT TO 'user' IDENTIFIED BY 'password' USING 'LUCK24 ';
    -tried to do a simple select statement: SELECT COUNT (*) FROM customers@LUCK;

    and there I get an error message:

    ORA-28500: connection between ORACLE and a non-Oracle system has sent this message:
    [Generic connectivity using ODBC] [Microsoft] [ODBC driver manager] Der Datenquellenname wurde nicht found, und're wurde kein Standardtreiber angegeben (SQL State: IM002;) SQL Code: 0)
    ORA-02063: preceding 2 lines of LUCK24

    can anyone help?

    Ikrischer

    Ikrischer,
    On which platform do you have installed the drivers 32 bit and HSODBC? He was on a Windows 32-bit platform? It is not supported to run the 32-bit software on a Windows 64-bit platform.
    There were some problems with versions 10.2.0.3 and earlier that are similar to those you typo - problems with bigint and select count. These are laid down in the 10.2.0.4 group of patches, so you should apply to your ORACLE_HOME 10.2 directories and see if the problem still occurs.
    However, as already said HSODBC 10.2 is now desupported you need to find to install 11.1.0.6 DG4ODBC and then apply the 11.1.0.7 patch group which also solves the problem.
    If you have access to My Oracle Support then see this note.

    Select columns MySQL Bigint use HSODBC returns an incorrect value when you use ODBC MySQL Connector (Doc ID 401086.1)

    Kind regards
    Mike

  • Link to database not be created using a stored procedure

    Hello

    I am creating a link of database using a stored procedure.

    Here is the code for it

    CREATE OR REPLACE PROCEDURE create_db_link (ca_db_name IN VARCHAR2,

    ca_service_name IN VARCHAR2)

    AUTHID CURRENT_USER IS

    BEGIN

    EXECUTE IMMEDIATE ' create public database link test_db_link connect to ca_db_name identified by ca_db_name using "ca_service_name" ';

    END create_db_link;

    During execution of the code is created the db_link. But, when I ask all_db_links I get the following result.

    OWNER

    ------------------------------

    DB_LINK

    --------------------------------------------------------------------------------

    USERNAME

    ------------------------------

    HOST

    --------------------------------------------------------------------------------

    CREATED

    ---------

    PUBLIC

    TEST_DB_LINK. WORLD

    CA_DB_NAME

    ca_service_name

    20 Aug 13

    Could you please help me understand why it shows the parameter names in the name column of the USER and the HOST instead of the name of the database and the name of the service?

    This is to show exactly what you said to do.

    Did you expect that Oracle would read as if by magic through your string you passed to run immediately and magically know to replace all occurrences of the string that correspond to local (or even global) parameter/variable names with the values of these variables?  It does not work like that.  You could concatenate the values into the string.

    for example

    EXECUTE IMMEDIATE ' create public database link test_db_link connect to ' | ca_db_name |' identified by ' | ca_db_name: ' using the "' | ca_service_name | " ' ;

    But why are create you database links running?  Shouldn't this be part of the design of your application and the initial fact before the application runs?

  • Adjust the data in the database with the variables

    Hello

    For my internship, I have an assignment to read and set a database with the variables. This SQL server 2005 database contains variables of a controller. These are read and write variables. The assignment is to display the read variables and the user can adjust the variables of Scripture. The first part was "easy" because the forum contained a lot of examples of this. The second part is more difficult because the forum contains absolutely no example of this. Can I use LabVIEW 2010 and 2011, and also I downloaded the 30 day trial of the database connection tool. If it's useful, I can recommend my company to buy this package. Playback vi makes use of a UDL (Microsoft data link) connection.

    So you guys my question is: is it possible to adjust the specific variables in a database using LabVIEW? And maybe you can give me a little advice on this topic...

    Thanks in advance!

    Roy

    In SQL, the specific data are always selected with the keyword WHERE. In VI to update there is a link for options, you can for example add a constant 'WHERE id = 1457 and measure > 0.54 ".

    You can ofc. also build this chain through controls, settings and other means.

    If you prefer, you can use the Execute Query (under Advanced tab I think) to which you can send the complete query example "TestTable Update set name ="Zeus"where id > 14 and id.<>

    /Y

  • Insert data into another database with a script

    Hello.

    What is the best way to insert data into one database with a script

    INSERT INTO BF_PRUEBASMTP.bf_mtp_agr_inscription (ain_agreementid, ain_customerid, ain_paymethodsid, ain_servicemoduleid, referencia)

    SELECT AAG. AAG_AGREEMENTID, ACU. ACU_CUSTOMERID, 2, 2, ins. NUMERO_REFERENCIA

    OF BF_PRUEBASMTP.bf_mtp_agr_biller ABI

    JOIN IN-HOUSE

    BF_PRUEBASMTP. BF_MTP_AGR_AGREEMENT AAG ON ABI. ABI_BILLERID = AAG. AAG_BILLERID

    INNER JOIN 'CLIENTEUNICO. ALMUERZO" ins

    ON THE AAG. AAG_AGREEMENTID = ins. CONVENIOID

    INNER JOIN BF_PRUEBASMTP.bf_mtp_agr_customer ACU

    ON ACU.acu_typedocumentid = ins. TIPO_DOCUMENTO

    AND ACU.acu_numberid = ins. NUMERO_DOCUMENTO;

    CLIENTEUNICO. INSCRIPCIONES = SELECT * DE INSCRIPCIONES - to a DIFFERENT DATABASE


    Thank you very much.

    2931095 wrote:

    If I don't have permissions to create a database link. Is there another way to do this?

    Thank you.

    link to database IS the method by which an Oracle database accesses to a different database.

    If you are the ADMINISTRATOR, you should have permission.

    If you are not the ADMINISTRATOR, you should not have permission and need to talk to the ADMINISTRATOR that is allowed.

  • Could not create the link of database of the schema of the ORA/APEX

    Hello

    I tried to create the link of database for my schema oracle on my localhost and it brings me an error "database user has sufficient privileges for the proposed operation.". I don't know what the problem is?

    This pattern of localhost was created for APEX.

    Thank you

    I tried to create the link of database for my schema oracle on my localhost and it brings me an error "database user has sufficient privileges for the proposed operation.". I don't know what the problem is?

    This pattern of localhost was created for APEX.

    What is developer Sql has to do with the problem? This forum is ONLY for sql developer questions.

    If this isn't a problem with Sql developer please mark ANSWERED thread and repost it in the general forum of the database

    Database General Discussions

    The exception is you say the problem: the user you are using to create the DB link doesn't have the necessary privileges to create the DB link type you are trying to create. Privileges are required on the source and target databases.

    When repost you, you will need to provide:

    1. your full 4 DB for DBs source and target text segment

    2. a copy OF the sql * plus (or other) session you use to create the DB link

    3. information on the user that you use to create the link DB - including the privileges that have been granted to this ulser

    4 information on the type of link DB you try to create

  • Drop the link of database in oracle 11g

    I created a schema with the name of sapsmc which has all the privileges, then I created 1 link of database. Now, I want to drop this database link, but I can't able to drop this error.

    «SQL error: ORA-00604: error occurred at recursive SQL level 1 ORA-20101: Sorry, can't remove any object without the permission of live database SAPGateWay.» ORA-06512: at the level of the 5 00604 line. 00000 - 'error occurred at recursive SQL level %s' * Cause: an error occurred during the processing of a recursive SQL statement (a statement applicable to the internal dictionary tables). * Action: If the situation described in the next error on the stack can be corrected, do so; otherwise contact Oracle Support.

    Then I tried to delete the user SYS, while doing this that I got below error.

    SQL error: ORA-02024: database not found link 02024. 00000 - "database link not found" * Cause: database to remove link is not found in the dictionary * Action: correct the name of the database link

    Please help me I appreciate your efforts.

    ORA-20101: Sorry, can't remove any object without the permission of live database SAPGateWay.

    There is not much we can do about it.

    It is an exception defined by the user, probably from a FRONT DROP trigger defined at the level of the database, which prevents people from dropping objects.

    Contact, one who is responsible (DBA?) about how to proceed.

  • ORA-20002: you can't create links from database

    HI Experts,

    Creating database link, I get the error below. Anyone of you could please have some light on this error. I googled for this error and did not get any update.

    Oracle version: 11.2.0.3

    The user with whom I created this link of database DBA privilege.

    SQL > create database link temp_LINK connect to account identified by * using "(DESCRIPTION = (ADRESSE = (COMMUNUITY=tcp.world) (PROTOCOL = TCP)(Host=myself.us.lev.com) (Port = 1525)) (CONNECT_DATA = (SID = LNDB1DB)))'; "
    create database link temp_LINK connect to account identified by * using "(DESCRIPTION = (ADRESSE = (COMMUNUITY=tcp.world) (PROTOCOL = TCP)(Host=myself.us.lev.com) (Port = 1525)) (CONNECT_DATA = (SID = LNDB1DB)))'; "
    *
    ERROR at line 1:
    ORA-00604: error occurred at the SQL level 1 recursive
    ORA-20002: you can't create links from database
    ORA-06512: at line 4


    Thank you..

    Well Yes, this request confirmed suspicion of SB.

    The datadictionary is your friend

  • Duplication duplicate a database with RMAN, different host database different withou

    Hello

    I want to duplicate a database with RMAN, different host, a different database without RMAN Duplicate Technic.

    I HOST1 with a database DB1 and
    HOST2 with a DB2 database

    I have a complete backup of the DB1 in host HOST2. How can I use this backup to clone the database?

    Thank you

    see the links: -.
    http://kamranagayev.WordPress.com/2010/03/29/RMAN-video-tutorial-series-performing-disaster-recovery-with-RMAN/ (Video Tutorial)
    http://oracleinstance.blogspot.com/2010/08/disaster-recovery-using-RMAN-demo.html
    http://gavinsoorma.com/recovery-scenarios/

  • Creating a new database with the file exporrt

    Hello


    I am to create a new database with an export file.


    I have the export file (exp) and the environment put in place (Oracle10g on UNIX)


    Can you gimme a few guidelines and this lines that I could probably face and again to correct.



    Kind regards.

    Hello..

    Aman has already given a link, to cross.

    Well, as you already have a new environment 10g put in place, create tablespaces and users, (accurate to the source database) with the script from the source database, and then import (imp) the export dump using fromuser touser parameter.

    Anand

  • My ex is connected to my iCloud email secretly and do not think I know so now I can't link my email with my iPhone journal inside iCloud to check my mail or anything, how can I solve this

    My ex is connected to my iCloud email secretly and do not think I know so now I can't link my email with my iPhone journal inside iCloud to check my mail or anything how do I fix this someone please help lol

    Caitlyn,

    In the interest of privacy, I would recommend that you create a new password for your iCloud account.

    https://appleid.Apple.com/

  • BlackBerry smartphones of the suggestions for a weather link that works with the storm

    Hi guys,.

    Suggestions for a weather link that works with the storm?

    I like this one:

    http://www.NOAA.gov/

    I put in my zip code, and then when he shot to the top of my local forecast I bookmarked this page in my Storm. It marks the latitude and longitude, so when I go there next time I have to weather day.

    Easy to read and not a bunch of gadgets ads cluttering it up.

  • link to database

    Oracle Database 11 g 2

    EBSR12.2.4

    Oracle Linux 6.4

    Hello

    I want to create a link of database between 2 separate machines. What is the best way to do it?

    Rgds

    Roshan

    If you try to create DB link of BITEST to PREPRODUCTION, then.

    1. Add entry TNS of PREPRODUCTION in the file tnsnames.ora BITEST.

    2 tnsping PREPRODUCTION, if its OK then

    3. CREATE LINK of DATABASE link_name CONNECT TO target_db_user IDENTIFIED BY target_db_user_paswd USING 'target_tns_alias ';

    4 check the DB link - select * from dual@link_name;

    Kind regards

    Kiran

  • Different databases with the same name in 1 cluster?

    Hello classmates of dba,.

    I wish to discuss with you the following situation:

    We have a 4 RAC Cluster node.

    Databases node 1 and 2 contain the 11.2.0.3 (Enterprise Edition)

    Databases node 3 and 4 contain 11.2.0.4 (Standard edition)

    12.1 GI on all nodes and all are part of the 1 cluster.

    OS: Oracle Linux 6.5 (with + ASM)

    Our company wants to migrate databases EE 1 and 2 to 3 and 4 nodes node:

    -Downgrade of EA to itself

    -Upgrade 11.2.0.3 to 11.2.0.4

    Normally I do this by creating databases with DBCA under a new name and migrate data using Data Pump.

    The problem is that the company wants to have the same name of database on all nodes.

    Is it possible to have the same name of database on all 4 nodes simultaneously (from 2 houses of Oracle RDBMS different with different versions while all 4 nodes share 1GI?

    It is a method of support?

    Let's see if I can describe it more in detail.

    You have a database named ORCL in your RAC environment. Create a new blank database named SLAVE_PORT_NUM. Perform a dump of export of ORCL and import in SLAVE_PORT_NUM. At this point, you have the data in the new database. The original database to stop now:

    srvctl stop database orcl immediate o d

    ORCL is no longer running on all nodes. We just need to allow users to connect to this database with a service name. But before I can do, I need to remove the Cluster registry ORCL:

    srvctl remove the d orcl database

    Now create a service named ORCL that connects to SLAVE_PORT_NUM

    srvctl add service d slave_port_num s orcl r - newdb1, newdb2, newdb3, newdb4

    Your application always tries to connect to "orcl" on this same group. They don't know the PB has changed its name.

    When you change only the name of the service for the new database. I guess that the path of the ASM will have different name right?

    It cares ASM. ASM paths come into play when you create the new db.

    HTH,

    Brian

Maybe you are looking for