问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

如何查询oracle表的操作日志记录

发布网友 发布时间:2022-04-08 03:45

我来回答

4个回答

懂视网 时间:2022-04-08 08:07


There are 2 product(s) installed in this Oracle Home.




Interim patches (1) :


Patch  20299013     : applied on Wed Apr 01 11:46:34 CST 2015
Unique Patch ID:  18573940
Patch description:  "Database Patch Set Update : 11.2.0.4.6 (20299013)"
   Created on 4 Mar 2015, 02:27:44 hrs PST8PDT
Sub-patch  19769489; "Database Patch Set Update : 11.2.0.4.5 (19769489)"
Sub-patch  19121551; "Database Patch Set Update : 11.2.0.4.4 (19121551)"
Sub-patch  18522509; "Database Patch Set Update : 11.2.0.4.3 (18522509)"
Sub-patch  18031668; "Database Patch Set Update : 11.2.0.4.2 (18031668)"
Sub-patch  17478514; "Database Patch Set Update : 11.2.0.4.1 (17478514)"
   Bugs fixed:
     17288409, 17798953, 18273830, 18607546, 17811429, 17205719, 20506699
     17816865, 19972566, 17922254, 17754782, 16384983, 17726838, 13364795
     16934803, 17311728, 17284817, 17441661, 17360606, 13645875, 18199537
     16992075, 16542886, 17446237, 14015842, 17889549, 14565184, 19972569
     17071721, 20299015, 17610798, 17375354, 17449815, 17397545, 19463897
     18230522, 13866822, 17235750, 17982555, 16360112, 18317531, 17478514
     19769489, 12905058, 14338435, 18235390, 13944971, 18641451, 20142975
     17811789, 16929165, 18704244, 12747740, 18430495, 20506706, 17546973
     14054676, 17088068, 17346091, 18264060, 17016369, 17042658, 17343514
     14602788, 19972568, 19680952, 18471685, 19788842, 18508861, 14657740
     17332800, 19211724, 13837378, 13951456, 16315398, 17186905, 18744139
     19972564, 16850630, 18315328, 17437634, 19049453, 18673304, 17883081
     19006849, 19915271, 19013183, 18641419, 17296856, 18674024, 18262334
     17006183, 18277454, 16833527, 17232014, 16855292, 10136473, 17762296
     14692762, 17705023, 18051556, 17865671, 17852463, 18554871, 17853498
     19121551, 18334586, 19854503, 17551709, 19309466, 17588480, 19827973
     17344412, 17842825, 18828868, 18681862, 18554763, 17390160, 18456514
     16306373, 17025461, 13955826, 18139690, 11883252, 13609098, 17501491
     17239687, 17752121, 17299889, 17602269, 19197175, 17889583, 18316692
     17313525, 18673325, 12611721, 19544839, 18293054, 17242746, 18964939
     17600719, 18191164, 19393542, 17571306, 18482502, 19466309, 17951233
     17649265, 18094246, 19615136, 17040527, 17011832, 17165204, 18098207
     16785708, 16870214, 17465741, 16180763, 17174582, 17477958, 12982566
     16777840, 18522509, 20631274, 16091637, 17323222, 19463893, 16595641
     16875449, 12816846, 16524926, 17237521, 18228645, 18282562, 17596908
     19358317, 17811438, 17811447, 17945983, 18762750, 17156148, 18031668
     16912439, 17184721, 16494615, 18061914, 17282229, 17545847, 18331850
     18202441, 17082359, 18723434, 19554106, 17614134, 13558557, 17341326
     14034426, 17891946, 18339044, 17716305, 19458377, 17752995, 16392068
     19271443, 17891943, 18092127, 17258090, 17767676, 16668584, 18384391
     17614227, 17040764, 16903536, 17381384, 14106803, 15913355, 18973907
     18356166, 18673342, 17389192, 14084247, 16194160, 17612828, 17006570
     20506715, 17721717, 13853126, 17390431, 18203837, 17570240, 14245531
     16043574, 16863422, 17848897, 17877323, 18325460, 19727057, 17468141
     17786518, 17912217, 16422541, 19972570, 17267114, 17037130, 18244962
     18765602, 18203838, 18155762, 16956380, 16198143, 17246576, 17478145
     17394950, 14829250, 18189036, 18641461, 18619917, 17835627, 17027426
     16268425, 18247991, 19584068, 14458214, 18436307, 17265217, 17634921
     13498382, 16692232, 17786278, 17227277, 16042673, 16314254, 17443671
     18000422, 16228604, 16837842, 17571039, 17393683, 16344544, 17787259
     18009564, 20074391, 14354737, 15861775, 18135678, 18614015, 16399083
     18362222, 18018515, 16472716, 17835048, 17050888, 17936109, 14010183
     17325413, 18747196, 17080436, 16613964, 17036973, 17761775, 16579084
     16721594, 17082983, 18384537, 18280813, 20296213, 17302277, 16901385
     18084625, 15979965, 15990359, 18203835, 17297939, 17811456, 16731148
     13829543, 14133975, 17215560, 17694209, 18091059, 17385178, 8322815
     17586955, 18441944, 17201159, 16450169, 9756271, 17655634, 19730508
     17892268, 18868646, 17648596, 16220077, 16069901, 11733603, 16285691
     17587063, 18180390, 16538760, 18193833, 17348614, 17393915, 17957017
     17274537, 18096714, 17308789, 17238511, 18436647, 17824637, 14285317
     19289642, 14764829, 17622427, 18328509, 16571443, 16943711, 14368995
     18306996, 17346671, 14852021, 18996843, 17783588, 16618694, 17853456
     18674047, 17672719, 18856999, 12364061, 18783224, 17851160, 17546761






