Wednesday 6 June 2012

SQLPLUS OPTIONS

sqlplus options:-


1. sqlplus /nolog :

  • Starts SQL*Plus but does not log on (connect) a user/session.

C:\>sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on on Sun Apr7 09:01:36 2012
Copyright (c) 1982, 2005, Oracle.  All rights reserved.




2. sqlplus -v :

  • This option shows users about the version of sqlplus.



3. sqlplus -l username/wrongpassword :

  • This option allows user to login in sqlplus only once correctly & if it fails then user'll be directed to   DOS mode.


  • Otherwise 3 times login request is made.


4. sqlplus scott/tiger:

  • This option allows user to direct login with scott by just specifying username & password as username/password.


5. sqlplus scott/tiger as sysdba:

  • This option allows normal user to login as sysdba privileges.It'll act as a sysuser for the particular session.It'll use all system privileges which a sysuser has. 


Saturday 2 June 2012

Difference between SYSDBA and SYSOPER:-

Difference between SYSDBA and SYSOPER:-


SYSOPER:-


SYSOPER privilege allows operations such as: 
        Instance startup, mount & database open ,

        Instance shutdown, dismount & database close ,

        Alter database BACKUP, ARCHIVE LOG, and RECOVER.

        This privilege allows the user to perform basic operational tasks 
        without the ability to look at user data.





SYSDBA:-

SYSDBA can do more than start/stop the database. It has a lot more functionality that sysoper (Operator mode) which is normally used for basic database functions such as start/stop.

SYSDBA privilege includes all SYSOPER privileges plus full system privileges 
        (with the ADMIN option), plus 'CREATE DATABASE' etc
        This is effectively the same set of privileges available when 
        previously connected INTERNAL.


SYSDBA and SYSOPER are system privileges and don't misunderstand with DBA.DBA is a role which includes all system privileges excluding sysdba and sysoper.


sysdba and sysoper can be granted to user for administrative tasks by sys user.

for instance: 

grant [sysdba/sysoper] to <user's name>.
user may be anyone on which sys is going to give sysdba and sysoper privileges.