الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

ORA-12154: TNS:could not resolve the connect identifier specified

بدأه سماء بعيدة في 21 مارس 2012 · 4 رد · 2,983 مشاهدة · في Microsoft Visual Basic.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

ظهرت لي مشكلة

ORA-12154: TNS:could not resolve the connect identifier specified

عند ريط الفيجوال بيسك دوت 10 مع الاوراكل

سبق ونزلت ل 11g express وحقيقي ما عرفت ابني فيه جداول وبعدين نزلت oracle sql developer وبنتيت جداولي فيه

طبعا باتباع التعليمات حرفيا:

create_connection.jpg

Connection Name: xe_manal

user name: manal

password: manal

وبعدين انشئت 3 جداوال

بالبرنامج كتبت:

Imports System.Data.OracleClient

 Dim con As New OracleConnection
        con.ConnectionString = "User Id=manal;Password=manal;Data Source=oracleSN"
        con.Open()

وبجثت بقوقل عن الملف

system.data.oracleclient.dll

وبعدين

Oracle%20Namespace.jpg

بس انا ماعندي الملف تحت .net

ولكن رحت لاستعراض واخذت الملف system.data.oracleclient.dll من سطح المكتب

لقيت حلول بمواقع اجنبية بس ما فهمتها لانهم يشرحون للناس اللي اصلا عندهم خبره

مثلا:

اقتباس

The Oracle docs note:

ORA-12154: TNS:could not resolve the connect identifier specified

Cause: A connection to a database or other service was requested using a connect identifier, and the connect identifier specified could not be resolved into a connect descriptor using one of the naming methods configured. For example, if the type of connect identifier used was a net service name then the net service name could not be found in a naming method repository, or the repository could not be located or reached.

The following actions may be appropriate:

If you are using local naming (tnsnames.ora file):

Make sure that TNSNAMES is listed as one of the values of the names.directory_path parameter in the sqlnet.ora Oracle Net profile.

Verify that a tnsnames.ora file exists and is in the proper directory and is accessible.

Check that the net service name used as the connect identifier exists in the tnsnames.ora file.

Make sure there are no syntax errors anywhere in the tnsnames.ora file. Look for unmatched parentheses or stray characters. Errors in a tnsnames.ora file may make it unusable.

If you are using directory naming:

Verify that LDAP is listed as one of the values of the names.directory_path parameter in the sqlnet.ora Oracle Net profile.

Verify that the LDAP directory server is up and that it is accessible.

Verify that the net service name or database name used as the connect identifier is configured in the directory.

Verify that the default context being used is correct by specifying a fully qualified net service name or a full LDAP DN as the connect identifier

If you are using EZCONNECT naming:

Verify that EZCONNECT is listed as one of the values of the names.directory_path parameter in the sqlnet.ora Oracle Net profile.

Make sure the host, port and service name specified are correct.

Try enclosing the connect identifier in quote marks. See the Oracle Net Services Administrators Guide or the Oracle operating system specific guide for more information on naming.

NOTE: While there are many possible causes for the ORA-12154 error, it can also appear in the stack with a TNS-03505: failed to resolve name error indicating a problem occured prior to the server being found.

Also note the similiarities in numbering and content for ORA-12514, which is related to the tns listener service.

#2

السلام عليكم ...

  1. المشكلة في Data Source=oracleSN حيث أن oracleSN يجب ان يكون اسم الخدمة (Local Net service Name) أو اسم الجهاز ..
  2. أنا استخدم الــ Connection التالي :
            	oracleConn.ConnectionString = "Persist Security Info=False;User ID=system;password=manager;Data Source=hosampc";

    حيث hosampc هو اسم الجهاز الذي يحوي القاعدة ... أنا استخدم 11g express ..

  3. مشكلة فى الاتصال بين الدوت نت 2008 و قاعدة بيانات اوراكل (يوجد مرفقات مع المشاركة) .

لا إله إلا الله ... محمد رسول الله

لو كانت مشاركتي مفيدة و تريد تشجيعي على المزيد من العطاء , فضلا قم بتقييم المشاركة

المعرًف القديم : houssam11350_11350

من مواضيعي : ArabGenCode : مولد كود و إجراءات مخزنة و واجهات لجداول سيكوال سيرفر

#3
houssam11350_11350 كتب:

