Need to Archive the Database. . .

Hi There,
I need to follow the following steps -
1> I need to create a Replica of my Database (Say for ex, if i have 5 Tables in my Original database, then i need to copy all of these 5 Tables along with the data and all the Constraints to a newer database while keeping the Table and Columns Name same)
2> Now if user is Updating the data in the Original Database (i.e. updating some rows or Inserting some new rows to a table ) then i need to move these changes to the new Database once a Day. But here the Catch is that if the User is Deleting some rows from the Original database, then in this case i have to keep those Records as they are without deleting them from the new database.
Now i need to find a way as to how this can be done (whether i have to create some Scripts or a Java Job or do something else???)
Please Help :-)

Hi,
Does you have primary key or unique index on each 5 tables ???
If it's the case, it's possible to catch update,insert (or even delete) by triggers
on these 5 tables in order to stock in a trace table the primary keys/unique index
which will be inserted/updated (with a status (I for Insert, U for Update for example))
And make a procedure to read the "trace table" of the day and
insert the new data on the archive database when status = I;
update the data on the archive database when status = U;
delete in the trace tables all the rows processed.
And launch it by dbms_job once by night.
You have to take care in the order of the process for the 5 tables due to constraint considerations between these tables.
If you have not primary keys or unique index, I recommend to you to create one
(by using sequence number for example) else I think that your procedure will be a quite complex.
Mike

