2016. 9. 7. 11:21 오라클

oracle option enable


Oracle option enable/disable 방법


라이센스에 관련된 부분이니 민감한 부분임...


원래 DB 내리고 하라고 하는데 Single 이라 그런지 기동상태에서 해도 잘 되네??


But!!! alert log 살펴보면 해당 메세지 지속적으로 발생함.


Wed Sep 07 10:58:44 2016

WARNING: Oracle executable binary mismatch detected.

 Binary of new process does not match binary which started instance

issue alter system set "_disable_image_check" = true to disable these messages


현재 인스상태 상태와 일치하지 않으므로 메세지 발생하게 됨.

내렸다 올리면 없어짐..


[oracle:/home/oracle]#chopt disable partitioning


Writing to /oracle/product/11.2.0.4/install/disable_partitioning.log...

/usr/bin/make -f /oracle/product/11.2.0.4/rdbms/lib/ins_rdbms.mk part_off ORACLE_HOME=/oracle/product/11.2.0.4

/usr/bin/make -f /oracle/product/11.2.0.4/rdbms/lib/ins_rdbms.mk ioracle ORACLE_HOME=/oracle/product/11.2.0.4


sys@TEST> set line 120;

sys@TEST> col parameter for A50

sys@TEST> col value for A20

sys@TEST> select parameter,value from v$option where parameter='Partitioning';


PARAMETER                                          VALUE

-------------------------------------------------- --------------------

Partitioning                                          FALSE


- 11.2


chopt enable dm  (Oracle Data Mining)

chopt disable dm


chopt enable dv (Database Vault)

chopt disable dv


chopt enable olap (Oracle OLAP)

chopt disable olap


chopt enable lbac (Oracle Label Security)

chopt disable lbac


chopt enable partitioning (Oracle Partitioning)

chopt disable partitioning


chopt enable rat (Real Application Testing)

chopt disable rat


- 12.1


chopt enable dm  (Oracle Data Mining)

chopt disable dm


chopt enable olap (Oracle OLAP)

chopt disable olap


chopt enable partitioning (Oracle Partitioning)

chopt disable partitioning


chopt enable rat (Real Application Testing)

chopt disable rat


- 해당 옵션 적용 여부 확인


set line 120;

col parameter for A50

col value for A20

select parameter,value from v$option where parameter='Partitioning';

select parameter,value from v$option where parameter='Active Data Guard';


- 해당 옵션 사용유무 확인


col name for A60

col version for A15

select name, version, last_usage_date,currently_used from DBA_FEATURE_USAGE_STATISTICS where upper(name) like '%PARTITION%';


select name, version, last_usage_date,currently_used from DBA_FEATURE_USAGE_STATISTICS where upper(name) like '%OLAP%';


select name, version, last_usage_date,currently_used from DBA_FEATURE_USAGE_STATISTICS where upper(name) like '%TEXT%';


select name, version, last_usage_date,currently_used from DBA_FEATURE_USAGE_STATISTICS where upper(name) like '%XDB%';


select name, version, last_usage_date,currently_used from DBA_FEATURE_USAGE_STATISTICS where upper(name) like '%VAULT%';


select name, version, last_usage_date,currently_used from DBA_FEATURE_USAGE_STATISTICS where upper(name) like '%REAL%';


select name, version, last_usage_date,currently_used from DBA_FEATURE_USAGE_STATISTICS where upper(name) like '%LABEL%';


select name, version, last_usage_date,currently_used from DBA_FEATURE_USAGE_STATISTICS where upper(name) like '%ACTIVE%';



Posted by pat98

잘쓰던 시스템이 local 접속인데도  sqlplus 가 hang 걸리며 안될 때가 있다. 보통 보안관련 설정이나 권한변경 등이 원인이 되곤 하는데..

정확하게 파악하기 위하여 system call 을 추정해서 확인해 볼수 있다.

 

보통 흔한 증상으로

 

idle> conn / as sysdba

 

여기까진 접속이 잘 된다. 근데..

 

SQL> conn / as sysdba 하면 먹통이 된다.

 

==================================

이러면 막막한데 strace 를 써서 확인해 볼수 있겠다.

 

1. 만약  linux 경우

 

strace -f -o sqlplus.trc sqlplus /nolog

connect / as sysdba

 

sqlplus.trc 화일일 열어서 의심이 가는 부분을 확인해 본다. 100%는 아니지만 어느정도 유추가능한 경우가 있음.

 

2. AIX나 Solaris 인 경우

 

truss -aefo sqlplus.trc sqlplus /nolog

connect / as sysdba

(AIX, Solaris)

 

Posted by pat98

계정 변경 및 기타 문제로 인해 Oracle Inventory 정보유실로 corrupt 되었을 때..

 

==================================================

 

[oracle:/oracle]#opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation.  All rights reserved.


Oracle Home       : /oracle/product/11.2.0.4
Central Inventory : /oracle/oraInventory
   from           : /oracle/product/11.2.0.4/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /oracle/product/11.2.0.4/cfgtoollogs/opatch/opatch2016-09-02_10-58-33AM_1.log

