Implement Oracle Streams without having Primary Keys

In our environment, we can't create primary keys so anyone know how to implement oracle streams without having primary keys on the tables.
Thanks,

You can JOIN tables on any compatible columns or functions (like LEFT (PONumber,10) ):
http://technet.microsoft.com/en-us/library/ms191517(v=sql.105).aspx
BOL: "When the (ON) condition specifies columns, the columns do not have to have the same name or same data type; however, if the data types are not the same, they must be either compatible or types that SQL Server can implicitly convert. If the data types
cannot be implicitly converted, the condition must explicitly convert the data type by using the CONVERT function. "
LINK:
http://technet.microsoft.com/en-us/library/ms177634(v=sql.105).aspx
Typically tables are JOIN-ed on FK-s and PK-s.
Kalman Toth Database & OLAP Architect
SELECT Video Tutorials 4 Hours
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

Similar Messages

  • Configure CDC on tables not having Primary Key

    Hi,
    On one of our client majority of tables in their huge database are not having primary key. While starting journaling ODI-15021 error is being thrown. Is there any way to configure CDC on those tables. Even we are not in a situation to create logical primary key on ODI level. Client is asking for an oracle document which talks about such restriction. Kindly help me out. I've gone through documentation as well metalink. I'm not able to find any information regarding it.
    Regards,
    Shashi Ranjan

    Hi,
    Thanks a lot for your prompt reply. Let me describe my situation bit more clearer. I've configured ODI CDC on one schema which contains 1200 tables. I tried to configure primary key on each data store in source model but being an integrator, I'm not the right person to decide primary key on tables so, I reverted back to client to create primary key on tables or suggest what should be primary key. Now, client is asking for an oracle document stating that primary key is mandatory. They have such 20 schema with similar huge number of tables. I've gone through various documents and meta-links but no luck. Need urgent help on it.
    Regards,
    Shashi Ranjan

  • Dbtable without a primary key

    hi!
    is it possible to create a db-table without a primary key? if there is a possbility, how can i do this?
    greetings
    stefan

    Hello,
    The link i provided contains all your answers. Its oracle 8i documentation release. It contains everything that you want to know about oracle 8i release.
    What Are Index-Organized Tables?
    Index-organized tables are tables with data rows grouped according to the primary key. This clustering is achieved using a B-tree index. B-tree indexes are special types of index trees that differ from regular table B-tree indexes in that they store both the primary key and non-key columns. The attributes of index-organized tables are stored entirely within the physical data structures for the index.
    Why Use Index-Organized Tables?
    Index-organized tables provide fast key-based access to table data for queries involving exact match and range searches. Changes to the table data (such as adding new rows, updating rows, or deleting rows) result only in updating the index structure (because there is no separate table storage area).
    Also, storage requirements are reduced because key columns are not duplicated in the table and index. The remaining non-key columns are stored in the index structure.
    Index-organized tables are particularly useful when you are using applications that must retrieve data based on a primary key. Also, index-organized tables are suitable for modeling application-specific index structures. For example, content-based information retrieval applications containing text, image and audio data require inverted indexes that can be effectively modeled using index-organized tables.
    See Also: For more details about index-organized tables, see Oracle8i Concepts.
    Differences Between Index-Organized and Regular Tables
    Index-organized tables are like regular tables with a primary key index on one or more of its columns. However, instead of maintaining two separate storage spaces for the table and Btree index, an index-organized table only maintains a single Btree index containing the primary key of the table and other column values.
    Index-organized tables are suitable for accessing data by way of primary key or any key that is a valid prefix of the primary key. Also, there is no duplication of key values because a separate index structure containing the key values and ROWID is not created. Table 14-1 summarizes the difference between an index-organized table and a regular table.
    Table 14-1 Comparison of Index-Organized Table with a Regular Table
    Regular Table  Index-Organized Table 
    ROWID uniquely identifies a row; primary key can be optionally specified 
    Primary key uniquely identifies a row; primary key must be specified 
    ROWID pseudo-column refers to physical block address 
    ROWID pseudocolumn refers to primary key-based logical ROWID 
    Secondary indexes store physical data 
    Secondary indexes store primary key-based logical ROWID 
    Can be stored in a hash or index cluster 
    Cannot be stored in a hash or index cluster 
    Regards,
    Shekhar Kulkarni

  • How to do hibernate mapping for table or view without a primary key

    Hi,
    Anyone knows how to do hibernate mapping for table or view without a primary key?
    thanks.
    cc

    or you can make all column primary key .Anybody seriously considering that as a good idea should understand the implications:
    1. this requires that each row be unique - that's a minor issue normally, but can be a significant problem in some cases
    2. in practically all databases, a primary key constraint creates a unique index - this has many implications:
    a) in most databases, the index stores a copy of the column data that is indexed - this suggestion therefore more than doubles the data storage required for the data
    b) whenever an indexed column is changed, the index has to be maintained - this suggestion then more than doubles the work that each UPDATE statement has to do, since both the table and the index have to be maintained for any UPDATE at all
    This might work OK for toy projects, but it doesn't scale well at all...

  • Is it possible to Install Oracle Apps without having the user in a group db

    Can we Install oracle 11i with the user oracle:dba for db tier and user aapl:aapl for application tier.
    Is it possible to Install Oracle Apps without having the user in a group dba

    Can we Install oracle 11i with the user oracle:dba for db tier and user aapl:aapl for application tier.
    Is it possible to Install Oracle Apps without having the user in a group dbaI would say no, as the dba group is required to do the database administration tasks.
    What is the point of not using the dba group? Any specific reason?
    Thanks,
    Hussein

  • Problem with JPA Implementations and SQL BIGINT in primary keys

    I have a general Question about the mapping of the SQL datatype BIGINT. I discovered, that there are some different behaviour depending on the JPA implementation. I tested with TopLink Essentials (working) and with Hibernate (not working).
    Here is the case:
    Table definition:
    /*==============================================================*/
    /* Table: CmdQueueIn */
    /*==============================================================*/
    create table MTRACKER.CmdQueueIn
    CmdQueueInId bigint not null global autoincrement,
    Type int,
    Cmd varchar(2048),
    CmdState int,
    MLUser bigint not null,
    ExecutionTime timestamp,
    FinishTime timestamp,
    ExecutionServer varchar(64),
    ScheduleString varchar(64),
    RetryCount int,
    ResultMessage varchar(256),
    RecordState int not null default 1,
    CDate timestamp not null default current timestamp,
    MDate timestamp not null default current timestamp,
    constraint PK_CMDQUEUEIN primary key (CmdQueueInId)
    The java class for this table has the following annotation for the primary key field:
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "CmdQueueInId", nullable = false)
    private BigInteger cmdQueueInId;
    When using hibernate 3.2.1 as JPA provider I get the following exception:
    avax.persistence.PersistenceException: org.hibernate.id.IdentifierGenerationException: this id generator generates long, integer, short or string
    at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:218)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:176)
    at $Proxy16.persist(Unknown Source)
    at com.trixpert.dao.CmdQueueInDAO.save(CmdQueueInDAO.java:46)
    at com.trixpert.test.dao.CmdQueueInDAOTest.testCreateNewCmd(CmdQueueInDAOTest.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at
    Caused by: org.hibernate.id.IdentifierGenerationException: this id generator generates long, integer, short or string
    at org.hibernate.id.IdentifierGeneratorFactory.get(IdentifierGeneratorFactory.java:59)
    at org.hibernate.id.IdentifierGeneratorFactory.getGeneratedIdentity(IdentifierGeneratorFactory.java:35)
    at org.hibernate.id.IdentityGenerator$BasicDelegate.getResult(IdentityGenerator.java:157)
    at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:57)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2108)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2588)
    at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
    at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
    at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:290)
    at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:180)
    at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:108)
    at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131)
    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87)
    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
    at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:618)
    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:592)
    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:596)
    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:212)
    ... 34 more
    This means, that their ID generator does not support java.math.BigInteger as datatype.
    But the code works if I take TopLink essentials as JPA Provider.
    Looking at the spec shows the following:
    In chapter 2.1.4 "If generated primary keys are used, only integral types will be portable." Integral datatypes are byte, short, int, long and char. This would mean, that the Hibernate implementation fits the spec but there seem to be a problem in general with BIGINT datatypes.
    I use a SYBASE database. There it is possible to declare a UNSIGNED BIGINT. The range of numbers is therefore 0 - 2^64 - 1. Since in Java a long is always signed it would mean its range is from -2^63 -1 to 2^63 -1. So a mapping of BIGINT to java.lang.long could result in an overflow.
    The interesting thing is, that I used NetBeans to reverse engineer an existing database schema. It generated for all Primary Keys of Type BIGINT automatically a java.math.BigInteger. But for other fields (not being keys) it mapped BIGINTs to java.lang.long.
    It looks like there are some problems with either the spec itself or the implementation of it. While TopLink seems to handle the problem correctly, Hibernate doesn't. But Hibernate seems to fulfill the spec.
    Is anybody familiar with the Spec reading this and can elaborate a little about this situation?
    Many thanks for your input and feedback.
    Tom

    Not sure if I clearly understand your issue, would be good if you can explain it a bit more clearly.
    "I select a value from LOV and this value don't refresh in the view"
    If you mean ViewObject, check if autoSubmit property is set to true.
    Amit

  • How to code the ejbCreate() method without initailizing primary key?

    Hi all,
    I've just started learning about EJBs, and now am at the stage of learning how to create, deploy and test a CMP Entity Bean.
    Ran into a problem which I'm hoping someone can help out with.
    I'm using SQL Server 2000 as my backend database, and have created a simple table called TEST with 2 fields, id and name. id is set as the primary key, and as an identity conlumn. What this means is that when we do inserts, we don't need to specify a value for the id column. SQL Servers automatically generates that value.
    Here's my ejbCreate method in my bean class:
    public Integer ejbCreate(String name) throws CreateException {
        this.setName(name);
    }When I tried to run the create method from a web client, I got this error:
    javax.ejb.CreateException: [EJB:010148]In EJB 'SampleEJB', the primary key field 'id' was not set during ejbCreate. All primary key fields must be initialized during ejbCreate. at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:186) at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284) at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244) at everbright.ejb.SampleEJB_uzc4wg_HomeImpl_813_WLStub.create(Unknown Source) at jsp_servlet.__index._jspService(__index.java:152) at weblogic.servlet.jsp.JspBase.service(JspBase.java:33) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    So it seems like I can't leave the id field uninitialized in the ejbCreate method. However I don't know what to initialize it with either, because in order to know what value I need to initialize it to, I'll need to run a db query to retrieve the next primary key value for the id field. This doesn't sound very efficient to me.
    I tried to initailize it to null, but that gave me a NullPointerException.
    Why do we need to initialize the primary key field in ejbCreate? Should the container do the insert and then get it from the table accordingly?
    Is there any other way I can get this set-up working?
    Thanks!

    Hi Fusion777,
    Ya, I've been searching around forums for an answer also. Apparently this is indeed a problem that has no general solution. It depends on 2 factors:
    1) Whether or not the database supports autogenerate key (which most does) and how (Oracle does it by sequences while SQL Server by identities)
    2) Whether or not the application server supports 1).
    In my case, I'm using SQL Server and Weblogic Server 8.1 and most fortunately, Weblogic does support identities and sequences. Just define the <auto-key-generation> stanza in your weblogic-cmp-rdbms-jar.xml deployment descriptor, as follows:
    <automatic-key-generation>
         <generator-type>ORACLE</generator-type>
         <generator-name>test_sequence</generator-name>
         <key-cache-size>10</key-cache-size>
    </automatic-key-generation>
    <automatic-key-generation>
         <generator-type>SQL-SERVER</generator-type>
    </automatic-key-generation>
    <automatic-key-generation>
         <generator-type>NAMED_SEQUENCE_TABLE</generator-type>
         <generator-name>MY_SEQUENCE_TABLE_NAME</generator-name>
         <key-cache-size>100</key-cache-size>
    </automatic-key-generation>I've tried that and it works :-)
    I gather from your reply that those who are using JBoss are equally fortunate :-)
    So I thought I'll share this in case some other poor fellow is facing the same problem as we are. At least worse come to worse, he'll have the option of switching to either JBoss or Weblogic and know that it works in both :-)
    Some other users seem to be against the idea of using auto-generated keys for precisely the reason that it is not a standard across database and application servers. See this thread:
    http://forum.java.sun.com/thread.jspa?forumID=13&threadID=329896
    I've in fact stopped working on EJB 2.0 and am exploring something called Hibernate, which seems to have a more generic way of dealing with the auto-generated key issue. In fact, I've heard news that EJB 3.0, which is the upcoming standard for EJB, will be heavily inspired by Hibernate as far as CMP Entity Beans are concerned.
    You can check out Hibernate at http://www.hibernate.org.

  • Updatable report without technical primary key

    Hi,
    I have a number of tables which need a standard updatable query report (MRU/MRD/MRI). However, these tables do not have a generated primary key, but the primary key is edited by the user.
    I've tried generating a standard updatable report for this, however, this doesn't seem to work because it needs a generated primary key.
    So I've tried to write the MRU process myself, which could work. However, how would I add a new row, because this isn't possible unless you use the standard updatable report!!... :S I can't help but think this must be me overlooking something. I can't imagine APEX cannot use standard updatable reports without a generated primary key!
    Who can help?

    The solution you're suggesting is the best in my oppinion as well, however, I would like to know if it's possible to resolve this issue in another way. Using technical key's is best practice, but it's not wrong if you don't... so why isn't there a way in APEX to handle this?
    Maybe using the "Primary Key Source Type" as "Custom PL/SQL Function" in the "Tabular Form Element" is a possibility?
    I will try to convince the customer (other IT department) to use a technical primary key and replace the user generated key by a unique constraint, but ... I just want to know :)
    Edited by: Voxie2 on Jan 7, 2010 2:30 PM

  • Advice on implementing oracle streams on RAC 11.2 data warehouse database

    Hi,
    I would like to know high level overview on implementing one-way schema level replication within same database using oracle streams on RAC 11.2 data warehouse database.
    Are there any points that should be kept in mind before drafting the implementation plan.
    Please share your thougts and experiences.
    Thanks in advance
    srh

    Hi,
    I would like to know high level overview on implementing one-way schema level replication within same database using oracle streams on RAC 11.2 data warehouse database.
    Are there any points that should be kept in mind before drafting the implementation plan.
    Please share your thougts and experiences.
    Thanks in advance
    srh

  • Oracle 10g express edition primary key problem

    Hi , i have a database with varchar as primary key eg.SEG. however after i insert row and set priamry key as SEG , the primary key will be displayed as number eg.1 and not SEG. Why is it so?

    835401 wrote:
    Table Data Indexes Model Constraints Grants Statistics UI Defaults Triggers Dependencies SQL
    CREATE TABLE "TEST_DEPARTMENT"
    (     "DEPT_CODE" VARCHAR2(10) NOT NULL ENABLE,
         "DEPT_NAME" VARCHAR2(50),
         CONSTRAINT "TEST_DEPARTMENT_PK" PRIMARY KEY ("DEPT_CODE") ENABLE
    CREATE OR REPLACE TRIGGER "BI_TEST_DEPARTMENT"
    before insert on "TEST_DEPARTMENT"
    for each row
    begin
    select "TEST_DEPARTMENT_SEQ".nextval into :NEW.DEPT_CODE from dual;
    end;
    ALTER TRIGGER "BI_TEST_DEPARTMENT" ENABLE
    This is my SQLSo why is DEPT_CODE defined as VARCHAR2(10) when you are going to populate it (via the trigger) with a NUMBER?

  • HT201317 how can i share my primary photo stream without having to reselect photos to share

    My wife and I use 2 different icloud accounts but want to use the same photostream and have it automatically updated to both accounts- how can I do this?
    I don't want to select and share new pics every time i take them, i want it to be automatic.
    thanks
    Jason

    You can't delete an iCloud account, you can only delete it from your device. If you log back into your account and enable photo stream, I think you will find that your photo stream photos return.

  • JPQL HOWTO:  "join" entities without foreign/primary keys?

    I have entities Person and Representative.
    Entity Person has fields lastName, firstName and patronymic.
    Entity Representative has field named title.
    The task is:
    Select all Persons and Representatives where representative.title contains Person.firstName, Person.lastName and person.patronymic.
    Person can have several representatives.
    Person and Representative don't have any keys. Is it possible to do it using JPQL or it's better to use native sql query?

    I've tried something like this one:
    public class PersonAndRepresentatives {
         private Person person;
         private List<Representative> representatives;
    //my query:
                    StringBuilder sb = new StringBuilder();
                 sb.append("select new model.stateless.helperobject.PersonAndRepresentatives(p, repr) from Person p, Representative repr");
              sb.append(" where repr.title like p.firstName and repr.title like p.lastName");
              sb.append(" group by person.id");
              List<PersonAndRepresentatives> resultList = em.createQuery(sb.toString()).getResultList();But of course, I get exception on "*,*" which is here: "*from Person p, Representative repr*".
    What can I do?
    Seems like it's better to write native query and do not try to solve the problem using JPQL.

  • How to download an app without having to key my password each time

    How do I set up my Iphone 5 so when I download and app or song I don't have to always enter my password? This is very annoying.

    You can't. This is done as a security measure, so doubtful it will ever change. If you make another purchase within 15 minutes, you won't have to re-enter the password, but that's it.

  • CDC without Primary Key

    Hi,
    Can we implement Change Data Capture in Oracle 10g without having Primary Key at the source level.
    With Regards,
    Katta

    Hi;
    Can we implement Change Data Capture in Oracle 10g without having Primary Key at the source level.AFAIK yes; Please see
    http://docs.oracle.com/cd/B13789_01/server.101/b10736/cdc.htm#i1025409
    http://en.wikipedia.org/wiki/Change_data_capture
    Regard
    Helios

  • Logical standby and Primary keys

    Hi All,
    Why primary keys are essential for creating logical standby database? I have created a logical standby database on testing basis without having primary keys on most of the tables and it's working fine. I have not event put my main DB in force logging mode.

    I have not event put my main DB in force logging mode. This is because, redo log files or standby redo logfiles transforms into set of sql statements to update logical standby.
    Have you done any DML operations with nologging options and do you notice any errors in the alert.log? I just curious to know.
    But I wanted to know that, while system tablespace in hot backup mode,In the absence of both a primary key and a nonnull unique constraint/index, all columns of bounded size are logged as part of the UPDATE statement to identify the modified row. In other words, all columns except those with the following types are logged: LONG, LOB, LONG RAW, object type, and collections.
    Jaffar

Maybe you are looking for

  • Cannot Install Adobe Flash Player 11

    I am trying to install Adobe Flash Player 11 onto a my computer but it just goes to 95% and locks up. I am using Windows XP Pro- version 5.1, service pack 3 Enternet Explorer 8- version 8.0.6001.187.02 The computer had a working copy of Adobe Flash 1

  • Sound with cd rom but nothing else

    my problem is my sound works only with my cd rom   and nothing else  running windows me  windows 98 se and windows xp works fine but nothing with windows me  i have loaded all the drivers and updated them  in the device manager it says with a ? mark

  • TA22807 does mac mini 2012 support universal bluetooth keyboard?

    Such as a Windows keyboard...

  • First bar of bass not recording

    Ok so yet another GB10 issue - the first bar of my Midi bass doesn't record. Seems to show up in gb10 after I record it but only the last 3/4 bars play-back and the first note/bar simply does not play. Secondly.....I can't seem to loop-record (multip

  • InDesign Crash always on the same page

    Hi to all, I've a recurrent crash of InDesign when a browse a document of many pages. The crash occurres always on the same page with this error log: inDesign Crash always on the same page - Pastebin.com Can you help me to understand the cause? Thank