Turn on heat_map parameter in Oracle 12c - oracle

I have switched off heat_map parameter
SQL> SHOW PARAMETER heat_map;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
heat_map string OFF
But if I try to make it available I get the following errors:
SQL> ALTER SYSTEM SET heat_map = ON;
ALTER SYSTEM SET heat_map = ON
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-00439: feature not enabled: Heat Map
What should I do to enable that parameter?

When you are shown ORA-00439, you cannot use the specified feature, as it is not enabled.
The first thing to check is to ensure that you are using Oracle Enterprise Edition.
According to Oracle features - standard edition vs. enterprise edition the new heat_map 12c feature is reserved only for users using EE.

Related

Oracle XE audit_trail not saving for all users

I enabled auditing on my Oracle XE server via the following run by the sys user:
SQL> ALTER SYSTEM SET audit_sys_operations=true SCOPE=spfile;
SQL> ALTER SYSTEM SET audit_trail=XML,EXTENDED SCOPE=spfile;
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP
When I run queries as the sys user, an xml file records the queries in the default location (e.g., /u01/app/oracle/admin/XE/adump/xe_ora_2339_1.xml). However, if I run a query as a different user (e.g., test_user), no updates occur in any of the files in the adump directory.
I've confirmed that the parameter is set for the test_user:
SQL> show parameter audit;
NAME TYPE VALUE
------------------------ ------- ------------------------------
audit_file_dest string /u01/app/oracle/admin/XE/adump
audit_sys_operations boolean TRUE
audit_syslog_level string
audit_trail string XML, EXTENDED
I also tried restarting my sqlplus session (i.e., reconnecting with the test_user), as well as disabling audit_sys_operations, and the issue remains.
Version info: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production (via this docker image).
My issue was that, in addition to enabling auditing, I also needed to specify what to audit with the AUDIT command. In my case, I wanted everything, so I added the following (commands mentioned in this tutorial):
SQL> AUDIT ALL; # note: it seems like the next two statements would be included with "all", but I didn't verify this.
SQL> AUDIT SELECT TABLE, UPDATE TABLE, INSERT TABLE, DELETE TABLE;
SQL> AUDIT EXECUTE PROCEDURE;
Note that with AUDIT_TRAIL=XML,EXTENDED (and maybe all the file-based auditing settings?), it looks there is some buffering of writing the XML file, as I didn't get a query showing up until my test user disconnected, so if you are missing a log entry, try logging the user out to see if it shows up.

Set audit parameters with no startup

I want to activate an audit operation on a table or two in my oracle db,
and for that I need to set the audit parameters.
alter system set AUDIT_SYS_OPERATIONS=true scope=spfile;
alter system set AUDIT_TRAIL=db, extended scope=spfile;
But those parameters not realy changed becuase startup of DB is needed.
Is there a way to skip over the startup to apply those changes?
This is realy important DB in production Env, and startup is almost-impossible.
Thank you.
If you just want to enable auditing on a selected objects then you can do it without bouncing your database instance. Audit trail is set to DB by default.
SQL> show parameter audit
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest string /u01/app/oracle/admin/orcl/adu
mp
audit_sys_operations boolean FALSE
audit_syslog_level string
audit_trail string DB
All you need to do is to enable required auditing on that object.
SQL> conn jay
Enter password:
Connected.
SQL> audit select on my_table;
Audit succeeded.
SQL> conn system
Enter password:
Connected.
SQL> select * from jay.my_table;
no rows selected
Audit information can be accessed from USER_AUDIT_OBJECT view.
SQL> conn jay
Enter password:
Connected.
SQL> select username, action_name from user_audit_object where obj_name='MY_TABLE';
USERNAME ACTION_NAME
------------------------------ ----------------------------
SYSTEM SESSION REC
However, if you need to enable auditing for sysdba/sysoper privileged users such as sys then you need to set audit_sys_operations parameter to true which in turn requires database shutdown.
Moreover, if you are using Oracle 12c then AUDIT_SYS_OPERATIONS is set to true by default.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> show parameter audit
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest string /u01/app/oracle/admin/orcl/adump
audit_sys_operations boolean TRUE
audit_syslog_level string
audit_trail string DB
you cant use it with no startup
look this (Auditing Administrative Users)

How to check compatible and optimizer version for a Oracle database

