How do I replace a single instance of a string?

I'm trying to replace a certain string in a text file. The problem is, there is other data in the text file that is being affected by the replace() function, since replace() replaces each substring that fits the pattern it's looking for. I want my replacement function to target one single instance of something, at one specific instance, and to leave the rest of my text alone.
Any thoughts on how I'd do that?

I don't see how to do it with a String direclty without making silly copies.
But it seems you could use a StringBuilder and its method replace(int start, int end, String str).
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/StringBuilder.html#replace(int,%20int,%20java.lang.String)

Similar Messages

  • How do i create a single instance of a class inside a servlet ?

    how do i create a single instance of a class inside a servlet ?
    public void doGet(HttpServletRequest request,HttpServletResponseresponse) throws ServletException, IOException {
    // call a class here. this class should create only single instance, //though we know servlet are multithreaded. if, at any time 10 user comes //and access this servlet still there would one and only one instance of //that class.
    How do i make my class ? class is supposed to write some info to text file.

    i have a class MyClass. this class creates a thread.
    i just want to run MyClass only once in my servlet. i am afriad, if there are 10 users access this servlet ,then 10 Myclass instance wouldbe created. i just want to avoid this. i want to make only one instance of this class.
    How do i do ?
    they have this code in the link you provided.
    public class SingletonObject
      private SingletonObject()
        // no code req'd
      public static SingletonObject getSingletonObject()
        if (ref == null)
            // it's ok, we can call this constructor
            ref = new SingletonObject();          
        return ref;
      public Object clone()
         throws CloneNotSupportedException
        throw new CloneNotSupportedException();
        // that'll teach 'em
      private static SingletonObject ref;
    }i see, they are using clone !, i dont need this. do i ? shouldi delete that method ?
    where do i put my thread's run method in this snippet ?

  • How can I store a single instance of a hashtable

    How can I store a single instance of a hashtable in a predefined application object that way I can use it by all sessions? I've tried storing a instance of hashtable in the session but it only allows for one user and it doesn't accomplish my goal in the web application. Could show me how i could store a single instance of a hashtable in a predefined application object? Or at least a link which demonstrates it
    thanks

    assuming ctx is an instance of javax.servlet.ServletContext (which can be retrieved from the ServletConfig).
    ctx.setAttribute("yourAttrName", new Hashtable());

  • How to change an ASM single-instance  into a clustered ASM ?

    Hi,
    I have a node#1 with Oracle10gR2 installed (standard installation, not RAC).
    Everything is in the ORACLE_HOME.
    A unique single-instance database DB1 uses ASM#1 to access a diskgroup on a SAN.
    I'd like to install Clusterware in a separate CRS_HOME (within the oracle account), and protect ASM#1 and the database DB1 using an application VIP.
    The things is: I want to create another single-instance database DB2 on another node#2, with another ASM#2 instance.
    I need a clustered ASM (with Clusterware) installation to do that because ASM#1 and ASM#2 need to access the same diskgroup.
    I don't want to lose the existing data & configuration of the ASM#1 instance.
    What modifications I need to do in the current ASM#1 instance on node#1 to make it Clusterware-aware ?
    (Again, it's not a RAC installation...)
    Thanks

    Hi,
    I finally found this Metalink Note 452758.1, which describe the procedure....
    Any feedback about this ?

  • How can I replace a certain position of a String?

    How can I do this?
    I have this string: "Hello World"
    Now I want it to have: "Hello Warld"
    I already know the position of the char to be replaced.

    Try StringBuilder/StringBuffer. You can set a character at a certain location.

  • How can i replace backslashes with fowardslashes in a String

    Hi all,
    I hope someone can help me with this stupid problem iv been having, i need to replace all the backslashes in a String with forwardslashes.
    The method replace() doesnt work because it uses Chars, also i cant use replaceAll() because im restricted to using jdk1.3.
    I would really appreciate some help here,
    Thanks

    Or in other words, I have no idea what you're talking about:
    public class Foo {
         public static void main(String[] args) {
              String s = "string with \\ back \\ slashes \\ in \\ it !";
              System.out.println(s.replace('\\','/'));
    }

  • How to backup Oracle Database Single Instance using RMAN

    Folks,
    Hello. I am using Oracle Database Server 11gR1 with Operating System Oracle Linux 5.10.
    I understand how to backup database instance in SQL Server with Windows. But don't really understand how to backup database instance in Oracle with Linux.
    I have done Cold backup and Hot backup for the database instance HRCS90 but both get the same error message.
    Cold backup is below:
    SQL> startup
    ORACLE instance started.
    Total System Global Area  538677248 bytes
    Fixed Size                  2146024 bytes
    Variable Size             528482584 bytes
    Database Buffers            4194304 bytes
    Redo Buffers                3854336 bytes
    Database mounted.
    Database opened.
    SQL> shutdown immediate
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    RMAN> backup database;
    Starting backup at 25-NOV-13
    using target database control file instead of recovery catalog
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of backup command at 11/25/2013 14:26:52
    RMAN-06171: not connected to target database
    RMAN> backup HRCS90
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00558: error encountered while parsing input commands
    RMAN-01009: syntax error: found "identifier": expecting one of: "archivelog, auxiliary, as, backup, backupset, blocks, channel, check, copy, copies, controlfilecopy, cumulative, current, database, datafile, datafilecopy, device, diskratio, db_recovery_file_dest, db_file_name_convert, duration, filesperset, for, format, from, full, force, file, incremental, keep, (, maxsetsize, nochecksum, noexclude, nokeep, not, proxy, pool, reuse, recovery, section, skip, spfile, skip readonly, setsize, tablespace, tag, to, validate"
    RMAN-01008: the bad identifier was: HRCS90
    RMAN-01007: at line 1 column 8 file: standard input
    RMAN> backup database HRCS90
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00558: error encountered while parsing input commands
    RMAN-01009: syntax error: found "identifier": expecting one of: "archivelog, auxiliary, backup, backupset, channel, copy, controlfilecopy, current, database, datafile, datafilecopy, delete, diskratio, db_recovery_file_dest, filesperset, format, from, force, file, include, keep, (, maxsetsize, noexclude, nokeep, not, pool, plus, reuse, recovery, section, ;, skip, spfile, skip readonly, setsize, tablespace, tag, to"
    RMAN-01008: the bad identifier was: HRCS90
    RMAN-01007: at line 1 column 17 file: standard input
    While the database instance HRCS90 is startup, I do hot backup using the same commands and get the same error message with above cold backup.
    My question is:
    Can any folk tell me the specific steps (command by command) to backup a single database instance in Oracle using RMAN ?
    Thanks.

    Folks,
    Hello. Thanks a lot for replying. My database instance named HRCS90 is going to be backed up. My backup directory is /backup_Database_Instance_HRCS90.
    If database in open state, we must back up in archive log. If database in mount state but not open, we can back up in noarchive log.
    I have tried to back up HRCS90 in archive and noarchive log when database in mount state but not open as below:
    SQL>startup mount;
    SQL>exit
    [user@linux bin]$./rman
    RMAN>connect target;
    RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/backup_Database_Instance_HRCS90/full_%u_%s_%p';
    new RMAN configuration parameters:
    CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   '/backup_Database_Instance_HRCS90/full_%u_%s_%p';
    new RMAN configuration parameters are successfully stored
    released channel: ORA_DISK_1
    RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 360 DAYS;
    new RMAN configuration parameters:
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 360 DAYS;
    new RMAN configuration parameters are successfully stored
    RMAN> backup as backupset database plus archivelog;
    Starting backup at 01-DEC-13
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=44 device type=DISK
    specification does not match any archived log in the recovery catalog
    backup cancelled because all files were skipped
    Finished backup at 01-DEC-13
    Starting backup at 01-DEC-13
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting full datafile backup set
    channel ORA_DISK_1: specifying datafile(s) in backup set
    input datafile file number=00001 name=/u01/oradata/HRCS90/system01.dbf
    input datafile file number=00090 name=/u01/oradata/HRCS90/psimage.dbf
    input datafile file number=00060 name=/u01/oradata/HRCS90/gpapp.dbf
    input datafile file number=00119 name=/u01/oradata/HRCS90/tlwork.dbf
    input datafile file number=00102 name=/u01/oradata/HRCS90/pttlrg.dbf
    input datafile file number=00054 name=/u01/oradata/HRCS90/faapp.dbf
    input datafile file number=00110 name=/u01/oradata/HRCS90/saapp.dbf
    input datafile file number=00101 name=/u01/oradata/HRCS90/pttbl.dbf
    input datafile file number=00002 name=/u01/oradata/HRCS90/sysaux01.dbf
    input datafile file number=00106 name=/u01/oradata/HRCS90/py0lrg.dbf
    input datafile file number=00004 name=/u01/oradata/HRCS90/psdefault.dbf
    input datafile file number=00117 name=/u01/oradata/HRCS90/tlapp.dbf
    input datafile file number=00007 name=/u01/oradata/HRCS90/adapp.dbf
    input datafile file number=00082 name=/u01/oradata/HRCS90/paapp.dbf
    input datafile file number=00074 name=/u01/oradata/HRCS90/hrsapp.dbf
    input datafile file number=00092 name=/u01/oradata/HRCS90/ptamsg.dbf
    input datafile file number=00056 name=/u01/oradata/HRCS90/fgapp.dbf
    input datafile file number=00114 name=/u01/oradata/HRCS90/stapp.dbf
    input datafile file number=00005 name=/u01/oradata/HRCS90/aaapp.dbf
    input datafile file number=00118 name=/u01/oradata/HRCS90/tllarge.dbf
    input datafile file number=00009 name=/u01/oradata/HRCS90/avapp.dbf
    input datafile file number=00065 name=/u01/oradata/HRCS90/hrapp2.dbf
    input datafile file number=00078 name=/u01/oradata/HRCS90/hrwork.dbf
    input datafile file number=00116 name=/u01/oradata/HRCS90/stwork.dbf
    input datafile file number=00077 name=/u01/oradata/HRCS90/hrswork.dbf
    input datafile file number=00115 name=/u01/oradata/HRCS90/stlarge.dbf
    input datafile file number=00049 name=/u01/oradata/HRCS90/epapp.dbf
    input datafile file number=00098 name=/u01/oradata/HRCS90/ptprc.dbf
    input datafile file number=00037 name=/u01/oradata/HRCS90/eoewapp.dbf
    input datafile file number=00032 name=/u01/oradata/HRCS90/eoecapp.dbf
    input datafile file number=00086 name=/u01/oradata/HRCS90/piapp.dbf
    input datafile file number=00099 name=/u01/oradata/HRCS90/ptprjwk.dbf
    input datafile file number=00019 name=/u01/oradata/HRCS90/cularge.dbf
    input datafile file number=00035 name=/u01/oradata/HRCS90/eoeiapp.dbf
    input datafile file number=00045 name=/u01/oradata/HRCS90/eoppapp.dbf
    input datafile file number=00076 name=/u01/oradata/HRCS90/hrslarge.dbf
    input datafile file number=00044 name=/u01/oradata/HRCS90/eoltapp.dbf
    input datafile file number=00094 name=/u01/oradata/HRCS90/ptappe.dbf
    input datafile file number=00050 name=/u01/oradata/HRCS90/eplarge.dbf
    input datafile file number=00084 name=/u01/oradata/HRCS90/pcapp.dbf
    input datafile file number=00111 name=/u01/oradata/HRCS90/sacapp.dbf
    input datafile file number=00100 name=/u01/oradata/HRCS90/ptrpts.dbf
    input datafile file number=00023 name=/u01/oradata/HRCS90/eobfapp.dbf
    input datafile file number=00096 name=/u01/oradata/HRCS90/ptcmstar.dbf
    input datafile file number=00108 name=/u01/oradata/HRCS90/pylarge.dbf
    input datafile file number=00016 name=/u01/oradata/HRCS90/cularg1.dbf
    input datafile file number=00018 name=/u01/oradata/HRCS90/cularg3.dbf
    input datafile file number=00025 name=/u01/oradata/HRCS90/eocmapp.dbf
    input datafile file number=00027 name=/u01/oradata/HRCS90/eocmwrk.dbf
    input datafile file number=00029 name=/u01/oradata/HRCS90/eoculrg.dbf
    input datafile file number=00033 name=/u01/oradata/HRCS90/eoeclrg.dbf
    input datafile file number=00036 name=/u01/oradata/HRCS90/eoeilrg.dbf
    input datafile file number=00039 name=/u01/oradata/HRCS90/eoewwrk.dbf
    input datafile file number=00041 name=/u01/oradata/HRCS90/eoiulrg.dbf
    input datafile file number=00046 name=/u01/oradata/HRCS90/eopplrg.dbf
    input datafile file number=00048 name=/u01/oradata/HRCS90/eotplrg.dbf
    input datafile file number=00053 name=/u01/oradata/HRCS90/erwork.dbf
    input datafile file number=00061 name=/u01/oradata/HRCS90/gpdeapp.dbf
    input datafile file number=00072 name=/u01/oradata/HRCS90/hrlarg1.dbf
    input datafile file number=00079 name=/u01/oradata/HRCS90/htapp.dbf
    input datafile file number=00087 name=/u01/oradata/HRCS90/pilarge.dbf
    input datafile file number=00120 name=/u01/oradata/HRCS90/waapp.dbf
    channel ORA_DISK_1: starting piece 1 at 01-DEC-13
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of backup plus archivelog command at 12/01/2013 17:52:45
    ORA-19504: failed to create file "/backup_Database_Instance_HRCS90/full_0boqei2c_11_1"
    ORA-27040: file create error, unable to create file
    Linux-x86_64 Error: 13: Permission denied
    RMAN>
    RMAN>
    RMAN>
    RMAN>
    RMAN> backup as backupset database;
    Starting backup at 01-DEC-13
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting full datafile backup set
    channel ORA_DISK_1: specifying datafile(s) in backup set
    input datafile file number=00001 name=/u01/oradata/HRCS90/system01.dbf
    input datafile file number=00090 name=/u01/oradata/HRCS90/psimage.dbf
    input datafile file number=00060 name=/u01/oradata/HRCS90/gpapp.dbf
    input datafile file number=00119 name=/u01/oradata/HRCS90/tlwork.dbf
    input datafile file number=00102 name=/u01/oradata/HRCS90/pttlrg.dbf
    input datafile file number=00054 name=/u01/oradata/HRCS90/faapp.dbf
    input datafile file number=00110 name=/u01/oradata/HRCS90/saapp.dbf
    input datafile file number=00101 name=/u01/oradata/HRCS90/pttbl.dbf
    input datafile file number=00002 name=/u01/oradata/HRCS90/sysaux01.dbf
    input datafile file number=00106 name=/u01/oradata/HRCS90/py0lrg.dbf
    input datafile file number=00004 name=/u01/oradata/HRCS90/psdefault.dbf
    input datafile file number=00117 name=/u01/oradata/HRCS90/tlapp.dbf
    input datafile file number=00007 name=/u01/oradata/HRCS90/adapp.dbf
    input datafile file number=00082 name=/u01/oradata/HRCS90/paapp.dbf
    input datafile file number=00074 name=/u01/oradata/HRCS90/hrsapp.dbf
    input datafile file number=00092 name=/u01/oradata/HRCS90/ptamsg.dbf
    input datafile file number=00056 name=/u01/oradata/HRCS90/fgapp.dbf
    input datafile file number=00114 name=/u01/oradata/HRCS90/stapp.dbf
    input datafile file number=00005 name=/u01/oradata/HRCS90/aaapp.dbf
    input datafile file number=00118 name=/u01/oradata/HRCS90/tllarge.dbf
    input datafile file number=00009 name=/u01/oradata/HRCS90/avapp.dbf
    input datafile file number=00065 name=/u01/oradata/HRCS90/hrapp2.dbf
    input datafile file number=00078 name=/u01/oradata/HRCS90/hrwork.dbf
    input datafile file number=00116 name=/u01/oradata/HRCS90/stwork.dbf
    input datafile file number=00077 name=/u01/oradata/HRCS90/hrswork.dbf
    input datafile file number=00115 name=/u01/oradata/HRCS90/stlarge.dbf
    input datafile file number=00049 name=/u01/oradata/HRCS90/epapp.dbf
    input datafile file number=00098 name=/u01/oradata/HRCS90/ptprc.dbf
    input datafile file number=00037 name=/u01/oradata/HRCS90/eoewapp.dbf
    input datafile file number=00032 name=/u01/oradata/HRCS90/eoecapp.dbf
    input datafile file number=00086 name=/u01/oradata/HRCS90/piapp.dbf
    input datafile file number=00099 name=/u01/oradata/HRCS90/ptprjwk.dbf
    input datafile file number=00019 name=/u01/oradata/HRCS90/cularge.dbf
    input datafile file number=00035 name=/u01/oradata/HRCS90/eoeiapp.dbf
    input datafile file number=00045 name=/u01/oradata/HRCS90/eoppapp.dbf
    input datafile file number=00076 name=/u01/oradata/HRCS90/hrslarge.dbf
    input datafile file number=00044 name=/u01/oradata/HRCS90/eoltapp.dbf
    input datafile file number=00094 name=/u01/oradata/HRCS90/ptappe.dbf
    input datafile file number=00050 name=/u01/oradata/HRCS90/eplarge.dbf
    input datafile file number=00084 name=/u01/oradata/HRCS90/pcapp.dbf
    input datafile file number=00111 name=/u01/oradata/HRCS90/sacapp.dbf
    input datafile file number=00100 name=/u01/oradata/HRCS90/ptrpts.dbf
    input datafile file number=00023 name=/u01/oradata/HRCS90/eobfapp.dbf
    input datafile file number=00096 name=/u01/oradata/HRCS90/ptcmstar.dbf
    input datafile file number=00108 name=/u01/oradata/HRCS90/pylarge.dbf
    input datafile file number=00016 name=/u01/oradata/HRCS90/cularg1.dbf
    input datafile file number=00018 name=/u01/oradata/HRCS90/cularg3.dbf
    input datafile file number=00025 name=/u01/oradata/HRCS90/eocmapp.dbf
    input datafile file number=00027 name=/u01/oradata/HRCS90/eocmwrk.dbf
    input datafile file number=00029 name=/u01/oradata/HRCS90/eoculrg.dbf
    input datafile file number=00033 name=/u01/oradata/HRCS90/eoeclrg.dbf
    input datafile file number=00036 name=/u01/oradata/HRCS90/eoeilrg.dbf
    input datafile file number=00039 name=/u01/oradata/HRCS90/eoewwrk.dbf
    input datafile file number=00041 name=/u01/oradata/HRCS90/eoiulrg.dbf
    input datafile file number=00046 name=/u01/oradata/HRCS90/eopplrg.dbf
    input datafile file number=00048 name=/u01/oradata/HRCS90/eotplrg.dbf
    input datafile file number=00053 name=/u01/oradata/HRCS90/erwork.dbf
    input datafile file number=00061 name=/u01/oradata/HRCS90/gpdeapp.dbf
    input datafile file number=00072 name=/u01/oradata/HRCS90/hrlarg1.dbf
    input datafile file number=00079 name=/u01/oradata/HRCS90/htapp.dbf
    input datafile file number=00087 name=/u01/oradata/HRCS90/pilarge.dbf
    input datafile file number=00120 name=/u01/oradata/HRCS90/waapp.dbf
    channel ORA_DISK_1: starting piece 1 at 01-DEC-13
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 12/01/2013 17:56:51
    ORA-19504: failed to create file "/backup_Database_Instance_HRCS90/full_0coqeia5_12_1"
    ORA-27040: file create error, unable to create file
    Linux-x86_64 Error: 13: Permission denied
    As we see the above last 2 commands, either archive or noarchive, I get the same error:
    Archive: ORA-19504: "failed to create file /backup_Database_Instance_HRCS90/full_0boqei2c_11_1"
    Noarchive: ORA-19504: "failed to create file /backup_Database_Instance_HRCS90/full_0coqeia5_12_1" 
    My question is:
    What is the file "full_0boqei2c_11_1" or "full_0coqeia5_12_1" ?  How to solve the above error ?
    Thanks.

  • How do I replace a single record in a logfile?

    I'm developing a program that saves data to a logfile containing clusters. Every record (cluster) contains data from the tested item. The item can be as many as 400+. The file refnum is opened during the whole test. If the test of item 50 (this will be record 49) failed and needs to tested again I want to replace position 49 (counting from zero) with the "correct" test result, but LabVIEW insists and writes them as record 50 and thus item 50 has records as: 49 (failed; want to delete this) and the correct record 50 (this should be record 49 though...). I thought one should connect the "pos offset" at the desired place where the record should be stored in, but one can't connect to that when using datalog file... . I've also
    tried to use the "seek"-vi to position the refnum at the desired location but it ignores it... . What shall I do? I have a working "viewer" for my log-files so they aren't corrupted, everything else is OK. Any suggestions?
    //Anders Boussard

    You do not have to use dataloging, you can write the data directly to disk. Writing to a file in binary is much less structured than datalogging but gives the flexibilty of overwriting records. With binary files you can even write several groups of data at a time so the limiting factor tends to be the speed of your harddrive. Consider using the intermediate file write VIs. As an test, I was able to write different clusters of an arrays having different lenghts to a file and read them perfectly. If your data is of uniform structure, you will have no problems doing the same. Look at the read to binary file.vi and write to binary file.vi for example code to get started. You will have to experiment to get the hang of it.
    Chapter 13 of th
    e LabVIEW User Manual discusses how to do file I/O and you can also find example code and tutorials on our website.
    Jeremy Braden
    National Instruments

  • Iweb 08 - how can i replace a single published page with an updated page?

    At the moment, I find that I have to publish all four of my sites everytime I make a change to a single page.
    Is there a way I can publish a single webpage and replace it via the ftp?
    I'm sure I'm doing this wrong but can't seem to figure out why.

    See Chapter 2 here.

  • How do I replace one ' (Single Quote) with '' (Two single Quote)

    Hi,
    I have been surfing around the forum, coudn't find the similiar case.
    I have been trying but fail. Below is my code:
    activity = request.getParameter("activity");
    activity = activity.replace("\'", "\'\'");
    Error Occur:
    Incompatible type for method. Can't convert java.lang.String to char. activity = activity.replace("\'", "\'");
    I'm trying to use replaceAll(), but seem like the method is not existed, we are using Version Java 1.3
    Pls advise.
    Regards
    Ying

    For JDK 1.3 or ealier, use this:
      public static String replaceSubstrings(String str, String sub, String rep){
        int s, p, q;
        int slen = sub.length();
        StringBuffer sb = new StringBuffer();
        s = 0;
        p = str.indexOf(sub);
        q = p + slen;
        while (p != -1){
          sb.append(str.substring(s, p));
          sb.append(rep);
          s = q;
          p = str.indexOf(sub, s);
          if (p != -1){
            q = p + slen;
        sb.append(str.substring(s));
        return sb.toString();
    activity = replaceSubstrings(activity, "'", "''");

  • Replacing a single occurance in a string

    if i do string.replaceAll(old,new) then it replaces every occurance in the string
    how can i only replace the first found occurance in the string or even better specify where in the string i want to start looking
    so if i have
    hello hello hello hello
    i can say
    string.replace(5,"hello", "yellow")
    and it will give me
    hello yellow hello hello

    ive come up with this
    SNIP
    it seems to be doing the trick (so far)Good one! I guess the same is actually done with StringBuffer.replace()
    jTPdisplay.setText(new StringBuffer(f).replace(pos, pos+f.length(), r).toString());It should be something like this. :)

  • Single-instance manual standby for a three-node RAC database

    Hi all,
    I am wondering how it is possible to create a manual standby database for a rac primary database.
    Oracle versione is standard edition 11.1.
    I have experience creating and managing manual standby for single-instance database; I am wondering if and how I can instruct the single-instance standby database to discover and apply the three redo threads that I will copy from the primary site to the standby site.
    Should I use rman to catalog all the archived log on the standby site ?
    Should I configure many LOG_ARCHIVE_DEST_n parameters to point to many different path, one for each primary instance (i.e. one for each redo thread), and let rman automagically discover all the archived logs ?
    Should I configure only LOG_ARCHIVE_DEST_1 , put archivelogs from all threads in the same folder, and let rman automagically discover all the archived logs ?
    Thanks for every answer!
    Andrea

    Hi,
    indeed i catalog all transfered archive logs in front of the recover process.
    During the tests i believe (iirc) i was unable to recover from transfered archivelogs without catalog them first. But this statement is out of my mind, i am not 100% sure for this, sorry.
    Some more details.
    Because it is a standard edition, i have to use on the RAC side ASM. So our normal scripts to transfer archivelogs from primary to standby are obsolete.
    So i decided to put the whole standby thing into the database. Now the primary database uses external scheduler jobs to do the work. The standby side is not using ASM, so there is no need to handle the logs in any special way.
    The steps are:
    1. Get SCN from primary and standby
    2. Transfer the logs for the gap from ASM to "normal" filesystem.
    3. Transfer (and compress, if not in LAN) to standby archive dest
    4. Catalog on standby side
    5. Recover on standby side
    6. Delete on normal filesystem (on both sides, but on standby with a delay of 2 days just to be sure)
    The steps on the standby side are both using the primary scn from step 1 as a parameter to avoid error messages during the catalog or recover call.
    Hth
    Joerg

  • 10gR2 single instance to 11gR2 rac upgrade

    Can someone tell me some good approach for upgrading a single instance 10.2.0.2 database of approx size 2TB to 11.2.0.3 rac 2 node db on linux.

    Hi;
    1. You can upgrade your db to 11gr2 first than convert it to rac
    2. You can use RMAN and restore it to new 11gR2 server
    3. You can use expdp/impdp to new 11gR2 server
    Please see:
    Minimizing Downtime During Production Upgrade [ID 478308.1]
    Master Note For Oracle Database Upgrades and Migrations [ID 1152016.1]
    Different Upgrade Methods For Upgrading Your Database [ID 419550.1]
    Check:
    How does one convert a single instance database to RAC?
    http://www.orafaq.com/wiki/RAC_FAQ#How_does_one_convert_a_single_instance_database_to_RAC.3F
    Please also check my blog
    http://heliosguneserol.wordpress.com/2010/06/17/move-to-oracle-database-11g-release-2-wiht-mike-dietrich/
    In this pdf you can see patch of to upgrade db from x to n wiht many senerios wiht all related metalinks notes which is created by Oracle worker Mike Dietrich
    PS:Please dont forget to change thread status to answered if it possible when u belive your thread has been answered, it pretend to lose time of other forums user while they are searching open question which is not answered,thanks for understanding
    Regard
    Helios

  • How do I find & replace a single character?

    Am using Adobe Acrobat Pro....
    The find/replace box pull down has "Whole Words Only" checked and I cannot uncheck it.  How can I find and replace a single character throughout a document?

    That's just how it works. You can "find" anything, but you can only "replace" whole words. As soon as you click to open the "replace" section of the dialog the search settings are locked into their basic states, even if you don't enter a replacement string (but that part's a bug).
    The simple answer is that you cannot replace all instances of one character using Acrobat's inbuilt tools. You're expected to edit the document outside of PDF and recreate it.

  • How Can I Use Multiple Weblogic Instances in a Single OS

    Hello Everyone,
    Actually I have to install Some different applications. Few of them need weblogic 10.3.6 and others need 10.3.4. The OS am using is Oracle  Enterprise Linux 5.
    Now I am able to install 2 separate(One of 10.3.4 and 10.3.6) instances with two different users,In two different directories.
    I have installed the weblogic 10.3.6 version with a user webadmin and installed node manager with port 5556. This is working fine.
    The main problem here is :
    In the second instance (10.3.4 ) installed with a a different user and gave the port number to NodeManager as 1600 and its not getting started. Its throwing error and also after some errors in the terminal am able to see that its reverting to port number 5556 only.
    What might be the issue?
    I have to install 2 different versions of weblogic in a single Server. But am failing with NodeManager. What Can I do to have multiple weblogic instances with multiple versions in a single server ?
    Can anyone suggest a resolution for this please ?
    Thanks in advance.

    Pl do not spam these forums with multiple posts - How Can I Use Multiple Weblogic Instances in a Single OS

Maybe you are looking for

  • How do I disactivate the operating system on my macbook that was stolen from me?

    So in early September someone who I know broke into my apartment and stole my computer, I called the police and filed a report. I have some very snesitive documents on the computer that I would prefer no one to get their hands on. I was able to find

  • Where are the Harry Potter audio books?

    I downloaded the first 6 Harry Potter audio books over the past couple of months, and now I can't find them in the cloud, or even in Itunes! Where did they go?!

  • How to set the transparency for a image

    Hi iam reading and writing and GIF image,when i resize the new image the transparency of the old image is not applied to the new one it appears black as background. so i need to set the transparency of the old image to the new GIF image . so is there

  • Importing a .class file into my package?

    Hi. I'm making a java program but I need to use an external .class file to get variables and use methods from. Is it possible to "import" a class file into my package to be able to do so? Thanks

  • Scheduling a background job based on fiscal variant

    Hi All The organisation which i am working for has a 4-4-5 calender. The requirement is to schedule a job( A Z program which fetches data from R/3 table) in background so that it gets executed in 4-4-5 fashion. Thanks in Advance Regards