ORACLEÉó¼Æ
1¡¢Ê²Ã´ÊÇÉó¼Æ
Éó¼Æ£¨Audit)ÓÃÓÚ¼àÊÓÓû§ËùÖ´ÐеÄÊý¾Ý¿â²Ù×÷£¬²¢ÇÒOracle»á½«Éó¼Æ¸ú×Ù½á¹û´æ·Åµ½OSÎļþ£¨Ä¬ÈÏλÖÃΪ$ORACLE_BASE/admin/$ORACLE_SID/adump/£©»òÊý¾Ý¿â£¨´æ´¢ÔÚsystem±í¿Õ¼äÖÐµÄ SYS.AUD$±íÖУ¬¿Éͨ¹ýÊÓͼdba_audit_trail²é¿´£©ÖС£Ä¬ÈÏÇé¿öÏÂÉó¼ÆÊÇûÓпªÆôµÄ¡£
²»¹ÜÄãÊÇ·ñ´ò¿ªÊý¾Ý¿âµÄÉó¼Æ¹¦ÄÜ£¬ÒÔÏÂÕâЩ²Ù×÷ϵͳ»áÇ¿ÖƼǼ£ºÓùÜÀíԱȨÏÞÁ¬½ÓInstance£»Æô¶¯Êý¾Ý¿â£»¹Ø±ÕÊý¾Ý¿â¡£
2¡¢ºÍÉó¼ÆÏà¹ØµÄÁ½¸öÖ÷Òª²ÎÊý
AUDIT_SYS_OPERATIONS
AUDIT_SYS_OPERATIONS enables or disables the auditing of operations issued by user SYS, and users connecting with SYSDBA or SYSOPER privileges. The audit records are written to the operating system's audit trail. The audit records will be written in XML format if the AUDIT_TRAIL initialization parameter is set to XML.
AUDIT_TRAIL
AUDIT_TRAIL enables or disables database auditing.
Values:
none
Disables database auditing.
os
Enables database auditing and directs all audit records to the operating system's audit trail.
db
Enables database auditing and directs all audit records to the database audit trail (the SYS.AUD$ table).
db,extended
Enables database auditing and directs all audit records to the database audit trail (the SYS.AUD$ table). In addition, populates the SQLBIND and SQLTEXT CLOB columns of the SYS.AUD$ table.
xml
Enables database auditing and writes all audit records to XML format OS files.
xml,extended
Enables database auditing and prints all columns of the audit trail, including SqlText and SqlBind values.
You can use the SQL statement AUDIT to set auditing options regardless of the setting of this parameter.
×¢£ºÕâÁ½¸ö²ÎÊýÊÇstatic²ÎÊý£¬ÐèÒªÖØÐÂÆô¶¯Êý¾Ý¿â²ÅÄÜÉúЧ¡£
3¡¢Éó¼Æ¼¶±ð
µ±¿ªÆôÉó¼Æ¹¦Äܺ󣬿ÉÔÚÈý¸ö¼¶±ð¶ÔÊý¾Ý¿â½øÐÐÉó¼Æ£ºStatement(Óï¾ä)¡¢Privilege£¨È¨ÏÞ£©¡¢object£¨¶ÔÏ󣩡£
Statement£º
°´Óï¾äÀ´Éó¼Æ£¬±ÈÈçaudit table »áÉó¼ÆÊý¾Ý¿âÖÐËùÓеÄcreate table,drop table,truncate tableÓï¾ä£¬alter session by cmy»áÉó¼ÆcmyÓû§ËùÓеÄÊý¾Ý¿âÁ¬½Ó¡£
Privilege£º
°´È¨ÏÞÀ´Éó¼Æ£¬µ±Óû§Ê¹ÓÃÁ˸ÃȨÏÞÔ
Ïà¹ØÎĵµ£º
sql½Å±¾£¬Ò²¾ÍÊÇÔÚÎļþÖÐдÓÐsqlÓï¾äµÄÎļþ£¬¿ÉÒÔÔÚsqlplusÖÐÔËÐС£
ÒýÈësql½Å±¾
sqlplus Óû§Ãû/ÃÜÂë @sql½Å±¾.sql
£¨×¢Ò⣺ÔÚÓû§ÃûÃÜÂëÊäÈë½áÊøºóÒ»¶¨Òª¼Ó¿Õ¸ñÈ»ºóÔÙд@sql½Å±¾£©
OracleÖеĿÕÖµ»áµ±×÷ÎÞÇî´ó´¦Àí£¬Æäʵ¿ÕÖµ¸ù±¾¾Í²»»á´æ´¢£¬Ö»ÊÇ¿´×÷ÊÇÎÞÇî´ó¡£
OracleÖпØÖÆ´¦Àíº¯Êý NVL(×Ö¶ÎÃû£¬ ......
Oracle ·ÖÇø±í
OracleÌṩÁË·ÖÇø¼¼ÊõÒÔÖ§³ÖVLDB(Very Large DataBase)¡£·ÖÇø±íͨ¹ý¶Ô·ÖÇøÁеÄÅжϣ¬°Ñ·ÖÇøÁв»Í¬µÄ¼Ç¼£¬·Åµ½²»Í¬µÄ·ÖÇøÖС£·ÖÇøÍêÈ«¶ÔÓ¦ÓÃ͸Ã÷¡£
OracleµÄ·ÖÇø±í¿ÉÒÔ°üÀ¨¶à¸ö·ÖÇø£¬Ã¿¸ö·ÖÇø¶¼ÊÇÒ»¸ö¶ÀÁ¢µÄ¶Î£¨SEGMENT£©£¬¿ÉÒÔ´æ·Åµ½²»Í¬µÄ±í¿Õ¼äÖС£²éѯʱ¿ÉÒÔͨ¹ý²éѯ±íÀ´·ÃÎʸ÷¸ö·ÖÇøÖеÄÊý¾Ý£¬Ò²¿ÉÒÔ ......
ORACLEÊý¾Ý¿âÓÐÁ½À౸·Ý·½·¨¡£µÚÒ»ÀàΪÎïÀí±¸·Ý£¬¸Ã·½·¨ÊµÏÖÊý¾Ý¿âµÄÍêÕû»Ö¸´£¬µ«Êý¾Ý¿â±ØÐëÔËÐÐÔڹ鵲ģʽÏ£¨ÒµÎñÊý¾Ý¿âÔڷǹ鵲ģʽÏÂÔËÐУ©£¬ÇÒÐèÒª¼«´óµÄÍⲿ´æ´¢É豸£¬ÀýÈç´Å´ø¿â£»µÚ¶þÀ౸·Ý·½Ê½ÎªÂß¼±¸·Ý£¬ÒµÎñÊý¾Ý¿â²ÉÓôËÖÖ·½Ê½£¬´Ë·½·¨²»ÐèÒªÊý¾Ý¿âÔËÐÐÔڹ鵲ģʽÏ£¬²»µ«±¸·Ý¼òµ¥£¬¶øÇÒ¿ÉÒÔ²»ÐèÒªÍⲿ´æ ......
INSTR·½·¨µÄ¸ñʽΪ
INSTR(Ô´×Ö·û´®, Ä¿±ê×Ö·û´®, ÆðʼλÖÃ, Æ¥ÅäÐòºÅ)
ÀýÈ磺INSTR('CORPORATE FLOOR','OR', 3, 2)ÖУ¬Ô´×Ö·û´®Îª'CORPORATE FLOOR', Ä¿±ê×Ö·û´®Îª'OR'£¬ÆðʼλÖÃΪ3£¬È¡µÚ2¸öÆ¥ÅäÏîµÄλÖá£
ĬÈϲéÕÒ˳ÐòΪ´Ó×óµ½ÓÒ¡£µ±ÆðʼλÖÃΪ¸ºÊýµÄʱºò£¬´ÓÓұ߿ªÊ¼²éÕÒ¡£
ËùÒÔSELECT INSTR('CORPORATE FLOOR' ......
SQLÖеĵ¥¼Ç¼º¯Êý
1.ASCII
·µ»ØÓëÖ¸¶¨µÄ×Ö·û¶ÔÓ¦µÄÊ®½øÖÆÊý;
SQL> select ascii('A') A,ascii('a') a,ascii('0') zero,ascii(' ') space from dual;
A A ZERO SPACE
--------- --------- --------- ---------
65 97 48 32
2.CHR
¸ø³öÕûÊý,·µ»Ø¶ÔÓ¦µÄ×Ö·û;
SQL> select chr(54740) zhao,chr(65) chr6 ......