Oracle Admin

From Sheep
Jump to: navigation, search

auto login

export ORACLE_SID=sid

sqlplus user/password@tnsName

add permissions to user to connect

grant resource,connect to user; - full permissions


output to file

spool <filename> spool off


killing session

select * from U$session where username="user";

alter system kill session "sid,serial#";

Dump database

exp  user/password@sid FULL=y  FILE=file.dmp
imp user/password FIlE=file.dmp [FROMUSER=user]

show constraints

http://en.wikibooks.org/wiki/Oracle_Programming/SQL_Cheatsheet#Displaying_Constraints

SELECT
	table_name,
	constraint_name,
	constraint_type
FROM user_constraints;