Unix shell: Environment variable works for file system but not for ASM path

We would like to switch from file system to ASM for data files of Oracle tablespaces. For the path of the data files, we have so far used environment variables, e.g.,
CREATE TABLESPACE BMA DATAFILE '${ORACLE_DB_DATA}/bma.dbf' SIZE 2M AUTOEXTEND ON;
This works just fine (from shell scripts, PL/SQL packages, etc.) if ORACLE_DB_DATA denotes a file system path, such as "/home/oracle", but doesn’t work if the environment variable denotes an ASM path like "\+DATA/rac/datafile". I assume that it has something to do with "+" being a special character in the shell. However, escaping "\+" didn’t work. I tried with both bash and ksh.
Oracle managed files (e.g., set DB_CREATE_FILE_DEST to +DATA/rac/datafile) would be an option. However, this would require changing quite a few scripts and programs. Therefore, I am looking for a solution with the environment variable. Any suggestions?
The example below is on a RAC Attack system (http://en.wikibooks.org/wiki/RAC_Attack_-OracleCluster_Database_at_Home). I get the same issues on Solaris/AIX/HP-UX on 11.2.0.3 also.
Thanks,
Martin
==== WORKS JUST FINE WITH ORACLE_DB_DATA DENOTING FILE SYSTEM PATH ====
collabn1:/home/oracle[RAC1]$ export ORACLE_DB_DATA=/home/oracle
collabn1:/home/oracle[RAC1]$ sqlplus "/ as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Fri Aug 24 20:57:09 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> CREATE TABLESPACE BMA DATAFILE '${ORACLE_DB_DATA}/bma.dbf' SIZE 2M AUTOEXTEND ON;
Tablespace created.
SQL> !ls -l ${ORACLE_DB_DATA}/bma.dbf
-rw-r----- 1 oracle asmadmin 2105344 Aug 24 20:57 /home/oracle/bma.dbf
SQL> drop tablespace bma including contents and datafiles;
==== DOESN’T WORK WITH ORACLE_DB_DATA DENOTING ASM PATH ====
collabn1:/home/oracle[RAC1]$ export ORACLE_DB_DATA="+DATA/rac/datafile"
collabn1:/home/oracle[RAC1]$ sqlplus "/ as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Fri Aug 24 21:08:47 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> CREATE TABLESPACE BMA DATAFILE '${ORACLE_DB_DATA}/bma.dbf' SIZE 2M AUTOEXTEND ON;
CREATE TABLESPACE BMA DATAFILE '${ORACLE_DB_DATA}/bma.dbf' SIZE 2M AUTOEXTEND ON
ERROR at line 1:
ORA-01119: error in creating database file '${ORACLE_DB_DATA}/bma.dbf'
ORA-27040: file create error, unable to create file
Linux Error: 2: No such file or directory
SQL> -- works if I substitute manually
SQL> CREATE TABLESPACE BMA DATAFILE '+DATA/rac/datafile/bma.dbf' SIZE 2M AUTOEXTEND ON;
Tablespace created.
SQL> drop tablespace bma including contents and datafiles;

My revised understanding is that it is not a shell issue with replacing +, but an Oracle problem. It appears that Oracle first checks whether the path starts with a "+" or not. If it does not (file system), it performs the normal environment variable resolution. If it does start with a "+" (ASM case), Oracle does not perform environment variable resolution. Escaping, such as "\+" instead of "+" doesn't work either.
To be more specific regarding my use case: I need the substitution to work from SQL*Plus scripts started with @script, PL/SQL packages with execute immediate, and optionally entered interactively in SQL*Plus.
Thanks,
Martin

Similar Messages

  • Risk terminator - Works in one system but not in the other

    Hi
    I have two SAP systems which is connected to one GRC system. Risk Terminator works well for the one system but does not work at all for the other.
    I have done the necessary configuration, set-up the RFC connector, tested the connectors, tested the connections from the GRC system. All seems fine but when I create a role in PFCG risk terminator does not seem to be trigged at all in my one system.
    Please advise
    Regards
    Mo

    I would check the adapter for the other system and that the external program is maintained correctly along with all the settings in /VIRSA/ZRTCNFG

  • FM CRM_PRIDOC_READ_OW works in source system but not when executed from BW

    Hello All,
    I have extended an extractor in the source system by adding additional fields.
    One of the FM I've used is CRM_PRIDOC_READ_OW. When I run an extraction test in the source system eveything works and data does populates into the new fields.But when I run the infopackage from the BW side, I get an error message which saids the transaction has been terminated. I've been able to trace and pinpoint the possible cause of the error. When I do not call this FM, the infopackage finishes but I do not get data for the new fields and when I do call this FM, I get the error.
    Has anyone experiance this issue before?
    Your assistance will be much appreciated. Here is a portion of the code I wrote:
      loop at I_TABLE into l_s_ZASCRM_OPPT_I.
        lv_guid = l_s_ZASCRM_OPPT_I-GUID.
        lv_item_guid = l_s_ZASCRM_OPPT_I-ITEM_GUID.
        call function 'CRM_PRIDOC_READ_OW'
          exporting
          iv_header_guid = lv_guid
          importing
          ES_PRIDOC = ls_pridoc.
        loop at ls_pridoc-PRIC_COND into ls_pric_cond.
          if ls_pric_cond-kposn = lv_item_guid.
            case ls_pric_cond-STUNR.
              when '40'.
                l_s_ZASCRM_OPPT_I-zz_gpm_ttl_i = ls_pric_cond-kwert.
              when '55'.
                l_s_ZASCRM_OPPT_I-zz_gpd_ttl_i = ls_pric_cond-kwert.
              when '60'.
                l_s_ZASCRM_OPPT_I-zzfy_sp_i = ls_pric_cond-kwert.
              when '70'.
                l_s_ZASCRM_OPPT_I-zzfy_gpm_i = ls_pric_cond-kwert.
              when '80'.
                l_s_ZASCRM_OPPT_I-zzfy_gpd_i = ls_pric_cond-kwert.
            endcase.
          endif.
        endloop.
        append l_s_ZASCRM_OPPT_I to l_s_ZASCRM_OPPT_Itab.
        clear l_s_ZASCRM_OPPT_I.
      endloop
    Thanks,
    Jeff

    Hello Geo!
    Thank you for your question. I think we mapped all the systems you show. Always the same error. Concerning your systems my transport log would say:
    Source system R3DEV does not exist
    We mapped this.
    Any ideas? Is there maybe something in customizing to do what could be forgetten? The system is newly connected and there have never been a transport compounded to this source system before.
    Best regards,
    Peter

  • How to work with file system in linux within a JSF app?

    I use this line in my backing bean to log some events:
    FileHandler fhxml = new FileHandler("../webapps/MyWebApp/Log/MyWebAppLog.xml", append);
    fhxml.setFormatter(new XMLFormatter());That works fine in windows but when I deploy it in my Tomcat 6 in linux It doesn't work. How can I work with file system in linux?

    You should never use relative paths to access the filesystem. The path would be relative to the current working directory which is not per se the same in all environments. To convert a relative web path to an absolute file system path, you need ServletContext#getRealPath(). Use this absolute file system path in the java.io stuff. In a JSF application on top of Servlet API you can get the underlying ServletContext by ExternalContext#getContext().
    Alternatively, if the file is located in one of the default paths of the classpath or if its path is added to the classpath, you can also just use ExternalContext#getResource() or even #getResourceAsStream() using just the file name.

  • Hide a  type of file System wide not just the extension*

    Is it Possible & if So  Howto hide a type of file System wide not just the extension*
    Am trying to HIDE the Associated file for Photo Processing software in Finder, its a Specific file to the Program & holds the Raw data text Processed Info
    . Would mean I would need to change each File individually
    Is there a way/apple script?
    Knowledge or experience would be Appreciated
    Thanks

    I followed these instructions and they work, but I also get errors. Here are two files in the directire, and the contents of ~/.profile, I called the function killextension:
    I run the command to hide the PDF:
    Note the two errors. Thank you very much, BTW. No more Dropbox attributes files!  

  • Mavericks Server; smbd: File system does not support 0x0, time/size attrs

    So I recently installed a Mac Mini with Mavericks and Server 3.2.2 in the main office of my company and everything has been going well, minus a few expected bugs, until recently. Starting last week we've been experiencing random intervals where File Sharing stopped working altogether, and I'd been able to reboot and get it running again. Unfortunately, as I'm the Systems and Server Admin, I've been too busy to look at the logs until now (following the degradation of one of the drives in our DAT-Optic RAID system, I figured it was time to make it a priority), and I'm seeing dozens of entries in the system logs regarding the process smbd with file system does not support errors.
    Here's an example.
    11/19/14 9:56:21.107 AM smbd[602]: File system does not support 0X40000, file attrs
    11/19/14 9:56:21.107 AM smbd[602]: File system does not support 0X0 time attrs
    11/19/14 9:56:21.107 AM smbd[602]: File system does not support 0X0, size attrs
    11/19/14 9:56:21.107 AM smbd[602]: File system does not support 0X40000, file attrs
    11/19/14 9:56:21.107 AM smbd[602]: File system does not support 0X0 time attrs
    11/19/14 9:56:21.107 AM smbd[602]: File system does not support 0X0, size attrs
    11/19/14 9:56:21.108 AM smbd[602]: File system does not support 0X40000, file attrs
    11/19/14 9:56:21.108 AM smbd[602]: File system does not support 0X0 time attrs
    11/19/14 9:56:21.108 AM smbd[602]: File system does not support 0X0, size attrs
    11/19/14 9:56:21.108 AM smbd[602]: File system does not support 0X40000, file attrs
    11/19/14 9:56:21.108 AM smbd[602]: File system does not support 0X0 time attrs
    11/19/14 9:56:21.108 AM smbd[602]: File system does not support 0X0, size attrs
    11/19/14 9:56:21.110 AM smbd[602]: File system does not support 0X40000, file attrs
    11/19/14 9:56:21.110 AM smbd[602]: File system does not support 0X0 time attrs
    11/19/14 9:56:21.110 AM smbd[602]: File system does not support 0X0, size attrs
    11/19/14 9:56:21.119 AM smbd[602]: File system does not support 0X40000, file attrs
    11/19/14 9:56:21.119 AM smbd[602]: File system does not support 0X0 time attrs
    11/19/14 9:56:21.119 AM smbd[602]: File system does not support 0X0, size attrs
    11/19/14 9:56:21.119 AM smbd[602]: File system does not support 0X40000, file attrs
    11/19/14 9:56:21.119 AM smbd[602]: File system does not support 0X0 time attrs
    11/19/14 9:56:21.119 AM smbd[602]: File system does not support 0X0, size attrs
    11/19/14 9:56:21.124 AM smbd[602]: File system does not support 0X40000, file attrs
    11/19/14 9:56:21.124 AM smbd[602]: File system does not support 0X0 time attrs
    11/19/14 9:56:21.124 AM smbd[602]: File system does not support 0X0, size attrs
    11/19/14 9:56:21.124 AM smbd[602]: File system does not support 0X40000, file attrs
    11/19/14 9:56:21.124 AM smbd[602]: File system does not support 0X0 time attrs
    11/19/14 9:56:21.124 AM smbd[602]: File system does not support 0X0, size attrs
    11/19/14 9:56:21.125 AM smbd[602]: File system does not support 0X40000, file attrs
    11/19/14 9:56:21.125 AM smbd[602]: File system does not support 0X0 time attrs
    11/19/14 9:56:21.125 AM smbd[602]: File system does not support 0X0, size attrs
    11/19/14 9:56:21.125 AM smbd[602]: File system does not support 0X40000, file attrs
    11/19/14 9:56:21.125 AM smbd[602]: File system does not support 0X0 time attrs
    11/19/14 9:56:21.125 AM smbd[602]: File system does not support 0X0, size attrs
    11/19/14 9:56:21.130 AM smbd[602]: File system does not support 0X40000, file attrs
    11/19/14 9:56:21.130 AM smbd[602]: File system does not support 0X0 time attrs
    11/19/14 9:56:21.130 AM smbd[602]: File system does not support 0X0, size attrs
    11/19/14 9:56:21.131 AM smbd[602]: File system does not support 0X40000, file attrs
    As far as I can tell, nothing else has changed in our system except for the fact that one of the drives died and was rebuilt as of yesterday (these smbd problems extend to last week shortly after I updated to 3.2.2 I believe). Any help would be much appreciated. I would normally first attempt a repair permissions to see if the issue is related to a bad plist somewhere but the last time we did that, our ACLs were duplicated across our file share and often incorrectly. I'm not sure if it's just me but the last Mac Server software I used was Snow Leopard Server (when it was still a full OS version) and it was infinitely more stable than what I've experienced thus far with Server 3. Anyway, I appreciate any help/advice that can be given and I apologize for the rant.

    Been getting the same errors for a while.
    1/13/15 11:38:04.975 AM smbd[1112]: File system does not support 0X40000, file attrs
    1/13/15 11:38:04.975 AM smbd[1112]: File system does not support 0X0 time attrs
    1/13/15 11:38:04.975 AM smbd[1112]: File system does not support 0X0, size attrs
    1/13/15 11:38:05.124 AM smbd[1112]: File system does not support 0X40000, file attrs
    1/13/15 11:38:05.124 AM smbd[1112]: File system does not support 0X0 time attrs
    1/13/15 11:38:05.124 AM smbd[1112]: File system does not support 0X0, size attrs
    Believe they are related to random disconnects from the file server (10.9.5).

  • File Systems are not shown in CCMS Monitoring

    Hi Gurus,
    We have installed all SAP components in Solaris 10 zones including Solution Manager.
    Solaris File Systems are not shown in CCMS Monitoring under FileSystem. It looks like SAPOSCOL is not sending the OS data to CCMS. It does not show file systems in OS06 also.
    The probles exists on Systems runnig in Solaris 10 zones only and NOT on systems running on individual Servers. [without Solaris zones]
    Thanks,
    Pj

    Hi,
    You need take some special considerations while installing SOLMAN on SOLARIS 10 zones. Check these notes
    Note 870652 - Installation of SAP in a Solaris 10 zone
    Note 724713 - parameter settings for Solaris 10
    Hope this will solve your problem.
    --Ragu

  • The scroll function on my mousepad is disabled when viewing a pdf file in firefox version 5.0. The scroll works on the pdf, but not on the other tabs. When the pdf is closed, the scroll function returns to normal. Any ideas?!

    The scroll function on my mousepad is disabled when viewing a pdf file in firefox version 5.0. The scroll works on the pdf, but not on the other tabs. When the pdf is closed, the scroll function returns to normal. Any ideas?!

    Hey thanx for the help, it worked like a charm.
    I think firefox changed the application lay out, as I used to be able to choose my PDF opener from the list at " Adobe Acrobat Forms Document' where I could choose Nitro-PDF reader, but it has now moved all the way to the bottom like you suggested to the obvious place of "Portable Document Format" section.
    If someone didn't tell me , I wouldn't have scrolled all the way down to be able to find it... it really should be with all its cousins up the top...
    Cheers again..

  • In rz20 all file systems are not coming.

    Hi all.
    I have ccms configuration in local system not in central system menas every system there are own ccms configuration.
    File system In rz20 that all file systems are not coming.
    in os level there are like sapdata1,sapdata2.... & sapreorg but these file system are not coming in rz20.so we are not getting any alert regarding this file systems.
    Kindly suggest how can i fetch all the file system which are available in os level.
    thanks in advance.
    Thanks & regards,
    Laxmid

    Hi Kumar,
    Os -HP Unix
    In *RZ0> SAP CCMS Monitor Templates>Filesystems--->* these below file systems are not coming.Otheres are coming.
    /oracle/RXN/sapdata1
    /oracle/RXN/sapdata2
    /oracle/RXN/sapdata3
    /oracle/RXN/sapdata4
    /oracle/RXN/oraarch
    /oracle/RXN/sapreorg
    & please tell me there is one Lock & unlock is there in front of every node.what is this.
    Thanks & Regards
    Laxmi
    Edited by: laxmid on Feb 7, 2010 9:04 PM

  • Custome Tcode is not working in QA system but working in DEV system

    Hello,
    We have copied QM11 tacode to ZQM11. We found this ZQM11 tcode is not working in QA system, but properly working in DEV system. When we are execute this tcode from QA system with all required input, it says
    "No objects could be selected that met your selection criteria."
    But when do it in DEV system it is working fine. I have done following steps to check error
    1) All authorizations are good
    2) I have compared E070 and E071 table to found transport done with proper way.
    3) I have checked SE93, tcode condition is good.
    4) SE97 -->found call transaction is QM11 for ZQM11
    5) From program code level Authority check maintained properly.
    AUTHORITY-CHECK OBJECT 'Q_QMEL'
                 ID 'QMART'    FIELD I_QMART
                 ID 'TCD'      FIELD I_TCODE
                 ID 'WERKS'    DUMMY.
    6) Performed authorization trace to found error agains object Q_QMEL (RC =4), but in the role Q_QMEL has define with it's  proper value supplied by our functional team.
    7) Shows all active object in SU24 against ZQM11 are good
    8) When we call tcode it has thrown the error agains Q_QMEL only
    I am not able to understand why does not work this tcode in QA system, although working in DEV is good.
    Please help me to resolve this issue
    Thanks
    Pavel

    Bieng declared $WERKS field as DUMMY, is not relevant, so no matter its value, it will pass..
    There's a catch! If even DUMMY means literally that no matter user has any value, he is still authorized but in reality for such \fields authorization check is only successful when a value ' ' or * is found in user's authorization else it errors out.
    Sorry confused with programs where AUTHORITY-CHECK has  ' ' coded instead of DUMMY. You are right, DUMMY specified for as field would pass authorization check with any/no value in user's authorization. Please ignore my statement
    Sandipan
    Edited by: Sandipan Choudhury on Dec 29, 2010 2:11 AM

  • Is database using File system, RAW devices or ASM?

    Hi there
    Is is possible to find out if the database is using File system, RAW devices or ASM for storage?
    I think for ASM, we can tell by querying the V$DATAFILE view if it has ' DATA ' or something like that (a name that has ' ' prefixed to it). Is this the only way? How about other sotrage types (RAW and Filesystem)?
    Thanks in advance!

    user12033597 wrote:
    I think for ASM, we can tell by querying the V$DATAFILE view if it has ' DATA ' or something like that (a name that has ' ' prefixed to it). Is this the only way? How about other sotrage types (RAW and Filesystem)?V$DATAFILE or DBA_DATA_FILE
    Raw depends on your OS - in *nix, likely something like /dev/sdc1
    ASM depends on ASM and will include + and will follow an ASM pattern, such as described http://docs.oracle.com/cd/B19306_01/server.102/b14200/clauses004.htm
    File depends on OS - in *nix, likely start with a '/' and NOT be in /dev or /proc.  In Winders start with C:\ or some other disk path.
    Nicely discussed in the docs in the Administrators Guide found at http://tahiti.oracle.com

  • CSS '%% The File System is not mounted.' error.

    While I first thought that this was a hardware problem, I've had it happen to 3 of my CSS 11503s in the last 2 weeks. I logged into the CSS and found that the prompt had gone back to the default prompt. Upon further investigation, I was not able to do a write mem - it would just return the following error:
    %% The File System is not mounted.
    Has anyone seen this before? I went to reboot the unit, but I've lost access to it. I'm actually going to the datacenter today to check it further, but I was hoping someone might be able to tell me if this is a bug or software issue I might need to worry about. Any help would be appreciated. Thanks!
    Additional info:
    CSS 11503 - failover pair running in one-armed mode.
    Version: sg0730203 (07.30.2.03)
    Flash (Locked): 07.30.2.03
    Flash (Operational): 07.30.2.03
    Type: PRIMARY
    Licensed Cmd Set(s): Standard Feature Set
    Jason

    Looks like you have a hard disk failure.
    Reboot the CSS and let it go through a full diagnostic.
    If it does not work after reboot, you will need to replace the unit.
    If it works, this could be a one-time error.
    If the error comes back, definitely replace the box.
    Gilles.

  • HT1661 My mid-2009 MacBook Pro has just died via a painful (for me) hard drive failure. I backed up a good percentage of files recently but not enough to keep me happy.  I need to access the dead drive on the MBP via a 2008 iMac. Best options?

    My mid-2009 MacBook Pro has just died via a painful (for me) hard drive failure. I backed up a good percentage of files recently but not enough to keep me happy.  I need to access the dead drive on the MBP via a 2008 iMac. Best options?
    I have ordered a 800 firewire to 800 firewire cable and am hoping to use the target mode option to copy files from the MBP.
    Is this possible?
    Hope so!
    Any advice and or help would be greatly appreciated.
    Many thanks,
    Neil

    Thanks Ogelthorpe.
    Just bought an enclosure to try that also.
    Hoping the MBP isn't really dead but just feigning death
    Fingers crossed.

  • When I send an email with bcc recipients, the bcc does not show in my sent mail so I can't reference back later who I sent the email to. Worked in Snow Leopard but not in Yosemite. Please advise if their is fix for that.

    When I send an email with bcc recipients, the bcc does not show in my sent mail so I can't reference back later who I sent the email to. Worked in Snow Leopard but not in Yosemite. Please advise if their is fix for that.

    Did you select View->Bcc Address Field from the menu bar?

  • Html link to pdf works ok on mac but not on ipad. adobe reader for ipad downloaded.

    HTML link to pdf works ok on Mac but not on ipad. Adobe Reader for ipad downloaded. What's wrong?

    Hi pwillener,
    Thank for reply. The pdf’s are in a subfolder “PDF” of the folder holding the web page. The web page itself uses
    . This works in full size computer browsers but not in an iPad.
    My excursion through the search engine has produced the idea of adding #page = requesting page to the URL but I have not had time to try it perhaps without the = sign.
    Bryan

Maybe you are looking for

  • Streamlining win XP pro for music question

    Hello guys and gals I will soon be buying the EMU 1212M card and I have a spare 160Gb drive which I will partition so my question is as per topic but I would need some links to places that shows you how to streamline or disable the crap in windows th

  • How can I determine what is making FireFox slow?

    I am using FF 34.0.5 on Win 8.1 64-bit. It works very well, but occasionally it will get very noticeably slower. When I go to Task Manager, it reports FF is using 29-31% of my i5 3570K 3.4 GHz CPU. It continues to work, and does not use up more resou

  • Issue with printing of header text

    hii frnds , my problem is i am   getting the header text printed properly but the text is not getting displayed whenever the user enters a numeric value without any gaps ... i have seen while debuging that the text is properly getting fetched and the

  • Nomad Jukebox Zen firmware 1.00

    I know I am behind but I need to find . I went to the suggested site nomadness.net but no luck. If anyone has it could you email to me or point me to a current site?Thanks!

  • SRM 7.0 Copy customer data in follow on documents

    Dear Gurus, I have same set of field extension in shopping cart and RFx. When I create an RFx from an SC, I want that the data filled in the custom fields in SC be copied to corresponding fields in RFx. How can i achieve this? Do i need to activate a