본문 바로가기

Oracle

Create user

ACCOUNT 절

ACCOUNT LOCK 을 지정하면 사용자 계정은 잠기게되고 접근할수 없게 된다.

ACCOUNT UNLOCK을 지정하면 사용자 계정은 활성화되고 접근 할수 있게 된다..

Examples

아래의 모든 예제는 example 테이블스페이스을 사용한다.

Creating a Database User: Example If you create a new user with PASSWORD EXPIRE, then the user's password must be changed before the user attempts to log in to the database. You can create the user sidney by issuing the following statement:
아래의 예제는 sidney라른 사용자계정을 생성한 예제이고, PASSWORD EXPIRE
CREATE USER sidney 
IDENTIFIED BY out_standing1
DEFAULT TABLESPACE example
QUOTA 10M ON example
TEMPORARY TABLESPACE temp
QUOTA 5M ON system
PROFILE app_user
PASSWORD EXPIRE;

The user sidney has the following characteristics:

  • The password out_standing1

  • Default tablespace example, with a quota of 10 megabytes

  • Temporary tablespace temp

  • Access to the tablespace SYSTEM, with a quota of 5 megabytes

  • Limits on database resources defined by the profile app_user (which was created in "Creating a Profile: Example")

  • An expired password, which must be changed before sidney can log in to the database

Creating External Database Users: Examples The following example creates an external user, who must be identified by an external source before accessing the database:

CREATE USER app_user1
IDENTIFIED EXTERNALLY
DEFAULT TABLESPACE example
QUOTA 5M ON example
PROFILE app_user;

The user app_user1 has the following additional characteristics:

  • Default tablespace example

  • Default temporary tablespace example

  • 5M of space on the tablespace example and unlimited quota on the temporary tablespace of the database

  • Limits on database resources defined by the app_user profile

To create another user accessible only by an operating system account, prefix the user name with the value of the initialization parameter OS_AUTHENT_PREFIX. For example, if this value is "ops$", you can create the externally identified user external_user with the following statement:

CREATE USER ops$external_user
IDENTIFIED EXTERNALLY
DEFAULT TABLESPACE example
QUOTA 5M ON example
PROFILE app_user;

Creating a Global Database User: Example The following example creates a global user. When you create a global user, you can specify the X.509 name that identifies this user at the enterprise directory server:

CREATE USER global_user
IDENTIFIED GLOBALLY AS 'CN=analyst, OU=division1, O=oracle, C=US'
DEFAULT TABLESPACE example
QUOTA 5M ON example;