Where is STANDBY and PRIMARY

Hi,
in 10g R2 , dataguard on unix HP
when connected to standby ,how can we find where is primary server ?
or :
when connected to primary ,how can we find where is standby server ?
Thank you.

from the primary; look athe parameter log_archive_dest_x you'll see something like:
SQL> select name, value from v$parameter where name like '%log_ar%' ;
log_archive_dest_2
SERVICE=TEST_STANDBY LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_
UNIQUE_NAME=test DELAY=120
tnsping TEST_STANDBY and here is your standby.
From the standby; query if fal_server is configured:
SQL> select name, value from v$parameter where name='fal_server';
NAME VALUE
fal_server TESTPROD
tnsping TESTPROD and here is your primary.

Similar Messages

  • Logical standby and Primary keys

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

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

  • Is there any impact that apply Oracle CPU on standby and primary DB

    We plan to apply Oracle April CPU on standby DB at this weekend. Then apply the same patch on primary DB next weekend. If I apply the patch on standby, then enable redo apply between primary and standby, is there any impact on primary DB. Theoretically, I don't think so. However, both DBs are production. I want to make sure there is no any impact by applying CPU in different time. Otherwise, I have to apply both DBs at the same time. Please advise. Thanks in advance.

    853153 wrote:
    I hope you read other people's post carefully. Don't pretend yourself is expert so that you can say whatever you want to say. This is the tech forum for Oracle technical people to ask question, seek help and so on. How do you know I didn't review document 278641.1 before I asked my question. Document 278641.1 only provide info on how to apply patch on primary and standby. Didn't say anything about applying the same patch on both DBs with data Guard at the different time. I just want to make sure If I apply patch on both DBs with one week difference, will this affect my primary database? Is there anything wrong here. If you paly in this forum as expert, please help people, not just look down people.
    I suggest you review [url http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way.
    When you ask for help, state the platform, operating system, Oracle version and patch level, no matter whether it seems important to the question or not. It most often is important. You may not know the difference between Itanium and PA-RISC, but that is important for Oracle and important for someone doing administrative work on an Oracle database to know. You should also learn to search the internet for answers to common questions. Everyone here wants to help, but few want to spoon-feed.
    When you have any kind of standby, that constrains what you can do to a primary, if you want the standby to work properly. You need to understand how things get from one to the other, and how to decide when to simply rebuild the standby from scratch - and that decision is based on your configuration and requirements. You don't want to be in some undefined configuration for any period of time.

  • RA-12514: TNS:listener does not  in 11g Standby and Primary

    Hi,
    We are under process of creating active database in Linux,when i am trying to connect to auxiliary database from primary , i am hitting below error, any ideas.
    rman target sys/oracle@adg auxiliary sys/oracle@adg1
    I am able to do tnsping from both servers.
    from standby
    [oracle@adg1 admin]$ tnsping adg
    TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 18-AUG-2011 18:49:15
    Copyright (c) 1997, 2009, Oracle. All rights reserved.
    Used parameter files:
    /u01/app/oracle/product/11.2.0/db_1/network/admin/sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = adg.xxxx.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = adg.xxxx.com) (UR=A)))
    OK (0 msec)
    [oracle@adg1 admin]$ tnsping adg1
    TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 18-AUG-2011 18:49:15
    Copyright (c) 1997, 2009, Oracle. All rights reserved.
    Used parameter files:
    /u01/app/oracle/product/11.2.0/db_1/network/admin/sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = adg1.xxxxcom)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = adg1.xxxx.com) (UR=A)))
    OK (0 msec)
    [oracle@adg1 admin]$
    From Primary:
    ========
    [oracle@adg admin]$ tnsping adg
    TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 19-AUG-2011 10:06:29
    Copyright (c) 1997, 2009, Oracle. All rights reserved.
    Used parameter files:
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = adg.xxx.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = adg.xxxx.com)(UR=A)))
    OK (10 msec)
    [oracle@adg admin]$ tnsping adg1
    TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 19-AUG-2011 10:06:29
    Copyright (c) 1997, 2009, Oracle. All rights reserved.
    Used parameter files:
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = adg1.xxx.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = adg1.xxx.com) (UR=A)))
    OK (0 msec)
    [oracle@adg admin]$
    ================================
    standby listener.ora
    [oracle@adg1 admin]$ cat listener.ora
    # listener.ora Network Configuration File: /u01/app/11.2.0/grid/network/admin/listener.ora
    # Generated by Oracle configuration tools.
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = adg1.xxx.com)(PORT = 1521))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = ADG)
    (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
    (SID_NAME = ADG1)
    standby tnsnames.ora
    [oracle@adg1 admin]$ cat tnsnames.ora
    # tnsnames.ora Network Configuration File: /u01/app/11.2.0/grid/network/admin/tnsnames.ora
    # Generated by Oracle configuration tools.
    ADG1 =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = adg1.xxx.com)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = adg1.xxx.com) (UR=A)
    ADG =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = adg.xx.com)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = adg.xxx.com) (UR=A)
    [oracle@adg1 admin]$

    I am trying to create active database from standby, how ever its failing with below error, any ideas..?
    Here is RMAN error log.
    ADG: Primary
    ADG1:Standby
    ==============
    Recovery Manager: Release 11.2.0.1.0 - Production on Tue Sep 6 03:26:09 2011
    Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
    RMAN> connect target *
    2> connect auxiliary *
    3> run {
    4> allocate channel prmy1 type disk;
    5> allocate channel prmy2 type disk;
    6> allocate channel prmy3 type disk;
    7> allocate channel prmy4 type disk;
    8> allocate channel prmy5 type disk;
    9> allocate auxiliary channel stby1 type disk;
    10> duplicate target database for standby from active database
    11> spfile parameter_value_convert 'adg','adg1'
    12> set db_unique_name='adg1'
    13> set standby_file_management='AUTO'
    14> set db_create_file_dest='+DATA'
    15> set db_recovery_file_dest='+DATA'
    16> set DB_RECOVERY_FILE_DEST_SIZE='8G'
    17> set control_files='+DATA/ADG1/controlfile/control01.ctl'
    18> set log_archive_max_processes='5'
    19> set fal_client='adg1'
    20> set fal_server='adg'
    21> set log_archive_config='dg_config=(adg1,adg)'
    22> nofilenamecheck
    23> ;
    24> }
    25>
    connected to target database: ADG (DBID=1317755151)
    connected to auxiliary database: ADG1 (not mounted)
    using target database control file instead of recovery catalog
    allocated channel: prmy1
    channel prmy1: SID=29 device type=DISK
    allocated channel: prmy2
    channel prmy2: SID=22 device type=DISK
    allocated channel: prmy3
    channel prmy3: SID=156 device type=DISK
    allocated channel: prmy4
    channel prmy4: SID=152 device type=DISK
    allocated channel: prmy5
    channel prmy5: SID=148 device type=DISK
    allocated channel: stby1
    channel stby1: SID=96 device type=DISK
    Starting Duplicate Db at 06-SEP-11
    contents of Memory Script:
    backup as copy reuse
    targetfile '/u01/app/oracle/product/11.2.0/db_1/dbs/orapwadg' auxiliary format
    '/u01/app/oracle/product/11.2.0/db_1/dbs/orapwadg1' targetfile
    '+DATA/adg/spfileadg.ora' auxiliary format
    '/u01/app/oracle/product/11.2.0/db_1/dbs/spfileadg1.ora' ;
    sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.0/db_1/dbs/spfileadg1.ora''";
    executing Memory Script
    Starting backup at 06-SEP-11
    Finished backup at 06-SEP-11
    sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.0/db_1/dbs/spfileadg1.ora''
    contents of Memory Script:
    sql clone "alter system set audit_file_dest =
    ''/u01/app/oracle/admin/adg1/adump'' comment=
    '''' scope=spfile";
    sql clone "alter system set dispatchers =
    ''(PROTOCOL=TCP) (SERVICE=adg1XDB)'' comment=
    '''' scope=spfile";
    sql clone "alter system set log_archive_dest_1 =
    ''Location=/u01/archvie VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=adg1'' comment=
    '''' scope=spfile";
    sql clone "alter system set log_archive_dest_2 =
    ''SERVICE=adg11 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=adg1'' comment=
    '''' scope=spfile";
    sql clone "alter system set db_unique_name =
    ''adg1'' comment=
    '''' scope=spfile";
    sql clone "alter system set standby_file_management =
    ''AUTO'' comment=
    '''' scope=spfile";
    sql clone "alter system set db_create_file_dest =
    ''+DATA'' comment=
    '''' scope=spfile";
    sql clone "alter system set db_recovery_file_dest =
    ''+DATA'' comment=
    '''' scope=spfile";
    sql clone "alter system set DB_RECOVERY_FILE_DEST_SIZE =
    8G comment=
    '''' scope=spfile";
    sql clone "alter system set control_files =
    ''+DATA/ADG1/controlfile/control01.ctl'' comment=
    '''' scope=spfile";
    sql clone "alter system set log_archive_max_processes =
    5 comment=
    '''' scope=spfile";
    sql clone "alter system set fal_client =
    ''adg1'' comment=
    '''' scope=spfile";
    sql clone "alter system set fal_server =
    ''adg'' comment=
    '''' scope=spfile";
    sql clone "alter system set log_archive_config =
    ''dg_config=(adg1,adg)'' comment=
    '''' scope=spfile";
    shutdown clone immediate;
    startup clone nomount;
    executing Memory Script
    sql statement: alter system set audit_file_dest = ''/u01/app/oracle/admin/adg1/adump'' comment= '''' scope=spfile
    sql statement: alter system set dispatchers = ''(PROTOCOL=TCP) (SERVICE=adg1XDB)'' comment= '''' scope=spfile
    sql statement: alter system set log_archive_dest_1 = ''Location=/u01/archvie VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=adg1'' comment= '''' scope=spfile
    sql statement: alter system set log_archive_dest_2 = ''SERVICE=adg11 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=adg1'' comment= '''' scope=spfile
    sql statement: alter system set db_unique_name = ''adg1'' comment= '''' scope=spfile
    sql statement: alter system set standby_file_management = ''AUTO'' comment= '''' scope=spfile
    sql statement: alter system set db_create_file_dest = ''+DATA'' comment= '''' scope=spfile
    sql statement: alter system set db_recovery_file_dest = ''+DATA'' comment= '''' scope=spfile
    sql statement: alter system set DB_RECOVERY_FILE_DEST_SIZE = 8G comment= '''' scope=spfile
    sql statement: alter system set control_files = ''+DATA/ADG1/controlfile/control01.ctl'' comment= '''' scope=spfile
    sql statement: alter system set log_archive_max_processes = 5 comment= '''' scope=spfile
    sql statement: alter system set fal_client = ''adg1'' comment= '''' scope=spfile
    sql statement: alter system set fal_server = ''adg'' comment= '''' scope=spfile
    sql statement: alter system set log_archive_config = ''dg_config=(adg1,adg)'' comment= '''' scope=spfile
    Oracle instance shut down
    released channel: prmy1
    released channel: prmy2
    released channel: prmy3
    released channel: prmy4
    released channel: prmy5
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 09/06/2011 03:26:19
    RMAN-03015: error occurred in stored script Memory Script
    RMAN-04006: error from auxiliary database: ORA-01031: insufficient privileges
    Recovery Manager complete.
    Here is alert.log error.
    =============
    *** 2011-09-06 03:20:24.156
    Redo shipping client performing standby login
    *** 2011-09-06 03:20:24.200 4539 krsu.c
    Logged on to standby successfully
    Client logon and security negotiation successful!
    Error 16058 attaching RFS server to standby instance at host 'adg1'
    Error 16058 attaching to destination LOG_ARCHIVE_DEST_2 standby host 'adg1'
    ORA-16058: standby database instance is not mounted
    *** 2011-09-06 03:20:24.205 4132 krsh.c
    PING[ARC3]: Heartbeat failed to connect to standby 'adg1'. Error is 16058.
    *** 2011-09-06 03:20:24.205 2747 krsi.c
    krsi_dst_fail: dest:2 err:16058 force:0 blast:1
    Redo shipping client performing standby login
    OCISessionBegin failed -1
    .. Detailed OCI error val is 1034 and errmsg is 'ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    Linux Error: 2: No such file or directory
    OCISessionBegin failed. Error -1
    .. Detailed OCI error val is 1034 and errmsg is 'ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    Linux Error: 2: No such file or directory
    OCISessionBegin failed. Error -1
    .. Detailed OCI error val is 1034 and errmsg is 'ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    Linux Error: 2: No such file or directory
    *** 2011-09-06 03:26:24.324 4132 krsh.c
    Error 1034 received logging on to the standby
    *** 2011-09-06 03:26:24.325 869 krsu.c
    Error 1034 connecting to destination LOG_ARCHIVE_DEST_2 standby host 'adg1'
    Error 1034 attaching to destination LOG_ARCHIVE_DEST_2 standby host 'adg1'
    ORA-01034: ORACLE not available
    *** 2011-09-06 03:26:24.325 4132 krsh.c
    PING[ARC3]: Heartbeat failed to connect to standby 'adg1'. Error is 1034.
    *** 2011-09-06 03:26:24.325 2747 krsi.c
    krsi_dst_fail: dest:2 err:1034 force:0 blast:1

  • How to verify that standby and primary are working correctly  or not

    Hi,
    Oracle Version : 10.2.0.1.0
    OperatingSystem : WindowsXp
    I have configured a stand by database on my local database.Here i would like to know weather by stand by is configured correctly and working fine are not.
    Please help me.
    Thank & Regards
    Poorna Prasad.

    Hi,
    When i issue these statements in my primary database the output is like this
    SQL> SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
    SEQUENCE# FIRST_TIM NEXT_TIME
           169 19-AUG-09 20-AUG-09
           170 20-AUG-09 20-AUG-09
           171 20-AUG-09 20-AUG-09
           172 20-AUG-09 20-AUG-09
           173 20-AUG-09 20-AUG-09
           174 20-AUG-09 21-AUG-09
           175 21-AUG-09 21-AUG-09
           176 21-AUG-09 22-AUG-09
           177 22-AUG-09 22-AUG-09
           178 22-AUG-09 23-AUG-09
           179 23-AUG-09 23-AUG-09
    SEQUENCE# FIRST_TIM NEXT_TIME
           180 23-AUG-09 24-AUG-09
           180 23-AUG-09 24-AUG-09
           181 24-AUG-09 24-AUG-09
           181 24-AUG-09 24-AUG-09
           182 24-AUG-09 24-AUG-09
           182 24-AUG-09 24-AUG-09
           183 24-AUG-09 24-AUG-09
           183 24-AUG-09 24-AUG-09
           184 24-AUG-09 24-AUG-09
           184 24-AUG-09 24-AUG-09
           185 24-AUG-09 24-AUG-09
    SEQUENCE# FIRST_TIM NEXT_TIME
           185 24-AUG-09 24-AUG-09
           186 24-AUG-09 25-AUG-09
           186 24-AUG-09 25-AUG-09
           187 25-AUG-09 25-AUG-09
           187 25-AUG-09 25-AUG-09
           188 25-AUG-09 25-AUG-09
           188 25-AUG-09 25-AUG-09
           189 25-AUG-09 25-AUG-09
           190 25-AUG-09 25-AUG-09
    31 rows selected.
    SQL> select * from v$dataguard_status;
    FACILITY                 SEVERITY         DEST_ID MESSAGE_NUM ERROR_CODE CAL TIMESTAMP MESSAGE
    Log Transport Services   Informational          0           1          0 NO  25-AUG-09 ARC0: Archival started
    Log Transport Services   Informational          0           2          0 NO  25-AUG-09 ARC1: Archival started
    Log Transport Services   Informational          0           3          0 NO  25-AUG-09 ARC2: Archival started
    Log Transport Services   Informational          0           4          0 NO  25-AUG-09 ARC3: Archival started
    Log Transport Services   Informational          0           5          0 NO  25-AUG-09 ARC4: Archival started
    Log Transport Services   Informational          0           6          0 NO  25-AUG-09 ARC5: Archival started
    Log Transport Services   Informational          0           7          0 NO  25-AUG-09 ARC6: Archival started
    Log Transport Services   Informational          0           8          0 NO  25-AUG-09 ARC7: Archival started
    Log Transport Services   Informational          0           9          0 NO  25-AUG-09 ARC8: Archival started
    Log Transport Services   Informational          0          10          0 NO  25-AUG-09 ARC9: Archival started
    Log Transport Services   Informational          0          11          0 NO  25-AUG-09 ARCa: Archival started
    FACILITY                 SEVERITY         DEST_ID MESSAGE_NUM ERROR_CODE CAL TIMESTAMP MESSAGE
    Log Transport Services   Informational          0          12          0 NO  25-AUG-09 ARCb: Archival started
    Log Transport Services   Informational          0          13          0 NO  25-AUG-09 ARCc: Archival started
    Log Transport Services   Informational          0          14          0 NO  25-AUG-09 ARCd: Archival started
    Log Transport Services   Informational          0          15          0 NO  25-AUG-09 ARCe: Archival started
    Log Transport Services   Informational          0          16          0 NO  25-AUG-09 ARCf: Archival started
    Log Transport Services   Informational          0          17          0 NO  25-AUG-09 ARCg: Archival started
    Log Transport Services   Informational          0          18          0 NO  25-AUG-09 ARCh: Archival started
    Log Transport Services   Informational          0          19          0 NO  25-AUG-09 ARCi: Archival started
    Log Transport Services   Informational          0          20          0 NO  25-AUG-09 ARCj: Archival started
    Log Transport Services   Informational          0          21          0 NO  25-AUG-09 ARCk: Archival started
    Log Transport Services   Informational          0          22          0 NO  25-AUG-09 ARCl: Archival started
    FACILITY                 SEVERITY         DEST_ID MESSAGE_NUM ERROR_CODE CAL TIMESTAMP MESSAGE
    Log Transport Services   Informational          0          23          0 NO  25-AUG-09 ARCm: Archival started
    Log Transport Services   Informational          0          24          0 NO  25-AUG-09 ARCn: Archival started
    Log Transport Services   Informational          0          25          0 NO  25-AUG-09 ARCo: Archival started
    Log Transport Services   Informational          0          26          0 NO  25-AUG-09 ARCp: Archival started
    Log Transport Services   Informational          0          27          0 NO  25-AUG-09 ARCq: Archival started
    Log Transport Services   Informational          0          28          0 NO  25-AUG-09 ARCr: Archival started
    Log Transport Services   Informational          0          29          0 NO  25-AUG-09 ARCs: Archival started
    Log Transport Services   Informational          0          30          0 NO  25-AUG-09 ARCt: Archival started
    Log Transport Services   Informational          0          31          0 NO  25-AUG-09 ARCi: Becoming the 'no FAL' ARCH
    Log Transport Services   Informational          0          32          0 NO  25-AUG-09 ARCi: Becoming the 'no SRL' ARCH
    Log Transport Services   Informational          0          33          0 NO  25-AUG-09 ARCl: Becoming the heartbeat ARCH
    FACILITY                 SEVERITY         DEST_ID MESSAGE_NUM ERROR_CODE CAL TIMESTAMP MESSAGE
    Log Transport Services   Error                  0          34       1017 YES 25-AUG-09 Error 1017 received logging on to the standby
    Fetch Archive Log        Error                  2          35      16191 YES 25-AUG-09 FAL[server, ARC0]: Error 16191 creating remote archivelog file 'stand'
    Log Transport Services   Error                  0          36       1017 YES 25-AUG-09 Error 1017 received logging on to the standby
    Log Transport Services   Error                  2          37      16191 YES 25-AUG-09 PING[ARCl]: Heartbeat failed to connect to standby 'stand'. Error is 16191.
    Log Transport Services   Error                  0          38       1017 YES 25-AUG-09 Error 1017 received logging on to the standby
    Log Transport Services   Error                  2          39      16191 YES 25-AUG-09 PING[ARCl]: Heartbeat failed to connect to standby 'stand'. Error is 16191.
    Log Transport Services   Error                  0          40       1017 YES 25-AUG-09 Error 1017 received logging on to the standby
    Log Transport Services   Error                  2          41      16191 YES 25-AUG-09 PING[ARCl]: Heartbeat failed to connect to standby 'stand'. Error is 16191.
    Log Transport Services   Error                  0          42      12518 YES 25-AUG-09 Error 12518 received logging on to the standby
    Log Transport Services   Error                  2          43      12518 YES 25-AUG-09 PING[ARCl]: Heartbeat failed to connect to standby 'stand'. Error is 12518.
    Log Transport Services   Error                  0          44       1017 YES 25-AUG-09 Error 1017 received logging on to the standby
    FACILITY                 SEVERITY         DEST_ID MESSAGE_NUM ERROR_CODE CAL TIMESTAMP MESSAGE
    Log Transport Services   Error                  2          45      16191 YES 25-AUG-09 PING[ARCl]: Heartbeat failed to connect to standby 'stand'. Error is 16191.
    Log Transport Services   Error                  0          46       1017 YES 25-AUG-09 Error 1017 received logging on to the standby
    Log Transport Services   Error                  2          47      16191 YES 25-AUG-09 PING[ARCl]: Heartbeat failed to connect to standby 'stand'. Error is 16191.
    Log Transport Services   Error                  0          48       1017 YES 25-AUG-09 Error 1017 received logging on to the standby
    Log Transport Services   Error                  2          49      16191 YES 25-AUG-09 PING[ARCl]: Heartbeat failed to connect to standby 'stand'. Error is 16191.
    Log Transport Services   Error                  0          50       1017 YES 25-AUG-09 Error 1017 received logging on to the standby
    Log Transport Services   Error                  2          51      16191 YES 25-AUG-09 PING[ARCl]: Heartbeat failed to connect to standby 'stand'. Error is 16191.
    Log Transport Services   Error                  0          52       1017 YES 25-AUG-09 Error 1017 received logging on to the standby
    Log Transport Services   Error                  2          53      16191 YES 25-AUG-09 PING[ARCl]: Heartbeat failed to connect to standby 'stand'. Error is 16191.
    Log Transport Services   Error                  0          54       1017 YES 25-AUG-09 Error 1017 received logging on to the standby
    Log Transport Services   Error                  2          55      16191 YES 25-AUG-09 PING[ARCl]: Heartbeat failed to connect to standby 'stand'. Error is 16191.
    FACILITY                 SEVERITY         DEST_ID MESSAGE_NUM ERROR_CODE CAL TIMESTAMP MESSAGE
    Log Transport Services   Error                  0          56       1017 YES 25-AUG-09 Error 1017 received logging on to the standby
    Log Transport Services   Error                  2          57      16191 YES 25-AUG-09 PING[ARCl]: Heartbeat failed to connect to standby 'stand'. Error is 16191.
    Log Transport Services   Error                  0          58       1017 YES 25-AUG-09 Error 1017 received logging on to the standby
    Log Transport Services   Error                  2          59      16191 YES 25-AUG-09 PING[ARCl]: Heartbeat failed to connect to standby 'stand'. Error is 16191.
    Log Transport Services   Error                  0          60       1017 YES 25-AUG-09 Error 1017 received logging on to the standby
    Log Transport Services   Error                  2          61      16191 YES 25-AUG-09 PING[ARCl]: Heartbeat failed to connect to standby 'stand'. Error is 16191.
    Log Transport Services   Error                  0          62       1017 YES 25-AUG-09 Error 1017 received logging on to the standby
    Log Transport Services   Error                  2          63      16191 YES 25-AUG-09 PING[ARCl]: Heartbeat failed to connect to standby 'stand'. Error is 16191.
    Log Transport Services   Error                  0          64       1017 YES 25-AUG-09 Error 1017 received logging on to the standby
    Log Transport Services   Error                  2          65      16191 YES 25-AUG-09 PING[ARCl]: Heartbeat failed to connect to standby 'stand'. Error is 16191.
    Log Transport Services   Error                  0          66       1017 YES 25-AUG-09 Error 1017 received logging on to the standby
    FACILITY                 SEVERITY         DEST_ID MESSAGE_NUM ERROR_CODE CAL TIMESTAMP MESSAGE
    Log Transport Services   Error                  2          67      16191 YES 25-AUG-09 PING[ARCl]: Heartbeat failed to connect to standby 'stand'. Error is 16191.and when i issue these statements in my stand by the output is.
    SQL> select * from V$managed_standby;
    PROCESS          PID STATUS       CLIENT_P CLIENT_PID                               CLIENT_DBID                      GROUP#                                   RESETLOG_ID    THREAD#  SEQUENCE#     BLOCK#     BLOCKS DELAY_MINS KNOWN_AGENTS ACTIVE_AGENTS
    ARCH            4504 CONNECTED    ARCH     4504                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            3440 CONNECTED    ARCH     3440                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            5504 CONNECTED    ARCH     5504                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            5352 CONNECTED    ARCH     5352                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            5344 CONNECTED    ARCH     5344                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            1320 CONNECTED    ARCH     1320                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            5088 CONNECTED    ARCH     5088                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            3416 CONNECTED    ARCH     3416                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            5916 CONNECTED    ARCH     5916                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            5776 CONNECTED    ARCH     5776                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            4744 CONNECTED    ARCH     4744                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    PROCESS          PID STATUS       CLIENT_P CLIENT_PID                               CLIENT_DBID                      GROUP#                                   RESETLOG_ID    THREAD#  SEQUENCE#     BLOCK#     BLOCKS DELAY_MINS KNOWN_AGENTS ACTIVE_AGENTS
    ARCH            1144 CONNECTED    ARCH     1144                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            5900 CONNECTED    ARCH     5900                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            4848 CONNECTED    ARCH     4848                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            5560 CONNECTED    ARCH     5560                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            4672 CONNECTED    ARCH     4672                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH             400 CONNECTED    ARCH     400                                      1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            4996 CONNECTED    ARCH     4996                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            5356 CONNECTED    ARCH     5356                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            5800 CONNECTED    ARCH     5800                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            3104 CONNECTED    ARCH     3104                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            6100 CONNECTED    ARCH     6100                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    PROCESS          PID STATUS       CLIENT_P CLIENT_PID                               CLIENT_DBID                      GROUP#                                   RESETLOG_ID    THREAD#  SEQUENCE#     BLOCK#     BLOCKS DELAY_MINS KNOWN_AGENTS ACTIVE_AGENTS
    ARCH            2400 CONNECTED    ARCH     2400                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            3712 CONNECTED    ARCH     3712                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            4248 CONNECTED    ARCH     4248                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            5580 CONNECTED    ARCH     5580                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            3160 CONNECTED    ARCH     3160                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            4436 CONNECTED    ARCH     4436                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            5116 CONNECTED    ARCH     5116                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    ARCH            1488 CONNECTED    ARCH     1488                                     1560521699                       N/A                                                0          0          0          0          0          0            0             0
    MRP0            4464 WAIT_FOR_LOG N/A      N/A                                      N/A                              N/A                                        687453795          1        189          0          0          0            0             0
    31 rows selected.Regards
    Poorna

  • Seeing traffic on both standby and primary servers in a serverfarm

    Hi,
    Is it normal to see traffic on the secondary server in a serverfarm like the below output.
    If its secondary it shouldnt be recieving any traffic until the primary goes down or offline.
    rserver: 192.168.10.40
    192.168.10.40:8000 8 OPERATIONAL 3 118169 284
    rserver: 192.168.10.41
    192.168.10.41:8000 8 STANDBY 0 23798 33
    Thanks

    you had connections but not actually since the current counte is at 0.
    Maybe the primary went down ?
    Did you check the log ?
    The 'show probe detail' and 'show rserver detail' ?
    Gilles.

  • Version diff in standby and primary

    Hi, we have production and standby setup in oracle10g. As I would like to upgrade the database from oracle10g to oracle11g. I would like to know if there is version difference in between primary (11g) and standby database (10g) will the datagaurd will sync the standby database ?

    Dear Beginner,
    There is nothing like version sync in Oracle Data Guard. They should be the same because at the end of the day if it is the physical standby of the production database, this means one day it could be the production database indeed. Treat the physical standby database as a prodcution database and they really should be twins on every aspects.
    Regards.
    Ogan

  • Physical Standby and Primary Hangs after Role Reversal

    Created Physical Standby using two machines.(10.2.0.2)
    Plugged it into Grid Control(R3)
    Tried to switch over. This was carried out successfully but then hanged while updateing the configuration. This is what I am getting in the drcMITDG.log on
    Primary:
    DG 2007-10-05-09:02:33 0 2 0 DMON: Entered rfm_get_chief_lock() for CTL_SWITCH, reason 0
    DG 2007-10-05-09:02:34 0 2 0 DMON: Entered rfm_get_chief_lock() for CTL_SWITCH, reason 0
    DG 2007-10-05-09:02:34 0 2 635079900 DMON: ENUM_DRC: success. (len = 987)
    DG 2007-10-05-09:02:34 0 2 635079900 DMON: ENUM_DRC operation completed
    DG 2007-10-05-09:02:47 0 2 0 DMON: Entered rfm_get_chief_lock() for CTL_SWITCH, reason 0
    DG 2007-10-05-09:02:47 0 2 635079901 DMON: ENUM_DRC: success. (len = 987)
    DG 2007-10-05-09:02:47 0 2 635079901 DMON: ENUM_DRC operation completed
    DG 2007-10-05-09:02:48 0 2 0 DMON: Entered rfm_get_chief_lock() for CTL_SWITCH, reason 0
    DG 2007-10-05-09:03:03 0 2 0 DMON: Entered rfm_get_chief_lock() for CTL_SWITCH, reason 0
    DG 2007-10-05-09:03:18 0 2 0 DMON: Entered rfm_get_chief_lock() for CTL_SWITCH, reason 0
    DG 2007-10-05-09:03:28 0 2 0 DMON: Entered rfm_get_chief_lock() for CTL_SWITCH, reason 0
    DG 2007-10-05-09:03:28 0 2 635079902 DMON: ENUM_DRC: success. (len = 987)
    DG 2007-10-05-09:03:28 0 2 635079902 DMON: ENUM_DRC operation completed
    DG 2007-10-05-09:03:33 0 2 0 DMON: Entered rfm_get_chief_lock() for CTL_SWITCH, reason 0
    DG 2007-10-05-09:03:48 0 2 0 DMON: Entered rfm_get_chief_lock() for CTL_SWITCH, reason 0
    DG 2007-10-05-09:04:03 0 2 0 DMON: Entered rfm_get_chief_lock() for CTL_SWITCH, reason 0
    SECONDARY:
    DG 2007-10-04-14:04:51 0 2 0 DMON: Health check master lock conversion successful
    DG 2007-10-04-14:04:51 0 2 0 DMON: a process acquired the healthcheck master lock
    DG 2007-10-04-14:04:51 0 2 0 DMON: posting primary instances for SWITCHOVER phase 5
    DG 2007-10-04-14:04:51 0 2 0 DMON: SWITCHOVER Completed with errors
    DG 2007-10-04-14:04:51 0 2 0 INSV: Received message for inter-instance publication
    DG 2007-10-04-14:04:51 0 2 0 Primary Site is named: MITDG_BACKREST
    DG 2007-10-04-14:04:51 0 2 0 req_id 0.0.0, opcode CTL_SWITCH, phase END, flags 5
    DG 2007-10-04-14:04:51 0 2 0 error = ORA-16509
    DG 2007-10-04-14:04:51 0 2 0 DMON: dispersing message to standbys for SWITCHOVER phase 5
    DG 2007-10-04-14:04:51 0 2 0 INSV: All instances have replied for message
    DG 2007-10-04-14:04:51 0 2 0 DMON: site 02001000, instance 00000001 queuing healthcheck lock re
    quest
    DG 2007-10-04-14:04:51 0 2 0 req_id 0.0.0, opcode CTL_SWITCH, phase END
    DG 2007-10-04-14:04:51 0 2 0 DMON: Releasing healthcheck master lock
    DG 2007-10-04-14:04:51 0 2 0 DMON: Health check master lock conversion successful
    DG 2007-10-04-14:04:51 0 2 0 DMON: a process acquired the healthcheck master lock
    DG 2007-10-05-08:48:42 1000 2 635079894 DMON: Entered rfm_get_chief_lock() for MON_VERIFY, reason
    0
    DG 2007-10-05-08:48:52 1000 2 635079894 DMON: Entered rfm_get_chief_lock() for MON_VERIFY, reason
    0
    DG 2007-10-05-08:49:07 1000 2 635079894 DMON: Entered rfm_get_chief_lock() for MON_VERIFY, reason
    0
    DG 2007-10-05-08:49:22 1000 2 635079894 DMON: Entered rfm_get_chief_lock() for MON_VERIFY, reason
    0
    DG 2007-10-05-08:49:37 1000 2 635079894 DMON: Entered rfm_get_chief_lock() for MON_VERIFY, reason
    0
    DG 2007-10-05-08:49:52 1000 2 635079894 DMON: Entered rfm_get_chief_lock() for MON_VERIFY, reason
    0
    Any idea what is going on..
    Thanks

    Hi, you must upraise a iTAR to Oracle Support for resolve this problem, because this behaviour is irregular and you will lost much time for analyze and resolve this problem.
    Regards.

  • Standby and primary

    On my Primary database
    when I did archive log list, it gives me
    Database log mode Archive Mode
    Automatic archival Enabled
    Archive destination /u04/oradata/arch/PROD/
    Oldest online log sequence 29627
    Next log sequence to archive 29629
    Current log sequence 29629
    On my standby database, when I did archive log list, it gives me
    SQL> archive log list;
    Database log mode Archive Mode
    Automatic archival Enabled
    Archive destination /u04/oradata/arch/STNBY/
    Oldest online log sequence 29627
    Next log sequence to archive 0
    Current log sequence 29629
    But during hotback on primary it pops up with these errors
    RMAN-08137: WARNING: archive log not deleted as it is still needed
    archive log filename=/u04/oradata/arch/PROD/PROD_0001_749397572_0000028449.arc thread=1 sequence=28449
    RMAN-08137: WARNING: archive log not deleted as it is still needed
    archive log filename=/u04/oradata/arch/PROD/PROD_0001_749397572_0000028450.arc thread=1 sequence=28450
    RMAN-08137: WARNING: archive log not deleted as it is still needed
    I am sure Standby is not in sync with primary.
    Can someone explain in detail how to resolve this issue.
    Any help is greatly appreciated.
    Thank you

    My alert log in bdump has the following information:
    Primary database is in MAXIMUM PERFORMANCE mode
    RFS[739]: Successfully opened standby log 4: '/u01/oradata/STNBY/redo_STNBY_04a.log'
    Tue Sep 13 11:27:35 2011
    Primary database is in MAXIMUM PERFORMANCE mode
    RFS[739]: Successfully opened standby log 4: '/u01/oradata/STNBY/redo_STNBY_04a.log'
    Tue Sep 13 11:28:04 2011
    Primary database is in MAXIMUM PERFORMANCE mode
    RFS[739]: Successfully opened standby log 4: '/u01/oradata/STNBY/redo_STNBY_04a.log'
    Tue Sep 13 11:40:33 2011
    Primary database is in MAXIMUM PERFORMANCE mode
    RFS[739]: Successfully opened standby log 4: '/u01/oradata/STNBY/redo_STNBY_04a.log'
    Tue Sep 13 12:00:44 2011
    Primary database is in MAXIMUM PERFORMANCE mode
    RFS[739]: Successfully opened standby log 4: '/u01/oradata/STNBY/redo_STNBY_04a.log'
    Tue Sep 13 12:02:49 2011
    Primary database is in MAXIMUM PERFORMANCE mode
    RFS[739]: Successfully opened standby log 4: '/u01/oradata/STNBY/redo_STNBY_04a.log'
    Trace file in bdump give me the following information.
    *** 2011-09-09 11:58:59.650 61283 kcrr.c
    FAL[client, MRP0]: Error 12514 connecting to PROD for fetching gap sequence
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    *** 2011-09-09 11:59:29.662
    OCIServerAttach failed -1
    .. Detailed OCI error val is 12514 and errmsg is 'ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    *** 2011-09-09 11:59:29.662 61283 kcrr.c
    FAL[client, MRP0]: Error 12514 connecting to PROD for fetching gap sequence
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    *** 2011-09-09 11:59:59.674
    OCIServerAttach failed -1
    .. Detailed OCI error val is 12514 and errmsg is 'ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    *** 2011-09-09 11:59:59.674 61283 kcrr.c
    FAL[client, MRP0]: Error 12514 connecting to PROD for fetching gap sequence
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    *** 2011-09-09 12:00:29.687
    OCIServerAttach failed -1
    .. Detailed OCI error val is 12514 and errmsg is 'ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    *** 2011-09-09 12:00:29.687 61283 kcrr.c
    FAL[client, MRP0]: Error 12514 connecting to PROD for fetching gap sequence
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    *** 2011-09-09 12:00:59.697
    Check that the CONTROL_FILE_RECORD_KEEP_TIME initialization
    parameter is defined to a value that is sufficiently large
    enough to maintain adequate log switch information to resolve
    archivelog gaps.
    -----------------------------------------------------------

  • Should standby and primary database use the same release version?

    Then If I do upgrade, I'll have to stop the two database
    and then upgrade?

    Hi,
    Look at the requirements it is specified there. And as far as I can recollect they must match. Because standby feature differ beween the versions.
    Best,
    EA

  • SECURITY PATCH ON STANDBY DATABASE AND PRIMARY DATABASE

    I have a question on applying CPU on standby and primary database
    I have a standby database on machine2 and primary on machine1
    I applied a CPU patch on the Oracle Home of Standby database and
    did not run the catcpu.sql as standbydatabase is in mount state.
    Now i am going to apply the CPU patch on primary database.
    What i need to confirm is that after i apply the patch on primary database oracle home
    and run the cat cpu.sql on that do i have to do anything on the standby database
    for instance rebuilding it or something or the change would be shipped to the standby
    server automatically.
    The purpose is to have the primary and standby database on the same patch level
    in case of a failover
    Please let me know asap

    Any one has any idea on this. Any ideas would be appreciated

  • Convert Standyby to Primary and Primary to Standby using Data Gaurd

    What are the steps involved to do the following.
    Convert Standyby to Primary and Primary to Standby databse server using Data Gaurd.
    Pls help.

    That will be a role Switchovers.
    Check the Oracle document and follow the steps.
    http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14239/role_management.htm#i1030646

  • Difference between primary key and primary index

    Dear All,
             Hi... .Could you pls tell me the difference between primary key and primary index.
    Thanks...

    Hi,
    Primary Key : It is one which makes an entry of the field unique.No two distinct rows in a table can have the same value (or combination of values) in those columns.
    Eg: first entry is 111, if you again enter value 111 , it doesnot allow 111 again. similarly for the strings or characters or numc etc. Remember that for char or numc or string 'NAME' is not equal to 'name'.
    Primary Index: this is related to the performance .A database index is a data structure that improves the speed of operations in a table. Indices can be created using one or more columns, providing the basis for both rapid random lookups and efficient ordering of access to records. The disk space required to store the index is typically less than the storage of the table (since indices usually contain only the key-fields according to which the table is to be arranged, and excludes all the other details in the table), yielding the possibility to store indices into memory from tables that would not fit into it. In a relational database an index is a copy of part of a table. Some databases extend the power of indexing by allowing indices to be created on functions or expressions. For example, an index could be created on upper(last_name), which would only store the uppercase versions of the last_name field in the index.
    In a database , we may have a large number of records. At the time of retrieving data from the database based on a condition , it is a burden to the db server. so whenever we create a primary key , a primary index is automatically created by the system.
    If you want to maintain indices on other fields which are frequently used in where condition then you can create secondary indices.
    Reward points if helpful.
    Thanks,
    Sirisha..

  • Doubt regarding switchover from logical standby to primary

    I am using Oracle 10g databases on Linux environment
    I was trying creating a data guard configuration and once I was successfully done I created a logical standby database from the physical standby . Then I was trying to do a switchover .
    By mistake I gave the prepare switchover command in the logical standby before executing it in the primary . And then when I gave it in the primary both the status turned to be "PREPARING SWITCHOVER"
    In logical standby
    SQL> ALTER DATABASE PREPARE TO SWITCHOVER TO PRIMARY;
    Database altered.
    SQL>  SELECT SWITCHOVER_STATUS FROM V$DATABASE;
    SWITCHOVER_STATUS
    PREPARING SWITCHOVER
    In primary
    SQL> ALTER DATABASE PREPARE TO SWITCHOVER TO LOGICAL STANDBY;
    Database altered.
    SQL> select switchover_status from v$database;
    SWITCHOVER_STATUS
    PREPARING SWITCHOVERNow I am not able to commit any of them to primary or logical standby
    In primary
    SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO LOGICAL STANDBY;
    ALTER DATABASE COMMIT TO SWITCHOVER TO LOGICAL STANDBY
    ERROR at line 1:
    ORA-16217: prepare to switchover has not completed
    ORA-06512: at line 1
    In logical standby
    SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
    ALTER DATABASE commit  TO SWITCHOVER TO PRIMARY
    ERROR at line 1:
    ORA-16109: failed to apply log data from previous primaryLet me know what should be done now ? Is there anyway to solve this issue ?

    Can you try using the following first on Primary and then on Standby?
    ALTER DATABASE PREPARE TO SWITCHOVER CANCEL;

  • Dynamic SQL Joining between tables and Primary keys being configured within master tables

    Team , Thanks for your help in advance !
    I'm looking out to code a dynamic SQL which should refer Master tables for table names and Primary keys and then Join for insertion into target tables .
    EG:
    INSERT INTO HUB.dbo.lp_order
    SELECT *
    FROM del.dbo.lp_order t1
    where not exists ( select *
    from hub.dbo.lp_order tw
    where t1.order_id = t2.order_id )
    SET @rows = @@ROWCOUNT
    PRINT 'Table: lp_order; Inserted Records: '+ Cast(@rows AS VARCHAR)
    -- Please note Databse names are going to remain the same but table names and join conditions on keys
    -- should vary for each table(s) being configured in master tables
    Sample of Master configuration tables with table info and PK Info :
    Table Info         
    Table_info_ID    Table_Name    
    1        lp_order    
    7        lp__transition_record    
    Table_PK_Info        
    Table_PK_Info_ID    Table_info_ID    PK_Column_Name
    2                1    order_id
    8                7    transition_record_id
    There can be more than one join condition for each table
    Thanks you !
    Rajkumar Yelugu

    Hi Rajkumar,
    It is glad to hear that you figured the question out by yourself.
    There's a flaw with your while loop in your sample code, just in case you hadn't noticed that, please see below.
    --In this case, it goes to infinite loop
    DECLARE @T TABLE(ID INT)
    INSERT INTO @T VALUES(1),(3),(2)
    DECLARE @ID INT
    SELECT @ID = MIN(ID) FROM @T
    WHILE @ID IS NOT NULL
    PRINT @ID
    SELECT @ID =ID FROM @T WHERE ID > @ID
    So a cursor would be the appropriate option in your case, please reference below.
    DECLARE @Table_Info TABLE
    Table_info_ID INT,
    Table_Name VARCHAR(99)
    INSERT INTO @Table_Info VALUES(1,'lp_order'),(7,'lp__transition_record');
    DECLARE @Table_PK_Info TABLE
    Table_PK_Info_ID INT,
    Table_info_ID INT,
    PK_Column_Name VARCHAR(99)
    INSERT INTO @Table_PK_Info VALUES(2,1,'order_id'),(8,7,'transition_record_id'),(3,1,'order_id2')
    DECLARE @SQL NVarchar(MAX),
    @ID INT,
    @Table_Name VARCHAR(20),
    @whereCondition VARCHAR(99)
    DECLARE cur_Tabel_Info CURSOR
    FOR SELECT Table_info_ID,Table_Name FROM @Table_Info
    OPEN cur_Tabel_Info
    FETCH NEXT FROM cur_Tabel_Info
    INTO @ID, @Table_Name
    WHILE @@FETCH_STATUS = 0
    BEGIN
    SELECT @whereCondition =ISNULL(@whereCondition+' AND ','') +'t1.'+PK_Column_Name+'='+'t2.'+PK_Column_Name FROM @Table_PK_Info WHERE Table_info_ID=@ID
    SET @SQL = 'INSERT INTO hub.dbo.'+@Table_Name+'
    SELECT * FROM del.dbo.'+@Table_Name+' AS T1
    WHERE NOT EXISTS (
    SELECT *
    FROM hub.dbo.'+@Table_Name+' AS T2
    WHERE '+@whereCondition+')'
    SELECT @SQL
    --EXEC(@SQL)
    SET @whereCondition = NULL
    FETCH NEXT FROM cur_Tabel_Info
    INTO @ID, @Table_Name
    END
    Supposing you had noticed and fixed the flaw, your answer sharing is always welcome.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

Maybe you are looking for