Forgot your password?    
+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Dynamic Script to take Hot Backup of Oracle Database

  1. #1
    Expert Oracle Administrator
    Join Date
    Oct 2011
    Location
    New Delhi, India
    Posts
    427

    Dynamic Script to take Hot Backup of Oracle Database

    This script is applicable for 8i,9i,10g and 11g.
    It dynamically collects all the information of the database.



    - It takes a backup of all the datafiles of the database by putiing each tablespace in begin backup mode
    - It takes a binary and a trace backup of the controlfile
    - It however does not take a backup of the archives



    In this case the backup location is set to /u01/orabkp/
    BEFORE Creating the HotBkp procedure, set the backup location in the procedure.


    1 . CREATE THE HOTBKP PROCEDURE IN THE DATABASE FOR WHICH HOT BACKUP IS TO BE TAKEN
    -------------------------------------------------------------------------------------------------------

    create or replace procedure HotBkp
    is

    /* cursor to capture Tablespaces that it will be put in the Backup, accessing Temporary Tablespaces Managed Locally */
    cursor cTbs is
    select ts# tId, name tName
    from v$tablespace
    where ts# not in (select distinct ts# from v$tempfile);

    /* Cursor to capture Data Files that it will be put in the Backup */
    cursor cDtfl is
    select ts# tId, name dName, substr(name,
    instr(name,decode('\',NULL,'/','\'),-1)+1,
    instr(name,'.',-1)-instr(name,decode('\',NULL,'/','\'),-1)-1) DestName
    from v$datafile;

    /* Default backup directory. It should be compatible with your environment. */
    CBkpDir constant varchar2(100):='/u01/orabkp/';

    /* Default extension's backup files */
    CBkpExt constant varchar2(4):='.bkp';

    /* Default extension's control file logical backup */
    CBkpCtflExt constant varchar2(4):='.sql';

    /* Files name generated throught Logical Backup and Control Files's Backup Online */
    CBkpCtfl constant varchar2(7):='control';

    VSpid varchar2(100);

    VUdump varchar2(100);

    begin
    dbms_output.enable(50000);

    dbms_output.put_line('spool '||CBkpDir||'hotbkp.log');

    /* Capture the start hour of Backup Online execution */
    dbms_output.put_line('select to_char(sysdate, ''dd/mm/rrrr hh24:mi:ss'')
    Start_Time'||chr(10)||
    'from dual;');

    /* Starting the LOOP to take a Tablespaces's Backup Online */
    for rTbs in cTbs loop

    dbms_output.put_line('alter tablespace '||rTbs.tName||' begin backup;');
    for rDtfl in cDtfl loop

    if (rDtfl.tId=rTbs.tId) then
    dbms_output.put_line('HOST cp '||rDtfl.dName||' '||CBkpDir);
    end if;
    end loop;

    dbms_output.put_line('alter tablespace '||rTbs.tName||' end backup;');

    dbms_output.put_line('alter system checkpoint;');

    end loop;

    dbms_output.put_line('alter database backup controlfile to trace as '''||CBkpDir||'controlfile_bkp.trc'||''';');
    dbms_output.put_line('alter database backup controlfile to '''||CBkpDir||CBkpCtfl||CBkpExt||''';');


    dbms_output.put_line('alter system archive log current;');

    /* Capture the end hour of Backup Online execution */
    dbms_output.put_line('select to_char(sysdate, ''dd/mm/rrrr hh24:mi:ss'')
    End_Time'||chr(10)||
    'from dual;');

    /* Closing the log */
    dbms_output.put_line('spool off');

    end;
    /


    2. SPOOL OUTPUT TO A SQL FILE and EXEC THE HOTBKP PROCEDURE
    =================================================
    USAGE :

    conn / as sysdba
    set feed off
    set serveroutput on
    set linesize 300
    spool $HOME/hotbkp.sql
    exec HotBkp;
    spool off
    set feed on
    exit;

    3. Check the script $HOME/hotbkp.sql .
    This script will be now be used to take a hot backup, after creating the respective Directory to take a hot backup

  2. #2
    Expert Oracle Administrator
    Join Date
    Oct 2011
    Location
    New Delhi, India
    Posts
    427
    Create the Directory where Hot Backup is to be taken
    mkdir /u01/orabkp/

    Take the Backup

    SQL> spool hotbkp.log
    SQL> @hotbkp.sql
    SP2-0734: unknown command beginning "SQL> exec ..." - rest of line ignored.

    START_TIME
    -------------------
    01/01/2012 15:44:51


    Tablespace altered.



    Tablespace altered.


    System altered.


    Tablespace altered.



    Tablespace altered.


    System altered.


    Tablespace altered.



    Tablespace altered.


    System altered.


    Tablespace altered.



    Tablespace altered.


    System altered.


    Database altered.


    Database altered.


    System altered.


    END_TIME
    -------------------
    01/01/2012 15:46:28

    SP2-0734: unknown command beginning "SQL> spool..." - rest of line ignored.
    SQL>

  3. #3
    Hi Sir ,

    I was trying to run your script on my machine but while running it was throwoing some errors. please provide some help on this issue.

    thanks
    Manish Kumar

    SP2-0734: unknown command beginning "cursor cTb..." - rest of line ignored.

    TID TNAME
    ---------- ------------------------------
    0 SYSTEM
    1 CTXD
    382 APPS_TS_TX_IDX
    381 APPS_TS_TX_DATA
    387 APPS_TS_ARCHIVE
    391 OLAP
    388 APPS_TS_QUEUES
    307 PORTAL
    383 APPS_TS_SEED
    385 APPS_TS_SUMMARY
    384 APPS_TS_INTERFACE

    TID TNAME
    ---------- ------------------------------
    390 ODM
    2 OWAPUB
    389 APPS_TS_MEDIA
    386 APPS_TS_NOLOGGING
    368 APPS_UNDOTS1

    16 rows selected.

    SP2-0734: unknown command beginning "cursor cDt..." - rest of line ignored.

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    0
    /u02/oracle/proddata/system01.dbf
    /u02/oracle/proddata/system01

    0
    /u02/oracle/proddata/system02.dbf
    /u02/oracle/proddata/system02

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------

    0
    /u02/oracle/proddata/system03.dbf
    /u02/oracle/proddata/system03

    0
    /u02/oracle/proddata/system04.dbf

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/system04

    0
    /u02/oracle/proddata/system05.dbf
    /u02/oracle/proddata/system05

    1

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/ctxd01.dbf
    /u02/oracle/proddata/ctxd01

    2
    /u02/oracle/proddata/owad01.dbf
    /u02/oracle/proddata/owad01


    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    388
    /u02/oracle/proddata/a_queue02.dbf
    /u02/oracle/proddata/a_queue02

    390
    /u02/oracle/proddata/odm.dbf
    /u02/oracle/proddata/odm

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------

    391
    /u02/oracle/proddata/olap.dbf
    /u02/oracle/proddata/olap

    0
    /u02/oracle/proddata/system10.dbf

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/system10

    0
    /u02/oracle/proddata/system06.dbf
    /u02/oracle/proddata/system06

    307

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/portal01.dbf
    /u02/oracle/proddata/portal01

    0
    /u02/oracle/proddata/system07.dbf
    /u02/oracle/proddata/system07


    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    0
    /u02/oracle/proddata/system09.dbf
    /u02/oracle/proddata/system09

    0
    /u02/oracle/proddata/system08.dbf
    /u02/oracle/proddata/system08

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------

    0
    /u02/oracle/proddata/system11.dbf
    /u02/oracle/proddata/system11

    368
    /u02/oracle/proddata/undo01.dbf

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/undo01

    381
    /u02/oracle/proddata/a_txn_data01.dbf
    /u02/oracle/proddata/a_txn_data01

    382

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/a_txn_ind01.dbf
    /u02/oracle/proddata/a_txn_ind01

    383
    /u02/oracle/proddata/a_ref01.dbf
    /u02/oracle/proddata/a_ref01


    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    384
    /u02/oracle/proddata/a_int01.dbf
    /u02/oracle/proddata/a_int01

    385
    /u02/oracle/proddata/a_summ01.dbf
    /u02/oracle/proddata/a_summ01

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------

    386
    /u02/oracle/proddata/a_nolog01.dbf
    /u02/oracle/proddata/a_nolog01

    387
    /u02/oracle/proddata/a_archive01.dbf

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/a_archive01

    388
    /u02/oracle/proddata/a_queue01.dbf
    /u02/oracle/proddata/a_queue01

    389

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/a_media01.dbf
    /u02/oracle/proddata/a_media01

    381
    /u02/oracle/proddata/a_txn_data02.dbf
    /u02/oracle/proddata/a_txn_data02


    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    381
    /u02/oracle/proddata/a_txn_data03.dbf
    /u02/oracle/proddata/a_txn_data03

    382
    /u02/oracle/proddata/a_txn_ind02.dbf
    /u02/oracle/proddata/a_txn_ind02

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------

    382
    /u02/oracle/proddata/a_txn_ind03.dbf
    /u02/oracle/proddata/a_txn_ind03

    382
    /u02/oracle/proddata/a_txn_ind04.dbf

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/a_txn_ind04

    382
    /u02/oracle/proddata/a_txn_ind05.dbf
    /u02/oracle/proddata/a_txn_ind05

    383

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/a_ref02.dbf
    /u02/oracle/proddata/a_ref02


    34 rows selected.

    SP2-0734: unknown command beginning "CBkpDir co..." - rest of line ignored.
    SP2-0734: unknown command beginning "CBkpExt co..." - rest of line ignored.
    SP2-0734: unknown command beginning "CBkpCtflEx..." - rest of line ignored.
    SP2-0734: unknown command beginning "CBkpCtfl c..." - rest of line ignored.
    SP2-0734: unknown command beginning "VSpid varc..." - rest of line ignored.
    SP2-0734: unknown command beginning "VUdump var..." - rest of line ignored.
    dbms_output.put_line('spool '||CBkpDir||'hotbkp.log');
    *
    ERROR at line 4:
    ORA-06550: line 4, column 32:
    PLS-00201: identifier 'CBKPDIR' must be declared
    ORA-06550: line 4, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 12, column 13:
    PLS-00201: identifier 'CTBS' must be declared
    ORA-06550: line 12, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 28, column 74:
    PLS-00201: identifier 'CBKPDIR' must be declared
    ORA-06550: line 28, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 29, column 65:
    PLS-00201: identifier 'CBKPDIR' must be declared
    ORA-06550: line 29, column 1:
    PL/SQL: Statement ignored

  4. #4
    Expert Oracle Administrator
    Join Date
    Oct 2011
    Location
    New Delhi, India
    Posts
    427
    Manish ,

    1) you have Definitely not created the package properly or not executed it properly. Show how you have created it
    Please send the outcome of step 1 ie create or replace ....
    (1 . CREATE THE HOTBKP PROCEDURE IN THE DATABASE FOR WHICH HOT BACKUP IS TO BE TAKEN
    after changing the backup location - currently is set to /u01/orabkp/ )

    2) Show how you have executed the script as well.

  5. #5
    Hi Sir,

    i tried running your script again but i am facing the same issue. i copied your given script text from here to my root path file hb_pkg.sql using vi i copied the text. I even changed my file path where i will be taking the back up ie /u02/orabkp

    then at the same path where i saved the hb_pkg.sql i started the sqlplus / as sysdba and at the sql prompt i executed the hb_pkg.sql as: sql>@hb_pkg.sql . after doing all this i am not gettin the procedure as you have explained.





    /* cursor to capture Tablespaces that it will be put in the Backup, accessing Temporary Tablespaces Managed Locally */
    cursor cTbs is
    select ts# tId, name tName
    from v$tablespace
    where ts# not in (select distinct ts# from v$tempfile);

    /* Cursor to capture Data Files that it will be put in the Backup */
    cursor cDtfl is
    select ts# tId, name dName, substr(name,
    instr(name,decode('\',NULL,'/','\'),-1)+1,
    instr(name,'.',-1)-instr(name,decode('\',NULL,'/','\'),-1)-1) DestName
    from v$datafile;

    /* Default backup directory. It should be compatible with your environment. */
    CBkpDir constant varchar2(100):='/u02/orabkp/';

    /* Default extension's backup files */
    CBkpExt constant varchar2(4):='.bkp';

    /* Default extension's control file logical backup */
    CBkpCtflExt constant varchar2(4):='.sql';

    /* Files name generated throught Logical Backup and Control Files's Backup Online */
    CBkpCtfl constant varchar2(7):='control';

    VSpid varchar2(100);

    VUdump varchar2(100);

    begin
    dbms_output.enable(50000);

    dbms_output.put_line('spool '||CBkpDir||'hotbkp.log');

    /* Capture the start hour of Backup Online execution */
    dbms_output.put_line('select to_char(sysdate, ''dd/mm/rrrr hh24:mi:ss'')
    Start_Time'||chr(10)||
    'from dual;');

    /* Starting the LOOP to take a Tablespaces's Backup Online */
    for rTbs in cTbs loop

    dbms_output.put_line('alter tablespace '||rTbs.tName||' begin backup;');

    for rDtfl in cDtfl loop

    if (rDtfl.tId=rTbs.tId) then
    dbms_output.put_line('HOST cp '||rDtfl.dName||' '||CBkpDir);
    end if;
    end loop;

    dbms_output.put_line('alter tablespace '||rTbs.tName||' end backup;');

    dbms_output.put_line('alter system checkpoint;');

    end loop;

    dbms_output.put_line('alter database backup controlfile to trace as '''||CBkpDir||'controlfile_bkp.trc'||''';');
    dbms_output.put_line('alter database backup controlfile to '''||CBkpDir||CBkpCtfl||CBkpExt||''';');


    dbms_output.put_line('alter system archive log current;');

    /* Capture the end hour of Backup Online execution */
    dbms_output.put_line('select to_char(sysdate, ''dd/mm/rrrr hh24:mi:ss'')

    End_Time'||chr(10)||
    'from dual;');

    /* Closing the log */
    dbms_output.put_line('spool off');

    end;







    ERROR:


    [oraapps@localhost ~]$ vi hb_pkg.sql
    [oraapps@localhost ~]$ sqlplus

    SQL*Plus: Release 9.2.0.5.0 - Production on Sun Jan 29 22:30:14 2012

    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

    Enter user-name: / as sysdba

    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.5.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.5.0 - Production

    SQL> @hb_pkg.sql
    SP2-0734: unknown command beginning "cursor cTb..." - rest of line ignored.

    TID TNAME
    ---------- ------------------------------
    0 SYSTEM
    1 CTXD
    382 APPS_TS_TX_IDX
    381 APPS_TS_TX_DATA
    387 APPS_TS_ARCHIVE
    391 OLAP
    388 APPS_TS_QUEUES
    307 PORTAL
    383 APPS_TS_SEED
    385 APPS_TS_SUMMARY
    384 APPS_TS_INTERFACE

    TID TNAME
    ---------- ------------------------------
    390 ODM
    2 OWAPUB
    389 APPS_TS_MEDIA
    386 APPS_TS_NOLOGGING
    368 APPS_UNDOTS1

    16 rows selected.

    SP2-0734: unknown command beginning "cursor cDt..." - rest of line ignored.

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    0
    /u02/oracle/proddata/system01.dbf
    /u02/oracle/proddata/system01

    0
    /u02/oracle/proddata/system02.dbf
    /u02/oracle/proddata/system02

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------

    0
    /u02/oracle/proddata/system03.dbf
    /u02/oracle/proddata/system03

    0
    /u02/oracle/proddata/system04.dbf

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/system04

    0
    /u02/oracle/proddata/system05.dbf
    /u02/oracle/proddata/system05

    1

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/ctxd01.dbf
    /u02/oracle/proddata/ctxd01

    2
    /u02/oracle/proddata/owad01.dbf
    /u02/oracle/proddata/owad01


    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    388
    /u02/oracle/proddata/a_queue02.dbf
    /u02/oracle/proddata/a_queue02

    390
    /u02/oracle/proddata/odm.dbf
    /u02/oracle/proddata/odm

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------

    391
    /u02/oracle/proddata/olap.dbf
    /u02/oracle/proddata/olap

    0
    /u02/oracle/proddata/system10.dbf

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/system10

    0
    /u02/oracle/proddata/system06.dbf
    /u02/oracle/proddata/system06

    307

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/portal01.dbf
    /u02/oracle/proddata/portal01

    0
    /u02/oracle/proddata/system07.dbf
    /u02/oracle/proddata/system07


    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    0
    /u02/oracle/proddata/system09.dbf
    /u02/oracle/proddata/system09

    0
    /u02/oracle/proddata/system08.dbf
    /u02/oracle/proddata/system08

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------

    0
    /u02/oracle/proddata/system11.dbf
    /u02/oracle/proddata/system11

    368
    /u02/oracle/proddata/undo01.dbf

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/undo01

    381
    /u02/oracle/proddata/a_txn_data01.dbf
    /u02/oracle/proddata/a_txn_data01

    382

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/a_txn_ind01.dbf
    /u02/oracle/proddata/a_txn_ind01

    383
    /u02/oracle/proddata/a_ref01.dbf
    /u02/oracle/proddata/a_ref01


    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    384
    /u02/oracle/proddata/a_int01.dbf
    /u02/oracle/proddata/a_int01

    385
    /u02/oracle/proddata/a_summ01.dbf
    /u02/oracle/proddata/a_summ01

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------

    386
    /u02/oracle/proddata/a_nolog01.dbf
    /u02/oracle/proddata/a_nolog01

    387
    /u02/oracle/proddata/a_archive01.dbf

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/a_archive01

    388
    /u02/oracle/proddata/a_queue01.dbf
    /u02/oracle/proddata/a_queue01

    389

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/a_media01.dbf
    /u02/oracle/proddata/a_media01

    381
    /u02/oracle/proddata/a_txn_data02.dbf
    /u02/oracle/proddata/a_txn_data02


    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    381
    /u02/oracle/proddata/a_txn_data03.dbf
    /u02/oracle/proddata/a_txn_data03

    382
    /u02/oracle/proddata/a_txn_ind02.dbf
    /u02/oracle/proddata/a_txn_ind02

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------

    382
    /u02/oracle/proddata/a_txn_ind03.dbf
    /u02/oracle/proddata/a_txn_ind03

    382
    /u02/oracle/proddata/a_txn_ind04.dbf

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/a_txn_ind04

    382
    /u02/oracle/proddata/a_txn_ind05.dbf
    /u02/oracle/proddata/a_txn_ind05

    383

    TID
    ----------
    DNAME
    --------------------------------------------------------------------------------
    DESTNAME
    --------------------------------------------------------------------------------
    /u02/oracle/proddata/a_ref02.dbf
    /u02/oracle/proddata/a_ref02


    34 rows selected.

    SP2-0734: unknown command beginning "CBkpDir co..." - rest of line ignored.
    SP2-0734: unknown command beginning "CBkpExt co..." - rest of line ignored.
    SP2-0734: unknown command beginning "CBkpCtflEx..." - rest of line ignored.
    SP2-0734: unknown command beginning "CBkpCtfl c..." - rest of line ignored.
    SP2-0734: unknown command beginning "VSpid varc..." - rest of line ignored.
    SP2-0734: unknown command beginning "VUdump var..." - rest of line ignored.
    dbms_output.put_line('spool '||CBkpDir||'hotbkp.log');
    *
    ERROR at line 4:
    ORA-06550: line 4, column 32:
    PLS-00201: identifier 'CBKPDIR' must be declared
    ORA-06550: line 4, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 12, column 13:
    PLS-00201: identifier 'CTBS' must be declared
    ORA-06550: line 12, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 28, column 74:
    PLS-00201: identifier 'CBKPDIR' must be declared
    ORA-06550: line 28, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 29, column 65:
    PLS-00201: identifier 'CBKPDIR' must be declared
    ORA-06550: line 29, column 1:
    PL/SQL: Statement ignored


    thanks
    Manish Kumar

  6. #6
    Expert Oracle Administrator
    Join Date
    Oct 2011
    Location
    New Delhi, India
    Posts
    427
    The Problem is that you have not copied the script properly (you have missed the first line of the script).

    The First line of the script begins from :

    create or replace procedure HotBkp
    is


    Please recopy and run the script again.

  7. #7
    Hi sir,

    Thanks its now working

    Manish Kumar

  8. #8
    Dear Hemant,

    After copying hotbackup script using vi and when i run the script to create the procedure
    i logged in as sysdba
    sql>@hotbkp.sql

    Above execute statement will take into hanging mode and nothing happening(why this is not creating hotbackup procedure ?)

    When i cancel the request by using CTRL+C then i will get the following statement
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1

    Please solve my problem...
    Gyanendra Jaiswal

  9. #9
    Please help anyone

  10. #10
    Expert Oracle Administrator
    Join Date
    Oct 2011
    Location
    New Delhi, India
    Posts
    427
    There is definitely a problem with the way you have copied the script.
    You need to copy the script from create right till the last '/'

    If you feel you have copied the script right , please email me the script that you have copied.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Script to Get Oracle Database info
    By shoaibansari in forum Oracle Database Administration 10g and 11g
    Replies: 1
    Last Post: 02-14-2012, 08:09 PM
  2. Oracle Database Manual Backup and Recovery.
    By ajaychandi in forum Backup, Restoration & Recovery, RMAN, Flashback, Datapump, Export, Import
    Replies: 0
    Last Post: 01-24-2012, 06:51 PM
  3. Replies: 0
    Last Post: 01-01-2012, 04:59 PM
  4. Replies: 1
    Last Post: 01-01-2012, 03:50 PM
  5. Replies: 0
    Last Post: 01-01-2012, 01:33 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

DBA Lounge (P) Ltd. deals in Oracle Technologies on Consulting, Resourcing, Corporate Training


Online and corporate training available on Oracle Database 11g, Oracle 11g Real Application Cluster (RAC), Oracle Applications 11i/R12, Oracle Fusion Middleware 11g, Oracle Identity Management-OIM, Oracle Internet Directory 11g-OID, Oracle Business Intelligence Enterprise Edition-OBIEE, Oracle Golden Gate, Oracle Access Management-OAM, Oracle Internet Directory-ODS, Oracle Identity Analytics Architecture-OIA Statistics