OPatch failed to locate Central Inventory.
Possible causes are:
    The Central Inventory is corrupted
    The oraInst.loc file specified is not valid.
LsInventorySession failed: OPatch failed to locate Central Inventory.
Possible causes are:
    The Central Inventory is corrupted
    The oraInst.loc file specified is not valid.

OPatch failed with error code 73

 

==================================================

 Oracle Home 정보를 다시 attach 하여 복구 완료..

 

$ORACLE_HOME/oui/bin> ./runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="/oracle/product/11.2.0.4" ORACLE_HOME_NAME="OraDb11g_home1"

 

확인 잘됨 !

 

[oracle:/home/oracle]#opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation.  All rights reserved.


Oracle Home       : /oracle/product/11.2.0.4
Central Inventory : /oracle/oraInventory
   from           : /oracle/product/11.2.0.4/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /oracle/product/11.2.0.4/cfgtoollogs/opatch/opatch2016-09-02_11-02-35AM_1.log

Lsinventory Output file location : /oracle/product/11.2.0.4/cfgtoollogs/opatch/lsinv/lsinventory2016-09-02_11-02-35AM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: single
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1):

Oracle Database 11g                                                  11.2.0.4.0
There are 1 products installed in this Oracle Home.


Interim patches (1) :

Patch  22502456     : applied on Thu Apr 21 16:29:11 KST 2016
Unique Patch ID:  19856194
Patch description:  "Database Patch Set Update : 11.2.0.4.160419 (22502456)"
   Created on 21 Mar 2016, 11:49:22 hrs
Sub-patch  21948347; "Database Patch Set Update : 11.2.0.4.160119 (21948347)"
Sub-patch  21352635; "Database Patch Set Update : 11.2.0.4.8 (21352635)"
Sub-patch  20760982; "Database Patch Set Update : 11.2.0.4.7 (20760982)"
Sub-patch  20299013; "Database Patch Set Update : 11.2.0.4.6 (20299013)"
Sub-patch  19769489; "Database Patch Set Update : 11.2.0.4.5 (19769489)"
Sub-patch  19121551; "Database Patch Set Update : 11.2.0.4.4 (19121551)"
Sub-patch  18522509; "Database Patch Set Update : 11.2.0.4.3 (18522509)"
Sub-patch  18031668; "Database Patch Set Update : 11.2.0.4.2 (18031668)"
Sub-patch  17478514; "Database Patch Set Update : 11.2.0.4.1 (17478514)"
   Bugs fixed:
     17288409, 21051852, 17811429, 18607546, 17205719, 20506699, 17816865
     17922254, 17754782, 16934803, 13364795, 17311728, 17441661, 17284817
     16992075, 17446237, 14015842, 19972569, 21756677, 21538558, 20925795
     17449815, 17375354, 19463897, 13866822, 17982555, 17235750, 17478514
     18317531, 14338435, 18235390, 20803583, 13944971, 20142975, 17811789
     16929165, 18704244, 20506706, 17546973, 20334344, 14054676, 17088068
     17346091, 18264060, 17343514, 21538567, 19680952, 18471685, 19211724
     13951456, 21847223, 16315398, 18744139, 16850630, 19049453, 18673304
     17883081, 19915271, 18641419, 18262334, 17006183, 16065166, 18277454
     16833527, 10136473, 18051556, 17865671, 17852463, 18554871, 17853498
     18334586, 17551709, 17588480, 19827973, 17344412, 17842825, 18828868
     17025461, 11883252, 13609098, 17239687, 17602269, 19197175, 22195457
     18316692, 17313525, 12611721, 19544839, 18964939, 17600719, 18191164
     19393542, 17571306, 18482502, 20777150, 19466309, 17040527, 17165204
     18098207, 16785708, 17465741, 17174582, 16180763, 16777840, 12982566
     19463893, 22195465, 16875449, 12816846, 17237521, 19358317, 17811438
     17811447, 21983325, 17945983, 18762750, 16912439, 17184721, 18061914
     17282229, 18331850, 18202441, 17082359, 18723434, 21972320, 19554106
     14034426, 18339044, 19458377, 17752995, 20448824, 17891943, 17258090
     17767676, 16668584, 18384391, 17040764, 17381384, 15913355, 18356166
     14084247, 20596234, 20506715, 21756661, 13853126, 18203837, 14245531
     21756699, 16043574, 22195441, 17848897, 17877323, 21453153, 17468141
     20861693, 17786518, 17912217, 17037130, 18155762, 16956380, 17478145
     17394950, 18641461, 18189036, 18619917, 17027426, 21352646, 16268425
     22195492, 19584068, 18436307, 17265217, 17634921, 13498382, 21526048
     19258504, 20004087, 17443671, 22195485, 18000422, 20004021, 22321756
     17571039, 21067387, 16344544, 18009564, 14354737, 21286665, 18135678
     18614015, 20441797, 18362222, 17835048, 16472716, 17936109, 17050888
     17325413, 14010183, 18747196, 17761775, 16721594, 17082983, 20067212
     21179898, 17302277, 18084625, 15990359, 18203835, 17297939, 17811456
     16731148, 21168487, 13829543, 17215560, 14133975, 17694209, 17385178
     18091059, 8322815, 17586955, 17201159, 17655634, 18331812, 19730508
     18868646, 17648596, 16220077, 16069901, 17348614, 17393915, 17274537
     17957017, 18096714, 17308789, 18436647, 14285317, 19289642, 14764829
     18328509, 17622427, 22195477, 16943711, 22502493, 14368995, 17346671
     18996843, 17783588, 21343838, 16618694, 17672719, 18856999, 18783224
     17851160, 17546761, 17798953, 18273830, 22092979, 16596890, 19972566
     16384983, 17726838, 17360606, 22321741, 13645875, 18199537, 16542886
     21787056, 17889549, 14565184, 17071721, 17610798, 20299015, 21343897
     22893153, 20657441, 17397545, 18230522, 16360112, 19769489, 12905058
     18641451, 12747740, 18430495, 17016369, 17042658, 14602788, 17551063
     19972568, 21517440, 18508861, 19788842, 14657740, 17332800, 13837378
     19972564, 17186905, 18315328, 19699191, 17437634, 22353199, 18093615
     19006849, 19013183, 17296856, 18674024, 17232014, 16855292, 17762296
     14692762, 21051840, 17705023, 19121551, 21330264, 19854503, 21868720
     19309466, 18681862, 18554763, 20558005, 17390160, 18456514, 16306373
     13955826, 18139690, 17501491, 17752121, 21668627, 17299889, 17889583
     18673325, 19721304, 18293054, 17242746, 17951233, 17649265, 18094246
     19615136, 17011832, 16870214, 17477958, 18522509, 20631274, 16091637
     17323222, 16595641, 16524926, 18228645, 18282562, 17596908, 17156148
     18031668, 16494615, 22683225, 17545847, 17655240, 17614134, 13558557
     17341326, 17891946, 17716305, 16392068, 19271443, 21351877, 18092127
     18440047, 17614227, 14106803, 16903536, 18973907, 18673342, 19032867
     17389192, 17612828, 16194160, 17006570, 17721717, 17390431, 17570240
     16863422, 18325460, 19727057, 16422541, 19972570, 17267114, 18244962
     21538485, 18765602, 18203838, 16198143, 17246576, 14829250, 17835627
     18247991, 14458214, 21051862, 16692232, 17786278, 17227277, 16042673
     16314254, 16228604, 16837842, 17393683, 17787259, 20331945, 20074391
     15861775, 16399083, 18018515, 22683212, 18260550, 21051858, 17036973
     16613964, 17080436, 16579084, 18384537, 18280813, 20296213, 16901385
     15979965, 18441944, 16450169, 9756271, 17892268, 11733603, 16285691
     17587063, 21343775, 16538760, 18180390, 18193833, 21387964, 21051833
     17238511, 17824637, 16571443, 18306996, 14852021, 18674047, 17853456
     12364061, 22195448

 