--------------------------------------------------------------------------------


OPatch succeeded.
[oracle@rh64 soft]$ cd 20760982/
[oracle@rh64 20760982]$ ls -ltr
total 88
drwxrwxr-x 4 oracle oinstall  4096 Jun  4 15:24 20760982
drwxr-xr-x 4 oracle oinstall  4096 Jun  4 15:24 19121551
drwxr-xr-x 4 oracle oinstall  4096 Jun  4 15:24 17478514
drwxr-xr-x 4 oracle oinstall  4096 Jun  4 15:24 18522509
drwxrwxr-x 4 oracle oinstall  4096 Jun  4 15:24 20299013
drwxrwxr-x 4 oracle oinstall  4096 Jun  4 15:24 19769489
drwxr-xr-x 4 oracle oinstall  4096 Jun  4 15:24 18031668
-rw-r--r-- 1 oracle oinstall    21 Jun  4 15:25 README.txt
-rw-r--r-- 1 oracle oinstall  3068 Jun  4 15:25 patchmd.xml
-rw-rw-r-- 1 oracle oinstall 49895 Jul 12 04:15 README.html
[oracle@rh64 20760982]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation.  All rights reserved.


PREREQ session


Oracle Home       : /u01/app/db11g/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/db11g/product/11.2.0/dbhome_1/oraInst.loc
OPatch version    : 11.2.0.3.6
OUI version       : 11.2.0.4.0
Log file location : /u01/app/db11g/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-07-21_01-21-52AM_1.log


Invoking prereq "checkconflictagainstohwithdetail"


Prereq "checkConflictAgainstOHWithDetail" passed.


OPatch succeeded.
[oracle@rh64 20760982]$ opatch apply
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation.  All rights reserved.




Oracle Home       : /u01/app/db11g/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/db11g/product/11.2.0/dbhome_1/oraInst.loc
OPatch version    : 11.2.0.3.6
OUI version       : 11.2.0.4.0
Log file location : /u01/app/db11g/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-07-21_01-22-25AM_1.log


Verifying environment and performing prerequisite checks...
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:




Following executables are active :
/u01/app/db11g/product/11.2.0/dbhome_1/bin/oracle
UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.
Log file location: /u01/app/db11g/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-07-21_01-22-25AM_1.log


OPatch failed with error code 73

------->>>>>没有关闭数据库,需要关闭数据库

[oracle@rh64 20760982]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.4.0 Production on Tue Jul 21 01:22:45 2015


Copyright (c) 1982, 2013, Oracle.  All rights reserved.




Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@rh64 20760982]$ ps -fu oracle
UID        PID  PPID  C STIME TTY          TIME CMD
oracle    1946  1945  0 01:13 pts/0    00:00:00 -bash
oracle    2127  2125  0 01:16 ?        00:00:00 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
oracle    2446  1946  1 01:23 pts/0    00:00:00 ps -fu oracle
[oracle@rh64 20760982]$ opatch apply
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation.  All rights reserved.




Oracle Home       : /u01/app/db11g/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/db11g/product/11.2.0/dbhome_1/oraInst.loc
OPatch version    : 11.2.0.3.6
OUI version       : 11.2.0.4.0
Log file location : /u01/app/db11g/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-07-21_01-23-12AM_1.log


Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   20760982  


Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name: 


You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  y






Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = ‘/u01/app/db11g/product/11.2.0/dbhome_1‘)




Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying sub-patch ‘20760982‘ to OH ‘/u01/app/db11g/product/11.2.0/dbhome_1‘


Patching component oracle.sysman.console.db, 11.2.0.4.0...


Patching component oracle.rdbms, 11.2.0.4.0...


Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...


Verifying the update...
Composite patch 20760982 successfully applied.
Log file location: /u01/app/db11g/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-07-21_01-23-12AM_1.log


OPatch succeeded.
[oracle@rh64 20760982]$ opatch lsinv
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation.  All rights reserved.




Oracle Home       : /u01/app/db11g/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/db11g/product/11.2.0/dbhome_1/oraInst.loc
OPatch version    : 11.2.0.3.6
OUI version       : 11.2.0.4.0
Log file location : /u01/app/db11g/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-07-21_01-27-11AM_1.log


Lsinventory Output file location : /u01/app/db11g/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2015-07-21_01-27-11AM.txt


--------------------------------------------------------------------------------
Installed Top-level Products (2): 


Oracle Database 11g                                                  11.2.0.4.0
Oracle Database 11g Examples                                         11.2.0.1.0
There are 2 product(s) installed in this Oracle Home.




Interim patches (1) :


Patch  20760982     : applied on Tue Jul 21 01:25:38 CST 2015
Unique Patch ID:  18908105
Patch description:  "Database Patch Set Update : 11.2.0.4.7 (20760982)"
   Created on 4 Jun 2015, 00:23:20 hrs PST8PDT
