Lock the SYS account [message #622550] |
Wed, 27 August 2014 09:54  |
 |
Michel Cadot
Messages: 68737 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Lalit Kumar B wrote on Wed, 27 August 2014 16:07Lock the sys account? Why? A user not having the necessary privileges would not be able to login as sys. So why the question to lock?
You cannot lock SYS.
|
|
|
|
Re: Locking the system user id in oracle [message #622553 is a reply to message #622552] |
Wed, 27 August 2014 10:14   |
 |
Michel Cadot
Messages: 68737 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
You can't? I can, there is a button for this. 
And you can lock your own account in Oracle (if you are not SYS):
SQL> show user
USER is "MICHEL"
SQL> alter user michel account lock;
User altered.
SQL> connect michel/michel
ERROR:
ORA-28000: the account is locked
Warning: You are no longer connected to ORACLE.
Anyway, it is better you can't lock SYS:
SYS> show user
USER is "SYS"
SYS> alter user sys account lock;
User altered.
SYS> connect sys as sysdba
Enter password:
Connected.
Even if (for completion):
SQL> select account_status from dba_users where username='SYS';
ACCOUNT_STATUS
--------------------------------
LOCKED
Lalit : Removed superfluous lines. I wonder how these extra lines get appended.
[Updated on: Wed, 27 August 2014 10:24] by Moderator Report message to a moderator
|
|
|
|
Re: Locking the system user id in oracle [message #622555 is a reply to message #622552] |
Wed, 27 August 2014 10:21   |
cookiemonster
Messages: 13965 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Lalit Kumar B wrote on Wed, 27 August 2014 16:02Michel, it was a question to OP. Perhaps, "how?" would have been more appropriate than "why?". Sorry for the confusion.
An analogy, I cannot lock my car while I am still inside.
It's the wrong question though. OP is asking about system not sys.
|
|
|
|
Re: Locking the system user id in oracle [message #622560 is a reply to message #622553] |
Wed, 27 August 2014 11:51   |
John Watson
Messages: 8965 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
One can lock the sys account:12c orclz>
12c orclz>
12c orclz> alter user sys account lock;
User altered.
12c orclz> conn sys/oracle
ERROR:
ORA-28000: the account is locked
Warning: You are no longer connected to ORACLE.
12c > Anyone know how I did that?
|
|
|
|
|
|
|
|
Re: Lock the SYS account [message #622571 is a reply to message #622570] |
Wed, 27 August 2014 12:34   |
John Watson
Messages: 8965 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
You have the answer, Michel. I thought you probably would. I'll post the answer tomorrow, in case anyone wants to try and work it out. Hint: think back to release 7.
|
|
|
|
Re: Lock the SYS account [message #622577 is a reply to message #622572] |
Wed, 27 August 2014 14:01   |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
In a quite old AskTom thread, Thomas said :
Quote:
If an user is in the dba group, then that user can connect "/ as sysdba", and they can connect "anything/anything as sysdba"
|
|
|
|
Re: Lock the SYS account [message #622596 is a reply to message #622580] |
Wed, 27 August 2014 23:28   |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
Ok, understood. Did some research and got the answer. It's the parameter O7_DICTIONARY_ACCESSIBILITY set to TRUE after logging as sysdba. Then we can simply connect without sysdba, but of course we can't perform any operations of sysdba.
|
|
|
|
|
|
Re: Lock the SYS account [message #622619 is a reply to message #622606] |
Thu, 28 August 2014 02:46   |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
Michel Cadot wrote on Thu, 28 August 2014 12:02
Post result of
show parameter spfile
show parameter ifile
Here you go,
SQL*Plus: Release 12.1.0.1.0 Production on Thu Aug 28 13:10:48 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string C:\APP\LALIT\PRODUCT\12.1.0.1\
DBHOME_1\BIN\DATABASE\SPFILEOR
CL.ORA
SQL> show parameter ipfile
SQL>
No results for ifile parameter.
|
|
|
|
|
|
|