How to check compatible and optimizer version for a Oracle database instance. I want to know if there is any specific command to check the above two versions from SqlPlus. For compatible version, I know following command might do the job:
select * from database_compatible_level;
I want similar command which will tell me optimizer version. Please help.
Run the following commands as sysdba to know the current values set for these parameters.
SQL>conn sys as sysdba
SQL>show parameter OPTIMIZER_FEATURES_ENABLE;
SQL>show parameter COMPATIBLE;
Any database user can check the OPTIMIZER_FEATURES_ENABLE setting by using the EXPLAIN PLAN command:
SQL> explain plan for select * from dual;
Explained.
SQL> select trim(plan_table_output) optimizer_features_enable
2 from table(dbms_xplan.display(format => 'advanced'))
3 where plan_table_output like '%OPTIMIZER_FEATURES_ENABLE%';
OPTIMIZER_FEATURES_ENABLE
--------------------------------------------------------------------------------
OPTIMIZER_FEATURES_ENABLE('19.1.0')
SQL>
Viewing most database parameters require SELECT_CATALOG_ROLE or SELECT ANY DICTIONARY, but luckily this parameter is exposed in the Outline section of the explain plan. The value in the explain plan is technically only for the statement, but as long as you don't change the parameter at the session or statement level, the value from the above query will be inherited from the system parameter.

Unable to alter Oracle Parameters

I am unable to add more than 200 datafiles in my database because of these parameters:
select records_total from v$controlfile_record_section where type = 'DATAFILE';
select value from v$parameter where name = 'db_files';
Both of these give me an output of 200. I need to increase this to 400 so I have tried:
alter system set records_total = 400 where name = 'db_files';
alter system set value= 400 where type = 'DATAFILE';
but I am getting
S
QL Error: ORA-02065: illegal option for ALTER SYSTEM
02065. 00000 - "illegal option for ALTER SYSTEM"
*Cause: The option specified for ALTER SYSTEM is not supported
*Action: refer to the user manual for option supported
Am I able to change these parameters and how?
You probably want to use commands like this:
C:\Users\jonearles>sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Fri Jul 10 13:07:16 2015
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> show parameter db_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_files integer 200
SQL> alter system set db_files=400 scope=spfile;
System altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1048576000 bytes
Fixed Size 3053584 bytes
Variable Size 662702064 bytes
Database Buffers 377487360 bytes
Redo Buffers 5332992 bytes
Database mounted.
Database opened.
SQL> show parameter db_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_files integer 400
SQL>
This assumes you are using an SPFILE (or else you will need to manually edit the init.ora file and restart) and you are not using RAC (or else you will need to use a command like srvctl stop database -d my_sid).
As ditto mentioned, it can help to look at the ALTER syntax. It may also help to look at the Oracle Database Reference, which will tell you if the command is dynamic (meaning it can be run without restarting the database).

How to prevent "parameter PLSQL_DEBUG is deprecated" compiler warning in Oracle SQL Developer

When I execute a package body DDL statement SQL Developer warns,
Warning: PLW-06015: parameter PLSQL_DEBUG is deprecated; use PLSQL_OPTIMIZE_LEVEL=1
How can SQL Developer be configured to not use PLSQL_DEBUG?
PLSQL_DEBUG is set to false in an sql*plus session using the same connection details,
> show parameters plsql
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
plsql_ccflags string
plsql_code_type string INTERPRETED
plsql_debug boolean FALSE
plsql_native_library_dir string
plsql_native_library_subdir_count integer 0
plsql_optimize_level integer 2
plsql_v2_compatibility boolean FALSE
plsql_warnings string ENABLE:ALL
Oracle SQL Developer v 2.1.1.64
Oracle 11g SE: 11.1.0.6.0
I am looking for a GUI option not a login trigger to achieve this.
I am not looking for a way to simply suppress the display of this warning. The warning must not be generated at all.
If you only want to disable a single warning you can use PLSQL_WARNINGS. The oracle documentation for 11g can be found here
To disable the warning for your session the usage is:
ALTER SESSION SET PLSQL_WARNINGS='ENABLE:ALL','DISABLE:06015';
However this will only disable for your current session. If you wanted it to be disabled whenever you login, you would need to add it to your login.sql file used with SQL Developer.
Alternatively I believe you can turn all PL/SQL compiler warnings off in SQL Developer (although i would not recommend this)
Preferences->Database->PL/SQL Compiler Options
It may be possible to remove the plsql_debug parameter, but I am unsure how to do this. Maybe someone else can help here.

Resources