Sub-patch  20299013; "Database Patch Set Update : 11.2.0.4.6 (20299013)"
Sub-patch  19769489; "Database Patch Set Update : 11.2.0.4.5 (19769489)"
Sub-patch  19121551; "Database Patch Set Update : 11.2.0.4.4 (19121551)"
Sub-patch  18522509; "Database Patch Set Update : 11.2.0.4.3 (18522509)"
Sub-patch  18031668; "Database Patch Set Update : 11.2.0.4.2 (18031668)"
Sub-patch  17478514; "Database Patch Set Update : 11.2.0.4.1 (17478514)"
   Bugs fixed:
     17288409, 21051852, 18607546, 17205719, 17811429, 17816865, 20506699
     17922254, 17754782, 16934803, 13364795, 17311728, 17441661, 17284817
     16992075, 17446237, 14015842, 19972569, 17449815, 17375354, 19463897
     17982555, 17235750, 13866822, 18317531, 17478514, 18235390, 14338435
     20803583, 13944971, 20142975, 17811789, 16929165, 18704244, 20506706
     17546973, 20334344, 14054676, 17088068, 18264060, 17346091, 17343514
     19680952, 18471685, 19211724, 13951456, 16315398, 18744139, 16850630
     19049453, 18673304, 17883081, 19915271, 18641419, 18262334, 17006183
     18277454, 16833527, 10136473, 18051556, 17865671, 17852463, 18554871
     17853498, 18334586, 17588480, 17551709, 19827973, 17842825, 17344412
     18828868, 17025461, 11883252, 13609098, 17239687, 17602269, 19197175
     18316692, 17313525, 12611721, 19544839, 18964939, 17600719, 18191164
     19393542, 17571306, 20777150, 18482502, 19466309, 17040527, 17165204
     18098207, 16785708, 17174582, 16180763, 17465741, 16777840, 12982566
     19463893, 12816846, 16875449, 17237521, 19358317, 17811438, 17811447
     17945983, 18762750, 17184721, 16912439, 18061914, 17282229, 18331850
     18202441, 17082359, 18723434, 19554106, 14034426, 18339044, 19458377
     17752995, 17891943, 17258090, 17767676, 16668584, 18384391, 17040764
     17381384, 15913355, 18356166, 14084247, 20506715, 13853126, 18203837
     14245531, 16043574, 17848897, 17877323, 17468141, 17786518, 17912217
     17037130, 18155762, 16956380, 17478145, 17394950, 18189036, 18641461
     18619917, 17027426, 16268425, 19584068, 18436307, 17265217, 17634921
     13498382, 20004087, 17443671, 18000422, 20004021, 17571039, 21067387
     16344544, 18009564, 14354737, 18135678, 18614015, 18362222, 17835048
     16472716, 17936109, 17050888, 17325413, 14010183, 18747196, 17761775
     16721594, 17082983, 20067212, 21179898, 17302277, 18084625, 15990359
     18203835, 17297939, 16731148, 17811456, 17215560, 13829543, 14133975
     17694209, 18091059, 17385178, 8322815, 17586955, 17201159, 17655634
     18331812, 19730508, 18868646, 17648596, 16220077, 16069901, 17348614
     17393915, 17957017, 17274537, 18096714, 17308789, 18436647, 14285317
     19289642, 14764829, 18328509, 17622427, 16943711, 14368995, 17346671
     18996843, 17783588, 16618694, 17672719, 18856999, 18783224, 17851160
     17546761, 17798953, 18273830, 19972566, 16384983, 17726838, 17360606
     13645875, 18199537, 16542886, 17889549, 14565184, 17071721, 20299015
     17610798, 20657441, 17397545, 18230522, 16360112, 19769489, 12905058
     18641451, 12747740, 18430495, 17042658, 17016369, 14602788, 19972568
     19788842, 18508861, 14657740, 17332800, 13837378, 19972564, 17186905
     18315328, 19699191, 17437634, 19006849, 19013183, 17296856, 18674024
     17232014, 16855292, 21051840, 14692762, 17762296, 17705023, 19121551
     19854503, 19309466, 18681862, 20558005, 17390160, 18554763, 18456514
     13955826, 16306373, 18139690, 17501491, 17299889, 17752121, 17889583
     18673325, 18293054, 17242746, 17951233, 17649265, 18094246, 19615136
     17011832, 16870214, 17477958, 18522509, 20631274, 16091637, 17323222
     16595641, 16524926, 18228645, 18282562, 17596908, 17156148, 18031668
     16494615, 17545847, 17614134, 13558557, 17341326, 17891946, 17716305
     16392068, 19271443, 18092127, 17614227, 18440047, 14106803, 16903536
     18973907, 18673342, 17389192, 16194160, 17006570, 17612828, 17721717
     17570240, 17390431, 16863422, 18325460, 19727057, 16422541, 17267114
     19972570, 18244962, 18765602, 18203838, 16198143, 17246576, 14829250
     17835627, 18247991, 14458214, 21051862, 16692232, 17786278, 17227277
     16042673, 16314254, 16228604, 16837842, 17393683, 17787259, 20331945
     20074391, 15861775, 16399083, 18018515, 21051858, 18260550, 17036973
     16613964, 17080436, 16579084, 18384537, 18280813, 20296213, 16901385
     15979965, 18441944, 16450169, 9756271, 17892268, 11733603, 17587063
     16285691, 16538760, 18180390, 18193833, 21051833, 17238511, 17824637
     16571443, 18306996, 14852021, 18674047, 17853456, 12364061






--------------------------------------------------------------------------------


OPatch succeeded.
[oracle@rh64 20760982]$ cd $ORACLE_HOME/rdbms/admin
[oracle@rh64 admin]$ sqlplus /nolog


SQL*Plus: Release 11.2.0.4.0 Production on Tue Jul 21 01:27:48 2015


Copyright (c) 1982, 2013, Oracle.  All rights reserved.


SQL> CONNECT / AS SYSDBA
Connected to an idle instance.
SQL> STARTUP
ORACLE instance started.


Total System Global Area  839282688 bytes
Fixed Size                  2257880 bytes
Variable Size             507513896 bytes
Database Buffers          327155712 bytes
Redo Buffers                2355200 bytes
Database mounted.
Database opened.
SQL> @catbundle.sql psu apply


PL/SQL procedure successfully completed.




Function created.




Function created.




PL/SQL procedure successfully completed.