--------------------------------------------------------------------------------

OPatch succeeded.

Posted by pat98

음..12cR2 Beta3에서는 샘플 스크립트가 빠져있네... 샘플이 왜 누락되어 있는지?.. 보고 확인해야 될 때가 있는데..


더 엄격한 ora12c_strong_verify_function 도 추가되어 있군..12cR1 부터 있었는진 모르겠다..


12cR2 Beta3 꺼


$ORACLE_HOEn/rdbms/admin/utlpwdmg.sql


Rem

Rem $Header: rdbms/admin/utlpwdmg.sql /main/13 2016/01/04 21:20:04 sumkumar Exp $

Rem

Rem utlpwdmg.sql

Rem

Rem Copyright (c) 2006, 2015, Oracle and/or its affiliates.

Rem All rights reserved.

Rem

Rem    NAME

Rem      utlpwdmg.sql - script for Default Password Resource Limits

Rem

Rem    DESCRIPTION

Rem      This is a script for enabling the password management features

Rem      by setting the default password resource limits.

Rem

Rem    NOTES

Rem      This file contains a function for minimum checking of password

Rem      complexity. This is more of a sample function that the customer

Rem      can use to develop the function for actual complexity checks that the

Rem      customer wants to make on the new password.

Rem

Rem    MODIFIED   (MM/DD/YY)

Rem    sumkumar    12/15/15 - Bug 22369990: Make all PVFs as common objects

Rem                           so as to make them available inside PDBs

Rem    yanlili     09/18/15 - Fix bug 20603202: Handle quoted usernames if

Rem                           called directly

Rem    hmohanku    02/17/15 - bug 20460696: add long identifier support

Rem    sumkumar    12/26/14 - Proj 46885: set inactive account time to

Rem                           UNLIMITED for DEFAULT profile

Rem    jkati       10/16/13 - bug#17543726 : remove complexity_check,

Rem                           string_distance, ora12c_strong_verify_function

Rem                           since we now provide them by default with new db

Rem                           creation

