Oracle Admin

From Moo
Jump to: navigation, search

auto login[edit]

export ORACLE_SID=sid

sqlplus user/password@tnsName

add permissions to user to connect[edit]

grant resource,connect to user; - full permissions


output to file[edit]

spool <filename> spool off


killing session[edit]

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

alter system kill session "sid,serial#";

Dump database[edit]

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

show constraints[edit]

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

SELECT
	table_name,
	constraint_name,
	constraint_type
FROM user_constraints;