PL/SQL procedure successfully completed.










Generating apply and rollback scripts...
Check the following file for errors:
/u01/app/cfgtoollogs/catbundle/catbundle_PSU_ORA11G_GENERATE_2015Jul21_01_28_33.log
Apply script: /u01/app/db11g/product/11.2.0/dbhome_1/rdbms/admin/catbundle_PSU_ORA11G_APPLY.sql
Rollback script: /u01/app/db11g/product/11.2.0/dbhome_1/rdbms/admin/catbundle_PSU_ORA11G_ROLLBACK.sql


PL/SQL procedure successfully completed.


Executing script file...








SQL> COLUMN spool_file NEW_VALUE spool_file NOPRINT
SQL> SELECT ‘/u01/app/cfgtoollogs/catbundle/‘ || ‘catbundle_PSU_‘ || name || ‘_APPLY_‘ || TO_CHAR(SYSDATE, ‘YYYYMonDD_hh24_mi_ss‘, ‘NLS_DATE_LANGUAGE=‘‘AMERICAN‘‘‘) || ‘.log‘ AS spool_file FROM v$database;








SQL> SPOOL &spool_file
SQL> exec sys.dbms_registry.set_session_namespace(‘SERVER‘)


PL/SQL procedure successfully completed.


SQL> PROMPT Processing OLAP Analytic Workspace...
Processing OLAP Analytic Workspace...
SQL> ALTER SESSION SET current_schema = sys;


Session altered.


SQL> @?/rdbms/admin/bug20558005.sql
SQL> --
SQL> -- bug20558005.sql
SQL> --
SQL> -- Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
SQL> --
SQL> --    NAME
SQL> --      bug20558005.sql -- drop unneeded procedure
SQL> --
SQL> --    DESCRIPTION
SQL> --      patch 9968263 left a procedure behind.  This file drops it.
SQL> --
SQL> --    NOTES
SQL> --      None
SQL> --
SQL> --    MODIFIED  (MM/DD/YY)
SQL> --    jcarey     03/16/15 - Created
SQL> 
SQL> drop procedure sys.drop_aw_elist_all;
drop procedure sys.drop_aw_elist_all
*
ERROR at line 1:
ORA-04043: object DROP_AW_ELIST_ALL does not exist




SQL> 
SQL> PROMPT Processing Oracle Database Packages and Types...
Processing Oracle Database Packages and Types...
SQL> ALTER SESSION SET current_schema = sys;


Session altered.


SQL> @?/rdbms/admin/bug20876312_apply.sql
SQL> Rem
SQL> Rem $Header: rdbms/admin/bug20876312_apply.sql /st_rdbms_11.2.0.4.0dbpsu/2 2015/05/12 23:28:52 ratakuma Exp $
SQL> Rem
SQL> Rem bug20876312_apply.sql
SQL> Rem
SQL> Rem Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
SQL> Rem
SQL> Rem    NAME
SQL> Rem      bug20876312_apply.sql - <one-line expansion of the name>
SQL> Rem
SQL> Rem    DESCRIPTION
SQL> Rem      <short description of component this file declares/defines>
SQL> Rem
SQL> Rem    NOTES
SQL> Rem      <other useful comments, qualifications, etc.>
SQL> Rem
SQL> Rem    BEGIN SQL_FILE_METADATA
SQL> Rem    SQL_SOURCE_FILE: rdbms/admin/bug20876312_apply.sql
SQL> Rem    SQL_SHIPPED_FILE:
SQL> Rem    SQL_PHASE:
SQL> Rem    SQL_STARTUP_MODE: NORMAL
SQL> Rem    SQL_IGNORABLE_ERRORS: NONE
SQL> Rem    SQL_CALLING_FILE:
SQL> Rem    END SQL_FILE_METADATA
SQL> Rem
SQL> Rem    MODIFIED   (MM/DD/YY)
SQL> Rem    ratakuma    04/17/15 - Created
SQL> Rem
SQL> 
SQL> SET ECHO ON
SQL> SET FEEDBACK 1
SQL> SET NUMWIDTH 10
SQL> SET LINESIZE 80
SQL> SET TRIMSPOOL ON
SQL> SET TAB OFF
SQL> SET PAGESIZE 100
SQL> 
SQL> create or replace view USER_AUDIT_POLICIES (OBJECT_NAME,
  2                          POLICY_NAME, POLICY_TEXT, POLICY_COLUMN, PF_SCHEMA,
  3                          PF_PACKAGE, PF_FUNCTION, ENABLED,
  4                          SEL, INS, UPD, DEL, AUDIT_TRAIL,
  5                          POLICY_COLUMN_OPTIONS)
  6  as
  7  SELECT OBJECT_NAME, POLICY_NAME, POLICY_TEXT,  POLICY_COLUMN,
  8         PF_SCHEMA, PF_PACKAGE, PF_FUNCTION, ENABLED,
  9         SEL, INS, UPD, DEL, AUDIT_TRAIL, POLICY_COLUMN_OPTIONS
 10  FROM DBA_AUDIT_POLICIES
 11  WHERE OBJECT_SCHEMA = SYS_CONTEXT(‘USERENV‘,‘CURRENT_USER‘)
 12  /


View created.


SQL> 
SQL> create or replace view USER_AUDIT_POLICY_COLUMNS(OBJECT_SCHEMA, OBJECT_NAME,
  2                          POLICY_NAME, POLICY_COLUMN)
  3  as
  4  select OBJECT_SCHEMA, OBJECT_NAME,
  5         POLICY_NAME, POLICY_COLUMN
  6  from DBA_AUDIT_POLICY_COLUMNS
  7  WHERE OBJECT_SCHEMA = SYS_CONTEXT(‘USERENV‘,‘CURRENT_USER‘)
  8  /


