jump to navigation

Turn off Oracle password expiration Tue - Jul 24, 2012

Posted by supriyatna in All, Howto, Oracle.
Tags: , ,
trackback

Pada Oracle Database 11g (termasuk Oracle Database XE -Express Edition- 11g) secara default password user akan expired setelah 180 hari. Pesan error yang muncul adalah sebagai berikut:

ERROR:
ORA-28001: the password has expired

Setting 180 hari ini ditentukan pada Oracle profile. Kita bisa melihat nilai dari DEFAULT profile melalui select terhadap table DBA_PROFILES.

SQL> set linesize 300
SQL> select * from dba_profiles order by 1,2;

PROFILE   RESOURCE_NAME               RESOURCE LIMIT
--------- --------------------------- -------- ---------
DEFAULT   COMPOSITE_LIMIT             KERNEL   UNLIMITED
DEFAULT   SESSIONS_PER_USER           KERNEL   UNLIMITED
DEFAULT   CPU_PER_SESSION             KERNEL   UNLIMITED
DEFAULT   CPU_PER_CALL                KERNEL   UNLIMITED
DEFAULT   LOGICAL_READS_PER_SESSION   KERNEL   UNLIMITED
DEFAULT   LOGICAL_READS_PER_CALL      KERNEL   UNLIMITED
DEFAULT   IDLE_TIME                   KERNEL   UNLIMITED
DEFAULT   CONNECT_TIME                KERNEL   UNLIMITED
DEFAULT   PRIVATE_SGA                 KERNEL   UNLIMITED
DEFAULT   FAILED_LOGIN_ATTEMPTS       PASSWORD 10
DEFAULT   PASSWORD_LIFE_TIME          PASSWORD 180
DEFAULT   PASSWORD_REUSE_TIME         PASSWORD UNLIMITED
DEFAULT   PASSWORD_REUSE_MAX          PASSWORD UNLIMITED
DEFAULT   PASSWORD_VERIFY_FUNCTION    PASSWORD NULL
DEFAULT   PASSWORD_LOCK_TIME          PASSWORD 1
DEFAULT   PASSWORD_GRACE_TIME         PASSWORD 7

16 rows selected.

Untuk mematikan/mendisable password expiration cara paling mudah yaitu dengan merubah setting PASSWORD_LIFE_TIME dari 180 (hari) menjadi UNLIMITED.

ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

Saya sendiri cenderung lebih memilih untuk membuat profile baru, dengan setting parameter yang telah kita sesuaikan. Untuk membuat/men-drop profile baru dengan cara berikut:

-- DROP PROFILE default2;
CREATE PROFILE default2 LIMIT
    COMPOSITE_LIMIT UNLIMITED
    CONNECT_TIME UNLIMITED
    CPU_PER_CALL UNLIMITED
    CPU_PER_SESSION UNLIMITED
    FAILED_LOGIN_ATTEMPTS 10
    IDLE_TIME UNLIMITED
    LOGICAL_READS_PER_CALL UNLIMITED
    LOGICAL_READS_PER_SESSION UNLIMITED
    PASSWORD_GRACE_TIME 7
    PASSWORD_LIFE_TIME UNLIMITED
    PASSWORD_LOCK_TIME 1
    PASSWORD_REUSE_MAX UNLIMITED
    PASSWORD_REUSE_TIME UNLIMITED
    PASSWORD_VERIFY_FUNCTION NULL
    PRIVATE_SGA UNLIMITED
    SESSIONS_PER_USER UNLIMITED
;

Lalu assign profile DEFAULT2 yang baru saja dibuat terhadap user yang kita inginkan.

ALTER USER dede PROFILE DEFAULT2;

Comments»

No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: