what differences SID and Service Name when use Oracle SQLDeveloper? - oracle

English is not my native please understand
When I try to login like system/password as sysdba to oracle(linux) by sqldeveloper(window)
It fail when through Service Name and return ORA-0131 :insufficient privileges
but SID? successfully passed
what differences? and how to connect with Service Name?

Thomas Kyte explained the difference beatifully :
A service name is more flexible than a SID would be.
A database can dynamically register with a listener using one or more service names. In fact, more than one database can register with a listener using the same service name (think about a clustered environment where you have multiple instances that all are the same database under the covers).
A database on the other hand has a single SID. And a single SID goes to a single database. It is a pure 1:1 relationship.
A service is a many to many relationship.
Service names are used with dynamic registration - the data registers with the listener after it starts up. Once it does that, you can connect.
With the SID - that is more like telling the listener "I want you to connect to this specific database, I know the 'address', here you go"
With the SERVICE - you are asking the listener to put you in touch with a database that can service your request, a database that registers using that service.
More information here, https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1508737000346067364
Similar question was asked in Stack Overflow 6 years back, How SID is different from Service name in Oracle tnsnames.ora
In your test environment, play around with tnsnames.ora and listener.ora. AFAIK, from 12c, Oracle uses only service_name, since it is flexible and has many to many relationship. I will cross-verify from documention if I find it incorrect.

Related

Informatica Workflow Cannot create proper Relational connection object to connect to SQL Server