View created.


SQL> 
SQL> CREATE OR REPLACE VIEW user_scheduler_job_log
  2    ( LOG_ID, LOG_DATE, OWNER, JOB_NAME, JOB_SUBNAME, JOB_CLASS, OPERATION, STATUS,
  3      USER_NAME, CLIENT_ID, GLOBAL_UID, CREDENTIAL_OWNER, CREDENTIAL_NAME,
  4      DESTINATION_OWNER, DESTINATION, ADDITIONAL_INFO)
  5    AS
  6    (SELECT
  7       LOG_ID, LOG_DATE, OWNER,
  8       DECODE(instr(e.NAME,‘"‘),0, e.NAME,substr(e.NAME,1,instr(e.NAME,‘"‘)-1)),
  9       DECODE(instr(e.NAME,‘"‘),0,NULL,substr(e.NAME,instr(e.NAME,‘"‘)+1)),
 10       co.NAME, OPERATION,e.STATUS, USER_NAME, CLIENT_ID, GUID,
 11       decode(e.credential, NULL, NULL,
 12          substr(e.credential, 1, instr(e.credential, ‘"‘)-1)),
 13       decode(e.credential, NULL, NULL,
 14          substr(e.credential, instr(e.credential, ‘"‘)+1,
 15             length(e.credential) - instr(e.credential, ‘"‘))),
 16       decode(bitand(e.flags, 1), 0, NULL,
 17          substr(e.destination, 1, instr(e.destination, ‘"‘)-1)),
 18       decode(bitand(e.flags, 1), 0, e.destination,
 19          substr(e.destination, instr(e.destination, ‘"‘)+1,
 20             length(e.destination) - instr(e.destination, ‘"‘))),
 21       ADDITIONAL_INFO
 22    FROM scheduler$_event_log e, obj$ co
 23    WHERE e.type# = 66 and e.dbid is null and e.class_id = co.obj#(+)
 24    AND owner = SYS_CONTEXT(‘USERENV‘,‘CURRENT_USER‘))
 25  /


View created.


SQL> 
SQL> CREATE OR REPLACE VIEW user_scheduler_job_run_details
  2    ( LOG_ID, LOG_DATE, OWNER, JOB_NAME, JOB_SUBNAME, STATUS, ERROR#, REQ_START_DATE,
  3      ACTUAL_START_DATE, RUN_DURATION, INSTANCE_ID, SESSION_ID, SLAVE_PID,
  4      CPU_USED, CREDENTIAL_OWNER, CREDENTIAL_NAME, DESTINATION_OWNER,
  5      DESTINATION, ADDITIONAL_INFO)
  6    AS
  7    (SELECT
  8       j.LOG_ID, j.LOG_DATE, e.OWNER,
  9       DECODE(instr(e.NAME,‘"‘),0, e.NAME,substr(e.NAME,1,instr(e.NAME,‘"‘)-1)),
 10       DECODE(instr(e.NAME,‘"‘),0,NULL,substr(e.NAME,instr(e.NAME,‘"‘)+1)),
 11       e.STATUS, j.ERROR#, j.REQ_START_DATE, j.START_DATE, j.RUN_DURATION,
 12       j.INSTANCE_ID, j.SESSION_ID, j.SLAVE_PID, j.CPU_USED,
 13       decode(e.credential, NULL, NULL,
 14          substr(e.credential, 1, instr(e.credential, ‘"‘)-1)),
 15       decode(e.credential, NULL, NULL,
 16          substr(e.credential, instr(e.credential, ‘"‘)+1,
 17             length(e.credential) - instr(e.credential, ‘"‘))),
 18       decode(bitand(e.flags, 1), 0, NULL,
 19          substr(e.destination, 1, instr(e.destination, ‘"‘)-1)),
 20       decode(bitand(e.flags, 1), 0, e.destination,
 21          substr(e.destination, instr(e.destination, ‘"‘)+1,
 22             length(e.destination) - instr(e.destination, ‘"‘))),
 23       j.ADDITIONAL_INFO
 24     FROM scheduler$_job_run_details j, scheduler$_event_log e
 25     WHERE j.log_id = e.log_id
 26     AND e.dbid is null
 27     AND e.type# = 66
 28     AND e.owner = SYS_CONTEXT(‘USERENV‘,‘CURRENT_USER‘))
 29  /


View created.


SQL> 
SQL> CREATE OR REPLACE VIEW all_scheduler_job_log
  2    ( LOG_ID, LOG_DATE, OWNER, JOB_NAME, JOB_SUBNAME, JOB_CLASS, OPERATION, STATUS,
  3      USER_NAME, CLIENT_ID, GLOBAL_UID, CREDENTIAL_OWNER, CREDENTIAL_NAME,
  4      DESTINATION_OWNER, DESTINATION, ADDITIONAL_INFO)
  5    AS
  6    (SELECT
  7       e.LOG_ID, e.LOG_DATE, e.OWNER,
  8       DECODE(instr(e.NAME,‘"‘),0, e.NAME,substr(e.NAME,1,instr(e.NAME,‘"‘)-1)),
  9       DECODE(instr(e.NAME,‘"‘),0,NULL,substr(e.NAME,instr(e.NAME,‘"‘)+1)),
 10       co.NAME, OPERATION, e.STATUS, e.USER_NAME, e.CLIENT_ID, e.GUID,
 11       decode(e.credential, NULL, NULL,
 12          substr(e.credential, 1, instr(e.credential, ‘"‘)-1)),
 13       decode(e.credential, NULL, NULL,
 14          substr(e.credential, instr(e.credential, ‘"‘)+1,
 15             length(e.credential) - instr(e.credential, ‘"‘))),
 16       decode(bitand(e.flags, 1), 0, NULL,
 17          substr(e.destination, 1, instr(e.destination, ‘"‘)-1)),
 18       decode(bitand(e.flags, 1), 0, e.destination,
 19          substr(e.destination, instr(e.destination, ‘"‘)+1,
 20             length(e.destination) - instr(e.destination, ‘"‘))),
 21       e.ADDITIONAL_INFO
 22     FROM scheduler$_event_log e, obj$ co
 23     WHERE e.type# = 66 and e.dbid is null and e.class_id = co.obj#(+)
 24     AND ( e.owner = SYS_CONTEXT(‘USERENV‘,‘CURRENT_USER‘)
 25           or  /* user has object privileges */
 26              ( select jo.obj# from obj$ jo, user$ ju where
 27                DECODE(instr(e.NAME,‘"‘),0, e.NAME,substr(e.NAME,1,instr(e.NAME,‘"‘)-1)) = jo.name
 28                  and e.owner = ju.name and jo.owner# = ju.user#
 29                  and jo.subname is null and jo.type# = 66
 30              ) in
 31              ( select oa.obj#
 32                  from sys.objauth$ oa
 33                  where grantee# in ( select kzsrorol from x$kzsro )
 34              )
 35           or /* user has system privileges */
 36              (exists ( select null from v$enabledprivs
 37                         where priv_number = -265 /* CREATE ANY JOB */
 38                     )
 39               and e.owner!=‘SYS‘)
 40          )
 41    )
 42  /


View created.


SQL> 
SQL> CREATE OR REPLACE VIEW all_scheduler_job_run_details
  2    ( LOG_ID, LOG_DATE, OWNER, JOB_NAME, JOB_SUBNAME, STATUS, ERROR#, REQ_START_DATE,
  3      ACTUAL_START_DATE, RUN_DURATION, INSTANCE_ID, SESSION_ID, SLAVE_PID,
  4      CPU_USED, CREDENTIAL_OWNER, CREDENTIAL_NAME, DESTINATION_OWNER,
  5      DESTINATION, ADDITIONAL_INFO)
  6    AS
  7    (SELECT
  8       j.LOG_ID, j.LOG_DATE, e.OWNER,
  9       DECODE(instr(e.NAME,‘"‘),0, e.NAME,substr(e.NAME,1,instr(e.NAME,‘"‘)-1)),
 10       DECODE(instr(e.NAME,‘"‘),0,NULL,substr(e.NAME,instr(e.NAME,‘"‘)+1)),
 11       e.STATUS, j.ERROR#, j.REQ_START_DATE, j.START_DATE, j.RUN_DURATION,
 12       j.INSTANCE_ID, j.SESSION_ID, j.SLAVE_PID, j.CPU_USED,
 13       decode(e.credential, NULL, NULL,
 14          substr(e.credential, 1, instr(e.credential, ‘"‘)-1)),
 15       decode(e.credential, NULL, NULL,
 16          substr(e.credential, instr(e.credential, ‘"‘)+1,
 17             length(e.credential) - instr(e.credential, ‘"‘))),
 18       decode(bitand(e.flags, 1), 0, NULL,
 19          substr(e.destination, 1, instr(e.destination, ‘"‘)-1)),
 20       decode(bitand(e.flags, 1), 0, e.destination,
 21          substr(e.destination, instr(e.destination, ‘"‘)+1,
 22             length(e.destination) - instr(e.destination, ‘"‘))),
 23       j.ADDITIONAL_INFO
 24     FROM scheduler$_job_run_details j, scheduler$_event_log e
 25     WHERE j.log_id = e.log_id
 26     AND e.type# = 66 and e.dbid is null
 27     AND ( e.owner = SYS_CONTEXT(‘USERENV‘,‘CURRENT_USER‘)
 28           or  /* user has object privileges */
 29              ( select jo.obj# from obj$ jo, user$ ju where
 30                  DECODE(instr(e.NAME,‘"‘),0, e.NAME,substr(e.NAME,1,instr(e.NAME,‘"‘)-1)) = jo.name
 31                  and e.owner = ju.name and jo.owner# = ju.user#
 32                  and jo.subname is null and jo.type# = 66
 33              ) in
 34              ( select oa.obj#
 35                  from sys.objauth$ oa
 36                  where grantee# in ( select kzsrorol from x$kzsro )
 37              )
 38           or /* user has system privileges */
 39              (exists ( select null from v$enabledprivs
 40                         where priv_number = -265 /* CREATE ANY JOB */
 41                     )
 42               and e.owner!=‘SYS‘)
 43          )
 44    )
 45  /


View created.


SQL> 
SQL> 
SQL> alter view USER_AUDIT_POLICIES compile;


View altered.


SQL> alter view USER_AUDIT_POLICY_COLUMNS compile;


View altered.


SQL> alter view user_scheduler_job_log compile;


View altered.


SQL> alter view user_scheduler_job_run_details compile;


View altered.


SQL> alter view all_scheduler_job_log compile;


View altered.


SQL> alter view all_scheduler_job_run_details compile;


View altered.


SQL> 
SQL> ALTER SESSION SET current_schema = SYS;


Session altered.


SQL> PROMPT Updating registry...
Updating registry...
SQL> INSERT INTO registry$history
  2    (action_time, action,
  3     namespace, version, id,
  4     bundle_series, comments)
  5  VALUES
  6    (SYSTIMESTAMP, ‘APPLY‘,
  7     SYS_CONTEXT(‘REGISTRY$CTX‘,‘NAMESPACE‘),
  8     ‘11.2.0.4‘,
  9     7,
 10     ‘PSU‘,
 11     ‘PSU 11.2.0.4.7‘);


1 row created.


SQL> COMMIT;


Commit complete.


SQL> SPOOL off
SQL> SET echo off
Check the following log file for errors:
/u01/app/cfgtoollogs/catbundle/catbundle_PSU_ORA11G_APPLY_2015Jul21_01_28_35.log
SQL> select * from  dba_registry_history;
ACTION_TIME                                                                 ACTION                         NAMESPACE                      VERSION                                ID BUNDLE_SERIES                  COMMENTS
--------------------------------------------------------------------------- ------------------------------ ------------------------------ ------------------------------ ---------- ------------------------------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
08-NOV-14 12.54.51.873764 PM                                                APPLY                          SERVER                         11.2.0.4                                2 PSU                            PSU 11.2.0.4.2
27-JAN-15 11.57.18.744412 AM                                                APPLY                          SERVER                         11.2.0.4                                5 PSU                            PSU 11.2.0.4.5
01-APR-15 11.54.50.240210 AM                                                APPLY                          SERVER                         11.2.0.4                                6 PSU                            PSU 11.2.0.4.6
21-JUL-15 01.28.36.827706 AM                                                APPLY                          SERVER                         11.2.0.4                                7 PSU                            PSU 11.2.0.4.7


4 rows selected.


SQL> 


5 Known Issues

7.2 Bug Fixes

没有啥特别的单机,比较简单那,需要注意下readme里面的knowns issues和bug fixes

版权声明:本文为博主原创文章,未经博主允许不得转载。

单机oracle数据库打最新11.2.0.4.7记录

标签:patch   11.2.0.4.7   oracle   

热心网友 时间:2022-04-08 05:15

1、打开oracle sql developer工具,没有此工具的可以去oracle官网下载安装即可,刚刚安装完成的是没有记录的,只有使用工具执行过后才会留下记录可以查询。打开之后不需要连接数据库就可以查询到sql记录了。

2、在二级菜单中,选择SQL历史记录选项,或者按快捷键F8打开窗口。

3、默认打开是会显示在最下方的小窗口,在标题栏双击鼠标左键,即可最大化窗口,再次双击左键还原窗口。

4、最大化窗口之后,便于更好的查询记录结果,如图所示,以往执行的sql记录都显示出来了,可以在每个栏目标题上单击,进行排序操作,一般可以点击时间戳字段,按时间来排序查询记录。第二次点击,可以切换顺序和逆序。

5、最后一个字段是持续时间,点击排序之后可以查询出哪些sql语句最快,哪些sql语句执行比较慢,需要优先等。

6、对于一些不需要的sql记录可以删除的,因为记录多了不便于查询,没有用的sql最好及时清除了。只需要选择您需要删除的记录,然后点击如图所示的清除按钮,在二次确认弹框中选择是,即可删除。

7、在删除按钮后面就是一个搜索输入框,在此处输入搜索关键字可以模糊匹配到记录,对于记不清的记录,采用模糊搜索的方式查询,效率非常高。工具会自动根据我们输入的关键字进行筛选过滤的。

热心网友 时间:2022-04-08 06:33

需要打开oracle审计功能才能记录,并且消耗一定性能。
简单打开审计如下
1、设置参数
alter system set audit_trail=db scope=spfile;
2、重启数据库
3、打开相应的审计(审计选项很多),如,对用户test对表操作的审计
audit table by test;
4、以dba查看审计记录
select * from dba_audit_trail;

热心网友 时间:2022-04-08 08:07

select * from v$sqlarea t order by t.FIRST_LOAD_TIME desc
oracle 怎么查看表的操作日志

Oracle日志文件查看方法:1、以sysdba权限用户登录数据库。2、执行sql语句:select * from v$logfile;3、结果显示即为日志路径:4、另外还有其他的操作日志可用以下两个sql语句查询:select * from v$sql;--(#查看最近所作的操作)select * fromv $sqlarea;--(#查看最近所作的操作)

如何查询oracle表的操作日志记录

1、打开oracle sql developer工具,没有此工具的可以去oracle官网下载安装即可,刚刚安装完成的是没有记录的,只有使用工具执行过后才会留下记录可以查询。打开之后不需要连接数据库就可以查询到sql记录了。2、在二级菜单中,选择SQL历史记录选项,或者按快捷键F8打开窗口。3、默认打开是会显示在最下方的小...

如何查询Oracle数据库的操作日志

方法1:使用LogMiner工具 优点:可以完全挖掘日志内容,找出所有执行过的SQL语句 缺点:1. 如果没有启用归档日志,则只能对联机日志进行挖掘 2. 需要掌握LogMiner的用法 访法2:查看HIST视图 优点:简单,只要使用普通的select语句查询 缺点:Oracle保留约1周的历史,所以要查太早的就不可能了 -- 找出哪个...

在ORACLE中怎么查看SQL执行日志

在Oracle中查看SQL执行日志的操作相对简单,以下是具体步骤:首先,确保你已经安装了OracleSQLDeveloper,如果没有,可通过浏览器轻松下载安装。步骤如下:1.打开SQLDeveloper工具,你可以通过菜单栏找到它,点击进入。接着,进入工具后,找到并使用以下方法查看SQL历史记录:2.在二级菜单中,可以直接选择"SQL...

oracle客户端如何查看日志信息

SQL&gt;select * fromv $sqlarea(#查看最近所作的操作)Oracle 数据库的所有更改都记录在日志中,从目前来看,分析Oracle日志的唯一方法就是使用Oracle公司提供的LogMiner来进行,因为原始的日志信息我们根本无法看懂,Oracle8i后续版本中自带了LogMiner,而LogMiner就是让我们看懂日志信息的工具,通过这个工具可以:...

Linux系统下怎么查询oracle归档日志?--风纳云

1. 当需要增大归档日志空间时,确保系统具备足够的磁盘容量,并对Oracle数据库进行相应的调整。三、清理归档日志 1. 查看当前已使用的归档日志量,确定是否有冗余或不必要保留的归档。2. 使用RMAN工具释放归档日志所占用的空间,首先连接RMAN工具进行操作。3. 利用RMAN工具查寻归档日志详细信息,以便精确...

在ORACLE 中怎么查看SQL 执行日志

1、首先打开oracle sql developer工具,没有此工具的可以去百度浏览器下载安装即可,鼠标点击查看菜单。2、在二级菜单中,选择SQL历史记录选项,或者按快捷键F8打开窗口。3、默认打开是会显示在最下方的小窗口,在标题栏双击鼠标左键,即可最大化窗口,再次双击左键还原窗口。4、最大化窗口之后,便于更好...

oracle imp 如何查看导入日志

1、首先,按win+R快捷键,会出现一个运行的窗口。2、在打开后面的输入框里面输入cmd,回车确定。3、此时会出现一个窗口,命令提示符。4、然后点击输入要打开的文件夹路径“data”,回车确定。5、然后在弹出来的文件窗口中,找到logname.log文件,右键单击选择打开方式中的“记事本”。6、然后就可以查...

如何查看oracle的日志文件?

的根目录下面,运行 soruce .bash_prfile 命令, 以便 输入相关命令。4、运行命令: cd $ORACLE_HOME 进入oracle的安装目录。5、在此输入命令: find -name listener.log ,查找监控日志文件。6、运行命令 cd 到查看到的日志文件目录。7、运行cat listener.log命令 查看日志文件。

如何查询Oracle用户操作日志

1 查看值得怀疑的SQL select substr(to_char(s.pct,'99.00'),2)||'%'load,s.executions executes,p.sql_text from(select address,disk_reads,executions,pct,rank() over(order by disk_reads desc) ranking from(select address,disk_reads,executions,100*ratio_to_report(disk_reads) over(...

oracle查询日志sql oracle存储过程记录日志 oracle数据库删除记录日志 oracle触发器记录日志 oracle 登录日志 oracle日记查看 oracle导入日志查看 查看oracle运行日志 oraclesql执行日志
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
《中国的土地》中,诗人为什么说中国的土地是“神奇的? ...这首诗中,如何写出了爱;刘湛秋在《中国的土地》如何写出了神奇... 有限责任公司变更经营范围,变更登记申请书中的许可经营项目和一般经营... 《中国的土地》中,诗人为什么说中国的土地是“神奇的土地” E盘中的一个文件夹打不开并提示explorer应用程序错误 我的电脑一打开E盘就显示explorer.exe遇到问题需要关闭(如图所示),点... 打开E盘后提示出现explorer.exe 应用程序错误 该内存不能为... 耍大牌百科耍大牌什么意思 丹东有哪些当地人常去的火锅店? 丹东有哪些正宗的重庆火锅店? 潮汕牛肉火锅排名第一的是哪个 疯狂猜图一个球队的标志 疯狂猜图一个蓝色的狮子(怪兽)标志的球队是什么球队 记号笔的墨水能用酒精擦掉吗? 鱼丸能放多长时间有保质期么? 为什么,温带海洋性气候和温带季风气候的自然带是一样的? 潮汕牛肉火锅为什么这么火? 疯狂猜图 球队 蓝色背景 中间有个C 高中温带海洋性气候与自然带的疑问 鱼丸常温下能存放多久 每天爱猜图4个字的球队叫甚么 为什么澳大利亚温带海洋性气候区的自然带却是亚热带 为什么澳大利亚温带海洋性气候区的自然带却是亚热带 疯狂猜图 球队类 两个字 鱼丸没有冰箱冬天怎么保存 为什么温带季风性气候和温带海洋性气候自然带相同 请问世界气候对应的各个自然带 欧洲西部温带海洋性气候的自然带是什么带? 疯狂猜图答案球队是什么 图例①、②、③代表的自然带分别是(  )A.*带常绿硬叶林带、温带落叶阔叶林带、温带荒漠带B.温带 哪些国家是地中海气候,哪些是温带海洋 对应自然带是? 疯狂猜图,球队,俩字,一件绿色的球衣,一半深绿,一半浅绿 鱼丸放在保温碗里可以放多久? 热带季风气候、温带海洋性气候、地中海气候属于哪种林带?我只知道*带季风气候是*带常绿阔叶林 疯狂猜图 球队 三个字 蓝色背景 红色球衣 领子和袖子是白的 从超市买的速冻着的鱼丸、虾丸等海鲜产品的保质期是多长时间?拿回家放冰箱里能保存多长时间? 北京香山以红叶闻名,每逢霜秋漫山红叶甚是壮观.北京的自然带为(  )A.*带常绿阔叶林带B.*带 鱼丸不冷藏可以保存3天吗? 疯狂猜图1.2城市所有答案图表完全攻略 疯狂猜图游怎么玩,疯狂猜图全攻略介绍 透支信用去消费的危害? 疯狂猜图。两个字球队,红格子衫右上角黄色圆圈标志 疯狂猜图答案 怎么用 信用卡恶意透支有什么后果? 所有穿黑衣服的名人是谁?疯狂猜图名人明星答案 办透支卡的坏处 疯狂猜图中所有图片的答案! 疯狂猜图答案 信用卡恶意透支后果有什么 信用卡恶意透支的后果