Grant fails...

hello all,
i am on 10.2.0.4, when i try to give the below grant i get following error...
Grant execute on sys_context to user;
ORA-04042: procedure, function, package, or package body does not exist
wat am i missing here...i couldnt find anything useful on oracle doc...
user has the DBA role and can run this query in sqlplus. user cannot run this query in a stored procedure, function, or package. so thats why i want to grant execute on sys_context....
Edited by: user8363520 on Jan 5, 2012 12:17 PM

user8363520 wrote:
hello all,
i am on 10.2.0.4, when i try to give the below grant i get following error...
Grant execute on sys_context to user;
ORA-04042: procedure, function, package, or package body does not exist
wat am i missing here...i couldnt find anything useful on oracle doc...
user has the DBA role and can run this query in sqlplus. user cannot run this query in a stored procedure, function, or package. so thats why i want to grant execute on sys_context....
Edited by: user8363520 on Jan 5, 2012 12:17 PMThat's not something that requires any sort of grant to access.
TUBBY_ORCL?create user test identified by test;
User created.
Elapsed: 00:00:00.09
TUBBY_ORCL?grant connect to test;
Grant succeeded.
Elapsed: 00:00:00.07
TUBBY_ORCL?connect test/test@orcl
Connected.
TUBBY_ORCL?select sys_context('USERENV', 'SID') from dual;
SYS_CONTEXT('USERENV','SID')
205
1 row selected.
Elapsed: 00:00:00.03
TUBBY_ORCL?