Rem    skayoor     10/26/12 - Bug 14671375: Execute privilege on pwd verify

Rem                           func

Rem    jmadduku    07/30/12 - Bug 13536142: Re-organize the code

Rem    jmadduku    12/02/11 - Bug 12839255: Compliant Password Verify functions

Rem    jmadduku    01/21/11 - Proj 32507: Add a new password verify function

Rem                           STIG_verify_function and enhance functionality of

Rem                           code that checks distance between old and new

Rem                           password

Rem    asurpur     05/30/06 - fix - 5246666 beef up password complexity check

Rem    nireland    08/31/00 - Improve check for username=password. #1390553

Rem    nireland    06/28/00 - Fix null old password test. #1341892

Rem    asurpur     04/17/97 - Fix for bug479763

Rem    asurpur     12/12/96 - Changing the name of password_verify_function

Rem    asurpur     05/30/96 - New script for default password management

Rem    asurpur     05/30/96 - Created

Rem



-- This script sets the default password resource parameters

-- This script needs to be run to enable the password features.

-- However the default resource parameters can be changed based

-- on the need.

-- A default password complexity function is provided.


Rem *************************************************************************

Rem BEGIN Password Management Parameters

Rem *************************************************************************


-- This script alters the default parameters for Password Management

-- This means that all the users on the system have Password Management

-- enabled and set to the following values unless another profile is

-- created with parameter values set to different value or UNLIMITED

-- is created and assigned to the user.


ALTER PROFILE DEFAULT LIMIT

PASSWORD_LIFE_TIME 180

PASSWORD_GRACE_TIME 7

PASSWORD_REUSE_TIME UNLIMITED

PASSWORD_REUSE_MAX  UNLIMITED

FAILED_LOGIN_ATTEMPTS 10

PASSWORD_LOCK_TIME 1

INACTIVE_ACCOUNT_TIME UNLIMITED

PASSWORD_VERIFY_FUNCTION ora12c_verify_function;


/**

The below set of password profile parameters would take into consideration

recommendations from Center for Internet Security[CIS Oracle 11g].


ALTER PROFILE DEFAULT LIMIT

PASSWORD_LIFE_TIME 90

PASSWORD_GRACE_TIME 3

PASSWORD_REUSE_TIME 365

PASSWORD_REUSE_MAX  20

FAILED_LOGIN_ATTEMPTS 3

PASSWORD_LOCK_TIME 1

PASSWORD_VERIFY_FUNCTION ora12c_verify_function;

*/


/**

The below set of password profile parameters would take into

consideration recommendations from Department of Defense Database

Security Technical Implementation Guide[STIG v8R1].


ALTER PROFILE DEFAULT LIMIT

PASSWORD_LIFE_TIME 60

PASSWORD_REUSE_TIME 365

PASSWORD_REUSE_MAX  5

FAILED_LOGIN_ATTEMPTS 3

PASSWORD_VERIFY_FUNCTION ora12c_strong_verify_function;

*/


Rem *************************************************************************

Rem END Password Management Parameters

Rem *************************************************************************

[oracle:/oracle/product/12.2.0.1/rdbms/admin]#vi utlpwdmg.sql

PASSWORD_LIFE_TIME 90

PASSWORD_GRACE_TIME 3

PASSWORD_REUSE_TIME 365

PASSWORD_REUSE_MAX  20

FAILED_LOGIN_ATTEMPTS 3

PASSWORD_LOCK_TIME 1

PASSWORD_VERIFY_FUNCTION ora12c_verify_function;

*/


/**

The below set of password profile parameters would take into

consideration recommendations from Department of Defense Database

Security Technical Implementation Guide[STIG v8R1].


ALTER PROFILE DEFAULT LIMIT

PASSWORD_LIFE_TIME 60

PASSWORD_REUSE_TIME 365

PASSWORD_REUSE_MAX  5

FAILED_LOGIN_ATTEMPTS 3

PASSWORD_VERIFY_FUNCTION ora12c_strong_verify_function;

*/


Rem *************************************************************************

Rem END Password Management Parameters

Rem *************************************************************************



샘플없으니 불편해서 일단 11g꺼 참고로 보기로 하고..


11gR2 꺼


$ORACLE_HOEn/rdbms/admin/utlpwdmg.sql


Rem

Rem $Header: utlpwdmg.sql 02-aug-2006.08:18:05 asurpur Exp $

Rem

Rem utlpwdmg.sql

Rem

Rem Copyright (c) 2006, Oracle. All rights reserved.  

Rem

Rem    NAME

Rem      utlpwdmg.sql - script for Default Password Resource Limits

Rem

Rem    DESCRIPTION

Rem      This is a script for enabling the password management features

Rem      by setting the default password resource limits.

Rem

Rem    NOTES

Rem      This file contains a function for minimum checking of password

Rem      complexity. This is more of a sample function that the customer

Rem      can use to develop the function for actual complexity checks that the 

Rem      customer wants to make on the new password.

Rem

Rem    MODIFIED   (MM/DD/YY)

Rem    asurpur     05/30/06 - fix - 5246666 beef up password complexity check 

