oci_set_db_operation
(PHP 7 >= 7.2.14, PHP 8, PHP 7 >= 7.3.1, PHP 8, PECL OCI8 >= 2.2.0)
oci_set_db_operation - 데이터베이스 작업을 설정합니다.
설명
oci_set_db_operation(resource $connection
, string $action
): bool
Oracle 추적을 위한 DBOP를 설정합니다.
데이터베이스 작업 이름은 일반적으로 SQL 문이 실행될 때 PHP에서 데이터베이스로의 다음 'round-trip'이 발생할 때 데이터베이스에 등록됩니다.
이후에 V$SQL_MONITOR
와 같은 데이터베이스 관리 뷰에서 데이터베이스 작업을 쿼리할 수 있습니다.
oci_set_db_operation() 함수는 OCI8이 Oracle 12(또는 그 이상) 클라이언트 라이브러리와 Oracle Database 12(또는 그 이상)를 사용할 때 사용할 수 있습니다.
매개변수
connection
- oci_connect(), oci_pconnect() 또는 oci_new_connect()가 반환하는 Oracle 연결 식별자입니다.
action
- 사용자가 선택한 문자열.
반환 값
성공하면 true
를, 실패하면 false
를 반환합니다.
Examples
예제 #1 DBOP 설정
<?php
$c = oci_connect('hr', 'welcome', 'localhost/XE');
// Record the operation
oci_set_db_operation($c, 'main query');
// Code that causes a round-trip, for example a query:
$s = oci_parse($c, 'select * from dual');
oci_execute($s);
oci_fetch_all($s, $res);
sleep(30);
?>
// While the script is running, the administrator can see the database operations // being performed: sqlplus system/welcome SQL> select dbop_name from v$sql_monitor;
노트
주의
Round-trip Gotcha
모든 OCI8 기능이 아닌 일부 기능이 왕복을 유발합니다. 결과 캐싱이 활성화된 경우 쿼리와 함께 데이터베이스에 대한 왕복이 발생하지 않을 수 있습니다.
기타
- oci_set_action() - 작업 이름을 설정합니다.
- oci_set_module_name() - 모듈 이름을 설정합니다
- oci_set_client_info() - 클라이언트 정보를 설정합니다
- oci_set_client_identifier() - 클라이언트 식별자를 설정합니다.