Similar Messages

  • I need to restart the database

    Hi Guys,
    I have migrated my database from oracle 9i to 10gR2 and from 32bit windows to 64bit RHEL4 using full database export and import. Everything works fine. We have got some performance enhancements also.
    But one report generation module which was supposed to complete in 25 minutes takes 1-2 hrs. to complete. Most of the time we need to restart the database to complete the operation. After restarting the database it completes within 15 mintutes.
    What may be cause of such behaviour, any idea? How should I proceed to resolve the issue? The cursor_sharing paramater is 'FORCE' which was same in our 9i setup also.
    Regards,
    Santosh

    Hi,
    >>After restarting the database it completes within 15 mintutes.
    It seems this doesn't make sense. Did you gather statistics for the tables? In addition, take a look at AWR from OEM that contains performance statistics and workload information on the database that is captured every hour and preserved for seven days by default. In this case, historical information is important to diagnose a performance problem that has already happened
    Cheers
    Legatti

  • Need to query the database to get the last sequence number

    Hi all
    I am trying to get the last sequence number of the last row inserted into my Oracle database. Please could someone give me the SQL which would allow me to do this - using Oracle SQL Explorer I have confirmed that there is a sequence on the table which is called: XYZ_SEQ and the code for this is:
    CREATE SEQUENCE "MY_USER_NAME"."XYZ_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 21 CACHE 20 NOORDER NOCYCLE ;
    My Java application is inserting a row into my table and to insert a new row I need to have the last sequence inserted +1 so the new row can be added.
    Any help would be much appreciated.

    Hi,
    Welcome to the forum!
    If you are using a sequence just do (example):
    INSERT INTO TABLE_NAME
       (COL1,
        COL2)
    VALUES
       (SEQUENCE_NAME.NEXTVAL,
        OTHER_VALUE);to obtain (and use) the next number in the sequence when you are inserting.
    If you have a sequence to use for a specific table, you should use it when your insert new data (no matter your are doing that: java application, procedure, etc). Doing this you avoid some problems when you have the sequence 'out of date' about the associated data.
    Regards,
    Edited by: Walter Fernández on Sep 19, 2009 10:08 AM
    Edited by: Walter Fernández on Sep 19, 2009 10:10 AM

  • EJB newbie -- do i need to create the database?

    I know this may seem an odd question but do i need to create a database and create all the tables with commands such as: CREATE TABLE (...)? or will the deployment descriptor do that for me?
    clarkie

    if u are using entity beans there is no need to create database.
    u can make use of create function of the entity beans...if u are using bmp u need to write explicitly the code(sql code) for creating the database
    if u r using cmp u dont need to explicitly write the code for creating the table
    regards
    shanu

  • Need to design the database design to support Chinese language

    Hi,
      can anybody give me suggusstion to redesign the SQL Server 2008 R2 database with chinese language support for existing database with varchar datatype (Non- Unicode Data Type)
    Thanks
    Pari

    You have to use NVarchar. Here is the script. During Select also you need N in the string
    set nocount on
    go
    USE master;
    GO
    IF DB_ID (N'MyOptionsTest') IS NOT NULL
    DROP DATABASE MyOptionsTest;
    GO
    CREATE DATABASE MyOptionsTest
    COLLATE Chinese_Taiwan_Stroke_CI_AS;
    GO
    use MyOptionsTest
    go
    IF OBJECT_ID('jj1') IS NULL
    begin
    create table jj1 (name nvarchar(45))
    end
    go
    go
    insert into jj1
    select N'我家己人有淡薄無爽快。'
    insert into jj1
    select N's省城话; t省城話'
    insert into jj1
    select N'微软数据库'
    insert into jj1
    select N'你叫什么名字?'
    insert into jj1
    select N'歡迎!/ 不用謝!/ 不客氣!'
    insert into jj1
    select N'我想18號坐飛機到倫敦'
    select * from jj1
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • I can insert data into an access database, but I need to querry the database for specific information. How do I do it?

    I can insert data into an access database, now I need to do some simple querries such as selecting all records that are greater than a certain value or = a certain value. How can I return only the selected records?

    If you don't want to spend any money, then instead of ActiveX, I would recomend LabSQL from Jeffrey Travis. I use it instead of the Connectivity toolkit and have had no problems. Besides being free, you have the advantage of being able to use it with any database. ActiveX ties you to Access and you upgrade your version of Access and find the properties and methods are different, you've got a lot of reprogramming to do.

  • Refresh database I need to automise the process

    Hello All,
    I need to automise the process of refreshing the database.
    The scenario is:
    I have one database intance and I need to copy the database to another instance every day.
    How is the best way to do this?
    Regards

    There is a very simple way to do it, as most of the time these days, people want even reporting db into read-write mode for which depending on db size and transactions happening per day, you can consider replication too or other solution like log-shipping\db
    mirroring if you have to have db in read - only mode.
    Below ones are easy to follow if simple ways you want to follow, but first get smtp  access for  this server so that you can use alert for this.
    Create a Sql  Server job to add step by keeping below step A, then add step to wait for backup, copy files steps to be done, like wait T-sql command. Then add final restoration step.
    A). Create a batch file wherein you will be calling first job using osql.
    B). Create a batch file wherein you will be calling restore job using osql.
    1. Create and disable Sql Server Job to backup database. It shd have steps like backup, old files removal, success and failure alerts. Add step to call to Robocopy job for copy backup files.
    2. Create and disable Robocopy backup file copy job to copy backup file to required server again with all options like copy just latest files, enable logging for copy. Add dos command to alert in case of success and failure message. This shd be one db at
    a time so that error and success message can be handled properly. Once copy of file is done then move the backup files to archive folder. Again maintain some retention for all folders where you keep backup files.
    3. Create and disable restore job on required server. Add steps like first kill all session for this db, bring db into single user mode, restore backup db, bring db into multi user mode, add any logins, fix required orphan users{If sql server 2012 use contained
    db to carry on logins and password}, shrink log files to remove unwanted log space, success and failure accordingly. Once backup file gets restored then move the backup files to archive folder, so that by mistake also, nobody shd be able to restore it.
    Thanks,
    Santosh Singh

  • Move RAC database - need to format the disk storage having RAC and ASM

    Hello,
    Short story:
    I need to format the disk storage used by a two nodes RAC with ASM.
    How can I have the database working the new disk storage.
    Long story:
    We decided to change the external disk storage formatting from RAID 5 to RAID 10.
    Configuration is: 2 Solaris nodes having Oracle software installed on each node and running with ASM
    - node1: ORCL1 database and +ASM1 asm instances
    - node2: ORCL2 database and +ASM2 asm instances
    Available is a NFS storage with plenty of space.
    Please tell me which would be the easiest way to move the database?
    Thank you

    Thanks alot for your answer.
    1) There is more trouble: I also have the Voting disk and the OCR on the same (and only) SAN storage. Do you know about steps to backup/restore and/or recreate these?
    As I said I have a NFS file system available with plenty of space.
    2) I will need to backup the database, which way would you recommend: RMAN or EXP ?

  • Do I need start the database before installing Oracle 9iAS portal?

    I found the Oracle white paper which talks about installing
    Oracle8i EE and Oracle 9iAS portal on windows 2000. Based this
    document, after Oracle 8i installaion but before installing
    Oracle 8.1.7.1.1 path, all the Oracle database related services
    startup type have been changed to 'Manual'.
    Based on my understanding, there are some objects will be
    created in this database during the installation of 9iAS portal
    repository. But this oracle white paper didn't say that I need
    have the database ruuning during the 9iAS installation. Do I
    need to start the database before installing 9iAS?
    Thanks

    hi,
    Even i am new to oracle application server and had the same doubt that you have.
    When you install Application Server there would be two tiers installed, application tier and middle tier, these tiers can be running from the same machine or different machines.
    These tiers will have a meta data repository to store application server related data, this database will be installed along with application server.
    It is upto you to install "oracle database 10gR2 " before or after installaion of application server, this will be an independent database which will have its own home, but after this installation you will have three homes, ex: infra_home,mid_home and 10gR2_home.
    by default oracle_home is set to the last installation that happens so if you install the database 10gR2 after installing application server it will point to 10gR2_home, but if you install 10gR2 before and application server later then the oracle home will be infra_home(if both the middle tier and infratier are on the same machine)
    you can always change the oracle home by using set ORACLE_HOME=path/to/oracle/home( in windows)
    or export ORACLE_HOME=path/to/oracle/home (in unix)
    hope this helps....
    regards

  • How to set the database in NOARCHIVELOG mode

    hellow world,
    I knewly joined this organization.
    Our database is very small < 4GB data.
    Database is running in ARCHIVELOG MODE.
    since we are not keeping any physical backup, so I opted to run the datbase in NOARCHIVELOG mode.
    For bringing the database in NOARCHIVE MODE, I simply changed the init.ora parameter LOG_ARCHIVE_START = FALSE and restart the database.
    offcourse the archiving stopped, but to my strange after 30 to 40 minutes my all log files filled an error message is being displayed to the server, saying
    log files are filled, waiting for the archiving, Oh my God, What has happened, All users came to my head, DATABASE HANGED, NOT RESPONSING.
    SIR, MY QUESTION IS
    WHAT FOR ALL LOG FILES WAITING?
    when i am saying NOARCHIEVE than
    please explain me, where i committed mistake. I am new to ADMINISTRATION.

    1. Not keeping any physical backup is all the more reason to stay in archivelog mode.
    2. You need to shutdown the database, startup mount, and issue 'alter database noarchivelog', the alter database open.

  • Urgent help : Need to recover a database without backup and archivelogs

    Hi,
    We are in urgent need to recover a database without backup and archivelogs
    one datafile seems corrupted
    SQL> recover automatic database until cancel using BACKUP CONTROLFILE;
    ORA-00279: change 10527325422479 generated at 07/27/2011 03:13:04 needed for
    thread 1
    ORA-00289: suggestion : /pys/u5/oradata/PYS/PYSarch/arch0001.0000181845.arc
    ORA-00280: change 10527325422479 for thread 1 is in sequence #181845
    ORA-00278: log file '/pys/u5/oradata/PYS/PYSarch/arch0001.0000181845.arc' no
    longer needed for this recovery
    ORA-00308: cannot open archived log
    '/pys/u5/oradata/PYS/PYSarch/arch0001.0000181845.arc'
    ORA-27037: unable to obtain file status
    HP-UX Error: 2: No such file or directory
    Additional information: 3
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    CANCEL
    ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
    ORA-01152: file 1 was not restored from a sufficiently old backup
    ORA-01110: data file 1: '/pys/u2/oradata/PYS/pay_system_01.dbf'

    N Gasparotto wrote:
    bsac14 wrote:
    my database is in no archive mode
    can you please tell how to restore
    yes it is a datafile corruptionYou did not say how you defined that's a datafile corruption. You provide minimum to zero information.
    I just need to bring the database up,no need any exact data
    I can refresh from prod laterThen drop and recreate database. Basically and since you are not in archive mode, no recover is possible. Period.
    Nicolas.Hi,
    How did you come to the conclusion that your datafile is corrupted? Can you provide and supported logs?
    Regards .....

  • Estimating the Database Size using Archivelog mode

    Dear OTN Forum,
    I need to find guidelines to estimate the additional space needed for a database in order to operate in archivelog mode.
    I've estimated the size of a database (Tables + indexes= 450 GB + 270 GB) operating in nonarchivelog mode, but I didn't know how to estimate the additional space needed to operate the database in archivelog mode.
    Please any kind of information will be well received!
    (paper, technical bulletins, metalink, etc.)
    Best regards,
    Alfredo

    The space required for archive logs does not depend on the size of your database. It is dependent on 3 factors.
    1. The size of your redo log members. Each archive log will be the same size as a redo log file.
    2. The number of transactions you do in the database. Each transaction writes information to the redo logs, and each redo log is archived when it is full.
    3. How laong a period you want to keep the archive logs available on disk for.
    For example, one of our systems is a very active OLTP system with about 500 users at peak times and around 100 fairly constantly. The database is about 40Gb, but it spins 15 - 20 64Mb archive logs each day. Typically, we keep 2 days worth of logs on-line at any given time. so, this system requires between 1.8 and 2.5 GB for archive logs.
    Another system, used mostly for reporting purposes, is over 100GB, but typically generates 5 - 6 32MB archive logs each week. So, it requires less than 200Mb for archive logs.
    HTH
    John

  • ARCHIVIVNG the database for the SAP SOLUTION MANAGER SYSTEM.

    Dear Experts,
       I am in the process of ARCHIVIVNG the database for the SAP SOLUTION MANAGER SYSTEM. Since the solman database is increasing randomly i need to archive the old tickets amd also the tables and also the other objects.
    Can any one help me how to archive and also what are all the objects to archive in the solution manager system.
    Regards,
    Umesh

    Dear ALL,
      I have got he table ARCDEL_OBJ ( Control Table for Archiving / Deletion) table I guess in this table  the archiving objects will be stored.
    The objects i got in this table are
    CA_BUPA
    CMS_PRJASM
    CRM_ACT_ON
    CRM_COMP
    CRM_IPMCON
    CRM_IPMPUC
    CRM_IPMSAC
    CRM_LEAD
    CRM_LEAS
    CRM_MKTPL
    CRM_MKTSC
    CRM_OPPT
    CRM_RAGR
    CRM_SACONT
    CRM_SALDOC
    CRM_SDBPBL
    CRM_SDBSOL
    CRM_SERORD
    CRM_SRCONT
    CRM_SRVCON
    CRM_SUR
    CRM_UBBPOL
    CRM_WTYCLM
    PRODUCT_MD
    CAN I ARCHIVE ALL THESE OBJECTS OR WHICH OBJECT HAS TO TO BE ARCHIVED IN THIS..............?????
    PLEASE LET ME KNOW THE  IMPACT OF ARCHIVING THESE OBJECTS.
    Regards,
    umesh

  • How to reinstall the database components of BI Publisher (11.1.1.5)

    Hi,
    We're using BI Publisher 11.1.1.5 installed within an existing Weblogic 10.3.6 instance running on Oracle Linux 5.6.
    We installed it against an existing 10g test database.
    We decided to refresh the database from the production system and we had to rebuild the test db from scratch, meaning we lost all BIP components installed in it.
    We re-ran the BIP RCU to create the schemas but we can't see how we can reinstall the other required BIP database components without doing a full deinstall and then install of everything.
    The other required db components are such things as the bipcatalog java classes. These are not installed by the RCU from what it seems.
    We have another test database with the BIP components in it and I can see them there so we could export/import them if necessary, but I thought there must be a way to use an assistant or something to do it.
    Any ideas how to go about reinstalling just the db objects?
    Thanks,
    Dave

    I have found out what it was that needed loading into the database, it wasn't BI Publisher specific after all. It is the database callout utility and JPublisher classes, which are used when calling out to invoke web services. They're loaded using loadjava command into the database.

  • How can i check if the database contains the rows stated or not?

    hi there..
    i hav a problem here. I need to check the database if it contains the row of the attribute. If it doesnt not hav the row, i would then insert a new row into it, or else, i would only update the attribute. I have encountered a null pointer error and i've been trying to resolve it but i cant solve it. Here's my code..
    "i" is the attribute i wan to check if it exist in the database.
    "id" is the attribute i wan to check, from my JSP
    String m = null;
    String sql11 = "SELECT i from database WHERE i ='" + i+ "'";
    System.out.println(sql11);
    try {
    db = new Database();
    rs = db.readRequest(sql11);
    if (rs != null && rs.next()) {
    U u= new U();
    u.setU(rs.getString("i"));
    m = u.getU(); ==> this is the line tat's givin my null pointer
    System.out.println(m);
    db.close();
    } catch (SQLException se) {
    se.printStackTrace();
    throw (new UserException("Unable to retrieve from Database!"));
    } catch (Exception e) {
    e.printStackTrace();
    throw (new UserException("Unknow error encountered!"));
    if (m.equals(id)){
    //performs the updating of database
    else if (m_userID.equals("nil")){
    // performs the inserting of new row in the database
    }*/

    And what does getU() do?

Maybe you are looking for