set serverout on;
DECLARE
CURSOR c_dept IS select distinct a.username, b.profile, b.resource_name, b.limit from dba_users a, dba_profiles b where a.profile = b.profile and a.profile is not null and b.resource_type = 'PASSWORD' and b.resource_name = 'FAILED_LOGIN_ATTEMPTS' and b.limit <> 'UNLIMITED' and a.username not in (select c.username from dba_users_with_defpwd c) and a.username not in ('SYS','SYSTEM','SYSMAN','MGMT_VIEW', 'ANONYMOUS', 'FLOWS_FILES', 'WKPROXY', 'WKSYS', 'FLOWS_030000', 'OLAPSYS', 'APEX_PUBLIC_USER');
vs_row2 c_dept%rowtype;
BEGIN
DBMS_OUTPUT.PUT_LINE('------------------------');
FOR vs_row2 IN c_dept
LOOP
-- DBMS_OUTPUT.PUT_LINE('Department:'|| vs_row2.profile||'-');
-- alter profile tet limit failed_login_attempts unlimited;
DBMS_OUTPUT.PUT_LINE('#############');
END LOOP;
END;
/
-- 带游标<br>create or replace procedure SP_Test is
DECLARE
cursor c_dept is select distinct a.username, b.profile, b.resource_name, b.limit from dba_users a, dba_profiles b where a.profile = b.profile and a.profile is not null and b.resource_type = 'PASSWORD' and b.resource_name = 'FAILED_LOGIN_ATTEMPTS' and b.limit <> 'UNLIMITED' and a.username not in (select c.username from dba_users_with_defpwd c) and a.username not in ('SYS','SYSTEM','SYSMAN','MGMT_VIEW', 'ANONYMOUS', 'FLOWS_FILES', 'WKPROXY', 'WKSYS', 'FLOWS_030000', 'OLAPSYS', 'APEX_PUBLIC_USER');
vs_row2 c_dept%rowtype;
tempresult varchar2(1024);
begin
for vs_row2 in c_dept loop
begin
tempresult := tempresult||vs_row2.profile;
DBMS_OUTPUT.PUT_LINE('#############'||tempresult);
alter profile 'test' limit failed_login_attempts unlimited;
end;
end loop;
end;
/
select distinct a.username, b.profile, b.resource_name, b.limit from dba_users a, dba_profiles b
where a.profile = b.profile and a.profile is not null and b.resource_type = 'PASSWORD' and b.resource_name = 'PASSWORD_LIFE_TIME'
and b.limit <> 'UNLIMITED' and a.username not in (select c.username from dba_users_with_defpwd c)
and a.username not in ('SYS','SYSTEM','SYSMAN','MGMT_VIEW', 'ANONYMOUS', 'FLOWS_FILES', 'WKPROXY', 'WKSYS', 'FLOWS_030000', 'OLAPSYS', 'APEX_PUBLIC_USER' , 'DBSNMP');
select distinct a.username, b.profile, b.resource_name, b.limit from dba_users a, dba_profiles b where a.profile = b.profile and a.profile is not null and b.resource_type = 'PASSWORD' and b.resource_name = 'FAILED_LOGIN_ATTEMPTS' and b.limit <> 'UNLIMITED' and a.username not in (select c.username from dba_users_with_defpwd c) and a.username not in ('SYS','SYSTEM','SYSMAN','MGMT_VIEW', 'ANONYMOUS', 'FLOWS_FILES', 'WKPROXY', 'WKSYS', 'FLOWS_030000', 'OLAPSYS', 'APEX_PUBLIC_USER');
alter profile PROFILE_DNADBM_XY_0115 limit failed_login_attempts unlimited;
分享到:
相关推荐
ORACLE技术文档\oracle cursor 游标.docORACLE技术文档\oracle cursor 游标.docORACLE技术文档\oracle cursor 游标.doc
详细的介绍了oracle中游标的使用.及完整的实例
oracle CURSOR 的幾個使用詳細例子,需要者可以在此下載,希望有幫助.
oracle中游标的使用方法,便于初学者参考,精通人员欢迎指正在。
使用python语言连接oracle数据库的连接工具,示例如下: import cx_Oracle connection = cx_Oracle.connect("scott", "tiger", "localhost/orcl") ...# close cursor and oracle cursor.close() connection.close()
NULL 博文链接:https://zzwwxx603620070618180334.iteye.com/blog/825144
修改后的oracle游标总结,比较的全面 修改后的oracle游标总结,比较的全面 修改后的oracle游标总结,比较的全面
Oracle中Cursor介绍[归类].pdf
select * from bonus; select * from salgrade; /* 多表查询: 笛卡尔积: 实际上是两张表的乘积,但是在实际开发中没有太大意义 格式: select * from 表1,表2 ...select * from emp e1, dept d1 where e1.deptno ...
Oracle cursor_sharing参数详解.docx
oracle 存储过程 包括 cursor record 动态sql 临时表等 用于oracle参考学习用
查询 SELECT语句用于从数据库中查询数据,当在PL/SQL中使用SELECT语句时,要与INTO子句一起使用,查询的 返回值被赋予INTO子句中的变量,变量的声明是在DELCARE中。SELECT INTO语法如下: SELECT [DISTICT|ALL...
Java获取Oracle存储过程返回的Cursor,使用odbc6
oracle下巧用bulk collect实现cursor批量fetch的sql语句,使用oracel的朋友可以试试了
ORACLE 游标的相关操作,轻轻松松学会ORACLE cursor
ibatis调存储过程返回游标,资料整理
Cursor(游标)是Oracle数据库中一个特有的概念。本文档简单介绍了Cursor及其使用方法。
Cursor2LOB 是一组 Oracle PL/SQL 例程,它们创建(或附加到)Oracle CLOB 或 BLOB,这些数据包含来自 Cursor(即来自表或查询)的数据,这些数据采用 CSV 或固定列格式。 此外,还有能够将 CSV 数据写入(或附加)...
oracle 游标的用法以及各种注意事项
NULL 博文链接:https://dingjun1.iteye.com/blog/836605