Oracle tips

获取会话ID

SELECT SID FROM V$SESSION WHERE USERNAME = ‘<Schema_user>’

获取被锁事务

SELECT SID, TYPE, LMODE, REQUEST, CTIME, BLOCK FROM V$LOCK WHERE SID IN (SELECT SID FROM V$SESSION WHERE USERNAME = ‘<Schema_user>’)

获取被锁对象

SELECT OBJECT_ID, SESSION_ID ORACLE_USERNAME, OS_USER_NAME, PROCESS, LOCKED_MODE FROM V$LOCKED_OBJECT WHERE
SESSION_ID IN (SELECT SID FROM V$SESSION WHERE USERNAME = ‘<Schema_user>’)

数据导入导出
exp cls02/[password]@[OracleName@tns_name] file=c:cls02_20080528.dmp owner=cls02 indexes=no statistics=none

imp qa02/[password] @[OracleName@tns_name] file=c:cls02_20080528.dmp fromuser=cls02 touser=qa02

获取服务器的语言设置(解决乱码问题时用到)

select * from v$nls_parameters

看这两个字段:
NLS_LANGUAGE
NLS_CHARACTERSET

NLS_LANG格式:
NLS_LANG = language_territory.charset
有三个组成部分(语言、地域和字符集),每个成分控制了NLS子集的特性。其中:language 指定服务器消息的语言。
territory 指定服务器的日期和数字格式。
charset 指定字符集

确保和客户端的设置是一样的

Comments are closed.