Reading contents of asm through shell script

How to read contents of asm through shell script?
Please paste one small example also.
Thanks
Bala

Hello Bala,
The ASM contents is not visible from the operating system or its utilities. Only visible to database instances, RMAN, and other Oracle-supplied tools.
Please see http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/glossary.htm#sthref4105
Regards,
Rodrigo Mufalani
http://mufalani.blogspot.com

Similar Messages

  • Creating user account and setting password in Solaris9 through shell script

    I need to create and set password of user through shell scripts.
    User can be added successfully through "useradd" command but password cant be set through "passwd" command in script.
    Is there any other alternative for the same.

    Hi,
    Did you get the answere for this ? I have the same problem as urs , like I want to creat the users by using useradd and want to hardcode there password in one script.
    But I cant use expect utility which would have made my work easier

  • Calling sql through shell script

    How do i call a sql file through shell script in unix ?

    Rahul India wrote:
    export ORACLE_HOME=$ORACLE_BASE/product/10g
    cd $ORACLE_HOME
    set `sqlplus -s <SCHEMA_NAME>/<SCHEMA_PASSWORD> <<EOF
    @r_100.sql
    exit;   
    EOF`THIS SCRIPT IS OK?You'll also need to set ORACLE_SID
    And I don't know why everyone is putting the reference to sqlplus inside a "set" valuation, nor why they are putting the reference to the script in a redirected input stream. All you need is
    sqlplus -s user/password  @r_100.sqlAnd to insure the invironment is correctly set:
    export ORACLE_SID=whatever
    export ORAENV_ASK=NO
    . oraenv
    unset ORAENV_ASK=NO
    sqlplus -s user/password  @r_100.sql

  • How to execute sql-queries through shell scripting in linux?

    How to execute sql-queries through shell scripting in linux?

    http://www.oracle.com/technology/pub/articles/saternos_scripting.html
    Two simple examples:
    #!/usr/bin/env bash
    set_orafra () {
       orafra=`echo 'set heading off
       select name from v$recovery_file_dest;
       exit' | sqlplus -s / as sysdba`
    set_orafra
    echo $orafra
    #!/usr/bin/env bash
    export ORACLE_SID=instance_name
    export ORACLE_HOME=/path_to_oracle_home_directory
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export PATH=/$ORACLE_HOME/bin/$PATH
    $ORACLE_HOME/bin/sqlplus -s <<EOF
    connect scott/tiger@my_instance_name
    INSERT INTO table VALUES (sysdate);
    exit
    EOFEdited by: Markus Waldorf on Sep 17, 2010 12:19 AM

  • Random SP2 error when starting oracle process through SHELL script

    Hi All,
    I am trying to process data in n-Number of tables through a package. The package is called through a shell script to create start data processing. All calls to the package are in a sql script which is basically exec calls-
    exec package.process ('T1','some param');
    exec package.process ('T1','some param');
    exec package.process ('T..n','some param');
    I have a shell script which I use to execute commands from the sql script. There is a reason behind using shell script. For some strange reason, I keep on getting -
    ERROR: logon denied - check for valid user with valid privileges
    SP2-0640: Not connected
    SP2-0641: "EXECUTE" requires connection to server
    SP2-0640: Not connected
    for some EXEC calls. Problem is, errors are generated at random. So in one run, I get error for T10,T11 and then in next run I might get for some other tables.
    However, when I am running the sql script from the sql prompt, all calls to the package are executed without any problem.
    This makes me think, it is something to do with the way database connection being initiated through UNIX.
    Has anyone faced similar issue? Your help/gudence is much appreciated.
    DB: Oracle 10.2.0.5
    OS: SUN Solaris 10
    Thanks in advance.

    Login credentials are provided inside the shell script.
    I did put a sleep(10) after EOF but no help. As mentioned if I run script file from sql promt, it runs without any hiccup. So it is the connection through the UNIX that is causing issue.
    As pointed out by Sybrand, I agree that it does not make a sense to connect and commit after every sql statement. So decided to change the shell script and so far, the result from my initial tests on a sample data is quite encouraging. Hopefully I will have a solution.
    But it will be nice to know why SHELL is doing what it is doing!!
    Legacy prog are sometime big time eye-openers..;)

  • Calling sql script through shell script

    Hi All
    I am trying to run one shell script it will execute the sql file which is in UNIX box. Problem here i am facing is
    when i submit the program through front end it taking time to execute and the status in running even for hours and hours. Manually i am terminating the concurrent program.
    But when same shell script when i tried to execute in putty it generating the output with in seconds
    Can you help what may be the error? I used the syntax like this
    Can you help what may be the error? need to change any syntax
    Thanks
    Prem Raj Dasari
    Edited by: Sravprem on Sep 20, 2012 12:43 AM

    Pl post details of OS, database and EBS versions. In your shell script, insert this line as the first line
    set -xthen run the concurrent program and paste the contents of the log of the concurrent program here
    HTH
    Srini

  • How to Call Multiple Sessions through Shell scripting

    Dear Members,
    I have a scenario where I load data into target table from 20 different source tables.
    For this I have written three procedures where there exists an bulk insert executed on a same table in every procedure. Now I have to call these procedures simultaneously so that
    all three bulk loads are executed at once in different sessions.
    For this I have to write a shell script which opens 3 different sessions and execute all these packages at once.
    Can you guide me through.

    When you call sqlplus in your shell script, put a & at the end so that it runs the SQL scripts in the background. For instance:
    #!/bin/bash
    ...oracle home stuff
    $ORACLE_HOME/bin/sqlplus user/pass @script.sql &
    $ORACLE_HOME/bin/sqlplus user/pass @script2.sql &
    $ORACLE_HOME/bin/sqlplus user/pass @script3.sql &

  • Error reading data from Infocube using shell script.

    Dear all ,
    I am facing a problem while reading data from an infocube using a shell script.
    The details are as follows.
    One of the shell script reads the data from the infocube to extract files with the values.
    The tables used for extraction by the shell script are :
    from   SAPR3."/BIC/F&PAR_CUBE.COPA"     FCOPA,
           SAPR3."/BIC/D&PAR_CUBE.COPAU"    COPAU,
           SAPR3."/BIC/D&PAR_CUBE.COPAP"    COPAP,
           SAPR3."/BIC/D&PAR_CUBE.COPA1"    CCPROD,
           SAPR3."/BIC/D&PAR_CUBE.COPA2"    CCCUST,
           SAPR3."/BIC/D&PAR_CUBE.COPA3"    COPA3,
           SAPR3."/BIC/D&PAR_CUBE.COPA4"    COPA4,
           SAPR3."/BIC/D&PAR_CUBE.COPA5"    COPA5,
           SAPR3."/BIC/MCCPROD"      MCCPROD,
           SAPR3."/BIC/SCCPROD"      SCCPROD,
           SAPR3."/BIC/MCCCUSTOM"    MCCCUSTOM,
           SAPR3."/BIC/SCCCUSTOM"    SCCCUSTOM,
           SAPR3."/BIC/SORGUNIT"     SORGUNIT,
           SAPR3."/BIC/SUNIMOYEAR"   SUNIMOYEAR,
    /*     SAPR3."/BI0/SFISCPER"     SFISCPER, */
           SAPR3."/BI0/SREQUID"      SREQUID,
           SAPR3."/BI0/SCURRENCY"    SCURRENCY,
           SAPR3."/BIC/SSCENARIO"    SSCENARIO,
           SAPR3."/BIC/SSOURCE"      SSOURCE
    The problem is that the file generation by this script (after reading the data from teh infocube) is taking an unexpected time of 2 hours which needs to be maximum 10 mins only.
    I used RSRV to get the info about these tables for the infocube:
    Entry '00046174', SID = 37 in SID table is missing in master data table /BIC/MCUSLEVEL2
    Entry '00081450', SID = 38 in SID table is missing in master data table /BIC/MCUSLEVEL2
    and so on for SID = 39  and SID = 35 .
    Checking of SID table /BIC/SCUSLEVEL2 produced errors
    Checking of SID table /BIC/SCUSLEVEL3 produced errors
    Can you please let me know if this can be a reason of delay in file generation (or reading of data from the infocube).
    Also , Please let me know how to proceed with this issue.
    Kindly let me know for more information, if required.
    Thanks in advance for your help.
    -Shalabh

    Hi ,
    In continuation with searching the solution to the problem , I could manage to note a difference in the partition of the Fact table of the infocube.
    Using SE14 -> Storage Parameters, I could find the partition done for the fact table as :
    PARTITION BY: RANGE
    COLUMN_LIST: KEY_ABACOPA
    and subsequently there are partitions with data in it.
    I need to understand the details of these partitions .
    Do they correspond to each requests in the infocube(which may not be possible as there are 13 requests in infocube and much more partitions).
    Most importantly, since this partition is observed for this onfocube only and not for other infocubes, it is possible that it can be a reason for SLOW RETRIEVAL of data from this ionfocube( not sure since the partition is used to help in fast retreival of data from the infocubes).
    Kindly help.
    Thanks for your co-operation in advance.
    -Shalabh

  • Arguments in function passed through shell script

    HI all,
    I have a shell script test.sh
    it contains the following
    A=$1
    B=$2
    C=$3
    D=$4
    sqlplus usr/pwd<<eof
    a varchar2(10);
    b varchar2(10);
    c date;
    d date;
    a:='$A';
    b:='$B';
    c:='$C';
    d:='$D';
    func(a,b,c,d(;
    eof
    func() defbn
    func(name varchar2,trc varchar2,dt1 date,dt2 date)
    end;
    When icall test.sh as
    ./test.sh xyz 0100 01-NOV-09 06-NOV-09
    It appneds dt1 with 06-NOV-09 and dt2 remains null.
    It should be like:
    dt1=01-NOV-09
    dt2=06-NOV-09
    inside function
    Thanks

    Are you sure there is no problem in SQL function *"func"* that you are calling?
    You haven't pasted the function code so can't really comment on that.
    Below test shows that it works really fine:
    kallo:DZHLHFC1> cat 1.ksh
    A=$1
    B=$2
    C=$3
    D=$4
    echo "Shell vars = $A,$B,$C,$D"
    sqlplus -s username/pass<<eof
    alter session set nls_date_format='DD-MON-YY';
    set serverout on size 10000
    declare
    a varchar2(10);
    b varchar2(10);
    c date;
    d date;
    begin
    a:='$A';
    b:='$B';
    c:='$C';
    d:='$D';
    dbms_output.put_line('');
    dbms_output.put_line('SQL vars =' ||a||',' ||b||',' ||c||',' ||d);
    end;
    eof
    kallo:DZHLHFC1> ./1.ksh xyz 0100 01-NOV-09 06-NOV-09
    Shell vars = xyz,0100,01-NOV-09,06-NOV-09
    Session altered.
    SQL vars =xyz,0100,01-NOV-09,06-NOV-09
    PL/SQL procedure successfully completed.

  • Help regarding issue connecting to DB through shell script

    Hi,
    I have a Oracle 8.1.7 Database running on a AIX box. I am trying to truncate one table from within the shell script using here documents.
    Code section of my script -
    succ=`sqlplus -s ${USR} << EOF
    whenever sqlerror exit sql.sqlcode
    set feedback on
    Truncate table abc.xyz;
    exit;
    EOF`
    USR has been set as /. We have ops$ users in the database. So when I run this script using my id it runs fine. The problem seems to be coming when this runs as part of the batch job which runs under a different osuser. The error is -
    + + sqlplus -s /
    + 0< /tmp/sh164108.8
    succ=ERROR:
    ORA-01017: invalid username/password; logon denied
    SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] | [INTERNAL]
    where <logon> ::= <username>[<password>][@<connect_string>] | /
    SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] | [INTERNAL]
    where <logon> ::= <username>[<password>][@<connect_string>] | /
    SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
    I am not sure what is going wrong. I have tried and googled for the issue and it seems that the issue is coming because the osuser under which the job runs may not be setup to use "sqlplus -s /" ? Any help appreciated.
    Regards,
    Saurabh

    This is the forum for Oracle's SQL Developer tool, not for general SQL and PL/SQL questions.Questions like this will get a better response in the PL/SQL forum.
    Having said that, it looks likely that the other user doesn't have an ops$ account.

  • Import through Shell Scripts

    Hi Friends ,
         I have run shell scripts for importing from my local system through TELNET It was running fine on the server.But now I need to import the same dump file into my local database.The ORACLE_SID refering to the database in the server is same as the database in my local system.
    So how to tell through the scripts that I need to connect to my local system.
    If anyone could explain this it could be of great help.
    Regards
    Marlon.

    Hi
    It depends on how your script is taken care on syntax of import/export. I can tell you exaxtly if you can past me your import/export shell script. However for your knowlege, you can specify ORACLE_SID with export/import with following ways
    1) exp user/pass@ORACLE_SID file=<file_name> log=<logfile>
    imp user/password@ORACLE_SID file=<dumpfile> fromuser=<username> touser=username
    if you are at same box where oracle server is intalled then you need not to mention oracle_SID but make sure that ORACLES_SID is configured in environment variable.
    All the best
    Alok

  • Automatic import process through shell script

    Hi all,
    oracle 10.2.0
    RHEL 4
    I have many export dump files in one directory exported from different schemas and different databases.
    I have to import them in different schemas in a single database.Ofcourse, I can manually import each file but to avod tedious work,i want to automate the task.I want linux do it for me.I wrote the below script but it works only for the first time.
    USR=system
    PWD=******
    for $i in `ls *.dmp`;do
    imp $USR/$PWD file=$i fromuser=test touser=`basename` $i
    done
    What else should i include in the script os that automatically oracle navigates through every dump file and import the database in the respective schema?
    Thanks

    Before trying a solution I have to understand something more...
    Are your dump file names <schema name>.dmp, e.g. user1.dmp, user2.dmp and so on, and you want to import into those schemas ? If so, is "fromuser=test" correct ? If not so, please clarify.
    And why "basename" ?

  • Intermittent error while trying to connect oracle through shell script

    Hi All,
    I am getting following error Intermittently while connecting to oracle database.
    ERROR:
    ORA-03113: end-of-file on communication channel
    SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
    where <logon> ::= <username>[<password>][@<connect_string>] | /
    SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
    where <logon> ::= <username>[<password>][@<connect_string>] | /
    SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
    Please help.
    Thanks in advance.

    I cannot give this file D:\oracle\ora92\network\trace\cli_3932_1.trc (sorry for that) No problem I understant that you don't want post sensitive information.
    You may contact Oracle Support Services (raise a SR along with generated trace files) for problem resolution.
    TNS-12547: TNS:lost contact
    TNS-00517: Lost contact12547, 00000, "TNS:lost contact"
    // *Cause: Partner has unexpectedly gone away, usually during process
    // startup.
    // *Action: Investigate partner application for abnormal termination. On an
    // Interchange, this can happen if the machine is overloaded.
    00517, 00000, "Lost contact"
    // *Cause: Partner has unexpectedly gone away.
    // *Action: Investigate partner application for abnormal termination.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Send mail through shell scripts

    hi,
    I am working in oracle9i and solaris 5.8 . i need to send a mail using the following codes
    ORACLE_HOME=/oracle/u01/app/oracle/product/9.2.0; export ORACLE_HOME
    ORACLE_SID=oracle; export ORACLE_SID
    PATH=/oracle/u01/app/oracle/product/9.2.0/bin:/usr/bin:; export PATH
    MAIL=/var/mail/dbacoe; export MAIL
    BASE_SUPPORT_EMAIL=mail [email protected]
    DATA_DIR=/oracle/sunora/
    SHIP_IND=Lynn_FMLA.csv
    uuencode $DATA_DIR/Lynn_FMLA.csv 'Lynn_FMLA.csv' | mailx -s 'Shipping Ind' $BASE_SUPPORT_EMAIL
    me run this file in script.sh and i also give the full permission.. chmod 777 script.sh
    after running this script i didnt get any error...
    but in the mean time i didnt receive any mail...
    please expalin me how to send a mil along with attachments using the scripts above...
    Regs...

    try -
    uuencode $DATA_DIR/Lynn_FMLA.csv Lynn_FMLA.csv | mailx -s 'Shipping Ind' $BASE_SUPPORT_EMAIL
    No single quote around second file name.
    rgds

  • Passing parameters into a shell script through alias Names ????

    I have two alias names ord and dev. And the content of them are as follows.
    alias ord
    ord='cd ${ORDER}/bin; export APPL_NAME=order; . SetupAppl order'
    alias dev
    dev='cd ${APPL_ROOT}/bin; export APPL_ENV=dev; . SetupEnv dev'
    Alias ord calls a shell script called SetupAppl. Alias dev calls a shell script called SetupEnv.
    I am trying to pass a parameter when calling the alias name dev, something like dev WEST. And I
    want to read that parameter inside the shell script SetupEnv.
    The way I want to execute them, first run the alias ord and then the alias dev. But, when I try
    to read the parameter in SetupEnv by $1 it is showing the value of the parameter passed to SetupAppl
    ie order and not WEST.
    Is there any way to read the value (WEST) passed as a parameter when executing the alias name.
    example : dev WEST and reading the value WEST inside SetupEnv
    The reason I am executing those scripts (SetupAppl and SetupEnv) with dot(.) in the front is because
    those scripts have some export statements which needs to exported to the environment.
    Any help on this is highly apprecaited

    Hi everybody,
    I posted same question earlier for UNIX/shell script and rec'd one response. Thanks to Bob.
    But the requirement has been changed and now my mgr wants the same task using PL/SQL. Could somebody help me ?
    Question again....
    I am working on a task which gets report on every remote database.
    I created a small database: ‘REPORTS_DB’ and I created 6 'sql' scripts on that database. While executing the first script, it calls the other 5 different 'sql' scripts. All these 5 sql scripts use a '@db_link' (hard coded) and gets that database's report to the database: REPORT_DB.
    It is working well. But,
    We have 42 databases and I have to get reports of all the 42 databases. Since it is not efficient to create 42 sets of sql scripts, I want to make it automated.
    I know (but I don't know HOW) I can pass a parameter (database link name) while running the first script (which calls the other 5 scripts), so that the parameter replaces the @db_link in all the 5 scripts and gets the report of the related (@db_link) database.
    Could somebody tell me how to do this task using SQL and PL/SQL ?
    OR
    send me a sample PL/SQL script to do this task?
    Sorry for the inconvenience and thanks in advance.
    - JT

Maybe you are looking for

  • How can i keep the music pushed to all of families devices but the calendar and notes just between my phone and my mac using icloud?

    Ok, so my whole family has the same apple ID so that we can all get the same music, and we want to be able to use icloud so that when one person buys a song it will push to all of our devices. But the problem is when I want my calendar on my mac to a

  • Arport express problems going from 5ghz to 2.4ghz

    Hi all I'm completely stumped with this one. Last night I needed to change the express from N 5ghz to N/B/G 2.4ghz. So using the manual setup screen I selected the options. but when I clicked on update, I just get the spinning wheel and the imac, mac

  • Question marks instead of graphics

    I'm getting mostly question marks instead of graphics. I use earthlink as my ISP. Any suggestions? Powerbook G4   Mac OS X (10.3.9)  

  • Free Java Database?

    I'm looking for a free Java database. A few recommended MySQL, but after going to their site, it looks they charge and aren't free. The database would be used in my own commercial product that would be sold to stores. Perhaps MySQL is just free for d

  • Adobe Air 2.7 broke in OS 1.0.6.2390

    Ok, so, Adobe Air sucks to begin with.  It's slowwwww and on the PB it's very unstable.  I've been living with, hoping for improvements.  But with the release of OS 1.0.6.2390 with Adobe Air 2.7 it REALLY sucks.  At least in the previous versino I co