测试目的: 测试存储过程的状态对该存储过程运行的影响。 环境准备: 1.创建测试表 test_drop_dep create table test_dep(name varchar2(20));insert into test_dep(name) values(ABC);commit; 2.建立依赖表 test_drop_dep的存储过程 create or replace proc
测试目的:
测试存储过程的状态对该存储过程运行的影响。
环境准备:
1.创建测试表 test_drop_dep
create table test_dep(name varchar2(20)); insert into test_dep(name) values('ABC'); commit;
2.建立依赖表 test_drop_dep的存储过程
create or replace procedure test_drop_dep
as v_count number; begin select count(*) into v_count from test_dep; dbms_output.put_line('BEFORE SLEEP TIME='||to_char(sysdate,'hh24:mi:ss')); dbms_lock.sleep(30); dbms_output.put_line('BEHIND SLEEP TIME='||to_char(sysdate,'hh24:mi:ss')); dbms_output.put_line('THE ROWCOUNT ='||to_char(v_count)); end; /
测试用例
测试用例1:
session1执行存储过程,session2删除表test_drop_dep,然后查询存储过程的状态。
session1执行存储过程
execute test_drop_dep;
session2删除表test_drop_dep,然后查询存储过程的状态
drop table test_dep; select object_name,status from dba_objects where object_name='TEST_DROP_DEP'; OBJECT_NAME STATUS ------------------------------ ------- TEST_DROP_DEP INVALID
测试用例1结论:
存储过程依赖的对象失效(删除)后,该存储过程会立即标记为失效invalid,即使该过程正在执行,已经运行的该存储过程会正常执行完毕。
测试用例2:
session1执行存储过程,session2删除表 test_drop_dep ,创建表test_drop_dep,执行存储过程。session1执行存储过程
execute test_drop_dep; /* SQL> execute test_drop_dep; BEFORE SLEEP TIME=10:06:47 BEHIND SLEEP TIME=10:07:17 THE ROWCOUNT =1 PL/SQL procedure successfully completed. */
session2删除表 test_drop_dep ,创建表test_drop_dep,执行存储过程
drop table test_dep; select object_name,status from dba_objects where object_name='TEST_DROP_DEP'; create table test_dep(name varchar2(20)); insert into test_dep(name) values('ABC'); commit; select object_name,status from dba_objects where object_name='TEST_DROP_DEP'; execute test_drop_dep; select object_name,status from dba_objects where object_name='TEST_DROP_DEP'; /* SQL> drop table test_dep; Table dropped. SQL> select object_name,status from dba_objects where object_name='TEST_DROP_DEP'; OBJECT_NAME STATUS ------------------------------ ------- TEST_DROP_DEP INVALID SQL> create table test_dep(name varchar2(20)); insert into test_dep(name) values('ABC'); Table created. SQL> commit; 1 row created. SQL> Commit complete. SQL> select object_name,status from dba_objects where object_name='TEST_DROP_DEP'; OBJECT_NAME STATUS ------------------------------ ------- TEST_DROP_DEP INVALID SQL> execute test_drop_dep; select object_name,status from dba_objects where object_name='TEST_DROP_DEP'; BEFORE SLEEP TIME=10:07:17 BEHIND SLEEP TIME=10:07:47 THE ROWCOUNT =1 PL/SQL procedure successfully completed. SQL> OBJECT_NAME STATUS ------------------------------ ------- TEST_DROP_DEP VALID */
测试用例2结论:
有效的存储过程执行后,会一直执行完毕,而不管当前是否是valid状态;
invalid的存储过程第一运行会执行编译,如果此时有未执行完成的该过程,编译一直处于library cache pin等待,直到所有过程都执行完才能编译执行。

mysqlviewshavelimitations : 1) 그들은 upportallsqloperations, datamanipulation throughviewswithjoinsorbqueries를 제한하지 않습니다

적절한 usermanagementInmysqliscrucialforenhancingsecurityandensuringfefficientDatabaseOperation.1) USECREATEUSERTOWDDUSERS,@'localHost'or@'%'.

mysqldoes notimposeahardlimitontriggers, butpracticalfactorsdeteirefectiveuse : 1) ServerConfigurationimpactStriggerManagement; 2) 복잡한 트리거 스케일 스케일 사이드로드; 3) argertableSlowtriggerTriggerPerformance; 4) High ConconcercencyCancaUspriggerContention; 5) m

예, It 'safetostoreBlobdatainmysql, butconsidertheStefactors : 1) StoragesPace : BlobScanconSumeSignificantspace, 잠재적으로 증가하는 CostsandSlownperformance

PHP 웹 인터페이스를 통해 MySQL 사용자를 추가하면 MySQLI 확장 기능을 사용할 수 있습니다. 단계는 다음과 같습니다. 1. MySQL 데이터베이스에 연결하고 MySQLI 확장자를 사용하십시오. 2. 사용자를 생성하고 CreateUser 문을 사용하고 Password () 함수를 사용하여 암호를 암호화하십시오. 3. SQL 주입 방지 및 MySQLI_REAL_ESCAPE_STRING () 함수를 사용하여 사용자 입력을 처리하십시오. 4. 새 사용자에게 권한을 할당하고 보조금 명세서를 사용하십시오.

mysql'sblobissuilableforstoringbinarydatawithinareldatabase, whilenosqloptionslikemongodb, redis, and cassandraofferflexible, scalablesolutionsforunstuctureddata.blobissimplerbutcanslowwownperformance를 사용하는 것들보업 betterscal randaysand

TOADDAUSERINMYSQL, 사용 : CreateUser'UserName '@'host'IdentifiedBy'Password '; 여기서'showTodoitseciRely : 1) ChoosetheHostCareLyTocon trolaccess.2) setResourcelimitswithOptionslikemax_queries_per_hour.3) Usestrong, iriquepasswords.4) enforcessl/tlsconnectionswith

toavoidcommonmistakeswithstringdatatypesinmysql, stroundStringTypenuances, chooseTherightType, andManageEncodingAndCollationSettingSefectively.1) usecharforfixed-lengthstrings, varcharvariable-length, andtext/blobforlargerdata.2) setcarcatter


핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

Video Face Swap
완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

인기 기사

뜨거운 도구

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 Linux 새 버전
SublimeText3 Linux 최신 버전

맨티스BT
Mantis는 제품 결함 추적을 돕기 위해 설계된 배포하기 쉬운 웹 기반 결함 추적 도구입니다. PHP, MySQL 및 웹 서버가 필요합니다. 데모 및 호스팅 서비스를 확인해 보세요.

Eclipse용 SAP NetWeaver 서버 어댑터
Eclipse를 SAP NetWeaver 애플리케이션 서버와 통합합니다.