fix for 12c profile

1.for CDBS
run as sysdba
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;
/

GRANT EXECUTE ON verify_function TO PUBLIC;

CREATE PROFILE c##APP_PROFILE LIMIT
COMPOSITE_LIMIT                  UNLIMITED
SESSIONS_PER_USER                UNLIMITED
CPU_PER_SESSION                  UNLIMITED
CPU_PER_CALL                     UNLIMITED
LOGICAL_READS_PER_SESSION        UNLIMITED
LOGICAL_READS_PER_CALL           UNLIMITED
IDLE_TIME                        UNLIMITED
CONNECT_TIME                     UNLIMITED
PRIVATE_SGA                      UNLIMITED
FAILED_LOGIN_ATTEMPTS            UNLIMITED
PASSWORD_LIFE_TIME               UNLIMITED
PASSWORD_REUSE_TIME              UNLIMITED
PASSWORD_REUSE_MAX               UNLIMITED
PASSWORD_VERIFY_FUNCTION         verify_function
PASSWORD_LOCK_TIME               1
PASSWORD_GRACE_TIME              7
;

alter user C##BACKUPDB profile c##APP_PROFILE;
alter user C##OPER profile c##APP_PROFILE;
alter user system profile c##APP_PROFILE;
alter user sys profile c##APP_PROFILE;

##change password

alter user system profile default;
alter user system identified by oracle123;

alter user sys profile default;
alter user sys identified by oracle123;

alter user C##OPER profile default;
alter user C##OPER identified by oper123;

alter user sys profile c##APP_PROFILE;
alter user system profile c##APP_PROFILE;
alter user C##OPER profile c##APP_PROFILE;

For pdbs

run as dba user

pdb
alter user IC_ADMIN profile APP_PROFILE;
alter user IC_READONLY profile APP_PROFILE;
alter user IC_USER profile APP_PROFILE;
alter user oper profile APP_PROFILE;
alter user PDBADMIN profile APP_PROFILE;

##change password

alter user IC_ADMIN profile default;
alter user IC_ADMIN identified by ic_admin12cu;

alter user IC_READONLY profile default;
alter user IC_READONLY identified by ic_readonly12cu;

alter user IC_USER profile default;
alter user IC_USER identified by ic_user12cu;

alter user oper profile default;
alter user oper identified by oper123;

alter user IC_ADMIN profile APP_PROFILE;
alter user IC_READONLY profile APP_PROFILE;
alter user IC_USER profile APP_PROFILE;
alter user oper profile APP_PROFILE;
时间: 2025-01-11 12:16:46

fix for 12c profile的相关文章

Tor Messenger 0.2.0b2 发布

Tor Messenger 0.2.0b2 发布了,以下为新版本的修改内容: MacBug 19269: Fix OS X file permissionsFix OS X profile when application is not placed in /ApplicationsTor Messenger 0.2.0b1 -- September 02, 2016 All PlatformsUse the THUNDERBIRD_45_3_0_RELEASE tag on mozilla-e

如图内容有进入要警惕

http://www.hi5.com/ezmf8u854https://www.hi5.com/ezmf8u854http://www.tagged.com/profile.html?uid=7308248690http://www.tagged.com/hi5/ezmf8u854http://www.hi5.com/profile.html?uid=7308248690https://www.hi5.com/profile.html?uid=7308248690http://www.hi5.c

个航母改价格

http://www.hi5.com/x07t3w3ahttps://www.hi5.com/x07t3w3ahttp://www.tagged.com/profile.html?uid=6028704571http://www.tagged.com/hi5/x07t3w3ahttp://www.hi5.com/profile.html?uid=6028704571https://www.hi5.com/profile.html?uid=6028704571http://www.hi5.com/

Fix error of &quot;you have been logged on with a temporary profile&quot;

You have been logged on with a temporary profile on windows2008 R2 After looking into this issue, I saw the following user profiles and I didn’t see my profile (ralin). C:\Users\TEMP.domainName.000 (first time to login) C:\Users\TEMP.domainName.001 (

Upgrade Oracle GI from 11.2 to 12C

12.1.0.2已经发布一段时间了,随着用户的增多,目前12C的版本稳定性,以及各个方面的功能性,得到大家的认可. 很多用户,需要将数据库从低版本升级到12C,本文就升级过程,做了详细的记录.(突然想起"多图杀猫"这个词) 升级前,首选需要查看文档,了解哪些版本可以升级到12C CompleteChecklist for Upgrading to Oracle Database 12c Release 1 using DBUA (Doc ID1516557.1)           

Oracle 12c RAC 搭建手册

1  共享设备配置 1.1            设备划分说明 冗余策略 卷划分及大小说明 OCRVOTING Ocrvoting01 8G Ocrvoting02 8G Ocrvoting03 8G DATAFILE Data01 8G Data02 8G FRA_ARCH Fra01 8G Fra02 8G 我们这里OCRVOTING 采用Normal,DATA和FRA 采用external. 11g中每个OCR和vote disk 至少需要600M空间.在ASM 的冗余级别中: exter

Use the Profile Manager to create and remove Firefox profiles

Skip to main content Switch language Skip to search Ask a question Sign In English Firefox Editing Tools Learn the Basics: get started Download, install and migration Firefox Sync Customize controls, options and add-ons Privacy and security settings

iOS Provisioning Profile(Certificate)与Code Signing详解

摘自:http://blog.csdn.net/phunxm/article/details/42685597 引言 关于开发证书配置(Certificates & Identifiers & Provisioning Profiles),相信做 iOS 开发的同学没少被折腾.对于一个 iOS 开发小白.半吊子(比如像我自己)抑或老兵,或多或少会有或曾有过以下不详.疑问.疑惑甚至困惑: 什么是App ID?Explicit/Wildcard App ID有何区别?什么是App Group

【12c】扩展数据类型(Extended Data Types)-- MAX_STRING_SIZE

[12c]扩展数据类型(Extended Data Types)-- MAX_STRING_SIZE 在12c中,与早期版本相比,诸如VARCHAR2, NAVARCHAR2以及 RAW这些数据类型的大小会从4K以及2K字节扩展至32K字节.只要可能,扩展字符的大小会降低对LOB 数据类型的使用.为了启用扩展字符大小,你必须将MAX_STRING_SIZE的初始数据库参数设置为EXTENDED. 要使用扩展字符类型需要执行以下过程: 1.关闭数据库 2.以升级模式重启数据库3.更改参数: ALT