在Oracle11g当中,可以有更加简单的定位当前trace文件的办法,那就是访问视图 v$diag_info。 store@TESTgt; select * from v$ve
在Oracle11g当中,可以有更加简单的定位当前trace文件的办法,那就是访问视图 v$diag_info。
store@TEST> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
store@TEST> set linesize 1500;
store@TEST> SELECT * FROM v$diag_info;
INST_ID NAME VALUE
---------- ---------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 Diag Enabled TRUE
1 ADR Base /opt/oracle/db
1 ADR Home /opt/oracle/db/diag/rdbms/test/TEST
1 Diag Trace /opt/oracle/db/diag/rdbms/test/TEST/trace
1 Diag Alert /opt/oracle/db/diag/rdbms/test/TEST/alert
1 Diag Incident /opt/oracle/db/diag/rdbms/test/TEST/incident
1 Diag Cdump /opt/oracle/db/diag/rdbms/test/TEST/cdump
1 Health Monitor /opt/oracle/db/diag/rdbms/test/TEST/hm
1 Default Trace File /opt/oracle/db/diag/rdbms/test/TEST/trace/TEST_ora_5555.trc
1 Active Problem Count 0
1 Active Incident Count 0
已选择11行。
视图中name='Default Trace File'的记录就是当前session的默认trace file。
store@TEST> SELECT value FROM v$diag_info WHERE;
VALUE
----------------------------------------------------------------------------------------------------
/opt/oracle/db/diag/rdbms/test/TEST/trace/TEST_ora_5555.trc
store@TEST> alter system set sql_trace=true;
系统已更改。
store@TEST> select * from dual;
D
-
X
store@TEST> alter system set sql_trace=false;
系统已更改。
store@TEST> !cat /opt/oracle/db/diag/rdbms/test/TEST/trace/TEST_ora_5555.trc
Trace file /opt/oracle/db/diag/rdbms/test/TEST/trace/TEST_ora_5555.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORACLE_HOME = /opt/oracle/db/db_1
System name: Linux
Node name: gtlions
Release: 2.6.18-194.el5PAE
Version: #1 SMP Mon Mar 29 20:19:03 EDT 2010
.。。。。
。。。。。
PARSING IN CURSOR #9 len=18 dep=0 uid=93 oct=3 lid=93 tim=1295493303679484 hv=942515969 ad='3a0de6c0' sqlid='a5ks9fhw2v9s1'
select * from dual
END OF STMT
PARSE #9:c=14999,e=158076,p=0,cr=3,cu=0,mis=1,r=0,dep=0,og=1,plh=272002086,tim=1295493303679479
.。。。
。。。。
=====================
PARSING IN CURSOR #7 len=32 dep=0 uid=93 oct=49 lid=93 tim=1295493315875782 hv=3586475918 ad='0' sqlid='19zugf7awajwf'
alter system set sql_trace=false
END OF STMT
PARSE #7:c=0,e=1849,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,plh=0,tim=1295493315875778
EXEC #7:c=9999,e=14897,p=0,cr=0,cu=3,mis=0,r=0,dep=0,og=0,plh=0,tim=1295493315891023
小结
关键词: v$diag_info,sql_trace
-The End-

MySQLstringtypesimpactstorageandperformanceasfollows:1)CHARisfixed-length,alwaysusingthesamestoragespace,whichcanbefasterbutlessspace-efficient.2)VARCHARisvariable-length,morespace-efficientbutpotentiallyslower.3)TEXTisforlargetext,storedoutsiderows,

MySQLstringtypesincludeVARCHAR,TEXT,CHAR,ENUM,andSET.1)VARCHARisversatileforvariable-lengthstringsuptoaspecifiedlimit.2)TEXTisidealforlargetextstoragewithoutadefinedlength.3)CHARisfixed-length,suitableforconsistentdatalikecodes.4)ENUMenforcesdatainte

MySQLoffersvariousstringdatatypes:1)CHARforfixed-lengthstrings,2)VARCHARforvariable-lengthtext,3)BINARYandVARBINARYforbinarydata,4)BLOBandTEXTforlargedata,and5)ENUMandSETforcontrolledinput.Eachtypehasspecificusesandperformancecharacteristics,sochoose

TograntpermissionstonewMySQLusers,followthesesteps:1)AccessMySQLasauserwithsufficientprivileges,2)CreateanewuserwiththeCREATEUSERcommand,3)UsetheGRANTcommandtospecifypermissionslikeSELECT,INSERT,UPDATE,orALLPRIVILEGESonspecificdatabasesortables,and4)

ToaddusersinMySQLeffectivelyandsecurely,followthesesteps:1)UsetheCREATEUSERstatementtoaddanewuser,specifyingthehostandastrongpassword.2)GrantnecessaryprivilegesusingtheGRANTstatement,adheringtotheprincipleofleastprivilege.3)Implementsecuritymeasuresl

ToaddanewuserwithcomplexpermissionsinMySQL,followthesesteps:1)CreatetheuserwithCREATEUSER'newuser'@'localhost'IDENTIFIEDBY'password';.2)Grantreadaccesstoalltablesin'mydatabase'withGRANTSELECTONmydatabase.TO'newuser'@'localhost';.3)Grantwriteaccessto'

The string data types in MySQL include CHAR, VARCHAR, BINARY, VARBINARY, BLOB, and TEXT. The collations determine the comparison and sorting of strings. 1.CHAR is suitable for fixed-length strings, VARCHAR is suitable for variable-length strings. 2.BINARY and VARBINARY are used for binary data, and BLOB and TEXT are used for large object data. 3. Sorting rules such as utf8mb4_unicode_ci ignores upper and lower case and is suitable for user names; utf8mb4_bin is case sensitive and is suitable for fields that require precise comparison.

The best MySQLVARCHAR column length selection should be based on data analysis, consider future growth, evaluate performance impacts, and character set requirements. 1) Analyze the data to determine typical lengths; 2) Reserve future expansion space; 3) Pay attention to the impact of large lengths on performance; 4) Consider the impact of character sets on storage. Through these steps, the efficiency and scalability of the database can be optimized.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Linux new version
SublimeText3 Linux latest version
