How to hide passwords in sql scripts?

Hi!
I have got a few sql scripts for some actions. In the scripts the connection information is plain text - even the SYS password in one script.
Are there ways to solve this behaviour? Perhaps encrypt it or... What does the practice say - how do you solve this???
Thanks
Markus

Depending on your environment and if these are administrative (DBA) scritps or production batch then here are some ideas:
For DBA
Run the scripts via cron in a DBA privileged account
sqlplus /nolog <<EOF
connect / as sysdba
start script
exit
EOF
The above requires no password,
For production batch assuming that all production runs under one OS ID that access to is restricted then potentially you can use OS authentication so the Oracle username has no password: create user bob identified externally.
sqlplus / @script
will then do the job
HTH -- Mark D Powell --

Similar Messages

  • Encrypt or hide password in sql script from shell

    Hello
    Have I some possibility to encrypt or hide password in this shell script :
    $ORACLE_HOME/bin/sqlplus -S /nolog<<EOF
    connect user/passw3@tns
    select * from dual;
    exit;
    EOF
    thank You
    Brano

    Or do not use login userid/pw at all. Instead use client authentication (externally identified account).
    CREATE USER ops$me identified externally;
    then as me on the host,
    $ORACLE_HOME/bin/sqlplus / >> /dev/null <<EOF1
    select * from dual;
    exit;
    EOF1
    That way your password never has to be stored or passed. Oracle knows that you have been authenticated by the server.

  • How can I run a SQL script file...

    How can I run a SQL script file from a location on my computer without providing the whole path?
    Is there some way I can set a "Working folder" in SQL Plus??
    Thanks!
    Tom

    You can create an environment variable called "SQLPATH" which is a list of directories that SQL*Plus will search for your .SQL
    scripts.
    I would like to use another directory than the oracle/bin...
    How can I do this ??
    Hello,
    U can do this by this way:
    Save odm_script.sql file to the default Oracle
    directory i.e. Oracle-Home/bin and Run following command
    through SQL Plus.
    SQL>@Script_Name
    I hope this will resolve ur problem.
    Regards,
    Omer Saeed Khan.

  • How to use views in sql script report?

    All all
    Can any one tell how to use views in sql script report?

    Most of the views are based on tables (or other views which are based on tables).
    The view typically shows one org at a time based on the context that is set.
    If you need records for all orgs, you need to use the underlying tables. Oracle typically names the tables with a _all suffix.
    e.g. PO_HEADERS will show records for one org at a time. PO_HEADERS_ALL will show records for all orgs.
    Hope this answers your question,
    Sandeep Gandhi

  • How to double dereference in sql scripts

    hi all,
    I wanted to call a sql file(sql2) from within an another sql file(sql1). The call to sql2 from sql1 contains some parameters( in form of integer and some variables). It is possible to access integer values in sql2 but i am unable to access the value stored in the variables in file2.
    How to access the parameter's(which is itself is a variable) value in the called sql script.
    Thanks,
    Shyam

    Depending on your environment and if these are administrative (DBA) scritps or production batch then here are some ideas:
    For DBA
    Run the scripts via cron in a DBA privileged account
    sqlplus /nolog <<EOF
    connect / as sysdba
    start script
    exit
    EOF
    The above requires no password,
    For production batch assuming that all production runs under one OS ID that access to is restricted then potentially you can use OS authentication so the Oracle username has no password: create user bob identified externally.
    sqlplus / @script
    will then do the job
    HTH -- Mark D Powell --

  • How to hide password in EJB client

    I have created an EJB client and it's initial context code is as below.
    Hashtable env = new Hashtable();
    env.put( Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.naming.ApplicationClientInitialContextFactory" );
    env.put( Context.SECURITY_PRINCIPAL, "scott" );
    env.put( Context.SECURITY_CREDENTIALS, "welcome1" );
    env.put(Context.PROVIDER_URL, "ormi://132.100.5.248:23791/ejbhr");
    The password is shown within the code. Please advise how I can hide this password, thanks.
    SK

    Hi Mike,
    Thanks for your information. From the documentation, password indirection applies to data-sources.xml, ra.xml, rmi.xml, jms.xml. My case is that the password is contained inside a Java program. Would you please provide me an example on how to apply password indirection for EJB client Java program? Much thanks.
    SK

  • Problem while executing script in Toad - How to use '&' in the sql script ?

    I have to execute sql script in toad. Sql script has one insert query in which one insert-value is 'USA & CAN'. When I executed the script in toad by pressing F5, I got a prompt window asking for the value if 'CAN' as it is after the &.
    I tried using[b] {escape '\' } .... but could not resolve the problem.
    Is there any solution or workaround to overcome this problem. I have thousands of records with such values and I have to use sql script only.

    There is an option in TOAD to change this behaviour.
    Look in VIEW/OPTIONS/SQL Editor/
    Uncheck the box for "Scan statements for bound variables before execution".
    In SQL*PLUS it would be SET SCAN OFF
    (desupported version is SET DEFINE OFF)
    Message was edited by:
    Sven Weller

  • How to directly edit PL/SQL Scripts

    I can't open PL/SQL source files directly into a PL/SQL editor - they're opened as SQL scripts. The tool still seems targeted towards database maintenance rather than developing code held in a separate version control system.
    Whilst technically the PL/SQL source files are just SQL scripts this doesn't make for easy PL/SQL development.
    A change to a PL/SQL source file involves:
    - Open source file into SQL script tab.
    - Choose connection to run script against.
    - Run as a SQL script.
    - Close source file.
    - Navigate to package spec/body in tree browser and open read-only in a view tab.
    - Click to edit object source - opens in new tab.
    - Edit source and compile.
    - Add 'create or replace' at top and '/' at end.
    - Select 'Save As...' and navigate to original source file.
    - Close script window that this automatically opens for newly saved file, and close edit source tab. Same task in PL/SQL developer:
    - Open source file into a Program Window.
    - Edit source and compile.
    - Click save.
    Making a single change is bad enough - try it when you're making substantial changes to a source file and you want to regularly check compilation and save changes.
    Can anyone help make this easier ?

    The tool still seems targeted towards database maintenance rather than developing code held in a separate version control system.They'll get to it eventually...
    I can't open PL/SQL source files directly into a PL/SQL editor - they're opened as SQL scriptsIs the extension .sql? Change it to .pls or .pks/.pkb. They seem to use the dumb extension-based system to find out what files they are dealing with, instead of parsing the contents.
    If the code doesn't get syntax coloured, open a function or procedure from database first, that seems to wake him up.
    Also make sure the files are as the same as in the DB (with create or replace, without final slash), so you can compile them directly from the same file-based editor.
    You still have to assign connection and navigate to the PL/SQL in the DB to view compilation errors and run/debug though. There are some requests on the announced SQL Developer Exchange for these (http://htmldb.oracle.com/pls/otn/f?p=42626:37:260789750723810::NO:::). Please vote for them to see them implemented.
    K.

  • How to Hide password when invoking sql plus from command promt?

    When i try to open sql plus in command prompt window and enter the sqlplus command follwed by username/password@connection string, the password is not hidden.
    How do I get it to show **** instead of displaying password characters out?
    Also, what is the command to clear screen : when I try cls or clear screen, I get a windows memory exception of somekind and the only option there is to kill the command window.
    Any tips on getting around this?
    Thanks a lot for your time and help.

    user8848256 wrote:
    Can you please give more details on how to not enter password when calling sqlplus from command window like you are saying?
    I tried this :
    sqlplus username/ @connection string -->Hit Enter : it asks for password but does not recognise the connectionstring to connect to.
    sqlplus username/ -->Hit Enter: It does same thing again.asks for password but gives tns adapter error after the password is entered.Leave out the slash:
    sqlplus username@connect_string

  • How to reset password from sql level

    Dear All,
    I have created a new client 300 which is a copy of 000,
    i have selected only SAP_CUST  profile, no user master profile is selected.
    After creation of client i have created one user,
    now only one user is existing in newly created client 300, unfortunately , i am unable to login using that user,
    for which i have to reset the password,
    how do i proceed to attend this issue.Can i do it from OS level or SQL level,, if so then please let me know how do i proceed for it.
    regards,
    SM

    HI,
    use the source client password for SAP*
    suppose you copied 300 client from source client  000 then use 000 sap* password in 300
    if you are still getting problem with login using sap* in client 300
    then  do following
    run query analyzer if you use SQl server 2000
    or run sql server management studio if you use SQL 2005
    connect to database
    use folloiwng query
    in SQL 2005 click on new query
    USE SID
    DELETE sid.USR02 where MANDT='300' and BNAME = 'SAP*'
    where SID = your sap system id ID in uppercase
    sid = your sap system id in lowercase
    query is case sensitive
    after executing query login with sap* user and password 'pass'.
    regards,
    kaushal
    regards,
    kaushal

  • How to Hide Password in Member List

    Hi,
    I have this set up:
    instead of the password being shown, I have previously just added ******* instead of the dynamic text binding.
    But i want to be able to see how many characters long the password is. With thte solution above, all passwords had 8 asterisks. I need to be able to see how many characters the password has, without seeing the actuall characters.
    I still need the dynamic text field, but how would I cover this up? (Some sites have the option to hide/reveal the password). I just want it hidden all the time.
    Any help would be very much appreciated!

    This function will replace your password string with the same amount of '*'
    public function ConvertoStar($string)
    $len = strlen($string); $star = "";
    for ( $s=1; $s <= $len; $s++ ) {
      $star .= "*"; 
    return $star;
    echo ConvertoStar($yourvalue)
    But your better off hashing your passwords though - PHP: Password Hashing - Manual

  • How to Improve this PL/SQL script

    Hi All,
    I have a package/procedure that insert data into table but it takes time more than 2 days. Have any known how to modify this script to improve the performance and reduce loading time, The following code is procedure I used to insert data.....
    Procedure INSERT_DATA (p_month IN DATE, p_product_id IN NUMBER ) IS
    cursor c1 is select * from tab#1; --reference data
    cursor c2 is select * from tab#2;
    cursor c3 is select * from tab#3;
    cursor c4 is select * from tab#4;
    cursor c5 is select * from tab#5;
    v_rec claim_table%rowtype;
    Begin
    for c1rec in c1 loop
    exit when c1%notfound;
    call procedure in package....;
    open c2(c1rec.claim_no);
    fetch c2 into v_location_cd ,v_claim_type_cd ;
    close c2;
    v_rec.location_cd := v_location_cd;
    v_rec.claim_type_cd := v_claim_type_cd ;
    open c3(c1rec.claim_no);
    fetch c3 into v_col#3,v_col#4;
    close c3;
    v_rec.col#3 := v_col#3 ;
    v_rec.col#4 := v_col#4 ;
    open c4(c1rec.claim_no);
    fetch c4 into v_col#5,v_col#6;
    close c4;
    v_rec.col#5 := v_col#5 ;
    v_rec.col#6 := v_col#6 ;
    insert into claim_table values ( v_rec.location_cd, v_rec.claim_type_cd , v_rec.col#3 , .......) ;
    if (c1%rowcount/1000) = trunc(c1%rowcount /1000) then
         commit;
    end if;
    end loop;
    commit;
    Exception
    exception statement....
    commit;
    End;
    Thanks All,
    Mcka

    A copy and paste of a reply I posted just a hour or so ago to the exact same approach used by a poster in [url http://forums.oracle.com/forums/thread.jspa?threadID=636929]this thread.
    Yucky code IMO. You are using PL/SQL to drive a nested loop join. Why? SQL is by far more capable of joining tables and is not limited to a using a nested loop approach only.
    Also, as you are using PL/SQL to drive it, it means that each cursor fetch in each (nested) FOR loop is a slow context switch from PL/SQL to SQL, in order to ship the row's data from the SQL engine to the PL/SQL engine. Only then to have that very same data shipped back (via yet another context switch) to the SQL engine to be inserted into table4.
    This code violates one of the most rudimentary performance principles in Oracle - it is not maximizing SQL and it it not minimizing PL/SQL. It is doing the exact opposite.
    As for the ad-hoc commits inside the loop - this does not make much sense. This will generate more redo and more overheads. Also, when something goes pear shape in that process, some rows would have been processed and inserted and committed. Some not.
    In this case, how do you expect to restart the failed process at the very first row that failed to be committed and continue processing from there?

  • How to hide fields using java script

    Hi,
    I have some fields in my form that I want to hide on click of one checkbox.
    I have added the javascript into click event(change event also) of check box when previewing in the Adobe LiveCycle Designer, the fields are hidden successfully when I select the checkbox. But when I deployed the same PDF, the fields are not hiding on click of check box.
    I have install ACF and set it as dynamic form.
    My Adobe Life Cycle Designer Version - 7.1
    I have put some alert statement to access the presence property of the object. The property is invisible in alert statement but could not understand why it is not hiding the fields.
    Another important observation if I am writing the same code in initialise event then it is hiding field.
    Please help me in this.
    Regards
    Satya

    Hi Satya,
    I am facing the same issue. Were you able to fix it ?
    Before deploying the xdb, the script works fine. After deployment it does not work.
    I used the code :
    xfa.resolveNode("Page11.Sub_PayTransGenDataCorpAdd").presence = "hidden";
    xfa.resolveNode("Page11.Sub_BranchAddress").presence = "hidden";
    Please advise..
    Regards,
    Vibha

  • How to Hide passwords in the security window?

    I went to the security window to find a password. I clicked to unhide and display all the passwords. Now I want to hide them all again and it will not hide them

    Use a master password.
    *https://support.mozilla.com/kb/Protecting+stored+passwords+using+a+master+password

  • How to send output from SQL script to the specified log file (not *.sql)

    ## 1 -I write sql command into sql file
    echo "SELECT * FROM DBA_USERS;">results.sql
    echo "quit;">>results.sql
    ##2- RUN sqlplus, run sql file and get output/results into jo.log file
    %ORACLE_HOME/bin/sqlplus / as sysdba<results.sql>>jo.log
    It doesn't work please advise

    $ echo "set pages 9999" >results.sql ### this is only to make the output more readable
    $ echo "SELECT * FROM DBA_USERS;" >>results.sql
    $ echo "quit" >>results.sql
    $ cat results.sql
    set pages 9999
    SELECT * FROM DBA_USERS;
    quit
    $ sqlplus -s "/ as sysdba" @results >jo.log
    $ cat jo.log
    USERNAME                          USER_ID PASSWORD
    ACCOUNT_STATUS                   LOCK_DATE  EXPIRY_DAT
    DEFAULT_TABLESPACE             TEMPORARY_TABLESPACE           CREATED
    PROFILE                        INITIAL_RSRC_CONSUMER_GROUP
    EXTERNAL_NAME
    SYS                                     0 D4C5016086B2DC6A
    OPEN
    SYSTEM                         TEMP                           06/12/2003
    DEFAULT                        SYS_GROUP
    SYSTEM                                  5 D4DF7931AB130E37
    OPEN
    SYSTEM                         TEMP                           06/12/2003
    DEFAULT                        SYS_GROUP
    DBSNMP                                 19 E066D214D5421CCC
    OPEN
    SYSTEM                         TEMP                           06/12/2003
    DEFAULT                        DEFAULT_CONSUMER_GROUP
    SCOTT                                  60 F894844C34402B67
    OPEN
    USERS                          TEMP                           06/12/2003
    DEFAULT                        DEFAULT_CONSUMER_GROUP
    HR                                     47 4C6D73C3E8B0F0DA
    OPEN
    EXAMPLE                        TEMP                           06/12/2003
    DEFAULT                        DEFAULT_CONSUMER_GROUPThat's only a part of the file, it's too long :-)

Maybe you are looking for

  • Checks are not Creating through APP

    Hi, User  not able create Checks through APP, I checked the Proposal Log: 1)none of the payment methods can be used for these items , 2)Payment not possible because of report error. Please anybodsy can help me on this

  • Adding SWF for pdf interactive

    Hi, I have a multi page indesign doc which is set to export for interactive pdf. I need to add two swf file in different pages and once I add them, they do not show once interactive PDF is exported. I have tried many different options with no success

  • Pxi 2575 high resistance

    I am having problems with the resistance across relays on a PXI-2575 increasing over time (faster than expected).  I am using a PXI-2575 in combination with a PXI-4070 for manufacturing test.  In some cases I am looking for an expected short circuit.

  • Stuffit Will Not "Expand" .sit Files

    Please help. Every time I double-click a ".sit" file (or, select Stuffit from the "open with" menu item), a small windows opens for less than a second, then closes. Nothing else happens. I can't tell what the window is because it only flashes on the

  • Multiple Audio Inputs

    I have two USB microphones which I use for home studio recording. I want to have two different 'Real Instrument' tracks, recording from each different microphone (one track recording from one mic, and the other track from the other mic), but in the G