Linux Script - ORACLE_BASE environment variable is not shipped

Hello

I created a Linux script to execute a SQL statement and have several variables being passed in the script.  The script executes the SQL statement with no problems, but I see the following message in the log file:

[/ u01/app/oracle/scripts/insert_asm_disk_usage.sh[8]:. : line 87: dbhome: not found

ORACLE_HOME = []? ORACLE_BASE environment variable since it is not defined

information is not available for the current user ID oracle.

You can set ORACLE_BASE manually if necessary.

The content of the script is:

#!/bin/ksh


# Declare variables
export ORACLE_SID=$1
export ORACLE_BASE=/u01/app/oracle
BACKUP_MOUNT=$2
export ORAENV_ASK=NO
. /usr/local/bin/oraenv
. $HOME/.env_variables
HOST_NAME=$(hostname -s)
LOG_DIR=/${BACKUP_MOUNT}/logs
umask 022


# Login to SQL Plus and execute the script
sqlplus -s / @$SCRIPT_DIR/insert_asm_disk_usage.sql ${HOST_NAME}

As I said, the script and SQL statement runs without any problem.

Is there anyway around this message?

Thank you

Frank

Frank.anellia wrote:

I changed the script and way out the variables ORACLE_HOME and ORACLE_BASE instead of using .env_variables:

  1. #! / bin/ksh
  2. # Declaring variables
  3. export ORACLE_BASE = / u01/app/oracle
  4. export ORACLE_HOME=/u01/app/oracle/product/11.2.0/oracle
  5. export ORACLE_SID = $1
  6. BACKUP_MOUNT = $2
  7. Export ORAENV_ASK = NO
  8. . / usr/local/bin/oraenv
  9. #. $HOME/.env_variables
  10. HOST_NAME = $(nom d'hôte-s)
  11. LOG_DIR = / ${BACKUP_MOUNT} / logs
  12. MAIL_LIST =' [email protected]'
  13. umask 022
  14. # Connect to sqlplus and run the script
  15. sqlplus-s / @$ SCRIPT_DIR/insert_asm_disk_usage.sql ${HOST_NAME}

It's not really help make the portable script, but no idea why it does not work with what is in the .env_variables?

If you (you should be) using oraenv, do not set the oracle environment variables yourself. I put the following in each shell script that calls everything about oracle:

# ------------------------------------------------------------------------

# set the environment for ORACLE_SID

# We assume that parm $1 was the name of the database, we work collaboratively with

#

export PATH = / usr/local/bin: $PATH

export ORACLE_SID = $1

Export ORAENV_ASK = NO

. oraenv

unset ORAENV_ASK

I have seen the error that you report it.  I do remember not the exact fix, but what I do recall is that I found exactly the fix actually reading the oraenv script, focusing on where this particular error message is issued, then back followed the logic of there.  If I can do it, if you can, and it will be an exercise in good learning on several levels, not all of which relate to this specific problem.  I think SB has already referred to this approach.

What else I remember correctly, is that the fix had to do with permissions... I think it was that I was connected the operating system with an account that did not have permissions to run certain process called oraenv.  But again, read the script and you should be able to get by.

Tags: Database

Similar Questions

  • Environment variable is not set after the installation of oracle 11i...

    Hello

    I installed oracle 11i on .After setting environment variable LINUX4AS is not defined. like $OAD_TOP, $APPL_TOP.

    HELP PLZ

    Hello

    What env file that you are trying to source? How do you source the env file?

    Question ".» //APPSORA.env and then check.

    Kind regards
    Hussein

  • GDR fails with "ERROR - IZU_TOP environment variable is not defined" on Windows

    When I try to run an OAM GDR I get this error "ERROR - variable of environment IZU_TOP is not defined. I saw this note:

    Solution:
    If make sure there is no file named "env" in or under $APPL_TOP.
    Ensure the standard UNIX command ' / usr/bin/env "is executed when you enter the UNIX command 'env' on the command line.
    This can be checked by, enter the following command at a command prompt:

    $ including env

    .. who should return something like this:

    / usr/bin/env


    .. but I'm on Windows and I do not have a/usr/bin/approx. When I check what env I get "E:\Oracle_Env_Tools\MKS\mksnt/env.exe".

    No idea how to fix this in Windows?

    Chris,

    I'll look into the patch, need me it?

    Because you have tried everything above without success, then I suggest you apply this hotfix.

    Kind regards
    Hussein

  • How to activate the form 12 c forms_http_proxy_host Environment Variable?

    Hi all

    I tried to make the new visible useful Proxy address. That's why I added:

    < PARAM NAME = "FORMS_HTTP_PROXY_HOST" VALUE = "% FORMS_HTTP_PROXY_HOST" >

    FORMS_HTTP_PROXY_HOST = '% FORMS_HTTP_PROXY_HOST '.

    for the webutil_jpi and Basic Environment Variables.

    When I call the form via the Proxy the Variable empty Tin.

    Someone at - it an idea how to operate?
    What was missing? Or are they called differently?

    I also tried "get_application_property" with no success.

    Here is a list of the parameters of the new...

    FORMS_HTTP_PROXY_HOST

    FORMS_HTTP_PROXY_PORT

    FORMS_HTTPS_PROXY_HOST

    FORMS_HTTPS_PROXY_PORT

    FORMS_PROXY_BYPASS

    Here are the environment variables and not the applet parameters.  They are defined in default.env.  The purpose of these is similar to Proxy Server settings in your browser.  For example, if your Oracle Forms environment called Oracle publication BI-serveur, which is hosted on a server that is separate from the Forms Server through a proxy, then you may need to use these variables.

    Note that they only be used by the queries associated with executing JVM process server-side.  This includes forms to BI-Publisher and imported Java calls.

  • Error message: PRVF-3929 - PATH environment variable.

    Hello

    I'm trying to install Oracle on my laptop and get the following error message resulting in installation hault.

    INFO: *********************************************
    NEWS: Environment Variable: 'PATH': this test checks if the length of the 'PATH' environment variable does not exceed the recommended time.
    INFO: Severity: CRITICAL
    INFO: OverallStatus:VERIFICATION_FAILED
    INFO: -----------------------------------------------
    INFO: Results of the audit for node: JF - PC
    NEWS: Expected value: 1023
    NEWS: Real value: 1159
    INFO: Error Message: PRVF-3929: adding location of Oracle binary in the PATH environment variable exceeds the length limit of the BONES of "1023" for the variable on node "JF - PC."
    INFO: Cause: the installer must update the environment variable PATH to include the value of '% ORACLE_HOME%/bin';.
    However, this will cause a path exceeds the maximum allowed length that allows the operating system.
    INFO: Action: make sure that the sum of the length of your current PATH environment variable and one of
    "% ORACLE_HOME%/bin;" does not exceed the limit of the operating system.
    Restart Setup after correcting the value of environment variable.


    Installation of the ton tent of the Oracle database - win64_11gR2

    MY PC CONFIGURATION:
    -Windows 7
    -64-bit

    Can you please help me get this resolved please.

    The following information appears to be linked: http://support.microsoft.com/kb/830473

    According to the link above, the maximum length of the PATH environment variable is 2048/8192 characters. Apparently the length has been increased to 2048 from Windows XP SP2. Your current path is about 1200 characters that is less than the limit of the OS.

    The Oracle installer is incorrect about the PRVF-3929 error message? Or if the length of the path environment variable is not the real problem? Maybe you can try temporarily shorten the path and add the full pathname after the installation of Oracle.

    You should be able to modify the path as follows:
    From the desktop, do a right click my computer, and then click Properties.
    In the System Properties window, click the Advanced tab.
    In the Advanced section, click the Environment Variables button.

    Using Windows 7 Professional? If the error message occurs even with a short path, then maybe there something else trigger this error, as the antivirus or other security software.

    Published by: Dude on July 3, 2011 11:15

  • Environment variable PATH exceeds the length of the operating system limit

    Hello everyone

    I am trying to install Oracle 11 g client on Windows 7

    I get below error when checks prior to Installation

    = Error description =.
    Environment variable: 'PATH' - this test checks to see if the length of the 'PATH' environment variable does not exceed the recommended time.
    Expected value
    : 1023
    Real value
    : 1069
    List of errors:
    -
    PRVF-3929: Add the Oracle binary location to the PATH environment variable will exceed the length limit of the BONES of "1023" of the variable on the node 'CNF0123H5R' - Cause: the installer must update the environment variable PATH to include the value of '% ORACLE_HOME%/bin';. However, this will cause a path exceeds the maximum allowed length that allows the operating system. -Action: Make sure the sum of the length of your current PATH environment variable and that "% ORACLE_HOME%/bin;" does not exceed the limit of the operating system. Restart Setup after correcting the value of environment variable.

    =============

    How to solve this error or I would say rather alert. I do not want to proceed with the installation, ignore him.

    What are the risks to ignore it.

    Thank you

    SAPH

    Do you mean that the removal of the unnecessary versions sql server solve the problem?

    It of a serious issue or are you just trying to make fun of me?
    For you rhetorical question: if I would have taken it without being the solution, I wrote this down?

    -----------
    Sybrand Bakker
    Senior Oracle DBA

  • Cannot run programs or restore Windows - error not able to detect options or environment variables

    original title: HELP!

    My netbook has changed, windows is no longer genuine, I can't run the tasks, restoring, recovering, absolutely nothing, not even download any help whatsoever.  I need help, I don't know if I was in charge by another entity, a virus or what, but I was totally disabled.  I can always get on line and access basic information about my computer.  An error message that comes up often is "not being able to detect options or environment variables.  In my view, that it is a virus that has locked all forms of assistance and recovery.   What can I do?   Help

    also I can't turn on my firewall and my current antivirus says that everything is ok.  It is not the case.  This problem started when a website popped up and said that I had been infected that I have to pay and download their program to save my computer.  This program would go not far, my current antivirus, locking and it kept popping up again and again until finally I ended up with a green background and disabled the system.

    This problem started when a website popped up and said that I had been infected that I have to pay and download their program to save my computer.


    It seems you have been affected and have installed malware now. It is a common program of scareware designed to trick you out if your money
    I suggest that you get better results here:
  • ARE does not recognize an environment variable

    Hello comrades,.

    On my Win 7 system, I redefined the HOME as C:\Users\bnks environment variable (by default, this is C:\Documents and Settings\Users\bnks).

    I would like to save an FM file to C:\Users\bnks\Checkout\Test\, so in my extendscript, I defined the following variable:


    docLib var = ' ~-Checkout-Test".


    where the tilde (~) must be analyzed by extendscript as HOME environment variable (according to Chapter 3, 'Access to system files' in the JavaScript Tools Guide).


    Unfortunately, the tilde is ignored when I try to save the file:

    ...

    var DNAME = docLib + rName + "FM".

    doc. Record (dname, saveParams, returnParams);

    ...


    No idea why this is happening?


    Thank you!!!



    The tilde does not work for me or the other (FM11), but you can get the value of an environment variable with $. getenv():

    docLib var = $.getenv ("HOME") + "\\Checkout\\Test\\";

  • TUXDIR environment variable not defined!

    Hello


    When I psadmin Launcher (in E:\HCM90PT849\appserv on a Win2003 Server) I get:

    ERROR: Could not open the Windows registry key for the environment variable T.
    TUXDIR environment variable not defined!

    But:
    SET 
    TUXDIR=C:\bea\Tuxedo9.1
    I don't understand.

    Any help?
    Thank you.

    Have you changed something? Is this a new installation?
    There was a similar thread a few days ago, have you checked it?
    Cannot install Tuxedo 9.1

    Nicolas.

  • Transition from UNIX to RMAN environment variables fails

    Hi gurus,

    Environment like below

    Oracle Versrion - 11.2.0.2.0

    OS - Linux RHEL 5

    RAC - Yes. node 2.

    My backup script fails when I set up the configuration of RMAN with unix environment variables. Error like below

    ERROR

    ---------

    RMAN-03002: failure of the command configures the 03/09/2014 02:28:33

    ORA-15124: ASM '+ DG_DATA/${ORACLE_SID}/snapcf_${ORACLE_SID}.f' file name contains an invalid alias name


    I created a text file of configuration rman with all the configuration as below. When I call the file rman_config from the Sheel script, it takes all the except statement environment variables to CONFIGURE snapshot. Did I miss something in the syntax or is not possible to pass environment variables in RMAN which includes ASM statements.


    Help, please.


    CONFIGURE the SNAPSHOT CONTROLFILE NAME to "+ DG_DATA/${ORACLE_SID}/snapcf_${ORACLE_SID}.f";

    Configure retention policy to recovery of 7-day window;

    Configure controlfile autobackup on;

    Configure controlfile autobackup peripheral type disc format in ' ${backup_dir}/${ORACLE_SID}/backup_controlfiles/%F';}

    Configure channel 1 device type disk format ' ${backup_dir}/${ORACLE_SID}/%d_t%t_s%s_p%p';}

    SET UP THE DEVICE TYPE DISK PARALLELISM 8 TYPE OF BACKUP BACKUPSET.

    run

    {

    Configure exclude them for the tablespace "SEA_DATA";

    Filesperset to compressed backupset database backup 1.

    Configure exclude them for the tablespace "SEA_DATA" clear;

    Backup to compressed backupset tablespace sea_data SECTION SIZE 240 G;

    backup current controlfile of Eve format='${backup_dir}/${ORACLE_SID}/stdby_controlfiles/%U';

    SQL "backup controlfile alter database path as"${backup_dir}/${ORACLE_SID}/backup_controlfiles/${ORACLE_SID}_ctl.${dt}.${u_no}.sql";"

    SQL 'alter system archive log current;

    ARCHIVELOG backup time 'sysdate-0, 5';

    }

    cross-checking of completed database before backup ' sysdate - 8';

    overlap archivelog all completed before ' sysdate - 8';

    backup before completed controlfile overlap ' sysdate - 10';

    Force delete expired backup is complete before ' sysdate - 8';

    force expired delete archivelog all completed before ' sysdate - 8';

    Force delete expired backup of controlfile completed before ' sysdate - 10';

    Configure controlfile autobackup format of disc type device to "%f"

    Configure the clear device type disk.

    Kind regards

    Lancerique.

    try without {}:

    CONFIGURE the SNAPSHOT CONTROLFILE NAME to "+ DG_DATA/$ORACLE_SID/snapcf_$ORACLE_SID.f";

    It worked for me (independent, no asm):

    . /etc/.bash_profile

    backup_dir = ' / u01/app/oracle/fast_recovery_area.

    Target system/oracle RMAN<>

    CONFIGURE the SNAPSHOT CONTROLFILE NAME to '$backup_dir/$ORACLE_SID/snapcf_$ORACLE_SID.f ';

    Configure retention policy to recovery of 7-day window;

    Configure controlfile autobackup on;

    Configure controlfile autobackup format disk device type to '$backup_dir/$ORACLE_SID/backup_controlfiles/%F ';

    Configure the format of disc type channel 1 device "$backup_dir/$ORACLE_SID/%d_t%t_s%s_p%p";

    SET UP THE DEVICE TYPE DISK PARALLELISM 8 TYPE OF BACKUP BACKUPSET.

    run

    {

    Configure exclude them for the tablespace 'USERS ';

    Filesperset to compressed backupset database backup 1.

    Configure exclude them for the tablespace 'USERS' clear;

    Backup to compressed backupset tablespace USERS SECTION SIZE 240 G;

    backup current controlfile of Eve format='$backup_dir/$ORACLE_SID/stdby_controlfiles/%U';

    SQL "backup controlfile alter database path as"$backup_dir/$ORACLE_SID/backup_controlfiles/$ORACLE_SID_ctl.sql";"

    SQL 'alter system archive log current;

    ARCHIVELOG backup time 'sysdate-0, 5';

    }

    cross-checking of completed database before backup ' sysdate - 8';

    overlap archivelog all completed before ' sysdate - 8';

    backup before completed controlfile overlap ' sysdate - 10';

    Force delete expired backup is complete before ' sysdate - 8';

    force expired delete archivelog all completed before ' sysdate - 8';

    Force delete expired backup of controlfile completed before ' sysdate - 10';

    Configure controlfile autobackup format of disc type device to "%f"

    Configure the clear device type disk.

    EXIT;

    EXPRESSIONS OF FOLKLORE

  • Windows system environment variables in "Sql * more»

    Can I use/reference of Windows system environment variables in "Sql * more?
    For example, I want to create sql-script runs in the database server computer that variable is "ORA_HOME", uses this value to perform a few sentences of sql/plsql.

    Oracle 10g personal, Windows 7.

    Edited by: CharlesRoos the 12.11.2010 17:28

    CharlesRoos wrote:
    The business problem:
    I created 2 databases in my computer. The two databases needs storage created by a script. The names of data files (.dbf files) of storage are the same for the two database. The two database has its own directory, where it holds data for the moment files. At the moment the data files for Database1 are in the folder something like '% ORACLE_HOME%"\oradata\%databasename1%\*.dbf and the second base of data has its data files in the other folder, somewhere '' % ORACLE_HOME%"\oradata\%databasename1%\*.dbf'. Now I want the script to create the tablespace called "INDX" with the same data file name "indx1.dbf" in the two database. If in the two documents mentioned the 'indx1.dbf' file must be created by the script. I think the script must do following:

    1. get ORACLE_HOME.
    2. connect to database "databasename1"
    3. EXECUTE IMMEDIATE "Create TableSpace INDX....file=%ORACLE_HOME% || databasename1 || indx1.dbf"
    4. connect to database "databasename2"
    5. EXECUTE IMMEDIATE "Create TableSpace INDX....file=%ORACLE_HOME% || databasename2 || indx1.dbf"
    

    I don't have database Oracle close more, if the code was pseudo-code.

    ---

    I do not understand how to use?-shortcut.

    OK, my first impression is ' why must even be scripted? Creation of new spaces of storage is usually a one-off operation.

    But what side this substitution of sqlplus command line variables. This example is Linux, but works on Windows with the change in the way environment variables are referenced:

    * echo nix - $myvariable
    Windows - echo myvariable %

    First of all, sqlscript to create the TS. Note the use of the substitution variable '& 1 '.
    {code}
    [oracle@vmlnx01 ~] $ cat makets.sql cat
    set echo on the comments on check on trimsp on
    Guest & 1
    --
    CREATE TABLESPACE EDSTEST PETIT_FICHIER
    DATAFILE ' / ora01/oradata/&1/edstest.dbf'
    SIZE 5 M
    REUSE
    AUTOEXTEND ON
    NEXT 1280K
    MAXSIZE 32767M
    LOGGING
    LOCAL MANAGEMENT MEASURE
    SEGMENT SPACE MANAGEMENT AUTO
    ;
    --
    Drop tablespace edstest
    including content and data files
    ;
    output
    {code}

    Thus, the OS invites: note that the @ is separated by a space, which makes a parm from command line instead of the part of the connection string

    {code}
    [oracle@vmlnx01 ~] $ export myparm = vlnxora1
    [oracle@vmlnx01 ~] $ sqlplus system/pswd @makets $myparm

    SQL * more: Release 10.2.0.4.0 - Production on Fri Nov 12 18:13:05 2010

    Copyright (c) 1982, 2007, Oracle. All rights reserved.

    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With partitioning, OLAP, Data Mining and Real Application Testing options

    SQL > prompt & 1
    vlnxora1
    SQL >--
    SQL > CREATE TABLESPACE EDSTEST PETIT_FICHIER
    2 DATAFILE ' / ora01/oradata/&1/edstest.dbf'
    3 SIZE 5 M
    4 REUSE
    5 AUTOEXTEND ON
    6. THE NEXT 1280K
    7 MAXSIZE 32767M
    8 LOGGING
    MEASURE 9 LOCAL MANAGEMENT
    10 SEGMENT SPACE MANAGEMENT AUTO
    11;
    2 old: DATAFILE ' / ora01/oradata/&1/edstest.dbf'
    2 new: DATAFILE ' / ora01/oradata/vlnxora1/edstest.dbf'

    Created tablespace.

    SQL >--
    SQL > drop tablespace edstest
    2 content and data files including
    3;

    Tablespace has fallen.

    SQL > exit
    Disconnected from the database to Oracle 10 g Enterprise Edition Release 10.2.0.4.0 - Production
    With partitioning, OLAP, Data Mining and Real Application Testing options
    [oracle@vmlnx01 ~] $
    {code}

  • Environment variables in the terminal

    Hi all

    Im trying to put my oracle environment variables in the linux terminal so that I can start SQL Plus.

    What im trying to put seems to map in the directories on my system but I'm not able to run SQLplus... maybe im lack obvious somehting?

    All ideas, follows a Terminal session:
    [matt@localhost ~]$ export ORACLE_BASE=/u01/app/oracle
    [matt@localhost ~]$ export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
    [matt@localhost ~]$ export ORACLE_SID=orcl
    [matt@localhost ~]$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    [matt@localhost ~]$ export PATH=$ORACLE_HOME/bin:$PATH
    [matt@localhost ~]$ export EDITOR=/usr/bin/vi
    [matt@localhost ~]$ sqlplus /nolog
    bash: sqlplus: command not found

    Question not a basis data, but anyway...

    Check if you have set the correct path.

    $ls -l  /u01/app/oracle/product/11.2.0/dbhome_1/bin/sqlplus
    
  • ORA-07217: sltln: environment variable cannot be evaluated.

    Hi all;


    DLOG = 'date + "a_ hour" ' export DLOG


    RMAN > backup backupset incremental compressed level 0 DATABASE FORMAT ' / u04/oradata/PDT003/weekly_bkp_$ (DLOG)'

    TAG WEEKLY_BACKUP INCLUDE CURRENT CONTROLFILE;


    Please watch this above command of rman backup that I run with a bash script. It gives me following error.


    channel ORA_DISK_1: starting piece 1 at 18 - SEP-15

    RMAN-03009: failure of the backup command on the channel ORA_DISK_1 at 18/09/2015 03:21:19

    ORA-07217: sltln: environment variable cannot be evaluated.

    No idea how to overcome? He took my 3 days from now.

    Hello

    1. it is tag format that should be unique - http://docs.oracle.com/cd/B28359_01/backup.111/b28273/rcmsubcl010.htm

    Check out the demo below, the sound works perfectly for me

    #! / bin/sh

    DLOG = ' date + «a_ hour»»
    Export DLOG
    echo "setting of my variable: $DLOG"

    echo "launched backup."

    RMAN target /.<>
    backup incremental backupset compressed level 0 FORMAT of DATABASE ' / u03/backup/weekly_bkp_$ (DLOG)' TAG WEEKLY_BACKUP INCLUDE CURRENT CONTROLFILE;
    "exit";
    EXPRESSIONS OF FOLKLORE

    echo "Backup complete".

    Wrong Code always my backup script - test scenario
    =================================

    [backup oracle@primary] $ sh test.sh
    My variable definition: a_19
    Backup started
    test.sh: line 9: DLOG: command not found

    Recovery Manager: release 11.2.0.3.0 - Production Wed Sep 23 19:46 2015

    Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

    connected to target database: PROD (DBID = 300203881)

    RMAN >
    From backup to 23-SEP-15
    using the control file of the target instead of recovery catalog database
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID = 37 type device = DISK
    channel ORA_DISK_1: starting from compressed backup set incremental level 0 datafile
    channel ORA_DISK_1: specifying datafile (s) in the backup set
    Enter a number of file datafile = 00001 name=/u03/prod/prod_pr/system01.dbf
    Enter a number of file datafile = name=/u03/prod/prod_pr/sysaux01.dbf 00002
    Enter a number of file datafile = 00005 name=/u03/prod/prod_pr/example01.dbf
    Enter a number of file datafile = name=/u03/prod/prod_pr/undotbs01.dbf 00003
    Enter a number of file datafile = name=/u03/prod/prod_pr/users01.dbf 00004
    channel ORA_DISK_1: starting piece 1 to 23 - SEP-15
    channel ORA_DISK_1: finished piece 1 to 23 - SEP-15
    total, handle = / backup/u03/weekly_bkp_ tag = comment WEEKLY_BACKUP = NONE
    channel ORA_DISK_1: complete set of backups, time: 00:00:55
    channel ORA_DISK_1: starting from compressed backup set incremental level 0 datafile
    channel ORA_DISK_1: specifying datafile (s) in the backup set
    including the current control in the backup set file
    including current SPFILE in the backup set
    channel ORA_DISK_1: starting piece 1 to 23 - SEP-15
    RMAN-00571: ===========================================================
    RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =.
    RMAN-00571: ===========================================================
    RMAN-03009: failure of the backup command on the channel ORA_DISK_1 at 23/09/2015-19:46:59
    ORA-19504: cannot create the file ' / u03/backup/weekly_bkp_.
    ORA-27038: created file already exists
    Additional information: 1

    RMAN >

    Complete recovery manager.
    Backup is complete

    RMAN > list backup;

    using the control file of the target instead of recovery catalog database

    List of backup sets
    ===================

    Time of accomplishment BS key Type LV size device Type elapsed time
    ------- ---- -- ---------- ----------- ------------ ---------------
    1 incr 0 M DISK 00:00:49 23-SEVEN 289,91.-15
    BP key: 1 location: AVAILABLE Tablet: YES Tag: WEEKLY_BACKUP

    [backup oracle@primary] $ ls-l
    Total 296888
    -rwxr-xr-x. 1 oracle oinstall 317 23 Sep 19:45 test.sh
    -rw - r-. 1 oracle oinstall 304005120 23 Sep 19:46 weekly_bkp_

    backup incremental backupset compressed level 0 DATABASE FORMAT ' / u03/backup/weekly_bkp_$ (DLOG)' TAG WEEKLY_BACKUP INCLUDE CURRENT CONTROLFILE;... WrongCode of $(DLOG)

    Fix the Code - test scenario 2
    ==============
    1 code .fixing now
    2. change of $(DLOG)... $DLOG

    RMAN target /.<>
    backup incremental backupset compressed level 0 DATABASE FORMAT ' / u03/backup/weekly_bkp_$ DLOG' TAG WEEKLY_BACKUP INCLUDE CURRENT CONTROLFILE;

    [backup oracle@primary] $ sh test.sh
    My variable definition: a_19
    Backup started

    Recovery Manager: release 11.2.0.3.0 - Production Wed Sep 23 19:48:58 2015

    Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

    connected to target database: PROD (DBID = 300203881)

    RMAN >
    From backup to 23-SEP-15
    using the control file of the target instead of recovery catalog database
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID = 27 type device = DISK
    channel ORA_DISK_1: starting from compressed backup set incremental level 0 datafile
    channel ORA_DISK_1: specifying datafile (s) in the backup set
    Enter a number of file datafile = 00001 name=/u03/prod/prod_pr/system01.dbf
    Enter a number of file datafile = name=/u03/prod/prod_pr/sysaux01.dbf 00002
    Enter a number of file datafile = 00005 name=/u03/prod/prod_pr/example01.dbf
    Enter a number of file datafile = name=/u03/prod/prod_pr/undotbs01.dbf 00003
    Enter a number of file datafile = name=/u03/prod/prod_pr/users01.dbf 00004
    channel ORA_DISK_1: starting piece 1 to 23 - SEP-15
    channel ORA_DISK_1: finished piece 1 to 23 - SEP-15
    total, handle = / backup/u03/weekly_bkp_a_19 tag = comment WEEKLY_BACKUP = NONE
    channel ORA_DISK_1: complete set of backups, time: 00:00:55
    channel ORA_DISK_1: starting from compressed backup set incremental level 0 datafile
    channel ORA_DISK_1: specifying datafile (s) in the backup set
    including the current control in the backup set file
    including current SPFILE in the backup set
    channel ORA_DISK_1: starting piece 1 to 23 - SEP-15
    RMAN-00571: ===========================================================
    RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =.
    RMAN-00571: ===========================================================
    RMAN-03009: failure of the backup command on the ORA_DISK_1 channel to 23/09/2015-19:49:56
    ORA-19504: cannot create the file ' / u03/backup/weekly_bkp_a_19.
    ORA-27038: created file already exists
    Additional information: 1

    RMAN >

    Complete recovery manager.
    Backup is complete
    [backup oracle@primary] $ ls - tl
    296924 total
    -rw - r-. 1 oracle oinstall 304046080 Sep 23 19:49 weekly_bkp_a_19 - naming convention good code wise but not with the prospect of rman
    -rwxr-xr-x. 1 oracle oinstall 315 23 September 19:48 test.sh

    Now the format that we cannot solve the format fixed for rman, you need to change it if you see above error
    Change to generated %U...system

    Test case 3 - worked perfectly

    RMAN target /.< eof="">
    backup incremental backupset compressed level 0 FORMAT of DATABASE ' / u03/backup/weekly_bkp_${DLOG}_%U' WEEKLY_BACKUP TAG INCLUDE CURRENT CONTROLFILE;.. reason format

    [backup oracle@primary] $ sh test.sh
    My variable definition: a_19
    Backup started

    Recovery Manager: release 11.2.0.3.0 - Production Wed Sep 23 19:53:02 2015

    Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

    connected to target database: PROD (DBID = 300203881)

    RMAN >
    From backup to 23-SEP-15
    using the control file of the target instead of recovery catalog database
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID = 36 type device = DISK
    channel ORA_DISK_1: starting from compressed backup set incremental level 0 datafile
    channel ORA_DISK_1: specifying datafile (s) in the backup set
    Enter a number of file datafile = 00001 name=/u03/prod/prod_pr/system01.dbf
    Enter a number of file datafile = name=/u03/prod/prod_pr/sysaux01.dbf 00002
    Enter a number of file datafile = 00005 name=/u03/prod/prod_pr/example01.dbf
    Enter a number of file datafile = name=/u03/prod/prod_pr/undotbs01.dbf 00003
    Enter a number of file datafile = name=/u03/prod/prod_pr/users01.dbf 00004
    channel ORA_DISK_1: starting piece 1 to 23 - SEP-15
    channel ORA_DISK_1: finished piece 1 to 23 - SEP-15
    total, handle = / backup/u03/weekly_bkp_05qht9kv_1_1 tag = comment WEEKLY_BACKUP = NONE
    channel ORA_DISK_1: complete set of backups, time: 00:00:55
    channel ORA_DISK_1: starting from compressed backup set incremental level 0 datafile
    channel ORA_DISK_1: specifying datafile (s) in the backup set
    including the current control in the backup set file
    including current SPFILE in the backup set
    channel ORA_DISK_1: starting piece 1 to 23 - SEP-15
    channel ORA_DISK_1: finished piece 1 to 23 - SEP-15
    total, handle = / backup/u03/weekly_bkp_06qht9mm_1_1 tag = comment WEEKLY_BACKUP = NONE
    channel ORA_DISK_1: complete set of backups, time: 00:00:01
    Backup finished 23-SEP-15

    RMAN >

    Complete recovery manager.
    Backup is complete
    [backup oracle@primary] $

    [backup oracle@primary] $ ls - tl

    Total 298188

    -rw - r-. 1 oracle oinstall 1097728 23 Sep 19:58 weekly_bkp_a_19_08qht9v5_1_1

    -rw - r-. 1 oracle oinstall 304242688 23 Sep 19:58 weekly_bkp_a_19_07qht9te_1_1

    -rwxr-xr-x. 1 oracle oinstall 320 23 September 19:57 test.sh

    It could be that useful now

    -Pavan Kumar N

  • connects not shipping to new sleep

    Well, here I am again... I've recreated the complete environment of DGTEST made a pass (following the instructions of http://www.visi.com/~mseberg/data_guard/Data_Guard_switchover.html) and after the crossing (now primary) sleep mode my log files are not shipped to the original primary server.

    I can't find anything wrong, and tnsping works as it should for services as well as the database.

    Wire Ref.: primary db newspapers going $OH / dbs location standby instead of dest_1

    Maybe I have an error in configuration net somewhere...
    From the NEW primary database server:  "brahe"
    ===================================
    
    $ [brahe] <DGTEST> /oracle/product/db/11.2.0.2/dbs>sqlplus / as sysdba
    
    SQL*Plus: Release 11.2.0.2.0 Production on Wed Apr 3 12:36:01 2013
    
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    
    
    SQL> connect sys/sys@DGTEST_DG1 as sysdba
    ERROR:
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    
    
    Warning: You are no longer connected to ORACLE.
    SQL> connect sys/sys@DGTEST as sysdba
    ERROR:
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    But still, I can't tnsping throughout the day with no problems...
    From the NEW primary database server:  "brahe"
    ===================================
    $ [brahe] <DGTEST> /oracle/product/db/11.2.0.2/dbs>tnsping DGTEST
    
    TNS Ping Utility for Linux: Version 11.2.0.2.0 - Production on 03-APR-2013 12:00:46
    
    Copyright (c) 1997, 2010, Oracle.  All rights reserved.
    
    Used parameter files:
    
    
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = kepler.nnet)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = DGTEST) (UR = A)))
    OK (0 msec)
    $ [brahe] <DGTEST> /oracle/product/db/11.2.0.2/dbs>tnsping DGTEST_DG1
    
    TNS Ping Utility for Linux: Version 11.2.0.2.0 - Production on 03-APR-2013 12:00:52
    
    Copyright (c) 1997, 2010, Oracle.  All rights reserved.
    
    Used parameter files:
    
    
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = kepler.nnet)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = DGTEST) (UR = A)))
    OK (0 msec)
    $ [brahe] <DGTEST> /oracle/product/db/11.2.0.2/dbs>tnsping DGTEST_DG2
    
    TNS Ping Utility for Linux: Version 11.2.0.2.0 - Production on 03-APR-2013 12:00:59
    
    Copyright (c) 1997, 2010, Oracle.  All rights reserved.
    
    Used parameter files:
    
    
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = brahe.nnet)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = DGTEST) (UR = A)))
    OK (10 msec)
    On the new Standby server:  "kepler"
    =========================
    $ [kepler] <DGTEST> /oracle/product/db/11.2.0.2/dbs>lsnrctl services
    
    LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 03-APR-2013 12:39:53
    
    Copyright (c) 1991, 2010, Oracle.  All rights reserved.
    
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=kepler.nnet)(PORT=1521)))
    Services Summary...
    Service "DGTEST_DG1" has 1 instance(s).
      Instance "DGTEST", status READY, has 1 handler(s) for this service...
        Handler(s):
          "DEDICATED" established:0 refused:0 state:ready
             LOCAL SERVER
    The command completed successfully
    
    
    $ [kepler] <DGTEST> /oracle/product/db/11.2.0.2/dbs>lsnrctl status
    
    LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 03-APR-2013 12:39:57
    
    Copyright (c) 1991, 2010, Oracle.  All rights reserved.
    
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=kepler.nnet)(PORT=1521)))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production
    Start Date                02-APR-2013 14:20:11
    Uptime                    0 days 22 hr. 19 min. 46 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /oracle/product/db/11.2.0.2/network/admin/listener.ora
    Listener Log File         /oracle/product/diag/tnslsnr/kepler/listener/alert/log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=kepler.nnet)(PORT=1521)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
    Services Summary...
    Service "DGTEST_DG1" has 1 instance(s).
      Instance "DGTEST", status READY, has 1 handler(s) for this service...
    The command completed successfully

    Ok

    SID_LIST_LISTENER

    Are you listener named 'DGTEST '?

    Mine is the default so I use SID_LIST_LISTENER. If I remember correctly from its SID_LIST_

    Otherwise, mine looks like:

    # listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0.3/network/admin/listener.ora
    # Generated by Oracle configuration tools.
    
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521))
          (ADDRESS = (PROTOCOL = IPC)(KEY = REGISTER))
        )
      )
    
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = PLSExtProc)
          (ORACLE_HOME = /u01/app/oracle/product/11.2.0.3)
          (PROGRAM = extproc)
        )
       (SID_DESC =
          (global_dbname = STANDBY_DGMGRL.myhost)
          (ORACLE_HOME = /u01/app/oracle/product/11.2.0.3)
          (sid_name = STANDBY)
        )
      )                    
    
    ADR_BASE_LISTENER = /u01/app/oracle
    
    INBOUND_CONNECT_TIMEOUT_LISTENER=120
    

    The ADR_BASE_LISTENER and the INBOUND_CONNECT_TIMEOUT_LISTENER should not cause you error.

    Sometimes, a rogue in the file will be.

    I think lsnrctl status does not LOAN show.

    I believe that we are close. (kind of pleasure, with the exception of the works do not)

    Best regards

    mseberg

  • v$ session interpreted as environment variable under unix

    Hi all
    I want to run a Unix shell script sql command, which queries a table v$ session. I enclose the script below.

    VI a2.sh
    #!/bin/sh
    echo "collect stat"
    sqlplus -s usr_name/pwd@orcl<<EOF
    select ss.username,se.SID,VALUE/100 cpu_usage_seconds from v$session ss,v$sesstat se,v$statname sn where se.STATISTIC# = sn.STATISTIC# and NAME like '%CPU used by this session%' and    se.SID = ss.SID and    ss.status='ACTIVE' and ss.username is not null order by VALUE desc;
    EOF
    My output is:

    A2.sh
    collect stat
    select ss.username,se.SID,VALUE/100 cpu_usage_seconds from v ss,v se,v sn where se.STATISTIC# = sn.STATISTIC# and NAME like '%CPU used by this session%' and se.SID = ss.SID and    ss.status='ACTIVE' and ss.username is not null order by VALUE desc
                                                                         *
    ERROR at line 1:
    ORA-00942: table or view does not exist
    Someone could suggest me, is it possible in what way I can put all the variables or changes environment oracle/unix and oracle installation can understand that it is a table name and not an environment variable?

    I have the script running with '-' as an escape character in front of the ' $'. I wanted to know if there is another way.

    You use here document, so you have the choice - either escape you each shell simple metacharacter in document here as already suggested, or get away just like below:

    [oracle ~]$ cat t.sh
    #!/bin/sh
    echo "collect stat"
    sqlplus -s scott/tiger@O11202<<\EOF
    select ss.username,se.SID,VALUE/100 cpu_usage_seconds from v$session ss,v$sesstat se,v$statname sn where se.STATISTIC# = sn.STATISTIC# and NAME like '%CPU used by this session%' and    se.SID = ss.SID and    ss.status='ACTIVE' and ss.username is not null order by VALUE desc;
    EOF
    
    [oracle ~]$ ./t.sh
    collect stat
    
    USERNAME                              SID CPU_USAGE_SECONDS
    ------------------------------ ---------- -----------------
    SCOTT                                 149                 0
    SCOTT                                 149                 0
    SCOTT                                 149                 0
    SCOTT                                 149                 0
    

    So, escaping from the EOF of the document means here, all included metacharacters are ignored.

    Best regards

    Maxim

Maybe you are looking for