I have a script which must be run as sys but i do not have the sys password, i only have the system password.
Can i , either reset the sys password using system user or connect as sys without it ?
I am using oracle 9i
The better way to change the sys password is creating a orapwd file & bounce the db. But, this can't be done again & again on PRD systems. Hence you can follow this way.
First check whether sys user has any password, if has the notedown by connecting to db as [ sqlplus " / as sysdba" ] & running the given query. Some time for security reason some companies policy may lock the sys & system login with null password. CHECK IT OUT.
select username, account_status, password from dba_users where username='SYS';
then alter the sys login with new password
alter use sys identified by <new pass>;
once you script executing is complete revert the old password again
alter user sys identified by values 'old password';