Rem    nireland    08/31/00 - Improve check for username=password. #1390553

Rem    nireland    06/28/00 - Fix null old password test. #1341892

Rem    asurpur     04/17/97 - Fix for bug479763

Rem    asurpur     12/12/96 - Changing the name of password_verify_function

Rem    asurpur     05/30/96 - New script for default password management

Rem    asurpur     05/30/96 - Created

Rem



-- This script sets the default password resource parameters

-- This script needs to be run to enable the password features.

-- However the default resource parameters can be changed based 

-- on the need.

-- A default password complexity function is also provided.

-- This function makes the minimum complexity checks like

-- the minimum length of the password, password not same as the

-- username, etc. The user may enhance this function according to

-- the need.

-- This function must be created in SYS schema.

-- connect sys/<password> as sysdba before running the script


CREATE OR REPLACE FUNCTION verify_function_11G

(username varchar2,

  password varchar2,

  old_password varchar2)

  RETURN boolean IS 

   n boolean;

   m integer;

   differ integer;

   isdigit boolean;

   ischar  boolean;

   ispunct boolean;

   db_name varchar2(40);

   digitarray varchar2(20);

   punctarray varchar2(25);

   chararray varchar2(52);

   i_char varchar2(10);

   simple_password varchar2(10);

   reverse_user varchar2(32);


