|
No. Profile_1
Oracle9i Profile_1
==================
PURPOSE
-------
ProfileÀ» ÀÌ¿ëÇÑ »ç¿ëÀÚ ÀÚ¿ø °ü¸®¿¡ ´ëÇؼ ¾Ë¾Æº¸ÀÚ
Explanation
-----------
(1) ProfileÀ» »ç¿ëÇÒ ¼ö ÀÖµµ·Ï ȯ°æ ¼³Á¤
SQL> connect system
Enter password:
Connected.
SQL> show parameter resource
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
enqueue_resources integer 968
resource_limit boolean FALSE
resource_manager_plan string
SQL> alter system set resource_limit = true scope=spfile;
System altered.
# resource_limit¸¦ true·Î º¯°æÇÑ ÈÄ DB Àç½ÃÀÛ.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 236000476 bytes
Fixed Size 451804 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL> show parameter resource
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
enqueue_resources integer 968
resource_limit boolean TRUE
resource_manager_plan string
(2) Profile¿¡´Â ¾î¶²°ÍµéÀÌ ÀÖ´ÂÁö Á¶È¸ÇØ º¸ÀÚ
SQL> desc dba_profiles;
Name Null? Type
----------------------------------------- -------- ----------------------------
PROFILE NOT NULL VARCHAR2(30)
RESOURCE_NAME NOT NULL VARCHAR2(32)
RESOURCE_TYPE VARCHAR2(8)
LIMIT VARCHAR2(40)
SQL> select resource_name, resource_type from dba_profiles;
RESOURCE_NAME RESOURCE
-------------------------------- --------
COMPOSITE_LIMIT KERNEL
FAILED_LOGIN_ATTEMPTS PASSWORD
SESSIONS_PER_USER KERNEL
PASSWORD_LIFE_TIME PASSWORD
CPU_PER_SESSION KERNEL
PASSWORD_REUSE_TIME PASSWORD
CPU_PER_CALL KERNEL
PASSWORD_REUSE_MAX PASSWORD
LOGICAL_READS_PER_SESSION KERNEL
PASSWORD_VERIFY_FUNCTION PASSWORD
LOGICAL_READS_PER_CALL KERNEL
RESOURCE_NAME RESOURCE
-------------------------------- --------
PASSWORD_LOCK_TIME PASSWORD
IDLE_TIME KERNEL
PASSWORD_GRACE_TIME PASSWORD
CONNECT_TIME KERNEL
PRIVATE_SGA KERNEL
(3) Profile »ý¼º
SQL> create profile test_profile limit
2 sessions_per_user 2
3 cpu_per_session unlimited
4 cpu_per_call 6000
5 idle_time 1
6 connect_time 480
7 /
Profile created.
# ¼¼¼Ç´ç 2¸íÀÇ À¯Àú¸¦ Çã¿ëÇÏ°í SessionÀÇ Á¢¼ÓÈÄ 1ºÐ µ¿¾È ¾Æ¹«·± ÀÛ¾÷ÀÌ ÀϾÁö ¾Ê´Â
´Ù¸é ÀÚµ¿À¸·Î SessionÀ» Á¾·áÇÑ´Ù.
# ProfileÀ» »ý¼ºÇÏ¿© »ç¿ëÀÚ¿¡°Ô ÁöÁ¤ÇÏÁö ¾ÊÀ¸¸é »õ·Ó°Ô »ý¼ºµÇ´Â ¸ðµç »ç¿ëÀÚ´Â Default·Î
Á¤ÀÇµÈ ¸ðµç ProfileÀÇ ±â´ÉÀ» ¼öÇàÇÒ¼ö ÀÖ´Ù.
# connect_timeÀº 8ºÐ( 480 )µ¿¾È¸¸ SessionÀ» »ç¿ëÇÒ ¼ö ÀÖ°Ô Á¦ÇÑÇÑ´Ù.
SQL> select profile, resource_name, limit from dba_profiles
2 where profile = 'TEST_PROFILE';
PROFILE RESOURCE_NAME LIMIT
------------------------------ -------------------------------- --------------
TEST_PROFILE COMPOSITE_LIMIT DEFAULT
TEST_PROFILE SESSIONS_PER_USER 2
TEST_PROFILE CPU_PER_SESSION UNLIMITED
TEST_PROFILE CPU_PER_CALL 6000
TEST_PROFILE LOGICAL_READS_PER_SESSION DEFAULT
TEST_PROFILE LOGICAL_READS_PER_CALL DEFAULT
TEST_PROFILE IDLE_TIME 1
TEST_PROFILE CONNECT_TIME 480
TEST_PROFILE PRIVATE_SGA DEFAULT
TEST_PROFILE FAILED_LOGIN_ATTEMPTS DEFAULT
TEST_PROFILE PASSWORD_LIFE_TIME DEFAULT
TEST_PROFILE PASSWORD_REUSE_TIME DEFAULT
TEST_PROFILE PASSWORD_REUSE_MAX DEFAULT
TEST_PROFILE PASSWORD_VERIFY_FUNCTION DEFAULT
TEST_PROFILE PASSWORD_LOCK_TIME DEFAULT
TEST_PROFILE PASSWORD_GRACE_TIME DEFAULT
# ¼³Á¤ÇÑ ProfileÀÌ Á¦´ë·Î Àû¿ëµÇ¾ú´ÂÁö È®ÀÎ.
(4) »ý¼ºÇÑ ProfileÀ» »ç¿ëÀÚ¿¡°Ô Àû¿ë½ÃÅ°°í °á°ú¸¦ È®ÀÎÇÑ´Ù
SQL> alter user kigook profile test_profile;
User altered.
SQL> connect kigook/kigook
Connected.
SQL> select * from t;
ID
--
aa
# 1ºÐÈÄ¿¡ ´Ù½Ã °°Àº ¹®ÀåÀ» Á¶È¸ÇØ º¸ÀÚ.
SQL> /
select * from t
*
ERROR at line 1:
ORA-02396: exceeded maximum idle time, please connect again
# Á¢¼ÓÈÄ 1ºÐ°£ ¾Æ¹«·± ÀÛ¾÷ÀÌ ¾øÀ¸¸é ÀÚµ¿À¸·Î SessionÀ» Á¾·á½ÃÅ°´ÂÁö È®ÀÎ.
(5) ProfileÀÇ ¼öÁ¤
SQL> connect system
Enter password:
Connected.
SQL> alter profile test_profile limit
2 idle_time 10
3 /
Profile altered.
SQL> select resource_name, limit from dba_profiles
2 where resource_name like '%IDLE_TIME%';
RESOURCE_NAME LIMIT
-------------------------------- ----------------------------------------
IDLE_TIME UNLIMITED
IDLE_TIME 10
# º¯°æµÈ ProfileÀÇ ³»¿ë È®ÀÎ.
Conclusion
----------
ProfileÀ» Àû¿ëÇÏ¿© °èÁ¤¿¡ ´ëÇÑ °ü¸®¿¡ ´ëÇؼ ¾Ë¾Æº¸¾Ò´Ù. ´ÙÀ½ Note¿¡¼ ´Ù¸¥ ºÎºÐ¿¡ ´ë
Çؼ ¾Ë¾Æº¸°Ú´Ù.
Reference Documents
-------------------
No. Profile_2
Written by Kigook Choi
|