mercoledì 9 gennaio 2013

Oracle Database: some SQL useful commands

In this brief post I list some SQL/SQLPlus commands I find pretty useful.

-Quick connect as sysdba:

[oracle@oracle ~]$ sqlplus / as sysdba

-Connect as sysdba to a specific db instance:

If more than one instance is running on same machine you can specify to which instance you wish to connect to using:

[oracle@oracle ~]$ sqlplus

Once logged in specify instance with this syntax:

SQL> conn sys/password@sid as sysdba

Connected.


-Drop user and user owned objects:

To drop a user and any database objects owned by user itself just use this command:

SQL> DROP  USER  user  CASCADE;

Nessun commento:

Posta un commento