Problem While Creating Physical Standby Using RMAN

Hi Guru's
May be this incidence you all face while creating physical standby DB. I try to create Physical standby database Using RMAN Duplicate Command from one server
(pri machine) to Standby Machine.
The steps i followed to create the above are as follows:
Step 1:- Enable Forced Logging
SQL> ALTER DATABASE FORCE LOGGING;
Step 2:- Configure a Standby Redo Log
SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 10
  2> ('/oracle/dbs/log1c.rdo','/oracle/dbs/log2c.rdo') SIZE 500M;
Step 3:- Set Primary Database Initialization Parameters
SQL> create pfile='?/dbs/pfileorcl.ora' from spfile;
Edit the pfile to add the standby parameters, here shown:
db_unique_name='orcl'
LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcl,orcldr)'
LOG_ARCHIVE_DEST_2='SERVICE=orcldr LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcldr'
*.fal_server=orcldr
*.fal_client=orcl
*.standby_file_management=auto
Step 4:- Enable Archiving
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP MOUNT;
SQL> ALTER DATABASE ARCHIVELOG;
SQL> ALTER DATABASE OPEN;
Step 5:- Setup tnsnames for standby database
This should be done on primary database by altering tnsnames.ora or using NetCA command, and create it by the name orcldr
orcldr =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = standby-svr)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcldr)
Step 6:- Backup database and copy it to standby
This backup script should be run on primary and copied to standby on the same mount point, running this scripts using RMAN, all files under /rman_backup should be copied to /rman_backup on standby server.
$rman target /
RMAN> run
allocate channel c1 type disk;
allocate channel c2 type disk;
backup database format '/rman_backup/%U';
backup archivelog all format '/rman_backup /%U';
backup current controlfile for standby format '/rman_backup/%U';
Step 7:- Standby Database Steps
Installing Oracle Software
This should be same release and patchset with exactly same ORACLE_HOME mount point.
Setting Up listener
Create and start a listener on standby database using NetCA, or creating listener.ora in $ORACLE_HOME/network/admin
LISTENER =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = standby-svr)(PORT = 1521))
Step 8:- Set Standby Database Initialization Parameters
Copying the pfile created in primary database and renames it to initorcldr.ora, and changes these parameters:
db_unique_name='orcldr'
LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcldr,orcl)'
LOG_ARCHIVE_DEST_2='SERVICE=orcl LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcl'
*.fal_server=orcl
*.fal_client=orcldr
*.LOG_ARCHIVE_DEST_STATE_2='ENABLE'
Step 9:- Setup tnsnames for primary database
This should be done on standby database by altering tnsnames.ora or using NetCA command, and create it by the name orcl
orcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = primary-svr)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
Step 10:- Copy a Password File
A password file must be created on the Primary and copied over to the Standby site. The sys password must be identical on both sites. Copy orapworcl to $ORACLE_HOME/dbs and rename file to orapworcldr
Step 11:- Create mount points for Oracle
Mount point should be created on standby server with the same convention used in primary, this includes the location for controlfiles, redo logs, datafiles, archive log destination and alert logs.
$ mkdir -p /u01/app/oracle/oradata/orcl/
$ mkdir -p /u01/app/oracle/flash_recovery_area/
$ mkdir -p /u01/app/oracle/admin/orcl/adump
$ mkdir -p /u01/app/oracle/admin/orcl/bdump
$ mkdir -p /u01/app/oracle/admin/orcl/cdump
$ mkdir -p /u01/app/oracle/admin/orcl/udump
Step 12:- Use RMAN to restore backup and setup standby
Connect to RMAN and execute the following command to create standby database, this should be performed on standby server after copying backup and setting tnsnames.
$ export ORACLE_SID=orcldr
$ rman target sys/tiger@orcl auxiliary sys/tiger@orcldr
RMAN> duplicate target database for standby dorecover;
Here i am getting problem as :
While trying to connect to traget database and auxiliary database i notice that when RMAN is connect to both databases it shows
orcl ( DBID xyz)
orcl (not mounted)
Here in my view the second database must be standby database name or auxiiary db name is standby db name which in my case is orcldr
after this issue i am facing the second issues as :
in command
duplicate target database for standby dorecover;
After modifying the command to
RMAN> duplicate target database to "standby";
rman-05520 database name mismatch
Can u please let me know where i am mistaking

ok for pri:
db_name=orcl
db_unique_name=orcl
for standby:
db_name=orcl 
db_unique_name=sbyorcl ( i change orcldr to sbyorcl later)for new testing
but now what i am getting on
  Verify connectivity
On Primary Server:
C:\> lsnrctl stop LISTENERI (working fine)
C:\> lsnrctl start LISTENER (working fine)
C:\> tnsping orcl (working fine)
C:\> tnsping sbyorcl (working fine)
C:\> sqlplus sys/xxxxx@orcl (working fine)
C:\> sqlplus sys/xxxxx@sbyorcl (not working fine)
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
On Standby Server:
C:\>lsnrctl stop LISTENER
C:\> lsnrctl start LISTENER
C:\> tnsping orcl
C:\> tnsping sbyorcl
C:\> sqlplus sys/xxxxx@orcl
C:\> sqlplus sys/xxxxx@sbyorcl
My listner file for pri :-
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = orcl)
      (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
      (SID_NAME = ORCL)
LISTENER =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.202.129)(PORT = 1521))
tnsnames.ora file on pri is:
sbyorcl =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.202.128)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = sbyorcl)
ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.202.129)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
and listener file on standby :
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
      (PROGRAM = extproc)
    (SID_DESC =
      (GLOBAL_DBNAME = orcl)
      (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
      (SID_NAME = orcl)
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.202.128)(PORT = 1521))
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
and tnsnames.ora file on standby:
ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.202.128)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
sbyorcl =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.202.129)(PORT = 1521))
(CONNECT_DATA =
       SERVICE_NAME = sbyorcl)
EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
Kinldy guide me where i am mistaking it's urgent

Similar Messages

  • Creating physical standby using rman fails with ORA-19558: error de-allocat

    Dear All,
    We are creating physical stadnby database from 2 node RAC ( 2 node RAC to standalone physical standby).
    While in the rman duplicate process we are getting below error, we were not able to sorted out..
    No third party storage has been used ....
    DB version : 11gR2 and the OS is RHEL5
    Appreciate if any one hepl us to resolve this issue ...
    Thanks in advance ...
    RMAN-03009: failure of backup command on prmy1 channel at 10/05/2011 17:59:26
    ORA-19558: error de-allocating device
    ORA-19557: device error, device type: DISK, device name:
    ORA-17627: ORA-01041: internal error. hostdef extension doesn't exist
    ORA-17627: ORA-01041: internal error. hostdef extension doesn't exist
    ORA-03113: end-of-file on communication channel
    Edited by: 889828 on 2011/10/06 2:17 AM

    The problem is well decribed in your alert log.....you are using Oracle Managed File names which means you will not be able to duplicate the database as RMAN won't be able to automatically generate new names for the files using the DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT initialization parameters.
    Youll have to use the SET NEWNAME command to specify the names of the database files. Done this a few times , and I don't recommend using OMF specifically beacuse of this hassle.
    WARNING: OMF is enabled on this database. Creating a physical standby controlfile, when OMF is enabled on the primary database, requires manual RMAN intervention to resolve OMF
    datafile pathnames.
    NOTE: Please refer to the RMAN documentation for procedures describing how to manually resolve OMF datafile pathnames.
    Problem handling is described in
    Oracle® Database Backup and Recovery Reference
    10g Release 2 (10.2)
    Part Number B14194-03

  • Problem while creating Physical standby database on remote Server

    Hi
    I try to create a physical standby datbaase using OEM 10gr2, it is working when I create on same server. No issue but when I try to create same on remote server it is giving below warning and process failing. Please let me know what needs to be down in this senario...
    It is showing redo log information in v$log and v$log_file but not creating physically on PHYSICAL Standby instance..
    I appriciate your help and ur time too..
    These messages are from PRIMARY database alert*.log file
    There is space for up to 12 standby redo logfiles
    Use the following SQL commands on the standby database to create
    standby redo logfiles that match the primary database:
    ALTER DATABASE ADD STANDBY LOGFILE 'srl1.f' SIZE 52428800;
    ALTER DATABASE ADD STANDBY LOGFILE 'srl2.f' SIZE 52428800;
    ALTER DATABASE ADD STANDBY LOGFILE 'srl3.f' SIZE 52428800;
    ALTER DATABASE ADD STANDBY LOGFILE 'srl4.f' SIZE 52428800;
    ALTER DATABASE ADD STANDBY LOGFILE 'srl5.f' SIZE 52428800;
    WARNING: OMF is enabled on this database. Creating a physical
    standby controlfile, when OMF is enabled on the primary
    database, requires manual RMAN intervention to resolve OMF
    datafile pathnames.
    NOTE: Please refer to the RMAN documentation for procedures
    describing how to manually resolve OMF datafile pathnames.
    Thanks and Regards,
    RK

    Well, it is simply warning that "Creating a physical
    standby controlfile, when OMF is enabled on the primary
    database, requires manual RMAN intervention to resolve OMF
    datafile pathnames.
    NOTE: Please refer to the RMAN documentation for procedures
    describing how to manually resolve OMF datafile pathnames"
    For instance, the path for the logfile name in "ALTER DATABASE ADD STANDBY LOGFILE 'srl5.f' SIZE 52428800" may need to be changed manually. It is advisable to check the mentioned documentation.

  • Error while creating physical standby database using Oracle Grid 10.2.0.5

    Hi All,
    I am setting up data guard using oracle grid.
    Primary database version: - 10.2.0.4
    Standby database version: - 10.2.0.4
    Primary OS Red Hat Enterprise Linux AS release 4 (Nahant Update 8)2.6.9
    Standby OS Red Hat Enterprise Linux AS release 4 (Nahant Update 8)2.6.9
    I am creating physical standby database using EM. But it is getting failed with error message in sqlnet.ora file
    Fatal NI connect error 12533, connecting to:
    (DESCRIPTION=(ADDRESS_LIST=)(CONNECT_DATA=(SERVICE_NAME=INPRDSB_XPT)(SERVER=dedicated)(CID=(PROGRAM=oracle)(HOST=indb50.oii.com)(USER=oracle))))
      VERSION INFORMATION:
            TNS for Linux: Version 10.2.0.4.0 - Production
            TCP/IP NT Protocol Adapter for Linux: Version 10.2.0.4.0 - Production
      Time: 17-AUG-2010 02:40:07
      Tracing not turned on.
      Tns error struct:
        ns main err code: 12533
        TNS-12533: TNS:illegal ADDRESS parameters
        ns secondary err code: 0
        nt main err code: 0
        nt secondary err code: 0As we can see, address_list is empty.
    Can anyone suggest what could be the reason behind this?

    Dear user13295317,
    Here is the error explanation;
    Oracle Error :: TNS-12533
    TNS:illegal ADDRESS parameters
    Cause
    An illegal set of protocol adapter parameters was specified.
    In some cases, this error is returned when a connection cannot be made to the protocol transport.
    Action
    Verify that the destination can be reached using the specified protocol.
    Check the parameters within the ADDRESS section of TNSNAMES.ORA.
    Legal ADDRESS parameter formats may be found in the Oracle operating system specific documentation for your platform.
    Protocols that resolve names at the transport layer (such as DECnet object names) are vulnerable to this error if not properly configured or names are misspelled.Hope That Helps.
    Ogan

  • Physical standby using rman

    Step By Step Guide To Create Physical Standby Database Using RMAN
         Doc ID:     Note:469493.1
    says: Step 2: Move the backups to the standby server
    I'm a rman novice. What does that move look like? Do I copy the various files mentioned in the backup output, like /u01/oracle/product/ora10g/flash_recovery_area/ORA10G/backupset/2007_12_09/o1_mf_annnn_TAG20071209T145731_3oqf84xl_.bkp or is there some other glue that has to be performed to make the standby system see the backup correctly.
    Could I just tar up the FRA?

    Hi,
    You can place your backup whatever you find it appropriate and catalog it on the target server using catalog rman command.
    Your FRA can be large and it can take time to copy all content of FRA to target server.
    The best way to use backup ... format '<path_to_backup location>/bkp_%U'; Then copy backup piece(s) to target server and register with catalog start with '<path_to_backup location on target server';
    Best Regards,
    Alex

  • Problem while creating WBS elements using LSMW

    Hello experts,
    I am able to create Project Definitions using LSMW. (using recording)
    But there is a problem while creating WBS elements.
    Tcode CJ20 has table control and that will become problem for multiple rows (levels).
    Can anyone suggest a solution to mass upload WBS elements?
    Thanks for your valuable advice.

    Hi,
    Instead of using "BAPI_PROJECT_MAINTAIN", use following solution. We are using this solution and it is working pretty good.
    If the WBS element is already created and you want to create one more with same data, first get the WBS related information using BAPI_PROJECT_GETINFO as you are doing currently.
    I am using different sets of BAPIs to create project, create / change WBS element.
    I use function module from Function group CJ2001 ( Project related BAPIs ), CJ2054 ( WBS related BAPIs ) and PS_BAPI ( pre/post processing BAPIs ). There are specific order in which you need to execute these BAPIs.
    For example if you want to create / change the WBS element, the BAPIs sequence is:
    <b>1. BAPI_PS_INITIALIZATION
    2. BAPI_BUS2054_CREATE_MULTI ( to create  WBS )
             or
    2. BAPI_BUS2054_CHANGE_MULTI ( to change WBS )
    3. BAPI_PS_PRECOMMIT
    4. BAPI_TRANSACTION_COMMIT</b>
    Check the documentation of BAPI "BAPI_BUS2054_CREATE_MULTI " to see how these function modules work.
    Let me know if you need further information.
    Regards,
    RS

  • Problem while creating service PO using bapi_po_create1

    hi all,
        i am getting error :
    In case of account assignment, please enter acc. assignment data for item
    what does this mean?
    please help,,
    thanks,
    Siddhartha Prakash

    Hi Sid.
    I'm having this same problems on creating PO Service. Did you solve it? How did you do that?
    I'm using a PR and the Category is 'Y', and I cant find where is the problem.
    The tables that I'm passing to the BAPI_PO_CREATE1 are:
    POITEM/ POITEMX
    POACCOUNT/ POACCOUNTX
    POSERVICES
    POSRVACCESSVALUES
    Please, if you have any idea, let me know!
    Tks a lot!
    Renata

  • Problem while creating partner link using https URL

    Hi,
    To create the partnerlink using https URL, I had done the following:
    -Imported the self signed certificate into the OraBPELPM_\jdk\jre\lib\security\cacert
    -Added following entries in OraBPELPM_1\integration\jdev\jdev\bin\jdev.conf
    AddVMOption -Djavax.net.ssl.keyStore=E:\OraBPELPM_1\jdk\jre\lib\security\cacert
    AddVMOption -Djavax.net.ssl.keyStorePassword=esbtest123
    I am not able to create partner link using URL https://localhost/orabpel/default/ErrorHandlerBPEL/1.0/ErrorHandlerBPEL?wsdl .
    Able to create partnerlink using same URL if I replace https with http.
    Did I miss any other configuration that needs to done to create partnerlink using https in JDeveloper BPEL Designer.
    Thanks,
    -Vidya

    Hi,
    I  too have the same issue. Appriciate if you share some knowledge on this issue.
    Thanks
    Aravinda

  • Problem while creating logical port using soamanager

    Hi all,
    I have created a client proxy for web service from a 3rd party system.
    When i am creating a logical port for the same consumer proxy i get a error as follows:
    RABAX_STATE -e: UNCAUGHT_EXCEPTION
    and a dump saying
    "  The exception 'CX_SXMLP' was raised, but it was not caught anywhere along the call hierarchy.
         Since exceptions represent error situations and this error was not adequately responded to, the running ABAP program
          'CL_SXMLP_FRAGMENT=============CP' has to be terminated.                  
    Please suggest what can be done or what can be the problem.
    Thanks in advance.
    Komal

    Pls go to txn SM59 and check if the RFC destination for webservice is working in the test connection.
    Then go to txn LPCONFIG and create the logical port using the RFC dest.  Pls mention the path suffix appropriately.
    Next in your code while instantiating the client proxy pass the logical port name in the constructor (if the LP is not maintained as default).
    Pls reward points if the tips are helpful.

  • Problem  while creating  contact person using SD_CUSTOMER_MAINTAIN_ALL

    Hi All,
    I am trying to create a contact person to a customer using FM SD_CUSTOMER_MAINTAIN_ALL.Following is the simple code that I am using.FM is not giving any exception.But the contact person is not getting created.can anyone help me regarding this.
    DATA: I_FKNVK TYPE TABLE OF FKNVK,
          wa      type FKNVK.
    MOVE '0009011357' to wa-kunnr.
    MOVE 'Bose' TO wa-namev.
    MOVE 'Lalit' TO wa-name1.
    MOVE  '9980055557'   to wa-TELF1.
    *MOVE 'City' TO wa-ort01.
    *MOVE 'DE' TO wa-parla.
    *MOVE '' to watelf1.
    *MOVE 'U' to wa-kz.
    APPEND wa to I_FKNVK.
    CALL FUNCTION 'SD_CUSTOMER_MAINTAIN_ALL'
    EXPORTING
      I_KNA1                              =
      I_KNB1                              =
      I_KNVV                              =
      I_BAPIADDR1                         =
      I_BAPIADDR2                         =
      I_MAINTAIN_ADDRESS_BY_KNA1          = ' '
      I_KNB1_REFERENCE                    = ' '
      I_FORCE_EXTERNAL_NUMBER_RANGE       = ' '
      I_NO_BANK_MASTER_UPDATE             = ' '
      I_CUSTOMER_IS_CONSUMER              = ' '
      I_RAISE_NO_BTE                      = ' '
        PI_POSTFLAG                         = 'X'
      PI_CAM_CHANGED                      = ' '
      PI_ADD_ON_DATA                      =
      I_FROM_CUSTOMERMASTER               = ' '
    IMPORTING
      E_KUNNR                             =
      O_KNA1                              =
      E_SD_CUST_1321_DONE                 =
    TABLES
      T_XKNAS                             =
      T_XKNBK                             =
      T_XKNB5                             =
      T_XKNEX                             =
      T_XKNVA                             =
      T_XKNVD                             =
      T_XKNVI                             =
        T_XKNVK                             = I_FKNVK
      T_XKNVL                             =
      T_XKNVP                             =
      T_XKNZA                             =
      T_YKNAS                             =
      T_YKNBK                             =
      T_YKNB5                             =
      T_YKNEX                             =
      T_YKNVA                             =
      T_YKNVD                             =
      T_YKNVI                             =
      T_YKNVK                             =
      T_YKNVL                             =
      T_YKNVP                             =
      T_YKNZA                             =
      T_UPD_TXT                           =
    EXCEPTIONS
       CLIENT_ERROR                        = 1
       KNA1_INCOMPLETE                     = 2
       KNB1_INCOMPLETE                     = 3
       KNB5_INCOMPLETE                     = 4
       KNVV_INCOMPLETE                     = 5
       KUNNR_NOT_UNIQUE                    = 6
       SALES_AREA_NOT_UNIQUE               = 7
       SALES_AREA_NOT_VALID                = 8
       INSERT_UPDATE_CONFLICT              = 9
       NUMBER_ASSIGNMENT_ERROR             = 10
       NUMBER_NOT_IN_RANGE                 = 11
       NUMBER_RANGE_NOT_EXTERN             = 12
       NUMBER_RANGE_NOT_INTERN             = 13
       ACCOUNT_GROUP_NOT_VALID             = 14
       PARNR_INVALID                       = 15
       BANK_ADDRESS_INVALID                = 16
       TAX_DATA_NOT_VALID                  = 17
       NO_AUTHORITY                        = 18
       COMPANY_CODE_NOT_UNIQUE             = 19
       DUNNING_DATA_NOT_VALID              = 20
       KNB1_REFERENCE_INVALID              = 21
       CAM_ERROR                           = 22
       OTHERS                              = 23
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        WAIT          = 'X'
    IMPORTING
       RETURN        =
    ENDIF.

    i see this so much on this site, users just posting solved and not giving details on how they fixed the problem, the SDN is meant to be for sharing!!
    If you find a fix, share it or don't bother being a part of the SDN community.(so annoying)

  • Problem while creating sales order using BAPI

    Hi all,
    i am creating a sales order from the purchase order data.
    when my client will send a PO in EDI format, my 3rd party edi tool will convert that edi formatted PO to text format. then i will upload that text formatted PO to my program then i will create a SO from those uploaded PO data using BAPI BAPI_SALESORDER_CREATEFROMDAT2.
      but,no sales order is being created.& also i am not getting any return message.by debugging also, i am not getting the error.plz suggest where i am doing mistake.below is the coding.
    DATA:
      gfilename LIKE rlgrap-filename.
    *--Internal tables
    DATA: BEGIN OF i_item OCCURS 50.    "Create Material Document Item
            INCLUDE STRUCTURE BAPISDITM .
    DATA: END OF i_item .
    DATA: BEGIN OF i_partner OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE BAPIPARNR.
    DATA: END OF i_partner.
    DATA: BEGIN OF i_schedule OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE BAPISCHDL .
    DATA: END OF i_schedule.
    DATA: BEGIN OF i_cond OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE BAPICOND .
    DATA: END OF i_cond.
    DATA: BEGIN OF i_part OCCURS 0,     " Internal table for split data
            part(20),
          END OF i_part.
    DATA: BEGIN OF i_return OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE bapiret2.
    DATA: END OF i_return.
    *-- Work areas
    DATA: BEGIN OF wa_header .       "sales Document Header Data
            INCLUDE STRUCTURE BAPISDHD1.
    DATA: END OF wa_header .
    *DATA: BEGIN OF wa_return .       "Output Structure
           INCLUDE STRUCTURE BAPIRET2.
    *DATA: END OF wa_return .
    DATA: begin of sorder.
         INCLUDE STRUCTURE BAPIVBELN.
    DATA: end of sorder.
    data:begin of t_upload,
         ebeln(10),  "PO no(seagate)
         aedat like sy-datum , "PO date
         bsart(4) , "PO type
         vdatu like sy-datum , "requested delivery date
         kunnr(10) , "customer no-sold-to-party
        kunak like vbak-kunnr, "bill-to-party
         name1_s(20), "name1 of sold-to-party
         name2_s(15), "name2 of sold-to-party
         land1_s(3), "country
         ort01_s(10),  "city
         regio_s(3), "region(state/province)
         pstlz_s(10), "postal code
         adrnr_s(10), "address
         bstkd_e(10), "end customer purchase order
         posex(6),     "end customer PO line no(item no)
         kdmat(18),     "end customer material no(part no)
         kunag(10),     "ship-to-party
         name1_c(20),   "name1 of ship-to-party
         name2_c(15),   "name2 of ship-to-party
         land1_c(3),   "country
         ort01_c(10),    "city
         regio_c(3),   "region(state/province)
         pstlz_c(10),   "postal code
         adrnr_c(10),   "address
         posnr(6), "item no(seagate PO line no)
         pstyv(4), "item category
         matnr(18), "material no(seagate 9 digit part no)
         zmeng(13), "Target quantity in sales unit
        vrkme like vbap-vrkme, "sales unit
         meins(3), "UOM
        posnr_tot like vbap-posnr,"Total no. of line items
         werks(4), "plant
        vstel like vbap-vstel, "shipping point
         empst(10), "receiving point
         shtyp(4), "shipment type
         route(6), "route
         vsbed(2), "shipping conds
        rkfkf like vbap-rkfkf, "method of billing for co/ppc orders
         zterm(4), "terms of payment key
         inco1(3), "F.O.B inco term1
         inco2(3), "F.O.B inco term2
         end of t_upload.
    Data: wa_upload like t_upload,
           i_upload like standard table of t_upload.
    Data:v_kunnr like kna1-kunnr,
          v_posnr like vbap-posnr,
          v_matnr like vbap-matnr,
          v_zmeng like vbap-zmeng,
          v_kunag like kna1-kunnr.
    *---Constants
    CONSTANTS: c_comma TYPE c VALUE ',',   " For splitting data at commas
               c_01(2) TYPE c VALUE '01',  " For movement code in Bapi
               c_b     TYPE c VALUE 'B',   " For mvt. Indicator in Bapi
               c_creat(5) TYPE c VALUE 'CREAT', " For button text
               c_clear(5) TYPE c VALUE 'CLEAR', " For clear button
               c_mvmt(4) TYPE c VALUE 'MVMT',
               c_ok(2)   TYPE c VALUE 'OK',
               c_error(5) TYPE c VALUE 'Error'.
    *--SELECTION SCREEN DESIGN--
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.
    PARAMETERS:     
                p_auart LIKE vbak-auart, " order type
                p_vkorg LIKE vbak-vkorg, " sales org
                p_vtweg LIKE vbak-vtweg, " dist channel
                p_spart LIKE vbak-spart, " division
                p_vkgrp LIKE vbak-vkgrp, " sales group
                p_vkbur LIKE vbak-vkbur, "sales office
                p_file(256) default 'c:/saleorder.txt'.         "File name
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN PUSHBUTTON 15(10) v_create USER-COMMAND creat.
    SELECTION-SCREEN PUSHBUTTON 40(10) v_clear USER-COMMAND clear.
      INITIALIZATION -
    INITIALIZATION.
      v_create = c_creat .
      v_clear = c_clear.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    PERFORM selectfile USING p_file.
    *--AT SELECTION_SCREEN--
    AT SELECTION-SCREEN .
      IF sy-ucomm = c_clear.
        PERFORM f_clear.
    ELSE.
       IF sy-ucomm <> c_mvmt.
    **--- Validating the input data.
         PERFORM f_check_inputs.
        ELSEif sy-ucomm = c_creat.
    *--- Validating the input data.
          PERFORM f_check_inputs.
    *-- Uploading the PO data.
          PERFORM f_PO_upload.
    *---checking the PO data
         PERFORM f_check_upload_data.
    *---create sales order from PO data
        PERFORM f_Sales_order_create.
        ENDIF.
    FORM f_PO_upload.
    gfilename = p_file.
      CALL FUNCTION 'WS_UPLOAD'
           EXPORTING
                filename                = gfilename
                filetype                = 'DAT'
           TABLES
                data_tab                = i_upload
           EXCEPTIONS
                conversion_error        = 1
                file_open_error         = 2
                file_read_error         = 3
                invalid_type            = 4
                no_batch                = 5
                unknown_error           = 6
                invalid_table_width     = 7
                gui_refuse_filetransfer = 8
                customer_error          = 9
                OTHERS                  = 10.
      IF sy-subrc <> 0.
        MESSAGE i398(00) WITH '(WS_UPLOAD)'
        ' Errors occured with exception '
         sy-subrc.
      ENDIF.
    ENDFORM.                    " f_PO_upload
    *&      Form  selectfile
          text
         -->P_P_FILE  text
    FORM selectfile CHANGING value(filename) TYPE c.
    CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
                def_filename     = gfilename
                def_path         = 'C:\'
                mask             = ',*.txt.'
                mode             = 'O'
                title            = 'Select File Name'
           IMPORTING
                filename         = filename
           EXCEPTIONS
                inv_winsys       = 1
                no_batch         = 2
                selection_cancel = 3
                selection_error  = 4
                OTHERS           = 5.
    ENDFORM.                    " selectfile
    FORM f_Sales_order_create.
      PERFORM f_fill_header.
      PERFORM f_fill_partner.
      PERFORM f_fill_item.
      PERFORM f_call_BAPI.
    ENDFORM.                    " f_Sales_order_create
    *&      Form  f_fill_header
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_header.
    move p_auart to wa_header-doc_type.
    move p_vkorg to wa_header-sales_org.
    move p_vtweg to wa_header-distr_chan.
    move p_spart to wa_header-division.
    move p_vkgrp to wa_header-sales_grp.
    move p_vkbur to wa_header-sales_off.
    Read table i_upload into wa_upload index 1.
    move wa_upload-ebeln to wa_header-purch_no_c.
    move wa_upload-aedat to wa_header-purch_date.
    move wa_upload-bsart to wa_header-po_method.
    move wa_upload-vdatu to wa_header-req_date_h.
    move wa_upload-bstkd_e to wa_header-purch_no_s.
    *move wa_upload-route to wa_header-route.
    move wa_upload-vsbed to wa_header-ship_cond.
    move wa_upload-empst to wa_header-rec_point.
    move wa_upload-shtyp to wa_header-ship_type.
    move wa_upload-zterm to wa_header-pmnttrms.
    move wa_upload-inco1 to wa_header-incoterms1.
    move wa_upload-inco2 to wa_header-incoterms2.
    ENDFORM.                    " f_fill_header
    *&      Form  f_fill_partner
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_partner.
    if not wa_upload-kunnr is initial.
    select single kunnr from kna1 into v_kunnr
                where kunnr = wa_upload-kunnr.
    if sy-subrc <> 0.
    Message E014 with 'customer does not exist'.
    else.
    move 'AG' to i_partner-partn_role.
    move wa_upload-kunnr to i_partner-partn_numb.
    move wa_upload-land1_s to i_partner-country.
    move wa_upload-name1_s to i_partner-name.
    move wa_upload-name2_s to i_partner-name_2.
    move wa_upload-ort01_s to i_partner-city.
    move wa_upload-regio_s to i_partner-region.
    move wa_upload-pstlz_s to i_partner-postl_code.
    move wa_upload-adrnr_s to i_partner-address.
    append i_partner.
    endif.
    endif.
    if not wa_upload-kunag is initial.
    select single kunnr from kna1 into v_kunag
                where kunnr = wa_upload-kunag.
    if sy-subrc <> 0.
    Message E015 with 'end customer does not exist'.
    else.
    move 'WE' to i_partner-partn_role.
    move wa_upload-kunag to i_partner-partn_numb.
    move wa_upload-land1_c to i_partner-country.
    move wa_upload-name1_c to i_partner-name.
    move wa_upload-name2_c to i_partner-name_2.
    move wa_upload-ort01_c to i_partner-city.
    move wa_upload-regio_c to i_partner-region.
    move wa_upload-pstlz_c to i_partner-postl_code.
    move wa_upload-adrnr_c to i_partner-address.
    append i_partner.
    endif.
    endif.
    ENDFORM.                    " f_fill_partner
    *&      Form  f_fill_item
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_item.
    loop at i_upload into wa_upload.
    if not wa_upload-matnr is initial.
    select single  maramatnr msegmenge into (v_matnr, v_zmeng) from
                       mara inner join mseg on maramatnr = msegmatnr
                       where mara~matnr = wa_upload-matnr.
    if sy-subrc <> 0.
    Message E016 with 'material no does not exist'.
    elseif v_zmeng LT wa_upload-zmeng.
    Message E017 with 'order quantity is greater than the quantity present'.
      endif.
    endif.
    move wa_upload-posnr to i_item-itm_number.
    move wa_upload-pstyv to i_item-item_categ.
    move wa_upload-matnr to i_item-material.
    move wa_upload-zmeng to i_item-target_qty.
    move wa_upload-meins to i_item-target_qu.
    move wa_upload-werks to i_item-plant.
    *move wa_upload-meins to wa_vbap-meins.
    *move wa_upload-posnr_tot to wa_vbap-posnr_tot.
    move wa_upload-posex to i_item-po_itm_no.
    move wa_upload-kdmat to i_item-cust_mat22.
    move wa_upload-inco1 to i_item-incoterms1.
    move wa_upload-inco2 to i_item-incoterms2.
    move wa_upload-zterm to i_item-pmnttrms.
    move wa_upload-empst to i_item-rec_point.
    move wa_upload-shtyp to i_item-ship_type.
    move wa_upload-route to i_item-route.
    append i_item.
    PERFORM f_fill_schedule_line.
    PERFORM f_fill_conditions.
    ENDLOOP.
    ENDFORM.                    " f_fill_item
    *&      Form  f_fill_schedule_line
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_schedule_line.
    move wa_upload-matnr to i_schedule-itm_number.
    move sy-datum to i_schedule-req_date.
    move wa_upload-zmeng to i_schedule-req_qty.
    append i_schedule.
    ENDFORM.                    " f_fill_schedule_line
    *&      Form  f_fill_conditions
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_conditions.
    move wa_upload-matnr to i_cond-itm_number.
    move sy-datum to i_cond-conpricdat.
    append i_cond.
    ENDFORM.                    " f_fill_conditions
    *&      Form  f_clear
          text
    -->  p1        text
    <--  p2        text
    FORM f_clear.
    clear:p_auart,
          p_vkorg,
          p_vtweg,
          p_spart,
          p_vkgrp,
          p_vkbur.
    ENDFORM.                    " f_clear
    *&      Form  f_call_BAPI
          text
    -->  p1        text
    <--  p2        text
    FORM f_call_BAPI.
    clear:i_item,i_partner,i_schedule.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
      SALESDOCUMENTIN               =
        ORDER_HEADER_IN               = wa_header
      ORDER_HEADER_INX              =
      SENDER                        =
      BINARY_RELATIONSHIPTYPE       =
      INT_NUMBER_ASSIGNMENT         =
      BEHAVE_WHEN_ERROR             =
      LOGIC_SWITCH                  =
      TESTRUN                       =
      CONVERT                       = ' '
    IMPORTING
       SALESDOCUMENT                  = sorder
      TABLES
      RETURN                        =
       ORDER_ITEMS_IN                 = i_item
      ORDER_ITEMS_INX               =
        ORDER_PARTNERS                = i_partner
       ORDER_SCHEDULES_IN             = i_schedule
      ORDER_SCHEDULES_INX           =
      ORDER_CONDITIONS_IN            = i_cond.
      ORDER_CFGS_REF                =
      ORDER_CFGS_INST               =
      ORDER_CFGS_PART_OF            =
      ORDER_CFGS_VALUE              =
      ORDER_CFGS_BLOB               =
      ORDER_CFGS_VK                 =
      ORDER_CFGS_REFINST            =
      ORDER_CCARD                   =
      ORDER_TEXT                    =
      ORDER_KEYS                    =
      EXTENSIONIN                   =
      PARTNERADDRESSES              =
    if not ( sorder-vbeln is initial ).
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    write: /'Order number:', sorder.
    else.
    loop at i_return.
    write: / i_return-id, i_return-number, i_return-message(80).
    endloop.
    *write: /'Error'.
    endif.
    *loop at i_return.
    *write: / i_return-id, i_return-number, i_return-message(80).
    *endloop.
    ENDFORM.                    " f_call_BAPI

    HI
      Pricing will be carried basing on the pricing
    procedure.
    Case1: Prices will be carried out automatically if
    necessary condition records are maintained for the
    condition type.
      For this you can go to Sales Order-> Item Conditions
    In the screen you can click on command button Analysis,
    which gives you the list of condition types associated
    to the pricing procedure. By clicking on the condition
    type you can know the action that has taken place.
    Case2: Manually forcing prices for Items.
      To do this, you have to populate ORDER_CONDITIONS_IN &
    ORDER_CONDITIONS_INX. Also note to identify the item
    numbers, you manually pass the item number for each item
    in the sales order, use the same item number for
    populating conditions.
      Parameters required:
    ORDER_CONDITIONS_IN:
      ITM_NUMBER, COND_TYPE, COND_VALUE, CURRENCY
    ORDER_CONDITIONS_INX:
      ITM_NUMBER, COND_TYPE, UPDATEFLAG, COND_VALUE,CURRENCY.
       Hope the above info helps you. Do revert back if you
    need more info.
    Kind Regards
    Eswar

  • Problem while creating table dynamically using stored procedure

    Hi all
    When i try to execute the following lines get insufficient privilege error.
    FYI: i m able to create table statically.(i.e without using stored procedure)
    CREATE OR REPLACE PROCEDURE pcalling IS
    str varchar2(60);
    BEGIN
    str:='create table t15(tno number,tname varchar2(5))';
    execute immediate str;
    END;
    Thanks in advance
    Satya

    hi
    SQL> CREATE OR REPLACE PROCEDURE runddl (ddl_in in VARCHAR2)
      2     AUTHID CURRENT_USER
      3  IS
      4  BEGIN
      5     EXECUTE IMMEDIATE ddl_in;
      6  END;
      7  .
    SQL> /
    Procedure created.AUTHID CURRENT_USER clause before the IS keyword which runddl executes, it should run under the authority of the invoker, or current user not the authority of the definer.
    if you omit it then it will no longer will be run if the creator doesnt have privelege to run this ddl regardless invoker has or not.
    i hope you got it
    Khurram Siddiqui
    [email protected]

  • Problem while creating generic DataSource using table

    Hello all,
    I am creating a generic DataSource using table EKBE. It is giving error " invalid extract structure template EKBE ". The reason is " The system tried to generate an extract structure with the template structure EKBE. This operation failed, because the template structure quantity fields or currency fields, for example, field MENGE refer to a different table (EKPO)".
    Could you suggest how to approach?
    Thanks,
    Zak.

    hi zahir,
    In your case the reference table used for quantity is ekko and the field is meins.
    and the reference table used for currency is ekpo and the field is waers.
    So you are not taking data from a single table. so you better create a view give the table name ekbe and select the corresponding fields you want.
    Add MEINS and WAERS and as well your required field in the view for example Zview and for Quantity field mention Zview as reference table and reference field as MEINS same for WAERS.
    try this if it doent work, tell me what error you are facing.
    with regards!
    ramesh

  • DG - creating physical standby using clone VMbox

    Hi,
    I have a VMbox 11.2.0.2 database prebuilt from "Oracle Developer Days".
    Then I clone it as "Oracle Developer Days Clone".
    Since they are now identical, How can I make the clone as my standby DB?
    Can I mount it as standby?
    Thanks,
    Petra-K

    Add to listerner.ora
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = PLSExtProc)
          (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_2)
          (PROGRAM = extproc)
        (SID_DESC =
          (GLOBAL_DBNAME = orcl_stby)
          (ORACLE_HOME =/u01/app/oracle/product/11.2.0/dbhome_2)
          (SID_NAME = orcl_stby)
    GLOBAL_DBNAME will service name of standby database.
    Regards
    Mahir M. Quluzade

  • Problem creating physical Standby database with RMAN

    Hi All
    I am trying to learn oracle dataguard and as part of the process learning creating standby database.
    Platform : Sun-Fire-V250 Sparc, Solaris 10
    Database Version - Oracle 11R2
    I am creating standby database on same server, so directory structure is different.
    Following the instructions on Oracle site I managed to create a functional physical standby database. But I am not able to create standby database using RMAN. These are the steps that I followed-
    1.Set up all necessary parameters on primary database as done while creating physical standby database manually, eg setting force logging, creating standby logs etc.
    2.Edited parameter file on primary database as done while creating manual pysical standby database creation. Some of the changes done are-
    On Primary Database:
    *.FAL_CLIENT='orcl11020' #Primary database unique name
    *.FAL_SERVER='stdby_11' #Standby database unique name
    db_file_name_convert='/<dir>/oradata/stdby_11','/<dir>/oradata/orcl11020'
    log_file_name_convert='/<dir>/oradata/stdby_11','/<dir>/oradata/orcl11020','/<dir>/oradata/stdby_11/redo_mem','/<dir>/oradata/orcl11020/redo_mem'
    standby_file_management=auto
    *.log_archive_config='DG_CONFIG=(orcl11020,stdby_11)'
    *.log_archive_dest_1='LOCATION=/<dir>/flash_recovery_area/ORCL11020/archivelog
    VALID_FOR=(ALL_LOGFILES,ALL_ROLES) db_unique_name=orcl11020'
    *.log_archive_dest_2='SERVICE=stdby_11 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=stdby_11'
    *.LOG_ARCHIVE_DEST_STATE_1='ENABLE'
    *.LOG_ARCHIVE_DEST_STATE_2='ENABLE'
    *.LOG_ARCHIVE_FORMAT='%t_%s_%r.arc'
    *.LOG_ARCHIVE_MAX_PROCESSES=30
    Copied same pfile for standby database and modified following-
    *.control_files='/<dir>/oradata/stdby_11/stdby_11.ctl','/<dir>/fra_stdby/stdby_11/stdby_11.ctl'
    *.db_name='orcl1102'
    *.db_unique_name='stdby_11'
    *.FAL_CLIENT='stdby_11'
    *.FAL_SERVER='orcl11020'
    db_file_name_convert='/<dir>/oradata/orcl11020','/<dir>/oradata/stdby_11'
    log_file_name_convert='/<dir>/oradata/orcl11020','/<dir>/oradata/stdby_11','/<dir>/oradata/orcl11020/redo_mem','/<dir>/oradata/stdby_11/redo_mem'
    standby_file_management=auto
    *.log_archive_dest_1='LOCATION=/<dir>/fra_stdby/STDBY_11/archivelog
    VALID_FOR=(ALL_LOGFILES,ALL_ROLES) db_unique_name=stdby_11'
    *.log_archive_dest_2='SERVICE=orcl11020 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
    db_unique_name=orcl11020'
    3. Add relevant information in tnsnames.ora and listener.ora files and then restart listener.
    3. Created password file with same credential as primary database.
    4.Up-to-date RMAN backup of primary database available.
    5.Create standby controlfile with rman
    While primary database s open (I tried with primary database in mount mode as well)-
    $>rman catalog rman/paswd@rman target /
    RMAN> BACKUP CURRENT CONTROLFILE FOR STANDBY;
    6. Open a new terminal and startup standby database in nomount mode using parameter file created -
    $>ORACLE_SID=stdby_11
    $>export ORACLE_SID
    $>sqlplus / as sysdba
    SQL>STARTUP NOMOUNT pfile='<location/initfilename.ora'
    SQL>quit
    $> rman AUXILIARY / target sys/passwd@orcl11020 catalog rman/passwd@rman
    RMAN>DUPLICATE TARGET DATABASE FOR STANDBY DORECOVER;
    RMAN finishes without error but archive logs are not being tranported. Looking at the log, following caught my eye-
    Error 1017 received logging on to the standby
    Check that the primary and standby are using a password file
    and remote_login_passwordfile is set to SHARED or EXCLUSIVE,
    and that the SYS password is same in the password files.
    returning error ORA-16191
    FAL[client, ARC2]: Error 16191 connecting to orcl11020 for fetching gap sequence
    Errors in file /<>dir>/diag/rdbms/stdby_11/stdby_11/trace/stdby_11_arc2_24321.trc:
    ORA-16191: Primary log shipping client not logged on standby
    Errors in file /<dir>/diag/rdbms/stdby_11/stdby_11/trace/stdby_11_arc2_24321.trc:
    ORA-16191: Primary log shipping client not logged on standby
    So on both primary and standby I confirmed
    SQL> show parameter remote_login_passwordfile
    NAME TYPE VALUE
    remote_login_passwordfile string EXCLUSIVE
    To make double sure that password files are same, I shutdown both databases, delete password files and recreated with same credentials.
    Password files are called - orapworcl11020 and orapwstdby_11
    Can someone guide me where thisngs are going wrong here please.

    Not sure if I understood it clearly.
    SELECT * FROM V$ARCHIVE_GAP;
    returns no rows so there is no gap.
    But could you please explain me the result of the previous query. To catch up again, on standby when I check
    SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG
    SEQUENCE# APPLIED
    75 NO
    74 NO
    76 NO
    77 NO
    I understand that though archive files have been copied across but they are not applied yet.
    On primary when I give your query -
    SELECT name as STANDBY,SEQUENCE#,applied, completion_time
    2 FROM v$archived_log
    3 where dest_id=2
    4 and sequence# BETWEEN 74 and 80;
    I get -
    STANDBY SEQUENCE# APPLIED COMPLETIO
    stdby_11 74 YES 28-JUN-11
    stdby_11 75 YES 28-JUN-11
    stdby_11 76 YES 29-JUN-11
    stdby_11 77 YES 29-JUN-11
    stdby_11 78 YES 29-JUN-11
    stdby_11 79 YES 29-JUN-11
    stdby_11 80 YES 29-JUN-11
    stdby_11 75 NO 07-JUL-11
    stdby_11 74 NO 07-JUL-11
    stdby_11 76 NO 07-JUL-11
    stdby_11 77 NO 07-JUL-11
    stdby_11 78 NO 07-JUL-11
    I have intentionally given
    sequence# BETWEEN 74 and 80
    because I know in the current incarnaion of the database, max sequence is 78.
    So my understanding is, the rows between 28-29 June are from previous incarnation, correct me if I am wrong
    Archive files of the current incarnation, since I successfully created standby database are shipped but yet to be applied - am I right?
    Then my final question is, when will these archives be applied to standby database?
    I am sorry to ask too many questions but I am just trying to understand how it all works.
    Thanks for your help again

Maybe you are looking for