JDBC URL to connect to Standby Database

Could somebody please post the details of configuring a JDBC String in an app server (JBOSS) to connect to Standby database.

Hi,
The type, multiplicity or redundancy of the datasource connection pool can be independent of your JPA application beyond configuring global parameters. I would expect that JBoss can be setup to pool or cluster multiple JTA datasources to appear as one single pool as other servers are able to - I have not looked into this myself specifically on JBoss but you should check out Oracle RAC support - which is supported on WebLogic.
thank you
/michael
www.eclipselink.org
An open source reference JPA provider

Similar Messages

  • JDBC-ODBC-Bridge connection to SQL Database

    Hi guys
    I have a problem. I've made a little game which I want to put on my website. It has a highscore-list which I want to connect to my web host's database server to get the current list.
    I tried this with JDBC and got it to work locally but when I uploaded it to my site it didn't work. I contacted my web host's technical support who told me that their server didn't have the JDBC driver and that I should use ODBC instead. I did lots of reading and found out about this JDBC-ODBC-Bridge. I have since been trying to implement this into my program but hasn't been successful.
    In my original JDBC connection I used
    private String url = "jdbc:mysql://" + host +  "/" + mydatabase;
    Class.forName("com.mysql.jdbc.Driver");
    Connection connection = DriverManager.getConnection(url, username, password);Now I'm trying
    private String url = "jdbc:odbc://" + host + "/" + database;
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection connection = DriverManager.getConnection(url, username, password);But, at least when trying it locally, I get the error
    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name is too long.
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6957)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114)
    at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3073)
    at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:323)
    at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    at HighscoreDB.readFile(HighscoreDB.java:53)
    at HighscoreDB.displayList(HighscoreDB.java:97)
    at HighscoreDB.main(HighscoreDB.java:33)Please help ;)
    Edited by: YZF-R1 on 2009-apr-09 13:26

    YZF-R1 wrote:
    masijade. wrote:
    Do you know what ODBC is?I think I at least have the basic idea, I learnt most of what I know from this post:
    [http://forums.sun.com/thread.jspa?threadID=211735&start=2&forumID=48]
    masijade. wrote:
    While "reading about this JDBC-ODBC Driver" did you also read about how to enter the URLs for it?No, I couldn't find that piece of information, why don't you tell me ;)
    Here
    >
    masijade. wrote:
    Did also read about the fact about needing to configure ODBC DSNs? Or about the fact that the connection URL is radically different if you don't configure one?No I did not. Please explain =)
    Here
    >
    PhHein wrote:
    Plus, JDBC-ODBC Bridges are evil!I'm beginning to realize this myself :O:(
    BalusC wrote:
    Drop that whole ODBC idea and just gently read the documentation which come along with the MySQL JDBC driver.I read a lot of it when I used the JDBC driver locally but how's that going to help me if the server doesn't have the JDBC driver installed?How will the Bridge help you if the ODBC Driver is not installed? And, the JDBC Driver (the Type 4.0 ones, which the MySQL Driver is) is 100% Java, so it can even be included in an Applet, if the HTML page that accesses it is done right, and the jars are "packaged" properly.

  • Data Guard Broker connecting to standby database fails

    Hello everybody
    I checked lots of pages but I'm not able to find a solution für my problem. I already set up a primary and a standby database (prim = ALPHA1 / standby = ALPHA2).
    After enabling my dgmgrl configuration I got two errors:
    DGM-17016: failed to retrieve status for database "alpha2"
    ORA-16664: unable to receive the result from a database
    The dg log from ALPHA1 says:
    06/04/2013 16:06:57
    Site alpha2 returned ORA-16664.
    Data Guard Broker Status Summary:
    Type Name Severity Status
    Configuration alphadgb Warning ORA-16607
    Primary Database alpha1 Success ORA-00000
    Physical Standby Database alpha2 Error ORA-16664
    While the dg log from ALPHA2 (standby) says:
    06/04/2013 16:43:28
    SPFILE is missing value for property 'LogArchiveFormat' with sid='ALPHA2'
    Warning: Property 'LogArchiveFormat' has inconsistent values:METADATA='arch_ALPHA2_%S_%t_%r.arc', SPFILE='(missing)', DATABASE='arch_ALPHA2_%S_%t_%r.arc'
    Failed to connect to remote database alpha1. Error is ORA-12514
    Failed to send message to site alpha1. Error code is ORA-12514.
    How can I solve this issue? Every type of tnsping is successfull. The sqlplus login from the primary to the standby database works, the other way round works too! Therefore the tnsnames and listener data seems to be correct.
    My configuration for ALPHA1 (primary db):
    Listener
    LISTENER_ALPHA1 =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.12.3.13)(PORT = 1521))
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    SID_LIST_LISTENER_ALPHA1 =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = ALPHA1_DGMGRL)
    (ORACLE_HOME = /oracle/ALPHA1/orahome)
    (SID_NAME = ALPHA1)
    tnsnames.ora
    ALPHA1.WORLD =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.12.3.13)(PORT = 1521))
    (CONNECT_DATA =
    (SID = ALPHA1)
    ALPHA2.WORLD =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.12.3.13)(PORT = 1522))
    (CONNECT_DATA =
    (SID = ALPHA2)
    DG_ALPHA1.WORLD =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.12.3.13)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = ALPHA1_DGMGRL)
    DG_ALPHA2.WORLD =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.12.3.13)(PORT = 1522))
    (CONNECT_DATA =
    (SERVICE_NAME = ALPHA2_DGMGRL)
    Parameters
    archive_lag_target integer 0
    log_archive_config string DG_CONFIG=(ALPHA2,ALPHA1)
    log_archive_dest string
    log_archive_dest_1 string LOCATION=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles) DB_UNIQUE_NAME=ALPHA2
    log_archive_dest_2 string SERVICE=ALPHA1 SYNC valid_for=(online_logfiles,primary_role) DB_UNIQUE_NAME=ALPHA1
    log_archive_format string arch_ALPHA2_%S_%t_%r.arc
    log_archive_local_first boolean TRUE
    log_archive_max_processes integer 4
    log_archive_min_succeed_dest integer 1
    log_archive_start boolean FALSE
    log_archive_trace integer 0
    standby_archive_dest string ?/dbs/arch
    For the DG Broker configuration
    DGMGRL>     connect sys/dgalpha42@DG_ALPHA1
    DGMGRL>     create configuration ALPHADGB
    DGMGRL>     primary database is ALPHA1
    DGMGRL>     connect identifier is DG_ALPHA1
    DGMGRL>     ;
    DGMGRL>     add database ALPHA2
    DGMGRL>     connect identifier is DG_ALPHA2
    DGMGRL>     maintained as physical
    DGMGRL>     ;
    There were no errors.
    DGMGRL> show database verbose ALPHA1
    Database - alpha1
    Role: PRIMARY
    Intended State: TRANSPORT-ON
    Instance(s):
    ALPHA1
    Properties:
    DGConnectIdentifier = 'dg_alpha1'
    ObserverConnectIdentifier = ''
    LogXptMode = 'ASYNC'
    DelayMins = '0'
    Binding = 'optional'
    MaxFailure = '0'
    MaxConnections = '1'
    ReopenSecs = '300'
    NetTimeout = '30'
    RedoCompression = 'DISABLE'
    LogShipping = 'ON'
    PreferredApplyInstance = ''
    ApplyInstanceTimeout = '0'
    ApplyParallel = 'AUTO'
    StandbyFileManagement = 'AUTO'
    ArchiveLagTarget = '0'
    LogArchiveMaxProcesses = '4'
    LogArchiveMinSucceedDest = '1'
    DbFileNameConvert = 'ALPHA2, ALPHA1'
    LogFileNameConvert = 'ALPHA2, ALPHA1'
    FastStartFailoverTarget = ''
    InconsistentProperties = '(monitor)'
    InconsistentLogXptProps = '(monitor)'
    SendQEntries = '(monitor)'
    LogXptStatus = '(monitor)'
    RecvQEntries = '(monitor)'
    SidName = 'ALPHA1'
    StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oraprakt)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ALPHA1_DGMGRL)(INSTANCE_NAME=ALPHA1)(SERVER=DEDICATED)))'
    StandbyArchiveLocation = 'USE_DB_RECOVERY_FILE_DEST'
    AlternateLocation = ''
    LogArchiveTrace = '0'
    LogArchiveFormat = 'arch_ALPHA1_%S_%t_%r.arc'
    TopWaitEvents = '(monitor)'
    Database Status:
    SUCCESS
    DGMGRL> show database verbose ALPHA2
    Database - alpha2
    Role: PHYSICAL STANDBY
    Intended State: APPLY-ON
    Transport Lag: (unknown)
    Apply Lag: (unknown)
    Real Time Query: OFF
    Instance(s):
    ALPHA2
    Properties:
    DGConnectIdentifier = 'dg_alpha2'
    ObserverConnectIdentifier = ''
    LogXptMode = 'SYNC'
    DelayMins = '0'
    Binding = 'OPTIONAL'
    MaxFailure = '0'
    MaxConnections = '1'
    ReopenSecs = '300'
    NetTimeout = '30'
    RedoCompression = 'DISABLE'
    LogShipping = 'ON'
    PreferredApplyInstance = ''
    ApplyInstanceTimeout = '0'
    ApplyParallel = 'AUTO'
    StandbyFileManagement = 'AUTO'
    ArchiveLagTarget = '0'
    LogArchiveMaxProcesses = '4'
    LogArchiveMinSucceedDest = '1'
    DbFileNameConvert = 'ALPHA1, ALPHA2'
    LogFileNameConvert = 'ALPHA1, ALPHA2'
    FastStartFailoverTarget = ''
    InconsistentProperties = '(monitor)'
    InconsistentLogXptProps = '(monitor)'
    SendQEntries = '(monitor)'
    LogXptStatus = '(monitor)'
    RecvQEntries = '(monitor)'
    SidName = 'ALPHA2'
    StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oraprakt)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ALPHA2_DGMGRL)(INSTANCE_NAME=ALPHA2)(SERVER=DEDICATED)))'
    StandbyArchiveLocation = 'USE_DB_RECOVERY_FILE_DEST'
    AlternateLocation = ''
    LogArchiveTrace = '0'
    LogArchiveFormat = 'arch_ALPHA2_%S_%t_%r.arc'
    TopWaitEvents = '(monitor)'
    Database Status:
    DGM-17016: failed to retrieve status for database "alpha2"
    ORA-16664: unable to receive the result from a database
    Can anybody help me to find a solution for this?

    Hey
    thanks for the answer. I followed you recommendations but I got the same error again. I restored/recovered the old status and looked deeper into the dgmgrl configuration before enabling. I found an interesting point. (show database verbose ALPHAx)
    Database - alpha1
    Role: PRIMARY
    Intended State: OFFLINE
    Instance(s):
    ALPHA1
    Properties:
    DGConnectIdentifier = 'dg_alpha1'
    ObserverConnectIdentifier = ''
    LogXptMode = 'ASYNC'
    DelayMins = '0'
    Binding = 'optional'
    MaxFailure = '0'
    MaxConnections = '1'
    ReopenSecs = '300'
    NetTimeout = '30'
    RedoCompression = 'DISABLE'
    LogShipping = 'ON'
    PreferredApplyInstance = ''
    ApplyInstanceTimeout = '0'
    ApplyParallel = 'AUTO'
    StandbyFileManagement = 'AUTO'
    ArchiveLagTarget = '0'
    LogArchiveMaxProcesses = '4'
    LogArchiveMinSucceedDest = '1'
    DbFileNameConvert = 'ALPHA2, ALPHA1'
    LogFileNameConvert = 'ALPHA2, ALPHA1'
    FastStartFailoverTarget = ''
    InconsistentProperties = '(monitor)'
    InconsistentLogXptProps = '(monitor)'
    SendQEntries = '(monitor)'
    LogXptStatus = '(monitor)'
    RecvQEntries = '(monitor)'
    SidName = 'ALPHA1'
    StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oraprakt)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ALPHA1_DGMGRL)(INSTANCE_NAME=ALPHA1)(SERVER=DEDICATED)))'
    StandbyArchiveLocation = 'USE_DB_RECOVERY_FILE_DEST'
    AlternateLocation = ''
    LogArchiveTrace = '0'
    LogArchiveFormat = 'arch_ALPHA1_%S_%t_%r.arc'
    TopWaitEvents = '(monitor)'
    Database Status:
    DISABLED
    Database - alpha2
    Role: PHYSICAL STANDBY
    Intended State: OFFLINE
    Transport Lag: (unknown)
    Apply Lag: (unknown)
    Real Time Query: OFF
    Instance(s):
    ALPHA2
    Properties:
    DGConnectIdentifier = 'dg_alpha2'
    ObserverConnectIdentifier = ''
    LogXptMode = 'ASYNC'
    DelayMins = '0'
    Binding = 'OPTIONAL'
    MaxFailure = '0'
    MaxConnections = '1'
    ReopenSecs = '300'
    NetTimeout = '30'
    RedoCompression = 'DISABLE'
    LogShipping = 'ON'
    PreferredApplyInstance = ''
    ApplyInstanceTimeout = '0'
    ApplyParallel = 'AUTO'
    StandbyFileManagement = 'AUTO'
    ArchiveLagTarget = '0'
    LogArchiveMaxProcesses = '4'
    LogArchiveMinSucceedDest = '1'
    DbFileNameConvert = 'ALPHA1, ALPHA2'
    LogFileNameConvert = 'ALPHA1, ALPHA2'
    FastStartFailoverTarget = ''
    InconsistentProperties = '(monitor)'
    InconsistentLogXptProps = '(monitor)'
    SendQEntries = '(monitor)'
    LogXptStatus = '(monitor)'
    RecvQEntries = '(monitor)'
    SidName = 'ALPHA2'
    StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oraprakt)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ALPHA2_DGMGRL)(INSTANCE_NAME=ALPHA2)(SERVER=DEDICATED)))'
    StandbyArchiveLocation = 'USE_DB_RECOVERY_FILE_DEST'
    AlternateLocation = ''
    LogArchiveTrace = '0'
    LogArchiveFormat = 'arch_ALPHA2_%S_%t_%r.arc'
    TopWaitEvents = '(monitor)'
    Database Status:
    DISABLED
    As the listener are configured ALPHA1 (prim) should be on port 1521 while ALPHA2 (stby) should work on 1522. In the configuration of DGMGRL only appears port 1521 (look at StaticConnectIdentifier). Is this maybe the reason of the networking problems with DG Broker? How can I fix this?
    Regards Mirko
    Edited by: 1009733 on 04.06.2013 09:22

  • Connect to Standby database

    Hi ..
    I set up oracle 11g Active DR. (prod db with 1 standby db(READ-ONLY) ) Seems the system working fine. But i can't connect to StandbyDB from SQL-Navigator (can connect to PROD). What can be the reason ?
    It shows this when i try to connect from navigator,
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    Linux-x86_64 Error: 2: No such file or directory
    Note :- I can connect to both DB's from sqlplus
    Regards
    Visi

    Hello;
    Example here :
    http://www.itsarva.com/ittopicsblog/?p=296
    Did you start the Database ( standby correctly )
    Startup mount
    recover managed standby database using current logfile disconnect;
    alter database recover managed standby database cancel;
    alter database open read only;
    alter database recover managed standby database using current logfile disconnect;
    Select open_mode from v$database;v$database should show "READ ONLY WITH APPLY"
    Best Regards
    mseberg
    Edited by: mseberg on Apr 20, 2012 5:11 AM

  • JDBC Url for connecting SQL Server Alias name

    Hi All,
    I am having a SqlServer Databse Instance for that we have created "alias name".
    i am unable to connect to that particular alias name.
    please can any one though light on this plz.
    Edited by: mahesh512 on Jun 17, 2009 6:48 PM

    If i am geussing right, you mean that you have created a TNS Name for your Database Server.
    If you are accessing it from your DB Client via the TNS name, maybe the CLient is configured to contact a TNS Server to retrieve the IP if the server.
    Your JDBC Driver does not do that. Either use the IP of the DB Server or provide a Source for the Driver to look up the IP via the TNS Name.
    How this is accomplished deplends on your Database.

  • JDBC Data Sources: connecting the HR database from Oracle Express

    What goes in the data string?
    Where do I find the information for Host name, port and SDI?
    Thanks!

    try these link
    About 'create database link ...'
    http://www.dba-oracle.com/t_how_create_database_link.htm
    http://forums.oracle.com/forums/search.jspa?threadID=&q=dblink&objID=f251&dateRange=all&userID=&numResults=15&rankBy=10001
    Edited by: Binepal on May 20, 2010 7:44 AM

  • Wrong SID in JDBC URL

    Hi all,
    I'm developing a java program in OAF context to generate a pdf from a xdo data template and template. this is already working, there is only one issue.
    The DataProcessor needs a connection, therefore I've specified hardcoded a JDBC URL.
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:apps/apps@(DE.............");
    and then pass conn to the DataProcessor.
    dataprocess.setConnection(conn);
    But i want to get rid of this hardcoded connection.
    So I did the following:
    OAApplicationModuleImpl am = (OAApplicationModuleImpl)pageContext.getRootApplicationModule();
    String JDBCURL = am.getOADBTransaction().getConnectionMetadata().getJdbcURL();
    System.out.println(JDBCURL");
    as result a wrong connectionstring: ....com)(PORT=1533)))(CONNECT_DATA=(SID=1533)))
    he takes for SID the port number....
    questions I have:
    - the way I work is correct?
    - where does he gets his jdbc url from? becuase I already checked my database in jdev and it works (with correct SID) and also my dbc file is correct...
    Thanks in advance!
    Stijn

    Stijn ,
    You can get connection from OADBTransactionImpl in AM.Here is the sample code:
    import oracle.apps.fnd.framework.server.OADBTransaction;
    import oracle.apps.fnd.framework.server.OADBTransactionImpl;
    import oracle.jdbc.driver.OracleConnection;
    OADBTransactionImpl oadbtransactionimpl = (OADBTransactionImpl)getOADBTransaction();
    OracleConnection conn = (OracleConnection)oadbtransactionimpl.getJdbcConnection();
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Connecting to a database over the internet

    Hello ,
    Ok heres an interesting question -
    I would like to have an applet running on my browser which needs to connect to a central server over the internet, which in turn will need to connect to a database and query some results. These results will be stored as flat files within the server.
    At the moment, I have a URL that connects to the database via the
    internet and that is working. However I don't think my applet on my browser will be able to create a flat file on that server direclty.
    Could some one please tell me how to go about this problem?
    Shalini

    Yes, put a servlet in between the applet and database. Let the servlet interace with the database on the applet's behalf and write that file on the server side.
    %

  • How to connect to a database thro JavaScript

    How do I connect to a database(Say Microsoft Access), through Javascript.
    -Thanx in Advance
    Harini

    JavaScript is something entirely different than Java.
    If you really want to program with JavaScript, you are in the wrong place here. The forums here are about Java, not JavaScript. So, find some other forum on the Internet which is about JavaScript.
    If you are programming in Java, you'll need to learn how to use the JDBC API to connect to a database. See the tutorial.

  • Connecting to different databases

    Hi,
    Is there any one JDBC driver that connects to different databases (SQL Server, Oracle, Informix, MS Access, DB2..etc)
    Can anybody Pls help me for the above problem, its urgent

    There are some drivers, which supports several DBs
    look for them here:
    http://industry.java.sun.com/products/jdbc/drivers
    Paul

  • Standby Database for Oracle 8.1.7 Std Ed

    Hi, I am using Oracle 8.1.7 std ed with W2K Adv Server. Both primary host and remote host using the same version of oracle and OS.
    So far both oracle path are identical and the standby folder is same with primary and I don't think I need to add the db_name_convert and log_name_convert into my standby parameter file.
    I have make a consistent backup from primary to standby and also create the standby control file from primary. However, I am having the problem on setting up the tnsnames.ora and listener.ora for both primary and standby? Can someone here give me the sample on configure those ora file? Say example
    Host Name (Primary) : PRMY
    DB_NAME (Primary) : PRMY
    SID (Primary) : PRMY
    Instance (Primary) : PRMY
    Host Name (Primary) : STBY
    DB_NAME : PRMY
    SID (Primary) : STBY
    Instance (Primary) : STBY.
    This error message is once i am going to connect the standby database via SQL*Plus using sys/change_on_install@STBY, error ORA-12154: TNS:could not resolve service name displayed. However, I managed to login follow by set oracle_sid=STBY and connect as sysdba.

    Hi Albert,
    Please find below the ora files for your perusal.
    # TNSNAMES.ORA for Primary Database
    PRMY =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = PRMY)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = PRMY)
    STBY =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = STBY)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = STBY)
    ============================================================
    # LISTENER.ORA for Standby Database
    LISTENER =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = STBY)(PORT = 1521))
    SID_LIST_LISTENER =
    (SID_DESC =
    (GLOBAL_DBNAME = STBY)
    (ORACLE_HOME = E:\oracle\ora81)
    (SID_NAME = STBY)
    ==============================================================
    # LISTENER.ORA for Primary Database
    LISTENER =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = PRMY)(PORT = 1521))
    SID_LIST_LISTENER =
    (SID_DESC =
    (GLOBAL_DBNAME = PRMY)
    (ORACLE_HOME = E:\oracle\ora81)
    (SID_NAME = PRMY)
    )

  • Execute DBMS_SERVICE in standby database

    Hi all.
    I have a 2 nodes RAC with 10.2.0.4.0 and 1 physical standby in red hat.
    I create a trigger to start services in standby in case of switchover. I do a switchover and create the services but...
    when i go back and execute a switchover again i have services started in Primary and Standby. !!!
    I need to stop, drop, kill services in standby because some connections wants to connect to standby database...
    execute dbms_service in standby and I have this error.
    SQL> exec dbms_service.stop_service('OSAPP3_GMP.bancocredicoop.coop');
    BEGIN dbms_service.stop_service('OSAPP3_GMP.bancocredicoop.coop'); END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00201: identifier 'DBMS_SERVICE.STOP_SERVICE' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    I don't know if i make a mistake in execution of procedure or I can't execute this procedure in standby database.
    There is another way to stop service in standby??
    Thanks and sorry by my english.

    I used to use role change triggers to start services, but there were always problems.
    Much better to use Dataguard Broker and have the services managed by CRS. When you switchover with Dataguard Broker it will tell CRS to stop the service on the new standby and start on the new primary.

  • Standby Database Switchover Question

    I have a Primary and a physical standby database. I have tested switchover and failover to a point. I can't get my client applications to navigate to the "new" primary DB after switchover or failover. I assume it may be something to do with my tnsnames.ora and listener.ora files in my configuration. I will place the contents of the files below.
    I was expecting to be able to add the failover syntax to my client tnsnames file and things would be fine. Unfortunately, clinet apps don't failover to "new" Primary ("old" standby DB) when testing failovers; Additionally, when testing switchovers, the client apps try to connect to the "new" standby DB ("old" Primary) instead of the "new" Primary DB.
    I was hoping someone might see a syntactical error that is preventing a transparent application failover.
    Thanks.
    Jim
    tnsnames.ora on client:
    TESTDB =
    (DESCRIPTION=(SOURCE_ROUTE=yes)
         (ADDRESS=(PROTOCOL=tcp)(HOST = oracle1.datacenter.staging)(PORT = 1521))
         (ADDRESS_LIST=(FAILOVER=on)(LOAD_BALANCE=off)
         (ADDRESS=(PROTOCOL=tcp)(HOST = oracle2.datacenter.staging)(PORT = 1521))(CONNECT_DATA=(SERVICE_NAME=orcl10STANDBY)))
         (CONNECT_DATA=(SERVICE_NAME=orcl10)))
    tnsnames.ora (on both Primary and Standby DB's)
    ORCL10 =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oracle1.datacenter.staging)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl10)
    ORCL10STANDBY =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oracle2.datacenter.staging)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl10STANDBY)
    listener.ora - Primary
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = D:\oracle\product\10.2.0\db_10)
    (PROGRAM = extproc)
    (SID_DESC =
    (ORACLE_HOME = D:\oracle\product\10.2.0\db_10)
    (SID_NAME = ORCL10)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oracle1.datacenter.staging)(PORT = 1521))
    listener.ora - Standby
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
    (PROGRAM = extproc)
    (SID_DESC =
    (ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
    (SID_NAME = ORCL10STANDBY)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oracle2.datacenter.staging)(PORT = 1521))
    )

    Hi another way can be configuring client tnsname files to support failover:
    EXAMPLE=
    (description=
    (address_list=
    (load_balance=off)
    (failover=on)
    (address=(protocol=tcp)(host=X)(port=1521))
    (address=(protocol=tcp)(host=Y)(port=1521)))
    (connect_data=(service_name=XXX)))
    if the listener on host X (primary db) fails, client tries to connect the standby database on host Y.

  • MANAGING A STANDBY DATABASE-CRITICAL

    Hi All,
    I had a primary database version 10.2.0.3 which i upgraded to 10.2.0.4. While upgrading the database
    i turned off archiving.
    After i upgraded the database and brought it up and the listener i started getting errors of
    missing archive logs at the standby site.
    My standby database is 10.2.0.3.
    My question is
    1) As i had turned archiving off at the primary site there is a gap in the archive numbers at the primary itself.
    arch_1_29345_623164377.dbf
    arch_1_29346_623164377.dbf
    -rw-r----- 1 oracle dba 5241344 Feb 7 08:43 arch_1_29347_623164377.dbf
    -rw-r----- 1 oracle dba 5241344 Feb 7 09:03 arch_1_29348_623164377.dbf
    -rw-r----- 1 oracle dba 5241344 Feb 7 09:35 arch_1_29349_623164377.dbf
    -rw-r----- 1 oracle dba 2781184 Feb 7 11:57 arch_1_29350_623164377.dbf
    --------------------GAP------------------------AS I HAD TURNED ARCHIVING OFF----------------
    -rw-r----- 1 oracle dba 5241344 Feb 7 15:57 arch_1_29561_623164377.dbf
    -rw-r----- 1 oracle dba 5241344 Feb 7 15:57 arch_1_29562_623164377.dbf
    -rw-r----- 1 oracle dba 5241344 Feb 7 15:57 arch_1_29563_623164377.dbf
    -rw-r----- 1 oracle dba 5241344 Feb 7 15:57 arch_1_29564_623164377.dbf
    I am getting errors that the standby is not in snyc with primary
    when i ran query
    SQL> SELECT PROCESS, STATUS, THREAD#, SEQUENCE#, BLOCK#, BLOCKS
    2 FROM V$MANAGED_STANDBY;
    on standby database
    it says i am missing sequence # 29351 which is due to the fact that there is no sequence like that on
    my primary itself.
    How should i resolve this gap.
    Also is it a good idea to upgrade the oracle home on my standbysite to 10.2.0.4 as i have upgraded
    my primary

    Hello,
    Like I said no easy way out of this situation. First option sync both usign RMAN and section option setup from the scratch (that's might not be possbile).
    You can also find similar steps under oracle documentation serach for resolving gaps manually/
    Here are the steps for first option, study it and make changes to according to your needs
    1. On the standby database, stop the managed recovery process
    SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
    2. On the standby database, find the SCN which will be used for the incremental backup at the primary database:
    SQL> SELECT CURRENT_SCN FROM V$DATABASE;
    This will used in the rman backup command at step 2.
    3. In RMAN, connect to the primary database and create an incremental backup from the
    SCN derived in the previous step:
    RMAN> BACKUP INCREMENTAL FROM SCN <SCN from previous step>
    DATABASE FORMAT '/tmp/ForStandby_%U' tag 'FORSTANDBY';
    You must create this incremental backup on disk for it to be useful. When you move
    the incremental backup to the standby database, you must catalog it at the
    standby as described in Oracle Database Backup and Recovery Advanced User's
    Guide. Backups on tape cannot be cataloged.
    4. Transfer all backup sets created on the primary system to the standby system (note that there may be
    more than one backup file created). For example:
    SCP /tmp/ForStandby_* standby:/tmp
    5. Connect to the standby database as the RMAN target, and catalog all incremental backup pieces:
    RMAN> CATALOG START WITH '/tmp/ForStandby';
    6. Recover the standby database with the cataloged incremental backup:
    RMAN> RECOVER DATABASE NOREDO;
    7. In RMAN, connect to the primary database and create a standby control file backup:
    RMAN> BACKUP CURRENT CONTROLFILE FOR STANDBY FORMAT '/tmp/ForStandbyCTRL.bck';
    8. Copy the standby control file backup to the standby system. For example:
    SCP /tmp/ForStandbyCTRL.bck standby:/tmp
    9. Shut down the standby database and startup nomount:
    RMAN> SHUTDOWN;
    RMAN> STARTUP NOMOUNT;
    10. In RMAN, connect to standby database and restore the standby control file:
    RMAN> RESTORE STANDBY CONTROLFILE FROM '/tmp/ForStandbyCTRL.bck';
    11. Shut down the standby database and startup mount:
    RMAN> SHUTDOWN;
    RMAN> STARTUP MOUNT;
    12. If the primary and standby database data file directories are identical, skip to step
    13. If the primary and standby database data file directories are different,
    then in RMAN, connect to the standby database, catalog the standby data files,
    and switch the standby database to use the just-cataloged data files. For
    example:
    RMAN> CATALOG START WITH '+DATA_1/CHICAGO/DATAFILE/';
    RMAN> SWITCH DATABASE TO COPY;
    13. If the primary and standby database redo log directories are identical, skip to step 14. Otherwise, on the standby database, use an OS
    utility or the asmcmd utility (if it is an ASM-managed database) to remove all
    online and standby redo logs from the standby directories and ensure that the
    LOG_FILE_NAME_CONVERT parameter is properly defined to translate log directory
    paths. For example, LOG_FILE_NAME_CONVERT='/BOSTON/','/CHICAGO/'.
    14. On the standby database, clear all standby redo log groups (there may be more than
    3):
    SQL> ALTER DATABASE CLEAR LOGFILE GROUP 1;
    SQL> ALTER DATABASE CLEAR LOGFILE GROUP 2;
    SQL> ALTER DATABASE CLEAR LOGFILE GROUP 3;
    15. If you have flashback enabled:
    On the standby database, restart Flashback Database:
    SQL> ALTER DATABASE FLASHBACK OFF;
    SQL> ALTER DATABASE FLASHBACK ON;
    16. If required restart managed recovery in the standby:
    On the standby database, restart recovery:
    SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;Regards
    Edited by: OrionNet on Feb 7, 2009 6:43 PM

  • Error when trying to recover datafile from standby database to primary

    hi friends,
    getting problem with restoring datafile from backupset taken on standby database to primary database.
    os: windows server 2003
    db: oracle 11gR1(11.1.0.6)
    i've configured standby database on two different hosts.
    host1 - primary (db_uinque_name= prod)
    host2 - standby (db_uniue_name= prodsby)
    I've configure both database with recovery catalog. I take backup on standby database. users' datafile of primary database has been lost.i'm trying to restore from the backupsets taken on standby database.
    with the help of - http://download.oracle.com/docs/cd/B28359_01/server.111/b28294/rman.htm#BAJCEFEG
    on primary
    c:\>rman target sys/password catalog rcat/password
    rman>list backup for db_unique_name prodsby;
    display the backupsets
    rman>restore datafile 4;
    Starting restore at 06-NOV-08
    starting full resync of recovery catalog
    full resync complete
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=1051 device type=DISK
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 11/06/2008 12:12:18
    RMAN-06026: some targets not found - aborting restore
    RMAN-06023: no backup or copy of datafile 4 found to restore
    also use to tag to restore the datafile
    rman>restore datafile 4 from tag='base0_prodsby';
    Starting restore at 06-NOV-08
    using channel ORA_DISK_1
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 11/06/2008 11:27:21
    RMAN-06026: some targets not found - aborting restore
    RMAN-06023: no backup or copy of datafile 4 found to restore
    i'm getting above errors when try to restore the datafile.
    when i issue the following command.
    BACKUP AS COPY DATAFILE 4 AUXILIARY FORMAT 'C:\app\Administrator\oradata\prod\USERS01.DBF';
    Starting backup at 06-NOV-08
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=1068 device type=DISK
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00004 name=C:\APP\ADMINISTRATOR\ORADATA\prod\USERS01.
    DBF
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/06/2008 12:49:
    15
    ORA-17628: Oracle error 19505 returned by remote Oracle server
    please friends, try to help me to solve the problem.
    Thanks,
    Vihang

    hi.
    Its not necessary its a otherway around to recover datafile from this backupset and apply archivelogs to make datafile consistent.
    yes, it ain't the right way to restore backup to primary location.
    so how would i connect to standby database with primary and recovery catalog.
    i need to connect to recovery catalog and primary site because i need to restore to primary location and recovery catalog contain all metadata and backupsets related information.
    i also tried the following steps from oracle documentation.
    Connect to the standby database as the target database:
    CONNECT TARGET sys@standby
    You are prompted for a password:
    target database Password: password
    Connect to the primary database as the auxiliary database:
    CONNECT AUXILIARY sys@primary
    You are prompted for a password:
    target database Password: password
    Back up the datafile on the standby host across the network to a location on the primary host. For example, suppose that /disk1/df2.dbf is the name of datafile 2 on the standby host. Suppose that /disk8/datafile2.dbf is the name of datafile 2 on the primary host. The following command would copy datafile 2 over the network to /disk9/df2copy.dbf:
    BACKUP AS COPY DATAFILE 2 AUXILIARY FORMAT '/disk9/df2copy.dbf';
    Starting backup at 06-NOV-08
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=1068 device type=DISK
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00004 name=C:\APP\ADMINISTRATOR\ORADATA\prod\USERS01.
    DBF
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/06/2008 12:49:
    15
    ORA-17628: Oracle error 19505 returned by remote Oracle server
    getting this error.

Maybe you are looking for

  • Control key no longer works after update.

    After updating Lion the control key no longer works. It beeps when pressing control and then a number key but nothing happens. This is left control key though. Right still works?

  • HP OfficeJet Pro 8600 - will print wirelessly but not scan on Windows 8.1. HP PC

    Hello, my HP printer and HP computer have been working perfectly but now all of a sudden I cannot scan anymore from my printer to my computer. I can print and scan the other way around and the wireless network works. I am just a regular user and don'

  • Autodiscover is ok with selfssl but problem in outlook exchange 2013

    hi, Finally i can setup autodiscover service with self ssl, here is the result   Submit   Connectivity Test Successful Test Details The Microsoft Connectivity Analyzer is attempting to test Autodiscover for [email protected]. Autodiscover

  • Final Cut Crash...  And NO RESTART!!!

    I had to restart Final Cut to enable my Sony PD-150 to talk with FC for Digitizing. I tried to close and re-open FC and it will not run. It starts up but then crashes to Finder. No error codes or anything. I've reinstalled and still have the issue. H

  • Query not using remote table primary key.

    Hello all, My following query is not using the PK of remote database. vem_business_event_attribute is having a PK on ATTRIBUTE_TYPE_ID and business_event_id. The table is last analyzed on 04-dec-2010. It has around 5 milloin rows. select /*+ DRIVING_