السلام عليكم ...

  1. المشكلة في Data Source=oracleSN حيث أن oracleSN يجب ان يكون اسم الخدمة (Local Net service Name) أو اسم الجهاز ..
  2. أنا استخدم الــ Connection التالي :
            	oracleConn.ConnectionString = "Persist Security Info=False;User ID=system;password=manager;Data Source=hosampc";

    حيث hosampc هو اسم الجهاز الذي يحوي القاعدة ... أنا استخدم 11g express ..

  3. مشكلة فى الاتصال بين الدوت نت 2008 و قاعدة بيانات اوراكل (يوجد مرفقات مع المشاركة) .

الأستاذ الكريم

جزاك الله خير

بالنسبة لـ

اقتباس

بعا أنا استخدمت Data Source=hosampc حيث أن hosampc هو اسم المخدم و يمكن وضع الــ IP (طبعا أنا جربته على Oracle XE) و إذا لم يعمل فأنت بحاجة لإعداد ما يسمى بــ Local Net service Name و هنا رابط يتحدث عن ذلك رابط و تكتب Data Source=orc1 حيث orc1 هو اسم الخدمة التي قمت بإنشائها ...

بالنسبة للرابط يقول:

اقتباس
3- Local Net service Name configurationقم بإنشاء وذلك كالتالي :

قم بتشغيل الأداة التالية Net8 Configuration Assistant والموجودة في:

Start -> programs -> Oracle - Orahome81 -> network administration->

Net8 Configuration Assistant

Oracle - Orahome81 -> network administration ---> <-البرامج <-إبدأ

Net8 Configuration Assistant

أنا ماعندي Oracle - Orahome81 -> network administration

عندي

post-250453-019507000 1332334668_thumb.j

وغيرت طريقة الربط

اضفت للمشروع

Oracle.DataAccess.dll

Imports Oracle.DataAccess.Client
Imports Oracle.DataAccess.Types

     Try
            Dim con As New OracleConnection
            con.ConnectionString = "Persist Security Info=False;User ID=manal;password=manal;Data Source=manalhamed"

            ' con.ConnectionString = "User Id=manal;Password=manal;Data Source=manalhamed"
            con.Open()
            Dim cmd As New OracleCommand
            cmd.CommandType = CommandType.Text
            cmd.Connection = con
            cmd.CommandText = "insert into tablenodes(nodeNo,nodeName," & _
                            "centerX,centerY,radius,fileNo) values(" & nd.pID & _
                            ",'" & nd.pName & "'," & nd.pCenter.X & "," & _
                            nd.pCenter.Y & "," & nd.pRadius & "," & FN & ")"

            Dim success As Boolean

            If cmd.ExecuteNonQuery() = 1 Then
                success = True
            Else
                success = False
            End If

            cmd.Dispose()
            con.Close()
            con.Dispose()
            Return success
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try

بالنسبه للـ ;Data Source=manalhamed

اخذتها من خصائص الكمبيوتر

post-250453-035514000 1332335123_thumb.j

الاوراكل موجود تحت الـ C مباشرة بينما sqldeveloper موجود تحت ملجد program files

وظهر نفس الخطأ

المرفقات
2.jpg3.jpg
#4

السلام عليكم ..

  1. ممكن تجريب Data Source = XE .. في الــ Connection String .
  2. في Oracle XE ندخل إلى محتويات القاعدة عن طريق مستعرض الانترنت من Get Started (في الصورة عندك بالاعلى) و يظهر هكذا ..img1.jpg
  3. بالنسبة لــ
    اقتباس
    أنا ماعندي Oracle - Orahome81 -> network administration
    بصراحة لا أذكر .. ربما هي غير مثبتة أو هي غير موجودة في نسخ الــ Express .. لكن باقي النسخ هي موجودة ..

لا إله إلا الله ... محمد رسول الله

لو كانت مشاركتي مفيدة و تريد تشجيعي على المزيد من العطاء , فضلا قم بتقييم المشاركة

المعرًف القديم : houssam11350_11350

من مواضيعي : ArabGenCode : مولد كود و إجراءات مخزنة و واجهات لجداول سيكوال سيرفر

#5

الحمدلله مشي الحال بعد ما كتبت xe

سبحان الله ما خطر على بالي، جربت امس xe_manal وما ضبطت

الله يجزاك كل خير

مواضيع مشابهة