BEGIN 

   digitarray:= '0123456789';

   chararray:= 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';


   -- Check for the minimum length of the password

   IF length(password) < 10 THEN

      raise_application_error(-20001, 'Password length less than 10');

   END IF;



   -- Check if the password is same as the username or username(1-100)

   IF NLS_LOWER(password) = NLS_LOWER(username) THEN

     raise_application_error(-20002, 'Password same as or similar to user');

   END IF;

   FOR i IN 1..100 LOOP

      i_char := to_char(i);

      if NLS_LOWER(username)|| i_char = NLS_LOWER(password) THEN

        raise_application_error(-20005, 'Password same as or similar to user name ');

      END IF;

    END LOOP;


   -- Check if the password is same as the username reversed

   

   FOR i in REVERSE 1..length(username) LOOP

     reverse_user := reverse_user || substr(username, i, 1);

   END LOOP;

   IF NLS_LOWER(password) = NLS_LOWER(reverse_user) THEN

     raise_application_error(-20003, 'Password same as username reversed');

   END IF;


   -- Check if the password is the same as server name and or servername(1-100)

   select name into db_name from sys.v$database;

   if NLS_LOWER(db_name) = NLS_LOWER(password) THEN

      raise_application_error(-20004, 'Password same as or similar to server name');

   END IF;

   FOR i IN 1..100 LOOP

      i_char := to_char(i);

      if NLS_LOWER(db_name)|| i_char = NLS_LOWER(password) THEN

        raise_application_error(-20005, 'Password same as or similar to server name ');

      END IF;

    END LOOP;


   -- Check if the password is too simple. A dictionary of words may be

   -- maintained and a check may be made so as not to allow the words

   -- that are too simple for the password.

   IF NLS_LOWER(password) IN ('welcome1', 'database1', 'account1', 'user1234', 'password1', 'oracle123', 'computer1', 'abcdefg1', 'change_on_install') THEN

      raise_application_error(-20006, 'Password too simple');

   END IF;


   -- Check if the password is the same as oracle (1-100)

    simple_password := 'oracle';

    FOR i IN 1..100 LOOP

      i_char := to_char(i);

      if simple_password || i_char = NLS_LOWER(password) THEN

        raise_application_error(-20007, 'Password too simple ');

      END IF;

    END LOOP;


   -- Check if the password contains at least one letter, one digit 

   -- 1. Check for the digit

   isdigit:=FALSE;

   m := length(password);

   FOR i IN 1..10 LOOP 

      FOR j IN 1..m LOOP 

         IF substr(password,j,1) = substr(digitarray,i,1) THEN

            isdigit:=TRUE;

             GOTO findchar;

         END IF;

      END LOOP;

   END LOOP;


   IF isdigit = FALSE THEN

      raise_application_error(-20008, 'Password must contain at least one digit, one character');

   END IF;

   -- 2. Check for the character

   <<findchar>>

   ischar:=FALSE;

   FOR i IN 1..length(chararray) LOOP 

      FOR j IN 1..m LOOP 

         IF substr(password,j,1) = substr(chararray,i,1) THEN

            ischar:=TRUE;

             GOTO endsearch;

         END IF;

      END LOOP;

   END LOOP;

   IF ischar = FALSE THEN

      raise_application_error(-20009, 'Password must contain at least one \

              digit, and one character');

   END IF;



   <<endsearch>>

   -- Check if the password differs from the previous password by at least

   -- 3 letters

   IF old_password IS NOT NULL THEN

     differ := length(old_password) - length(password);


     differ := abs(differ);

     IF differ < 3 THEN

       IF length(password) < length(old_password) THEN

         m := length(password);

       ELSE

         m := length(old_password);

       END IF;


       FOR i IN 1..m LOOP

         IF substr(password,i,1) != substr(old_password,i,1) THEN

           differ := differ + 1;

         END IF;

       END LOOP;


       IF differ < 3 THEN

         raise_application_error(-20011, 'Password should differ from the \

            old password by at least 3 characters');

       END IF;

     END IF;

   END IF;

   -- Everything is fine; return TRUE ;   

   RETURN(TRUE);

END;

/


-- This script alters the default parameters for Password Management

-- This means that all the users on the system have Password Management

-- enabled and set to the following values unless another profile is 

-- created with parameter values set to different value or UNLIMITED 

-- is created and assigned to the user.


ALTER PROFILE DEFAULT LIMIT

PASSWORD_LIFE_TIME 180

PASSWORD_GRACE_TIME 7

PASSWORD_REUSE_TIME UNLIMITED

PASSWORD_REUSE_MAX UNLIMITED

FAILED_LOGIN_ATTEMPTS 10

PASSWORD_LOCK_TIME 1

PASSWORD_VERIFY_FUNCTION verify_function_11G;




-- Below is the older version of the script


-- This script sets the default password resource parameters

-- This script needs to be run to enable the password features.

-- However the default resource parameters can be changed based 

-- on the need.

-- A default password complexity function is also provided.

-- This function makes the minimum complexity checks like

-- the minimum length of the password, password not same as the

-- username, etc. The user may enhance this function according to

-- the need.

-- This function must be created in SYS schema.

-- connect sys/<password> as sysdba before running the script


CREATE OR REPLACE FUNCTION verify_function

(username varchar2,

  password varchar2,

  old_password varchar2)

  RETURN boolean IS 

   n boolean;

   m integer;

   differ integer;

   isdigit boolean;

   ischar  boolean;

   ispunct boolean;

   digitarray varchar2(20);

   punctarray varchar2(25);

   chararray varchar2(52);


BEGIN 

   digitarray:= '0123456789';

   chararray:= 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';

   punctarray:='!"#$%&()``*+,-/:;<=>?_';


   -- Check if the password is same as the username

   IF NLS_LOWER(password) = NLS_LOWER(username) THEN

     raise_application_error(-20001, 'Password same as or similar to user');

   END IF;


   -- Check for the minimum length of the password

   IF length(password) < 4 THEN

      raise_application_error(-20002, 'Password length less than 4');

   END IF;


   -- Check if the password is too simple. A dictionary of words may be

   -- maintained and a check may be made so as not to allow the words

   -- that are too simple for the password.

   IF NLS_LOWER(password) IN ('welcome', 'database', 'account', 'user', 'password', 'oracle', 'computer', 'abcd') THEN

      raise_application_error(-20002, 'Password too simple');

   END IF;


   -- Check if the password contains at least one letter, one digit and one

   -- punctuation mark.

   -- 1. Check for the digit

   isdigit:=FALSE;

   m := length(password);

   FOR i IN 1..10 LOOP 

      FOR j IN 1..m LOOP 

         IF substr(password,j,1) = substr(digitarray,i,1) THEN

            isdigit:=TRUE;

             GOTO findchar;

         END IF;

      END LOOP;

   END LOOP;

   IF isdigit = FALSE THEN

      raise_application_error(-20003, 'Password should contain at least one digit, one character and one punctuation');

   END IF;

   -- 2. Check for the character

   <<findchar>>

   ischar:=FALSE;

   FOR i IN 1..length(chararray) LOOP 

      FOR j IN 1..m LOOP 

         IF substr(password,j,1) = substr(chararray,i,1) THEN

            ischar:=TRUE;

             GOTO findpunct;

         END IF;

      END LOOP;

   END LOOP;

   IF ischar = FALSE THEN

      raise_application_error(-20003, 'Password should contain at least one \

              digit, one character and one punctuation');

   END IF;

   -- 3. Check for the punctuation

   <<findpunct>>

   ispunct:=FALSE;

   FOR i IN 1..length(punctarray) LOOP 

      FOR j IN 1..m LOOP 

         IF substr(password,j,1) = substr(punctarray,i,1) THEN

            ispunct:=TRUE;

             GOTO endsearch;

         END IF;

      END LOOP;

   END LOOP;

   IF ispunct = FALSE THEN

      raise_application_error(-20003, 'Password should contain at least one \

              digit, one character and one punctuation');

   END IF;


   <<endsearch>>

   -- Check if the password differs from the previous password by at least

   -- 3 letters

   IF old_password IS NOT NULL THEN

     differ := length(old_password) - length(password);


     IF abs(differ) < 3 THEN

       IF length(password) < length(old_password) THEN

         m := length(password);

       ELSE

         m := length(old_password);

       END IF;


       differ := abs(differ);

       FOR i IN 1..m LOOP

         IF substr(password,i,1) != substr(old_password,i,1) THEN

           differ := differ + 1;

         END IF;

       END LOOP;


       IF differ < 3 THEN

         raise_application_error(-20004, 'Password should differ by at \

         least 3 characters');

       END IF;

     END IF;

   END IF;

   -- Everything is fine; return TRUE ;   

   RETURN(TRUE);

END;

/


-- This script alters the default parameters for Password Management

-- This means that all the users on the system have Password Management

-- enabled and set to the following values unless another profile is 

-- created with parameter values set to different value or UNLIMITED 

-- is created and assigned to the user.


-- Enable this if you want older version of the Password Profile parameters

-- ALTER PROFILE DEFAULT LIMIT

-- PASSWORD_LIFE_TIME 60

-- PASSWORD_GRACE_TIME 10

-- PASSWORD_REUSE_TIME 1800

-- PASSWORD_REUSE_MAX UNLIMITED

-- FAILED_LOGIN_ATTEMPTS 3

-- PASSWORD_LOCK_TIME 1/1440

-- PASSWORD_VERIFY_FUNCTION verify_function;

Posted by pat98

해외 사이트에 Oracle Database 12cR2 정식버전 출시 지연에 대한 루머가 있네요..

 

해당 기사는 2016년 6월에 나온것임..

 

http://www.crn.com/news/cloud/300081094/sources-oracle-may-delay-on-premise-12-2-database-release-to-drive-sales-of-cloud-based-version.htm/pgno/0/1

 

- 정리하면..

 

 2016년 9월 Open World 행사에서 12cR2 정식버전을 발표하지 않을까? 싶은데  하지만 on-premise 버전은 당장 사용할수 없고 아마도 Cloud 버전만 사용할수 있을것 같다.

 

왜냐? -> Cloud 로의 사용전환을 위한 일종의 Cloud Sales 전략으로 보임..

 

Oracle 12cR2 Beta 프로그램 접속해 보니 2016,8.10일에 Beta3 가 Release 되었네요..거의 막바지 인듯..

심히 해라 개발자들~~

Posted by pat98

RMAN 화일 복구시에 Reanme 하는 경우가 있는데 여러가지 값이 있으며 우선순위가 존재한다.


TSPITR (Tablespace Point-In-Time-Recovery) 시에 Rename 하는 방법들의 우선순위

  • 1. SET NEWNAME

  • 2. CONFIGURE AUXNAME

  • 3. DB_FILE_NAME_CONVERT

  • 4. AUXILIARY DESTINATION argument to RECOVER TABLESPAC

Target, Auxiliary 양쪽에 값이 적용이 되어 있을시 제일위에 설정된 값이 아래값들을 override 해 버린다.

Posted by pat98

현재구성은  RAC -> single 로 Dataguard 구성했음.

 

1번노드 : rac1

2번노드 : rac2

standby 노드 : test2

 

이상없이 구성한거 같은데 alertlog에 계속적으로 ORA-16191 계속뜰때..

------------------------------------------------------------
Check that the primary and standby are using a password file
and remote_login_passwordfile is set to SHARED or EXCLUSIVE,
and that the SYS password is same in the password files.
      returning error ORA-16191
------------------------------------------------------------

Solution :

 

1. 1번에서 redo 전송 중지

SQL>alter system set log_archive_dest_state_2=DEFER sid='*' scope=both;

 

2. 1번 노드에서 passwd file 재생성

orapwd file=$ORACLE_HOME/dbs/orapwRAC1 password=oracle entries=10

 

3. 2번 노드 및 스탠바이 서버에 복사

scp orapwRAC1 rac2:$ORACLE_HOME/dbs/orapwRAC2
scp orapwRAC1 single2:$ORACLE_HOME/dbs/orapwTEST2

 

4. 1번에서 redo 전송 재개

SQL>alter system set log_archive_dest_state_2=ENABLE sid='*' scope=both;

 

5. log switch

SQL>alter system switch all logfile;

 

6. 잘되는지 alert 로그확인, 이상 없이 잘 되는구먼..

 

 

Posted by pat98

2016. 7. 29. 14:51 오라클

oralce 9i 설치화일


옛날꺼 9i 설치화일 찾아보다가 화일 이름이 구분이 잘 안되어 있어 기록해 놓는다.

해당 URL은 지금가도 어차피 down 안됨. 개인적으로 가지고 있는 것들..

 

Oracle9i Database Release 2 Enterprise/Standard/Personal Edition for Windows NT/2000/XP


http://download.oracle.com/otn/nt/oracle9i/9201/92010NT_Disk1.zip
http://download.oracle.com/otn/nt/oracle9i/9201/92010NT_Disk2.zip
http://download.oracle.com/otn/nt/oracle9i/9201/92010NT_Disk3.zip


Oracle9i Database Release 2 Enterprise/Standard/Personal/Client Edition for Windows XP 2003/Windows Server 2003 (64-bit)


http://download.oracle.com/otn/nt/oracle9i/9202/92021Win64_Disk1.zip
http://download.oracle.com/otn/nt/oracle9i/9202/92021Win64_Disk2.zip


Oracle9i Database Release 2 Enterprise/Standard Edition for Intel Linux


http://download.oracle.com/otn/linux/oracle9i/9204/ship_9204_linux_disk1.cpio.gz
http://download.oracle.com/otn/linux/oracle9i/9204/ship_9204_linux_disk2.cpio.gz
http://download.oracle.com/otn/linux/oracle9i/9204/ship_9204_linux_disk3.cpio.gz


Oracle9i Database Release 2 (9.2.0.4) Enterprise/Standard Edition for Linux x86-64


http://download.oracle.com/otn/linux/oracle9i/9204/amd64_db_9204_Disk1.cpio.gz
http://download.oracle.com/otn/linux/oracle9i/9204/amd64_db_9204_Disk2.cpio.gz
http://download.oracle.com/otn/linux/oracle9i/9204/amd64_db_9204_Disk3.cpio.gz


Oracle9i Database Release 2 Enterprise/Standard Edition for AIX - Based 4.3.3 Systems (64-bit)


http://download.oracle.com/otn/aix/oracle9i/9201/server_9201_AIX64_Disk1.cpio.gz
http://download.oracle.com/otn/aix/oracle9i/9201/server_9201_AIX64_Disk2.cpio.gz
http://download.oracle.com/otn/aix/oracle9i/9201/server_9201_AIX64_Disk3.cpio.gz
http://download.oracle.com/otn/aix/oracle9i/9201/server_9201_AIX64_Disk4.cpio.gz


Oracle9i Database Release 2 Enterprise/Standard Edition for AIX- Based 5L Systems


http://download.oracle.com/otn/aix/oracle9i/9201/A99331-01.zip
http://download.oracle.com/otn/aix/oracle9i/9201/A99331-02.zip
http://download.oracle.com/otn/aix/oracle9i/9201/A99331-03.zip
http://download.oracle.com/otn/aix/oracle9i/9201/A99331-04.zip


Oracle9i Database Release 2 Enterprise/Standard Edition for Sun SPARC Solaris (32-bit)


http://download.oracle.com/otn/solaris/oracle9i/9201/92010Sol_Disk1.cpio.gz
http://download.oracle.com/otn/solaris/oracle9i/9201/92010Sol_Disk2.cpio.gz
http://download.oracle.com/otn/solaris/oracle9i/9201/92010Sol_Disk3.cpio.gz


Oracle9i Database Release 2 Enterprise/Standard Edition for Sun SPARC Solaris (64-bit)


http://download.oracle.com/otn/solaris/oracle9i64/9201/solaris64_9.2.0.1.0.Disk1.cpio.gz
http://download.oracle.com/otn/solaris/oracle9i64/9201/solaris64_9.2.0.1.0.Disk2.cpio.gz
http://download.oracle.com/otn/solaris/oracle9i64/9201/solaris64_9.2.0.1.0.Disk3.cpio.gz

 

Posted by pat98

 

휴지통에서 원하는 날짜만큼 명령어로 딱딱 지우는 명령어는 없고 명령어로 조건을 줘서 스크립트를 뽑아내는 방법이 있긴 하다.

 

1. 7일꺼만 남기고 다 지우기

 

spool purge_table_older_than_7_days.sql
select 'purge table '||owner||'."'||OBJECT_NAME||'";'
from dba_recyclebin where type='TABLE' and to_date(droptime,'YYYY-MM-DD:HH24:MI:SS')<sysdate-7;
spool off;

 

2. 5분 보다 오래된거 다 지우기

 

spool purge_table_older_than_5_minutes.sql
select 'purge table '||owner||'."'||OBJECT_NAME||'";'
from dba_recyclebin where type='TABLE' and to_date(droptime,'YYYY-MM-DD:HH24:MI:SS')<sysdate-(5/(24*60));
spool off;

spool purge_table_older_than_5_min.txt
@purge_table_older_than_5_minutes.sql
spool off;

 

------------------------------------------------------------

 

나머지 조건들은 필요에 따라 수정해서 상황에 맞게 쓰면 될듯.

Posted by pat98

 

ASM 디스크 그룹에 sector size 지정방법

 

기본값은 512 임.

단, 최초 생성시에만 지정할수 있다. 중간에 alter로 못 바꿈.

=============================

 

create diskgroup DATA EXTERNAL REDUNDANCY
DISK '/dev/asm1',
'/dev/asm2',
'/dev/asm3',
'/dev/asm4'
ATTRIBUTE 'compatible.asm'='11.2', 'compatible.rdbms'='11.2',
'au_size'='4M', 'sector_size='4096';

 

또한 SSD 사용시 Redo 로그 생성을 아래와 같이 해 주기도 한다. (성능향상을 위해)

Oracle Redo  기본값이 512 인데 SSD 의 기본 섹터 size 가 4K 이므로 맞춰준다.

 

1. 파라메터 반영

 

ALTER SYSTEM SET "_DISK_SECTOR_SIZE_OVERRIDE"="TRUE" ;

 

2. Redo 생성

 

ALTER DATABASE ADD LOGFILE GROUP 5 SIZE 100M BLOCKSIZE 4096;

Posted by pat98

01-10 20:25
Flag Counter
Yesterday
Today
Total

글 보관함

최근에 올라온 글

달력

 « |  » 2025.1
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

최근에 달린 댓글