Oracle Admin

From sheep
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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;