disable connect to database

i want to disable all user from access my oracle database includig user with admin privilage like system  ;
waleed ahmedassociate technical consultant Asked:
Who is Participating?
 
johnsoneSenior Oracle DBACommented:
Not possible to keep anyone from logging in.  You can keep most people out, but not everyone.

I see 2 options.

Issue this command:

ALTER SYSTEM ENABLE RESTRICTED SESSION;

That will prevent anyone that does not have the RESTRICTED SESSION privilege from connecting.  Out of the box, that would be the SYS user and any user with the DBA role.

The other would be to create a logon trigger that just returns an error.  This should prevent everyone except SYS from logging in.
0
 
pcelbaCommented:
In Windows: Simply stop the Oracle service
On other operating systems also the possibility to stop the Oracle database exists. Just tell what OS do you use.

You should tell what is your main goal. Remember admins do have access to all files after stopping the Oracle service.
0
 
waleed ahmedassociate technical consultant Author Commented:
i want to do some thing on my database and i don`t want any user to login to the database including the user with admin privilage  
i used oracle linux 7.4 as os
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
pcelbaCommented:
0
 
waleed ahmedassociate technical consultant Author Commented:
i don`t want to stop database
i want to stop all user from login to database
just only me
0
 
Alexander Eßer [Alex140181]Software DeveloperCommented:
What about "just" stopping the Listener ("lsnrctl stop")?! If he's doing his database work directly on the server, he should be able to connect...
0
 
johnsoneSenior Oracle DBACommented:
Stopping the listener wouldn't stop anyone who has an account on the server from connecting.  It would also stop connections to all databases the listener serves and not just the one that you are working on.
0
 
johnsoneSenior Oracle DBACommented:
I forgot to mention....

To allow users to connect again, issue:

ALTER SYSTEM DISABLE RESTRICTED SESSION;

I'm sure everyone could figure that out, but just putting it out there.

In addition, if you were doing a restart, instead of STARTUP, use STARTUP RESTRICT.  Then it is enabled at startup and you can disable with the above command as well (without having to restart again).
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.