How to recreate the control files

Can someone tell me how to recreate the control file?
Thanks in advance
Himanshu

Hi, You can use the following statement.
CREATE CONTROLFILE
SET DATABASE prod
LOGFILE GROUP 1 ('/u01/oracle/prod/redo01_01.log',
'/u01/oracle/prod/redo01_02.log'),
GROUP 2 ('/u01/oracle/prod/redo02_01.log',
'/u01/oracle/prod/redo02_02.log'),
GROUP 3 ('/u01/oracle/prod/redo03_01.log',
'/u01/oracle/prod/redo03_02.log')
NORESETLOGS
DATAFILE '/u01/oracle/prod/system01.dbf' SIZE 3M,
'/u01/oracle/prod/rbs01.dbs' SIZE 5M,
'/u01/oracle/prod/users01.dbs' SIZE 5M,
'/u01/oracle/prod/temp01.dbs' SIZE 5M
MAXLOGFILES 50
MAXLOGMEMBERS 3
MAXLOGHISTORY 400
MAXDATAFILES 200
MAXINSTANCES 6
ARCHIVELOG;
Thanks

Similar Messages

  • How to make the control file consistent when I re-mulitplexing them

    Oracle 10g R2 on the AIX 5.3L
    My current control files (three) from the default set-up are all located in the same directory (/dbbaan/oradata/<SID>/). If I want to change some of the multiplexing of the control file to different directory to avoid the media failure,
    1. I copy one or two control files to different directory.
    2. create a new init_sid.ora from spfile
    2. edit the init_sid.ora file and change the locations of the control file
    3. shutdown/restart the DB using the init_sid.ora.
    4. create the spfile from the pfile
    5 shutdown/restart the DB with new spfile ( "SQL> startup")
    My question is: since there is always time lag between copying and recreating the new init_sid.ora, while the control file(s) are constantly updating, how can Db guarrente the consistency of the DB when I restart the DB (the control file specified in the init_sid.ora may be some time old) ? or does it matter?
    I did above and my DB restart without problem.

    Another problem concerns me. What happen if one of
    multiplexed control file location, which I use a NFS
    of another server, goes down and is not available
    during the operation ( After I restart up the DB)? I
    am sure I will see the error of that control file in
    the alert log.If one of the control files not accessible during operation, Oracle will crash. So you better make sure all of your control file location are reliable and accessible.

  • In case of a DB crash what happens to the status of the Control File

    When a DB is crashed will the Control file that exists in the OS also get corrupted, What happens to the Data Files , how to recover the Control files and Data Files , the DB in case there isn't any Backup media or any Dump available on the DB.

    The only one way to recover a database is to be in archivelog mode.
    And if I said about recover stricto sensu, that's because even in noarchivelog mode we need to use the command recover until cancel before an open with resetlogs option, even if we haven't any redo/archive logs. That fake a recover, this is what we say a mimic recover. Which is not a recover stricto sensu like it can be the case with archivelog mode.
    Nicolas.

  • How to handle the control records in case of file to idoc scenario.

    Hi All,
    can you please clarify me how to handle the control records in case of file to idoc scenario.

    Hi,
    In File to Idoc scenario even though you selected apply control record values from payload and you are not getting those correct values which you have provided in the mapping.
    Also check the checkboxes Take sender from payload and Take receiver from payload along with the Apply control record values from payload checkbox
    Regards
    Seshagiri

  • How can i validate the data in the control file?

    Consider that the SQLLoader reads the Input data File from the path and it loads the data into the tables based up on the descrition specified in the control File.
    First, the table to be filled is created:
    create table sql_loader_1 ( load_time date, field_1 Numeric, field_2 varchar2(10)
    Sample Control File :
    load_1.ctl
    load data
    infile 'load_1.dat' "str '\r\n'"
    insert into table sql_loader_1
    load_time sysdate,
    field_2 position( 1:10),
    field_1 position(11:20)
    Note that the positions 11 through 20 are loaded into field_1 and positions 1 through 10 into field_2. The field load_time is filled with the current time (sysdate) of the load.
    Here's the data. The name of the file (load_1.dat) had been specified with the infile statement in the control file.
    load_1.dat
    0123456789abcdefghij
    foo bar
    here comes a very long line
    and the next is
    short
    Here i want to validate the field_1 (Numeric Datatype) since the data file contains the character value (i.e)abcdefghij

    Good question for this forum:
    Export/Import/SQL Loader & External Tables
    Werner

  • How to refer the SQL*Loader command line parameters in the control file

    The problem I am trying to resolve is to insert the input file name when SQL*Loader is loading the record from the file. I have multiple files to load and it is nice to associate a record with a particular input file.

    Create the control file dynamically (and fill one of the columns with the file name as a constant) before you start SQL*Loader
    Another option is to use external tables
    Re: Data Loading
    Message was edited by:
    Jens Petersen

  • How to pass parameters to the Control file while loading the data from flat file to staging table

    Thanks in advance

    Hi ,
    LOADDATA statement is required at the beginning of the control file.
    INFILE: INFILE keyword is used to specify location of the datafile or datafiles.
    INFILE* specifies that the data is found in the control file and not in an external file. INFILE ‘$FILE’, can be used to send the filepath and filename as a parameter when registered as a concurrent program.
    INFILE   ‘/home/vision/kap/import2.csv’ specifies the filepath and the filename.
    Hope this will help you......

  • Database creation having a trace of the control file

    Hi,
    I want to move a database from one server let's say A to another server let's say B I have a copy of all the datafiles, redo logs, control files and init file of the database fron the server A. I have a trace of the control file.
    I copied all these files on the server B in the location /dispecer_date/oradata, except init which is in ORACLE_HOME/dbs
    I thought that the simplest method to recreate the database is from the backup of the control file writing in sql the command CREATE CONTROLFILE how is written in trace and replacing the word REUSE with the word SET in CREATE CONTROLFILE instruction.
    I obtained an error:
    ORA-01503: Create controlfile failed
    ORA-01160: file is not a data file
    ORA-01110: datafile: '/dispecer_date/oradata/system.dbf'
    Why? The db_block_size parameter is 4096.
    Thank you,
    Mihaela

    Here are the steps .....
    sql > shutdown immediate ;
    create identical dir structure on server b
    copy all datafile,controlfile,redologfiles and pfile to target server ,And put them in same dir as of source.
    now on taget server
    sql > startup mountpfile = path of the pfile
    sql > alter database opn
    or
    sql > alter database open resetlogs ;
    this will do the trick, I don;t think recreating the controlfile is a good option hare , becuse you likly to loose some data if you stick on that one.
    hare krishna
    Alok

  • Re createing the control file

    alter database backup controlfile to trace;
    How do I re create the control file using what's in trace(Oracle 9i Solaris 9)
    Thanx.

    See Note 1012929.6 How to Recreate the Controlfile, the trace contains the syntax to recreate the controlfile, you can copy the contents to a sql file such as newctl.sql, edit the contents removing the header and make other changes such as increasing maxlogfiles, then run the sql file.
    HTH
    Enrique
    PS Why do you need to rebuild the controlfile?

  • Need help in writing the control file for SQLLOADER

    Is it possible to error out the Sqlloader in case the data fields in the data file for a row are more than the fields stated in the control file?
    i.e. My data file is something like
    aaa,bbb,cc
    dd,eee
    And my ctl file has just 2 columns in it. Is it possible to write a control file which will cause the Sqlloader to error out?
    Thanks...

    Nisha,
    Again I posted test example in your other post but here is how can do that
    CREATE TABLE mytest111 (
       col1 NUMBER,
       col2 NUMBER,
       col3 NUMBER
    LOAD DATA
    TRUNCATE INTO TABLE MYTEST111
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    col1 integer external,
    col2 integer external
    #mytest.dat
    1,2,3
    1,2
    SQL*Loader: Release 10.2.0.1.0 - Production on Fri Apr 10 11:40:39 2009
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Control File:   mytest.ctl
    Data File:      mytest.dat
      Bad File:     mytest.bad
      Discard File:  none specified
    (Allow all discards)
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 50
    Bind array:     64 rows, maximum of 256000 bytes
    Continuation:    none specified
    Path used:      Conventional
    Table USIUSER.MYTEST111, loaded from every logical record.
    Insert option in effect for this table: TRUNCATE
    TRAILING NULLCOLS option in effect
       Column Name                  Position   Len  Term Encl Datatype
    COL1                                FIRST     *   ,  O(") CHARACTER           
    COL2                                 NEXT     *   ,  O(") CHARACTER           
    Table MYTEST111:
      2 Rows successfully loaded.
      0 Rows not loaded due to data errors.
      0 Rows not loaded because all WHEN clauses were failed.
      0 Rows not loaded because all fields were null.
    Space allocated for bind array:                  33024 bytes(64 rows)
    Read   buffer bytes: 1048576
    Total logical records skipped:          0
    Total logical records read:             2
    Total logical records rejected:         0
    Total logical records discarded:        0
    Run began on Fri Apr 10 11:40:39 2009
    Run ended on Fri Apr 10 11:40:40 2009
    Elapsed time was:     00:00:00.99
    CPU time was:         00:00:00.06
    {code}
    Regards                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • I can only backup the datafiles but not the control files and SPFiles

    Hello, all,
    I am using the Oracle 10g on a linux server which runs redhat 9. I want to backup the whole database to the disk, but not the flash recovery area. It is /rawdata. I will show how I configure the backup part in EM. Is there anything wrong?
    1. the ARCHIVELOG is on
    2. under Administration, in the All Initialization Parameters, I remove the string value of “log_archive_dest_1”. After that, I go to the SPFile and remove the string value of “log_archive_dest_1”
    3. configure backup settings and policies. The Disk Backup Location field is set to /rawdata. Select Image Copy for Disk Backup type. Test Disk backup is successful.
    4. go to Policy page. Select “Automatically backup the control file and server parameter file (SPFile) with every backup and database structural change.) input /rawdata into the filed: Autobackup Disk Location
    Select “Optimize the whole database backup by skipping unchanged files such as read-only and offline datafiles that have been backed up”
    Select “Retain backups that are necessary for a recovery to any time whin the specified number of days (point-in-time recovery)
    Accept the default of 31days
    5. go to Schedul Backup
    6. select customized from the backup Strategy drop-down menu. Select the Whole Database
    7. in the Options page, select “Full backup” in the Backup Type section. Select “Online Backup” in the Backup Mode section. Select “back up all archived logs on disk” in the Advanced section.
    8. in the Setting page, select “Disk”
    9. in the Schedule page, accept the default job name and description. Select Immediately to execute the job immediately.
    10. just submit the job.
    After several minutes, the job is failed while the Prebackup and Postbackup are succeeded. The log says:
    Recovery Manager: Release 10.1.0.2.0 - Production
    Copyright (c) 1995, 2004, Oracle. All rights reserved.
    RMAN>
    connected to target database: ORCL10G (DBID=770753237)
    using target database controlfile instead of recovery catalog
    RMAN>
    Starting backup at 11-OCT-06
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=268 devtype=DISK
    channel ORA_DISK_1: starting datafile copy
    input datafile fno=00001 name=+DATADG/orcl10g/system01.dbf
    output filename=/rawdata/data_D-ORCL10G_I-770753237_TS-SYSTEM_FNO-1_68hvin50 tag=BACKUP_ORCL10G_000_101106111844 recid=108 stamp=603544772
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
    channel ORA_DISK_1: starting datafile copy
    input datafile fno=00003 name=+DATADG/orcl10g/sysaux01.dbf
    output filename=/rawdata/data_D-ORCL10G_I-770753237_TS-SYSAUX_FNO-3_69hvin6d tag=BACKUP_ORCL10G_000_101106111844 recid=109 stamp=603544813
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
    channel ORA_DISK_1: starting datafile copy
    input datafile fno=00005 name=+DATADG/orcl10g/example01.dbf
    output filename=/rawdata/data_D-ORCL10G_I-770753237_TS-EXAMPLE_FNO-5_6ahvin7g tag=BACKUP_ORCL10G_000_101106111844 recid=110 stamp=603544829
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
    channel ORA_DISK_1: starting datafile copy
    input datafile fno=00002 name=+DATADG/orcl10g/undotbs01.dbf
    output filename=/rawdata/data_D-ORCL10G_I-770753237_TS-UNDOTBS1_FNO-2_6bhvin7v tag=BACKUP_ORCL10G_000_101106111844 recid=111 stamp=603544835
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:08
    channel ORA_DISK_1: starting datafile copy
    input datafile fno=00004 name=+DATADG/orcl10g/users01.dbf
    output filename=/rawdata/data_D-ORCL10G_I-770753237_TS-USERS_FNO-4_6chvin87 tag=BACKUP_ORCL10G_000_101106111844 recid=112 stamp=603544841
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
    Finished backup at 11-OCT-06
    Starting Control File and SPFILE Autobackup at 11-OCT-06
    piece handle=/rawdata/c-770753237-20061011-05 comment=NONE
    Finished Control File and SPFILE Autobackup at 11-OCT-06
    RMAN>
    Starting backup at 11-OCT-06
    current log archived
    using channel ORA_DISK_1
    archived log /rawdata/arch_D-ORCL10G_id-770753237_S-1062_T-1_A-586368151_cqhvf270 not found or out of sync with catalog
    trying alternate file for archivelog thread 1, sequence 1062
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of backup command at 10/11/2006 11:20:54
    RMAN-06059: expected archived log not found, lost of archived log compromises recoverability
    ORA-19625: error identifying file /rawdata/arch_D-ORCL10G_id-770753237_S-1062_T-1_A-586368151_puhkv41f
    ORA-27037: unable to obtain file status
    Linux Error: 2: No such file or directory
    Additional information: 3
    RMAN>
    Recovery Manager complete.
    It seems the system tries to find a file “arch_D-ORCL10G_id-770753237_S-1062_T-1_A-586368151_cqhvf270” in /rawdata. I just can not understand.
    What should I do? Any advice is highly appreciated!
    Qian

    the string value in the field of 'log_archive_dest_1" under "All Initialization parameters" is "LOCATION=+DATADG/orcl10g/". The same value was in the field under SPFile.
    I reset these values and tried to backup the whole database. The same error appeared. The log says:
    Recovery Manager: Release 10.1.0.2.0 - Production
    Copyright (c) 1995, 2004, Oracle. All rights reserved.
    RMAN>
    connected to target database: ORCL10G (DBID=770753237)
    using target database controlfile instead of recovery catalog
    RMAN>
    Starting backup at 11-OCT-06
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=245 devtype=DISK
    channel ORA_DISK_1: starting datafile copy
    input datafile fno=00001 name=+DATADG/orcl10g/system01.dbf
    output filename=/rawdata/data_D-ORCL10G_I-770753237_TS-SYSTEM_FNO-1_6ghvj9rd tag=BACKUP_ORCL10G_000_101106043753 recid=114 stamp=603563922
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
    channel ORA_DISK_1: starting datafile copy
    input datafile fno=00003 name=+DATADG/orcl10g/sysaux01.dbf
    output filename=/rawdata/data_D-ORCL10G_I-770753237_TS-SYSAUX_FNO-3_6hhvj9sq tag=BACKUP_ORCL10G_000_101106043753 recid=115 stamp=603563963
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
    channel ORA_DISK_1: starting datafile copy
    input datafile fno=00005 name=+DATADG/orcl10g/example01.dbf
    output filename=/rawdata/data_D-ORCL10G_I-770753237_TS-EXAMPLE_FNO-5_6ihvj9tu tag=BACKUP_ORCL10G_000_101106043753 recid=116 stamp=603563977
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
    channel ORA_DISK_1: starting datafile copy
    input datafile fno=00002 name=+DATADG/orcl10g/undotbs01.dbf
    output filename=/rawdata/data_D-ORCL10G_I-770753237_TS-UNDOTBS1_FNO-2_6jhvj9ud tag=BACKUP_ORCL10G_000_101106043753 recid=117 stamp=603563984
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
    channel ORA_DISK_1: starting datafile copy
    input datafile fno=00004 name=+DATADG/orcl10g/users01.dbf
    output filename=/rawdata/data_D-ORCL10G_I-770753237_TS-USERS_FNO-4_6khvj9uk tag=BACKUP_ORCL10G_000_101106043753 recid=118 stamp=603563990
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
    Finished backup at 11-OCT-06
    Starting Control File and SPFILE Autobackup at 11-OCT-06
    piece handle=/rawdata/c-770753237-20061011-07 comment=NONE
    Finished Control File and SPFILE Autobackup at 11-OCT-06
    RMAN>
    Starting backup at 11-OCT-06
    current log archived
    using channel ORA_DISK_1
    archived log /rawdata/arch_D-ORCL10G_id-770753237_S-1062_T-1_A-586368151_cqhvf270 not found or out of sync with catalog
    trying alternate file for archivelog thread 1, sequence 1062
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of backup command at 10/11/2006 16:40:05
    RMAN-06059: expected archived log not found, lost of archived log compromises recoverability
    ORA-19625: error identifying file /rawdata/arch_D-ORCL10G_id-770753237_S-1062_T-1_A-586368151_puhkv41f
    ORA-27037: unable to obtain file status
    Linux Error: 2: No such file or directory
    Additional information: 3
    RMAN>
    Recovery Manager complete.
    Why the system keeps trying to find files under /rawdata? It is the destination, not the source.
    Any help is appreciated!
    Qian
    Message was edited by:
    QianChen

  • How to restore a control file without having its backup

    Hi,
    Can any one please suggest me how to restore a control file without having its backup.
    Thanks

    To add to what SB said, in years past the instructions for re-creating the control file manually were contained in the DBA Administration manual. It used to be and may still be common to be taking and saving a "backup control file to trace" for this purpose.
    If you lost only the primary copy of the control file and it is an OS file then while the database is shutdown you can copy the secondary over the primary and then use if to start the database. If the control file is stored in ASM then there should be a way to perform the copy via ASM.
    If you use rman for backups then a copy of the control file should be part of the backup process and you can retrieve it from the backup set then perform recovery using the backup control file though I do note the OP said something to the effect no backup exists. Still, I have knows of instances where the DBA did not realize that the backup set contained the control file and the spfile so I think this is worth mentioning just in case.
    HTH -- Mark D Powell --

  • Restore - filename for datafile is missing in the control file

    I am practicing RMAN recovery procedures and I encountered a problem that I do not know how to solve.
    1) I took a hot backup of my test database.
    2) Create tablespace TS_DATA_TEMP
    3) Deleted tablespace TS_DATA which had 2 datafiles
    4) Created tablespace TS_DATA with 1 datafile
    5) shutdown database
    6) logged into RMAN in nomount
    7) restore controlfile from autobackup;
    8) alter database mount;
    9) restore database;
    RMAN> restore database;
    Starting restore at 22-AUG-08
    using channel ORA_DISK_1
    the filename for datafile 5 is missing in the control file
    skipping datafile 1; already restored to file /u02/oradata/EDM91/system01.dbf
    skipping datafile 2; already restored to file /u02/oradata/EDM91/undotbs01.dbf
    skipping datafile 6; already restored to file /u02/oradata/EDM91/index
    skipping datafile 3; already restored to file /u02/oradata/EDM91/sysaux01.dbf
    skipping datafile 7; already restored to file /u03/oradata/EDM91/TS_INDEX01.dbf
    skipping datafile 9; already restored to file /u03/oradata/EDM91/TS_LOB01.dbf
    skipping datafile 4; already restored to file /u02/oradata/EDM91/users01.dbf
    restore not done; all files readonly, offline, or already restored
    Finished restore at 22-AUG-08
    10) tried to recover
    Starting recover at 22-AUG-08
    using channel ORA_DISK_1
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of recover command at 08/22/2008 15:04:22
    RMAN-06094: datafile 5 must be restored
    SQL> select name from v$datafile where file#=5;
    NAME
    /u04/oradata/EDM91/TS_DATA.dbf
    12) alter database backup controlfile to trace
    DATAFILE
    '/u02/oradata/EDM91/system01.dbf',
    '/u02/oradata/EDM91/undotbs01.dbf',
    '/u02/oradata/EDM91/sysaux01.dbf',
    '/u02/oradata/EDM91/users01.dbf',
    '/u04/oradata/EDM91/TS_DATA.dbf',
    '/u02/oradata/EDM91/index',
    '/u03/oradata/EDM91/TS_INDEX01.dbf',
    '/u04/oradata/EDM91/TS_DATA02.dbf',
    '/u03/oradata/EDM91/TS_LOB01.dbf'
    CHARACTER SET UTF8
    So i'm not sure what the problem is. Datafile TS_DATA.dbf is located in the control file but i'm getting the error: the filename for datafile 5 is missing in the control file.
    Suggestions on what's wrong with the control file?

    I found my mistake; a newbie error.
    I did not know I needed to include in my restore command the 'until' option when doing incomplete recovery. I only included the 'until' option in the recover command:
    original command
    restore database;
    recover database until sequence =123;
    should be
    restore database until sequence = 123;
    recover database until sequence =123;
    I usually run the command using a RUN block with a SET UNTIL SEQUENCE but this case I used the single commands separately.
    RUN
    +{+
    SET UNTIL sequence 123;
    RESTORE DATABASE;
    RECOVER DATABASE;
    +}+

  • RMAN-06024: no backup or copy of the control file found to restore

    I am cloning a new database using a full backup from previous nightly rman backup using a standby database utilizing catalog. When I run the duplicate command, I get
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 09/27/2011 15:04:05
    RMAN-03015: error occurred in stored script Memory Script
    RMAN-06026: some targets not found - aborting restore
    RMAN-06024: no backup or copy of the control file found to restore
    But the backup of controlfile does exists in the right place. What am I missing?

    958210 wrote:
    i was trying to clone a database to a remote machine, but it is giving me the following error
    'RMAN-06024: no backup or copy of the control file found to restore
    ORA-19505: failed to identify file "/u01/app/oracle/product/11.2.0/dbs/c-1617115651-20120912-02"
    even though i can list the backup of the control file in the source machine.
    thank you
    'How do I ask a question on the forums?
    SQL and PL/SQL FAQ
    Since we don't know what you did, so we can't know what you did wrong

  • Different log file name in the Control file of SQL Loader

    Dear all,
    I get every day 3 log files with ftp from a Solaris Server to a Windows 2000 Server machine. In this Windows machine, we have an Oracle Database 9.2. These log files are in the following format: in<date>.log i.e. in20070429.log.
    I would like to load this log file's data to an Oracle table every day and I would like to use SQL Loader for this job.
    The problem is that the log file name is different every day.
    How can I give this variable log file name in the Control file, which is used for the SQL Loader?
    file.ctl
    LOAD DATA
    INFILE 'D:\gbal\in<date>.log'
    APPEND INTO TABLE CHAT_SL
    FIELDS TERMINATED BY WHITESPACE
    TRAILING NULLCOLS
    (SL1 DATE "Mon DD, YYYY HH:MI:SS FF3AM",
    SL2 char,
    SL3 DATE "Mon DD, YYYY HH:MI:SS FF3AM",
    SL4 char,
    SL5 char,
    SL6 char,
    SL7 char,
    SL8 char,
    SL9 char,
    SL10 char,
    SL11 char,
    SL12 char,
    SL13 char,
    SL14 char,
    SL15 char)
    Do you have any better idea about this issue?
    I thought of renaming the log file to an instant name, such as in.log, but how can I distinguish the desired log file, from the other two?
    Thank you very much in advance.
    Giorgos Baliotis

    I don't have a direct solution for your problem.
    However if you invoke the SQL loader from an Oracle stored procedure, it is possible to dynamically set control\log file.
    # Grant previleges to the user to execute command prompt statements
    BEGIN
    dbms_java.grant_permission('bc4186ol','java.io.FilePermission','C:\windows\system32\cmd.exe','execute');
    END;
    * Procedure to execute Operating system commands using PL\SQL(Oracle script making use of Java packages
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Host" AS
    import java.io.*;
    public class Host {
    public static void executeCommand(String command) {
    try {
    String[] finalCommand;
    finalCommand = new String[4];
    finalCommand[0] = "C:\\windows\\system32\\cmd.exe";
    finalCommand[1] = "/y";
    finalCommand[2] = "/c";
    finalCommand[3] = command;
    final Process pr = Runtime.getRuntime().exec(finalCommand);
    new Thread(new Runnable() {
    public void run() {
    try {
    BufferedReader br_in = new BufferedReader(new InputStreamReader(pr.getInputStream()));
    String buff = null;
    while ((buff = br_in.readLine()) != null) {
    System.out.println("Process out :" + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    catch (IOException ioe) {
    System.out.println("Exception caught printing process output.");
    ioe.printStackTrace();
    }).start();
    new Thread(new Runnable() {
    public void run() {
    try {
    BufferedReader br_err = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
    String buff = null;
    while ((buff = br_err.readLine()) != null) {
    System.out.println("Process err :" + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    catch (IOException ioe) {
    System.out.println("Exception caught printing process error.");
    ioe.printStackTrace();
    }).start();
    catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    public static boolean isWindows() {
    if (System.getProperty("os.name").toLowerCase().indexOf("windows") != -1)
    return true;
    else
    return false;
    * Oracle wrapper to call the above procedure
    CREATE OR REPLACE PROCEDURE Host_Command (p_command IN VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'Host.executeCommand (java.lang.String)';
    * Now invoke the procedure with an operating system command(Execyte SQL-loader)
    * The execution of script would ensure the Prod mapping data file is loaded to PROD_5005_710_MAP table
    * Change the control\log\discard\bad files as apropriate
    BEGIN
    Host_Command (p_command => 'sqlldr system/tiburon@orcl control=C:\anupama\emp_join'||1||'.ctl log=C:\anupama\ond_lists.log');
    END;Does that help you?
    Regards,
    Bhagat

Maybe you are looking for

  • ABAP HR urgent help

    hi, I am working on a hr report ,in which the rrequirement is to send the out put of the report as attachement either as pdf or excel to the user email id . when runs the programme in the background,how will i do this ? please help regards Prasun

  • MOVED: Any modded BIOS for Neo4-F MS-7125 (PCB 1.0)........???

    This topic has been moved to BIOS. https://forum-en.msi.com/index.php?topic=100654.0

  • "missing file" message in PSE9

    All my pics in the PSE9 Organizer timeline say "missing file" and cannot be found when trying to open for editing. Have tried uninstalling and reinstalling but organizer timeline pics remain.

  • Flex Component Kit publish SWC not working with Flex 4

    I started this thread in the Flex forum and they are telling me that the SWC's I'm creating with Flash Professional CS5 and Flex Component Kit 2.0.0 are not linked with FCC for Flex 4. http://forums.adobe.com/thread/777789?tstart=0 That means the pro

  • Help plz any 1

    ok i have movies that i cant sync to my ipod coz im not   authorized to play them and im authorized my computer but it still wont play them or sync them help