Similar Messages

  • GRANT failed: password file missing or disabled

    Hi,
    I created password file using
    orapwd FILE=orapwprj ENTRIES=30 (where prj is the instance name)
    SQL> show parameter remote_login_passwordfile
    NAME TYPE VALUE
    remote_login_passwordfile string EXCLUSIVE
    SQL> grant sysdba to rempar;
    grant sysdba to rempar
    ERROR at line 1:
    ORA-01994: GRANT failed: password file missing or disabled

    Command to be used as
    orapwd file=password_file_name_with_complete path password=the_passwordBy default, the password file should be located in $ORACLE_HOME/dbs location for UNIX platform with password file format as "orapw<SID>"
    For windows, the password file should be located in %ORACLE_HOME%\database location with password file format as "PWD<SID>"

  • Trying to connect to target database...ORA-01994: GRANT failed: password

    I am trying to connect to a target database which on linux from a catalog database which is on Windows. I was initially having problems with our DEV database but eventually got it working. Now I have to register the QA database and I'm running into the same problems. Below is a list og things that I have tried:
    C:\>rman
    Recovery Manager: Release 10.2.0.3.0 - Production on Thu May 10 17:01:51 2007
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    RMAN> connect target sys/password@fprcqa
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    ORA-01031: insufficient privileges
    2. So I went to the target database (FPRCQA) and I checked the following:
    SYS@FPRCQA> select * from v$pwfile_users;
    no rows selected
    SYS@FPRCQA> grant sysdba to sys;
    grant sysdba to sys
    ERROR at line 1:
    ORA-01994: GRANT failed: password file missing or disabled
    3. Then I checked the passwordfile
    SYS@FPRCQA> show parameter pass
    NAME TYPE VALUE
    remote_login_passwordfile string[b] EXCLUSIVE
    4. Then I created a passwordfile in $ORACLE_HOME/dbs because it did not exist.
    [oracle@rh-staging dbs]$ orapwd file=orapwdFPRCQA password=password entries=300
    -rw-r----- 1 oracle oinstall 8385 Sep 11 1998 init.ora
    -rw-r--r-- 1 oracle oinstall 12920 May 3 2001 initdw.ora
    -rw-rw---- 1 oracle oinstall 1552 May 8 14:09 hc_FPRCQA.dat
    -rw-rw---- 1 oracle oinstall 24 May 8 14:09 lkFPRCQA
    drwxr-xr-x 63 oracle dba 4096 May 8 15:12 ..
    drwxr-x--- 2 oracle oinstall 4096 May 10 16:10 .
    -rw-r----- 1 oracle oinstall 5632 May 10 16:10 spfileFPRCQA.ora
    -rwSr----- 1 oracle oinstall 39424 May 10 16:14 orapwdFPRCQA
    5. Then I tried again to grant sysdba to sys and it gave me the same error as before.
    ALSO, I cannot connect to the the target database from the catalog database through sqlplus...as I get the same error of insufficient privs:
    C:\>set ORACLE_SID=fprcqa
    C:\>sqlplus /nolog
    SQL*Plus: Release 10.1.0.3.0 - Production on Thu May 10 17:11:41 2007
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    SQL> connect sys/password@fprcqa as sysdba
    ERROR:
    ORA-01031: insufficient privileges
    Can anyone help please?

    Hello all;
    I created the files with following command in $ORACLE_HOME/dbs/
    orapwd file=orapwRCVDB password=sys entries=20
    remote_login_passwordfile=EXCLUSIVE
    $ ls -ltr orapw*
    -rwxrwxrwx 1 oracle dba 3584 Dec 22 15:29 orapwRCVDB
    but still I am facing similar error ..
    SQL> grant sysdba to system;
    ORA-01994: GRANT failed: password file missing or disabled
    so i checked ...
    SQL> select * from v$pwfile_users;no rows selected
    can anyone tell me where I am doing mistakes ? It's urgent !!
    atul.

  • Two instances installation, grant sysdba failed because passwd file

    Hi
    I have a two instances Oracle 11g installation.
    Instance 1: ORATEST
    Instance 2: ORADESA
    So, i want add SYSDBA grant to ORADESA system user.
    [oracle@oracletesting dbs]$ echo $ORACLE_SID
    ORADESA
    [oracle@oracletesting dbs]$ echo $ORACLE_HOME
    /u01/app/oracle/product/11.2.0.3/desa/dbhome_1
    [oracle@oracletesting dbs]$ sqlplus /nolog
    SQL> conn /as sysdba
    Connected.
    SQL> show parameter password;
    NAME TYPE VALUE
    remote_login_passwordfile string EXCLUSIVE
    SQL> grant sysdba to system;
    grant sysdba to system
    ERROR at line 1:
    ORA-01994: GRANT failed: password file missing or disabled
    Ok, i recreate passwd file.
    [oracle@oracletesting dbs]$ rm $ORACLE_HOME/dbs/orapworaDESA
    [oracle@oracletesting dbs]$ orapwd file=$ORACLE_HOME/dbs/orapworaDESA password=xxx entries=5
    [oracle@oracletesting dbs]$ ls -all
    total 84
    drwxr-xr-x. 2 oracle oinstall 4096 Mar 28 10:57 .
    drwxr-xr-x. 71 oracle oinstall 4096 Mar 7 16:23 ..
    -rw-rw----. 1 oracle oinstall 1544 Mar 26 15:45 hc_oradesa.dat
    -rw-rw----. 1 oracle oinstall 1544 Mar 28 10:20 hc_ORADESA.dat
    -rw-r--r--. 1 oracle oinstall 2851 May 15 2009 init.ora
    -rw-r--r--. 1 oracle oinstall 68 Mar 26 15:45 initORADESA.ora
    -rw-r-----. 1 oracle oinstall 24 Mar 26 11:17 lkORADESA
    -rw-r-----.  1 oracle oinstall  2048 Mar 28 10:57 orapworaDESA
    -rw-r--r--. 1 oracle oinstall 48880 Mar 26 14:15 rmdup_oradesa.dat
    -rw-r-----. 1 oracle oinstall 3584 Mar 26 15:14 spfileoradesa.ora
    [oracle@oracletesting dbs]$ sqlplus /nolog
    SQL*Plus: Release 11.2.0.3.0 Production on Thu Mar 28 10:59:54 2013
    Copyright (c) 1982, 2011, Oracle. All rights reserved.
    SQL> conn /as sysdba
    Connected.
    SQL> grant sysdba to system;
    grant sysdba to system
    ERROR at line 1:
    ORA-01994: GRANT failed: password file missing or disabled
    Obviously something is wrong, but I do not know.
    Thanks

    [oracle@oracletesting dbs]$ rm $ORACLE_HOME/dbs/orapworaDESA
    [oracle@oracletesting dbs]$ orapwd file=$ORACLE_HOME/dbs/orapworaDESA password=xxx entries=5
    [oracle@oracletesting dbs]$ ls -all
    total 84
    drwxr-xr-x. 2 oracle oinstall 4096 Mar 28 10:57 .
    drwxr-xr-x. 71 oracle oinstall 4096 Mar 7 16:23 ..
    -rw-rw----. 1 oracle oinstall 1544 Mar 26 15:45 hc_oradesa.dat
    -rw-rw----. 1 oracle oinstall 1544 Mar 28 10:20 hc_ORADESA.dat
    -rw-r--r--. 1 oracle oinstall 2851 May 15 2009 init.ora
    -rw-r--r--. 1 oracle oinstall 68 Mar 26 15:45 initORADESA.ora
    -rw-r-----. 1 oracle oinstall 24 Mar 26 11:17 lkORADESA
    -rw-r-----. 1 oracle oinstall 2048 Mar 28 10:57 orapworaDESA
    -rw-r--r--. 1 oracle oinstall 48880 Mar 26 14:15 _rm_dup_oradesa.dat
    -rw-r-----. 1 oracle oinstall 3584 Mar 26 15:14 spfileoradesa.oraYour password file format is wrong. It should be "orapwSID" and yours is "orapworaSID" which is wrong.
    Thanks,
    Navneet

  • Unable to grant sysdba to user

    Hi,
    On my PC i am using Redhat 5. when I grant sysdba privilege to user hr it gives an error.
    SQL> grant sysdba to hr;
    grant sysdba to hr
    ERROR at line 1:
    ORA-01994: GRANT failed: password file missing or disabled
    I check the password file is in place in the folder HOME/dbs. what can be the problem.
    Plz help
    Thanx

    It works for me.
    bcm@bcm-laptop:~$ sqlplus
    SQL*Plus: Release 11.2.0.1.0 Production on Mon Nov 1 10:39:30 2010
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Enter user-name: / as sysdba
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> grant sysdba to hr;
    Grant succeeded.Either you are mistaken or Oracle is.
    Either you have an error of omission or error of commission, but without knowing what you have & what you do, no advice is possible.
    Is COPY & PASTE broken for you?
    Post results of
    SELECT * from v$version;

  • Password file and sysdba grant in 10g on AIX ...

    Hi,
    I am very familiar with password file, orapwd ...
    I installed oracle 10gR2 database on AIX, created a password file using orapwd (file name orapwdSID.ora under $ORACLE_HOME/dbs), set remote_login_passwordfile='EXCLUSIVE' in init.ora file.
    1 - When I select * from v$pwfile_users; I get 0 rows !!!
    2 - When I try to grant sysdba to an_user; I get ORA-01994: GRANT failed: password file missing or disabled
    Cause: The operation failed either because the INIT.ORA parameter REMOTE_LOGIN_PASSWORDFILE was set to NONE or else because the password file was missing.
    Action: Create the password file using the orapwd tool and set the INIT.ORA parameter REMOTE_LOGIN_PASSWORDFILE to EXCLUSIVE.
    any idea.
    thanks.

    Hi,
    I do not think so that this is a solution. because setting "Shared" means that all databases uses the same password file and only one user "SYS" is in this file (sysdba privilege) ...
    Not what I am looking for !
    regards.

  • How to exclude table grants from getting being streamed

    I have one way schema level streams replication setup with DDL. The destination database does not have all the roles and users setup that the source database has so when a grant happens on the source and the role or user does not exist in the destination database the grant fails and I get an apply error. I want to be able to ignore these.
    Thanks

    Assigning grants is not an automated process so why not use the DBMS_STREAMS.SET_TAG on source DB into the session and then issue the grant :
    SQL> exec DBMS_STREAMS.SET_TAG(tag => HEXTORAW('17'));
    PL/SQL procedure successfully completed.
    grant MY_ROLE to MY_OWNER ;
    -- the grant is not captured by streams, so not apply error
    SQL> exec DBMS_STREAMS.SET_TAG(tag => null ) ;
    PL/SQL procedure successfully completed.
    -- capture enabled again in this sessionhttp://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_strm.htm

  • Grant execute to all custom stored procedures, not quite working

    I would like to grant execute permissions on all custom stored procedures to a group and have tried using this:
    USE myDB
    select 'GRANT EXECUTE ON ['+name+'] TO [mydomain\mydb] '  from sys.objects  where type ='P' and is_ms_shipped = 0
    It seems to execute without error, I see the full list of stored procedures I've created listed like this:
    GRANT EXECUTE ON [procUserInsert] TO [mydomain\mydb]
    However the stored procedure I added earlier, which didn't have any explicit rights set for it, does not show that the execute permission has been granted. Other stored procedures, where I had already granted execute to the group, remain as they were (which
    is expected). I'm viewing permissions via ssms, selecting the new stored procedure, then properties, permissions. If the grant failed there ought to be an error message...I don't get it. This is sql server 2005.

    It seems like you were only printing the statement (SELECT), but it is unclear if you executed them.
    You could try granting EXECUTE permission at either the DB scope or SCHEMA scope. That would grant EXECUTE on all modules (i.e. SPs, UDFs, etc.) at the chosen scope, including modules created in the future. For example:
    -- Grant EXECUTE permission on all DB
    GRANT EXECUTE TO [myDomain\mydbGroup1]
    go
    -- Grant EXECUTE permission on schema mySchema
    GRANT EXECUTE ON SCHEMA::[mySchema] TO [myDomain\mydbGroup2]
    go
    I hope this helps.
    BTW. The way you were creating the dynamic SQL for granting permissions to SPs individually is subject to 2<sup>nd</sup> order injection attacks. You should use quotename(name) in order to escape object names.
    -Raul Garcia
     SQL Server Security
    This posting is provided "AS IS" with no warranties, and confers no rights.

  • Reg: Error while connecting to a remote database as SYS user.

    Hello all,
    When i try to connect to a database as SYS user i'm getting the error as
    ora-01017 invalid username/password logon denied
    But it is logging from the local system where the oracle is installed.
    I created the password file and checked the contents in v$pwfile_users.
    The result is " no rows selected".
    so when i try to grant sysdba to sys user
    grant sysdba to sys;
    i'm getting error as,
    ORA-01994: GRANT failed: password file missing or disabled
    Please help me in resolving this.
    Regards,
    Konda

    I created the passwordfile using the command below,
    orapwd.exe file=E:\app\Administrator\product\11.2.0\dbhome_1\database\PWDfile.ora force=y entries=30 password=<sys_password>
    is this okay...??

  • Password file issue in Oracle 10g

    Hi,
    While trying connecting from SQL prompt using command
    SQL> CONNECT SYS/PASSWORD@CONNECT_STRING AS SYSDBA
    It gives error
    ORA-01031 insufficient privilege
    If SQL> CONNECT SYS/PASSWORD AS SYSDBA
    It works successfully??
    After connecting without using connect_string.
    Only one DB is running on this machine.
    Then SELECT * FROM V$PWFILE_USERS;
    0 ROWS RETURNED
    Recreated the pwd file same issue persists. What may be the reason?
    If SQL> GRANT SYSDBA TO SYS;
    ERROR ORA-01994: GRANT FAILED: PASSWORD FILE MISSING OR DISABLED
    Password file created using command
    orapwd file=/u01/app/oracle/product/10.2.0db_1/dbs/orapwPRIMDB password=pwd entries=5
    Please help me.
    Thanks in advance.
    Edited by: Bharat Kaushik on May 31, 2009 4:20 PM

    The first command is a 'remote connection'. To be able to connect as sysdba remotely, spfile remote_login_passwordfile should be set to exclusive.
    When there is no password file or the parameter is incorrect this results in ora-1031.
    The second command uses O/S authentication, and doesn't use the password file at all.
    O/S authentication is set up in sqlnet.ora.
    SYS has always SYSDBA, by design. Granting SYSDBA to SYS is redundant.
    Obviously in this directory name
    /u01/app/oracle/product/10.2.0db_1/dbs/
    there is a / missing and it should have been
    /u01/app/oracle/product/10.2.0/db_1/dbs/
    So you still have no valid passwordfile.
    You could have and should have easily spotted this yourself.
    Sybrand Bakker
    Senior Oracle DBA
    Experts: those who did read the documentation.

  • Getting error when I tried to give sysdba to user1 in oracle 10g on solaris

    Hi,
    I have created a password file orapw<sid>.ora under dbs directory and set the remote_login_passwordfile=exclusive. I am getting the below error when I tried to give sysdba to user1.
    ORA-01994 Grant Failed : Password file missing or disabled.
    Kindly share your knowledge in this regards.
    Thanks,
    KarthicK

    1. drop the current password file if exists
    2 Recreate the password file. The user that will create the password file must be in OS DBA group
    Be sure that the user has XWR privileges on that file.
    give an fully pathname for the password file, under dbs directory ( not mandatory, but i prefer )
    3. recreate the password file and grant privilege to user user1
    Let we know

  • Button to call pl/sql stored proc using text box value as parameter

    I need to create a portal page with an input text box and a button (or a clickable pl/sql item). A user will enter a value in the text box and click the button, a stored pl/sql procedure will be executed that takes the value of the text box as an input parameter. The procedure output (basically a success or an error message) must be printed in a new window which the user can close after checking the output. No redirection to another page is required.
    I have no experience in developing portal pages and would appreciate if you point me in a right direction. Do I need to create an html form and obtain the value of the text box via p_session object? In this case what do I need to specify as ACTION for the form - the same page URL? Where should I place the call to the stored procedure? Or can I somehow use a pl/sql item?
    Thank you for your help

    Hi Arnaud
    Thank you for the reply. Could you please give me dome more details. I have created a procedure:
    create or replace procedure grant_roles (p_username varchar2) as
    begin
    <code>
    htp.p('Grant succeeded for username is '||p_username);
    exceptions when others then
    htp.p('Grant failed. '||v_err_msg);
    end;
    and an html portlet:
    <html>
    <body>
    <form name="input" action="/pls/portal/pls/portal_public.grant_roles_test?p_username=anna" method="get">
    <input type="text" name="t_username" size="20">
    <br>
    <input type="submit" value="Grant">
    </form>
    </body>
    </html>
    Obviously this is not the right way to call my procedure as it does not work. And of course I want to pass the value of the t_username text box to the procedure not the string "anna". I am also not sure where a procedure prints its output. Is it possible to open a new window to display the output?
    Thank you for your help,
    Anna

  • Security Problem Using an Impersonate User to exectue a bacth File

    Hi,
    I create a little windows application that have to create a list of Folder and also assign some User or group
    This application will be launched by any user from a shortcut on there own desktop
    The process in my application have to run under a domain User that will have the rights to execute those tasks
    The problem that I face now is that I can
    from my batch File create  all the folder that I need but the command that give the grant to certain users or group  fail. (See at the end of this question)
    I would like to know what permissions I have to give to the Impersonate user to achieve this goal
    Also where we should give this permission?  on a folder or  in active directory
    This is my application code and at the end you will find some command comming from the batch file that is execute from the process with the impersonate User
    I dont know if this is important but the domain use Active Directory 2008
    If there is something wrong I will appreciate to show me what I am doing wrong
    Vb Code
                Dim sDomain As String = My.Settings.DomainName
                Dim sUser As String = My.Settings.UserName
                Dim sPass As String = My.Settings.UserPassword
                Dim tokenHandle As New IntPtr(0)
                Try
                    If LogonUser(sUser, sDomain, sPass, 2, 0, tokenHandle) Then
                        Dim newId As New WindowsIdentity(tokenHandle)
                        Using impersonatedUser As WindowsImpersonationContext = newId.Impersonate()
                            'perform impersonated commands                        
                            ProcessBatchFile(sFullUncPath, sNoProject, sYear, sAddConstructionSite)
                        End Using
                        CloseHandle(tokenHandle)
                    Else
                        MessageBox.Show("Impossible to identify  the usager : " & sUser & " du domaine " & sDomain)
                    End If
                Catch ex As Exception
                    MessageBox.Show(ex.Message.ToString)
                Finally
                    lblWaitMessage.Visible = False
                    Me.btnGenerate.Enabled = True
                    Application.DoEvents()
                End Try
    Private Sub ProcessBatchFile(sFileRootPath As String, sProjectName As String, sYearFolder As String, sAddConstructionSite As String)
            Dim sBatchFileToLoad As String = String.Empty
            sBatchFileToLoad = "FileA.Bat"
            Dim sArgument As String = sYearFolder & " " & sProjectName & " " & sAddConstructionSite
            Try
                Using P As New Process()
                    'Launch a standard hidden command window
                    P.StartInfo.FileName = "cmd.exe"
                    P.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
                    P.StartInfo.CreateNoWindow = True
                    'Needed to redirect standard error/output/input
                    P.StartInfo.UseShellExecute = False
                    P.StartInfo.RedirectStandardInput = True
                    P.StartInfo.RedirectStandardOutput = True
                    'Add handler for when data is received
                    AddHandler P.OutputDataReceived, AddressOf SDR
                    'Start the process
                    P.Start()
                    'Begin async data reading
                    P.BeginOutputReadLine()
                    '"Map" our drive
                    P.StandardInput.WriteLine("pushd " & Application.StartupPath)
                    'Call our command, you could pass args here if you wanted
                    P.StandardInput.WriteLine(sBatchFileToLoad & " " & sArgument)
                    'Once our command is done CMD.EXE will still be sitting around so manually exit
                    P.StandardInput.WriteLine("exit")
                    P.WaitForExit()
                End Using
            Catch ex As Exception
                MessageBox.Show("Une erreur est survenue durant la création des répertoires" & vbCrLf & ex.Message.ToString)
            End Try
        End Sub
    Batch File command
    -- This command work fine and create the folder Gestion de Contrat
    md "Gestion de Contrat"  
    -- These command concerning grant fail
    icacls "Gestion de Contrat" /grant "Patrons":(OI)(CI)(RX)
    icacls "Gestion de Contrat" /grant "Patrons":(OI)(CI)(RD)
    icacls "Gestion de Contrat" /grant "Patrons":(OI)(CI)(W)
    icacls "Gestion de Contrat" /grant "Patrons":(OI)(CI)(M)
    icacls "Gestion de Contrat" /grant "Secretaires":(OI)(CI)(RX)
    icacls "Gestion de Contrat" /grant "Secretaires":(OI)(CI)(RD)
    icacls "Gestion de Contrat" /grant "Secretaires":(OI)(CI)(W)
    icacls "Gestion de Contrat" /grant "Secretaires":(OI)(CI)(M)
    icacls "Gestion de Contrat" /grant "Administration":(OI)(CI)(RX)
    icacls "Gestion de Contrat" /grant "Administration":(OI)(CI)(RD)
    icacls "Gestion de Contrat" /grant "Administration":(OI)(CI)(W)
    icacls "Gestion de Contrat" /grant "Administration":(OI)(CI)(M)
    Thanks in advance
    GC99

    Hi,
    I create a little windows application that have to create a list of Folder and also assign some User or group
    This application will be launched by any user from a shortcut on there own desktop
    The process in my application have to run under a domain User that will have the rights to execute those tasks
    The problem that I face now is that I can
    from my batch File create  all the folder that I need but the command that give the grant to certain users or group  fail. (See at the end of this question)
    I would like to know what permissions I have to give to the Impersonate user to achieve this goal
    Also where we should give this permission?  on a folder or  in active directory
    This is my application code and at the end you will find some command comming from the batch file that is execute from the process with the impersonate User
    I dont know if this is important but the domain use Active Directory 2008
    If there is something wrong I will appreciate to show me what I am doing wrong
    Vb Code
                Dim sDomain As String = My.Settings.DomainName
                Dim sUser As String = My.Settings.UserName
                Dim sPass As String = My.Settings.UserPassword
                Dim tokenHandle As New IntPtr(0)
                Try
                    If LogonUser(sUser, sDomain, sPass, 2, 0, tokenHandle) Then
                        Dim newId As New WindowsIdentity(tokenHandle)
                        Using impersonatedUser As WindowsImpersonationContext = newId.Impersonate()
                            'perform impersonated commands                        
                            ProcessBatchFile(sFullUncPath, sNoProject, sYear, sAddConstructionSite)
                        End Using
                        CloseHandle(tokenHandle)
                    Else
                        MessageBox.Show("Impossible to identify  the usager : " & sUser & " du domaine " & sDomain)
                    End If
                Catch ex As Exception
                    MessageBox.Show(ex.Message.ToString)
                Finally
                    lblWaitMessage.Visible = False
                    Me.btnGenerate.Enabled = True
                    Application.DoEvents()
                End Try
    Private Sub ProcessBatchFile(sFileRootPath As String, sProjectName As String, sYearFolder As String, sAddConstructionSite As String)
            Dim sBatchFileToLoad As String = String.Empty
            sBatchFileToLoad = "FileA.Bat"
            Dim sArgument As String = sYearFolder & " " & sProjectName & " " & sAddConstructionSite
            Try
                Using P As New Process()
                    'Launch a standard hidden command window
                    P.StartInfo.FileName = "cmd.exe"
                    P.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
                    P.StartInfo.CreateNoWindow = True
                    'Needed to redirect standard error/output/input
                    P.StartInfo.UseShellExecute = False
                    P.StartInfo.RedirectStandardInput = True
                    P.StartInfo.RedirectStandardOutput = True
                    'Add handler for when data is received
                    AddHandler P.OutputDataReceived, AddressOf SDR
                    'Start the process
                    P.Start()
                    'Begin async data reading
                    P.BeginOutputReadLine()
                    '"Map" our drive
                    P.StandardInput.WriteLine("pushd " & Application.StartupPath)
                    'Call our command, you could pass args here if you wanted
                    P.StandardInput.WriteLine(sBatchFileToLoad & " " & sArgument)
                    'Once our command is done CMD.EXE will still be sitting around so manually exit
                    P.StandardInput.WriteLine("exit")
                    P.WaitForExit()
                End Using
            Catch ex As Exception
                MessageBox.Show("Une erreur est survenue durant la création des répertoires" & vbCrLf & ex.Message.ToString)
            End Try
        End Sub
    Batch File command
    -- This command work fine and create the folder Gestion de Contrat
    md "Gestion de Contrat"  
    -- These command concerning grant fail
    icacls "Gestion de Contrat" /grant "Patrons":(OI)(CI)(RX)
    icacls "Gestion de Contrat" /grant "Patrons":(OI)(CI)(RD)
    icacls "Gestion de Contrat" /grant "Patrons":(OI)(CI)(W)
    icacls "Gestion de Contrat" /grant "Patrons":(OI)(CI)(M)
    icacls "Gestion de Contrat" /grant "Secretaires":(OI)(CI)(RX)
    icacls "Gestion de Contrat" /grant "Secretaires":(OI)(CI)(RD)
    icacls "Gestion de Contrat" /grant "Secretaires":(OI)(CI)(W)
    icacls "Gestion de Contrat" /grant "Secretaires":(OI)(CI)(M)
    icacls "Gestion de Contrat" /grant "Administration":(OI)(CI)(RX)
    icacls "Gestion de Contrat" /grant "Administration":(OI)(CI)(RD)
    icacls "Gestion de Contrat" /grant "Administration":(OI)(CI)(W)
    icacls "Gestion de Contrat" /grant "Administration":(OI)(CI)(M)
    Thanks in advance
    GC99

  • Cannot activate password file

    Hello,
    I need to enable remote login for sysdba / sysoper thus I've created a password file.
    &gt; orapwd file=orapwd.pwd password=super_secret entries=10The file orapwd.pwd was created successful in $ORACLE_HOME/dbs.Now in SQL*Plus
    SQL&gt; SELECT VALUE FROM v$parameter WHERE NAME = 'remote_login_passwordfile';
    VALUE
    EXCLUSIVE
    SQL&gt; GRANT sysdba TO sysuser;
    ERROR: at line 1:
    ORA-01994: GRANT failed: password file missing or disabledThis happens after a database restart too.I've even tried to switch back to a pfile instead of the spfile use to set the parameter to NONE and EXCLUSIVE back and forth.
    Any idea what else could be wrong?
    Thanks in advance
    Frank

    Yes, that was it, thanks
    The documentation library says:
    ------ snip ------
    The following command creates a password file named acct.pwd that allows up to 30 privileged users with different passwords. In this example, the file is initially created with the password secret for users connecting as SYS.
    orapwd FILE=acct.pwd PASSWORD=secret ENTRIES=30
    ------ snap ------
    ... and forgets to mention that the filename MUST BE orapw<SID> without any filename extension.
    Thanks again
    Frank

  • Oracle 8i Error ORA-01996 when adding user

    When trying to add a user in Oracle 8i I get the following message...
    "ORA-01996: GRANT failed: password file 'C:\oracle\ora81\DATABASE\PWDacuisp.ora is full"
    Does anyone know if there is parameter setting that needs to be adjusted? The file size of PWDacuisp.ora is 2kb... I am confused!
    Thanks for your help!
    Derek

    Hi,
    You'll have to use the orapwd utility to do so. Check the doc(click) for full reference.
    Regards,
    Yoann.

Maybe you are looking for