---
title: "怎么确保最终用户在数据库中只有一个会话"
author: "wanglihu"
date: "2009-08-11T18:47:43Z"
tags: []
slug: "untitled"
draft: false
lastmod: "2009-08-11T18:47:43Z"
id: 444958
url: "https://wanglihu.iteye.com/blog/444958"
---

sqlplus / as sysdba
create user test identified by test;
create profile one_session limit sessions_per_user 1;
alter user test profile one_session;
alter system set resource_limit=true;
conn test/test
host sqlplus test/test

SQL*Plus: Release 10.2.0.3.0 - Production on 星期二 8月 11 17:09:05 2009

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

ERROR:
ORA-02391: 超出同时存在的 SESSIONS_PER_USER 限制