On my Infa server PC, in Informatica Administration I created a repository service giving Oracle Database information. Once in Informatica I connect to this repository and there I want to create a mapping importing a table from a remote sql server pc (on my home network domain) and then create a workflow to put the data into an oracle target table.
Using ODBC admin console I created and tested the connection and I am also able to telnet the linked sql server and port.
Within informatica I created a relational connection for sql server and when I run the workflow I get the error reason (14007) failed to create and inituiate OLE DB instance and datatabase driven error, failed to connect to database using user I use in SSMS for windows authentication and connection string(). I would like to know, first of of all, if I am doing something wrong, willing to connect me to a repository with oracle database information and then use a sql server table on remote pc. Do I have to create another repository for Sql server and there use sql server tables or I can mix them? secondly I would like to know how to create a relational connection object in informatica for my linked sql server so that it will be the same of relatonal connection created with ODBC admin consolle. Last but not least I would like to understand why gives an error out saying I left connection string empty, when I cannot see a place where I can put it by creating the relational connection object
I might not be able to solve the problem completely, but here's few remarks that might be helpful:
PowerCenter Repository database is where PowerCenter will store all the metadata about the processes you create. It may be Oracle - that's perfectly fine. And as it is not releated to your data sources or targets, you do not need to create another one for different sources/targets. One is enough for all ot them.
Using PowerCenter Workflow Manager create the appropriate connections to all the systems you need. Here you create the connections that indicate ODBC/other connections that will be used by Integration Service to actually connect to your data sources and targets, hence
Make sure the ODBC / other data sources are specified on Intergration Service. It is the IS that will run the process, connect to systems specified in the process with the defined connections.
When you build the mappings, you create them in a client app (Mapping Designer) and you can connect to DB engines to create source and target definitions. Mark, that in such case you use the connection (eg. ODBC data source) defined on the client. Once you will try to actually run the workflow with the given mapping, it is executed on IS (mentioned above) where appropriate connections need to be defined - and that's completely separate.
When editing a session in a workflow, for each source and target you need to pick a connection defined in Informatica Repository, created as described in point 2 above (or use a variable to indicate one - but that's another story)
So the error you mention seems to be related to connection created in Workflow Manager - it probably does not specify the connection string that should refer the data source defined on IS.

Connecting Power BI to ORacle? Filling out TNSNames.ORa

We are using Oracle cloud CRM. Our organization has been using it since quite few years and the people who set it up have already left. I am new here and am trying to connect the CRM data to Power BI. I intalled the ODAC drivers and everything. However, I do not know what to enter in my tnsnames.ora file. That file has asked for service name, server name and hostID/name. No one in the organization has this information. I reached out to Oracle support and here is the response they gave:
Oracle’s response to the service request: “These details are not found in Documentation because they cannot be provided. You'll need to reach out to Power BI support to see if there are alternate ways to create this integration without these details.”
Does anyone know why Oracle would not share these details with us? If there is any other way to find out the server and service name? How should I proceed in such scenarios.
As of now, we use a link to login to the service and we do not have much documentation
Let me attempt to translate.
We are using Oracle cloud CRM
Oracle is hosting our application.
I am new here and am trying to connect the CRM data to Power BI
We want to query the database being used to store our application data.
Oracle’s response to the service request: “These details are not found in Documentation because they cannot be provided..."
This is where it gets fun, they are saying - we do not give clients direct access to the database where their data is hosted. So in other words, you CANNOT connect your tool directly to the database.
So, I think you're best bet, is to look into REST APIs that have been published for you as a subscriber to the service. This is often provided in lieu of providing direct access to your hosted environment.
Your other bet is to contact someone in your organisation that has the oracle connections in a file which you could load SQL Developer by Oracle, and explore the connections there. Most likely this will be a data engineer or IT contact in your organisation who will have this information. Once you have the connection info visible, you can then enter this directly in Power BI after creating an Oracle connection.

Confusion in Oracle naming

I wanted to form oracle database URL for my JDBC conection and few websites say SID should be part of URL and few say schema name.
Please compare schema, service name and SID in ORACLE? And how they are related?
is it like SID:schema is 1:n as in one SID can point to n schemas?
Please explain with the relation between them.
A SID is the unique identifier for a database, or if it's a RAC system for an instance of a database.
A Service is an identifier for a service offered by the database, and the database should be configured for services such as "BILLING_APP" or "CUST_WEBSITE". http://docs.oracle.com/cd/B28359_01/server.111/b28320/initparams217.htm
Don't confuse a database and an instance, by the way. A database is the set of data and control (etc) files, the instance is the memory areas and processes that access it. RAC has multiple instances per database, each of which can register with the listener to offer all or a subset of the total services offered by the database.
A schema is effectively the username that owns the objects, and there can be multiple schemas in the database.
So an application should be referencing a SERVICE to connect to, through a listener on a certain host and port. The listener resolves this to a database (possibly one of many that register to offer that service). The connection is made to the database as a user who might or might not be the owner of the schema. Typically the connection is not made as the schema owner for security reasons -- in fact the best level of security is to connect as User_A, calling code in User_B's schema, whicxh references tables in other users' schemas.
A SID is a Service ID and refers to a single Oracle database instance
A service name is very like a SID but multiple SIDs can be referenced by one Service Name
E.g. in a Dataguard scenario, the primary instance might be SID_01 and ORA_SRV. SID_02 and SID_03 are running somewhere on the network and receiving and applying the log files. SID_01 fails and SID_02 is brought up (Mounted and Opened) and now exposes itself ont he network as ORA_SRV.
Similarly with RAC multiple SIDs make up a single Service.
A schema is in effect a user.
A JDBC connection will be in some form of "HOST:PORT:(SID or Service name)". You will have to connect to the DB and will do so with a username and password. The username will (almost always) connect you to a schema of that name. You can can reference objects in another schema with dotted notation in your sql, e.g. SCHEMA.OBJECT_NAME

Entity Framework connect to mutiple database at runtime

I want to ask if I had a proper design. Background:I develop my web application with EF4. The application will be used by three offices. The business processes in the three offices is similar with each other. Each office has the database their own, but most tables, SPROCs in the databases are the same.My thinking:I want to extract the same tables and stored procedure to a single edmx file, and point the connection string to database at runtime basing on the logon user.
I add a method to the constructor
MPREntities(string connectionString, string containerName)
And will pass the connectionString and the container name, when initializing the MPREntities. The containerName is the same - "MPREntities", it does not depend on the databases pointed to. The connectionString will be changed according to the logon user before passing in. I have done some testing and seems it works. But is that a normal approach? any suggestions?
That approach will work, and is a good use case for this.

can't start oracle service in windows

I'm taking DB prog. class and we are required to use Oracle+ Oracle sql dev. I so far I got 3 DB in oracle each with a connection from Oracle sql dev.
In windows services I only have one service called OracleDBConsole"MY1stDB name" there's no similiar services for the other DBs I created.
When I try to start this service I receive error as the picture
I can connect through the connections in Oracle sql dev. to the other DB I created except the 1st one
Does anybody have an idea on this issue
As one of affected people, I finally found solution:
If this appears, run lsnrctl start as an administrator to start the listener.
Most probably your listener.ova and tnsnames.ova are improperly set.
OK you installed 3 instances on same machine. There are two possibilities.
They are all set up to use default ports so when one is started no other can start due to port conflict. In that case you need to reconfigure ports following documentation
Second possibility is you already have different ports for your instances. In that case please check your connection definitions if they use proper ports. First will probably need default 1521 but others needs other ports. You may try 1522 as when during instalation 1521 was used it could took next free. But generally you should go to NETWORK/ADMIN/listener.ora edit file and check what port is used. Then properly define connection in client tool.
But as said in comments. Installing 3 instances make no sense unless you're trying to do some study with DBlinks simulations.
Mentioned service relates to oracle enterprise manager service.you have this because it configured for your database. but to troubleshoot it please check its logs in %ORACLE_HOME%**HOSTNAME_DBNAME**\sysman\log*. check there logs and send to investigate.
regards,
Mohsen
There is insufficient detail about the error to know what the problem is, however my guess is that subsequent instances are attempting to use the same resource as the already started instance, most likely the port.
Nevertheless, your problem can be solved by not creating multiple instances of Oracle, but rather creating multiple databases in the one Oracle instance.
It is a virtual certainty that your teacher did not intend you to start multiple instances of Oracle.

Resources