Search This Blog

Total Pageviews

Monday 19 September 2011

Oracle system parameter had changed ?

changed parameter information



select snap_id,
to_char(end_interval_time,'yyyy/mm/dd hh24:mi:ss') end_interval_time ,
parameter_name,
bef_value,
value cur_value,
isdefault,
ismodified
from (select p.snap_id,
s.end_interval_time,
p.parameter_name,
lag(p.value,1) over(partition by p.instance_number , p.parameter_name order by p.snap_id ) bef_value,
p.value,
p.isdefault,
p.ismodified,
min(p.snap_id) over() min_snap_id
from dba_hist_parameter p,
(select dbid,
instance_number,
max(a.end_interval_time) end_interval_time,
max(snap_id) last_snap_id
from dba_hist_snapshot a
where dbid = (select dbid from v$database)
and instance_number = (select instance_number from v$instance)
group by dbid, instance_number, trunc(end_interval_time)) s
where p.dbid = s.dbid
and p.instance_number = s.instance_number
and p.snap_id = s.last_snap_id
)
where snap_id != min_snap_id
and (value != bef_value or (bef_value is null and value is not null))

Oracle Dictionary - Dynamic Views

Oracle dict view

col TABLE_NAME format a40
col COMMENTS format a70
SELECT * FROM DICT WHERE TABLE_NAME LIKE 'V$%' ORDER BY TABLE_NAME ;


col TABLE_NAME format a40
col COMMENTS format a70
SELECT * FROM DICT WHERE TABLE_NAME LIKE 'USER_%' ORDER BY TABLE_NAME;


col TABLE_NAME format a40
col COMMENTS format a70
SELECT * FROM DICT WHERE TABLE_NAME LIKE 'ALL_%' ORDER BY TABLE_NAME;


col TABLE_NAME format a40
col COMMENTS format a70
SELECT * FROM DICT WHERE TABLE_NAME LIKE 'DBA_%' ORDER BY TABLE_NAME;

What is going on inside your SYSAUX tablespace .

size in SYSAUX tablespace
Oracle SYSAUX tablespace


@$ORACLE_HOME/rdbms/admin/utlsyxsz.sql


This script estimates the space required for the SYSAUX tablespace.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Specify the Report File Name
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is utlsyxsz.txt. To use this name,
press to continue, otherwise enter an alternative.

Enter value for report_name: space.txt

Using the report name space.txt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SYSAUX Size Estimation Report
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Estimated at
14:24:41 on Sep 19, 2011 ( Monday ) in Timezone +01:00


DB_NAME HOST_PLATFORM INST STARTUP_TIME PAR
----------- ---------------------------------------- ----- ----------------- ---
* ORCL apt-lnxtst-01 - Linux IA (32-bit) 1 09:45:16 (09/19) NO

~~~~~~~~~~~~~~~~~~~~
Current SYSAUX usage
~~~~~~~~~~~~~~~~~~~~
| Total SYSAUX size: 429.3 MB
|
| Total size of SM/AWR 51.9 MB ( 12.1% of SYSAUX )
| Total size of SM/OPTSTAT 83.1 MB ( 19.4% of SYSAUX )
| Total size of EM 70.1 MB ( 16.3% of SYSAUX )
| Total size of XDB 48.3 MB ( 11.2% of SYSAUX )
| Total size of SDO 40.9 MB ( 9.5% of SYSAUX )
| Total size of TEXT 32.6 MB ( 7.6% of SYSAUX )
| Total size of AO 23.9 MB ( 5.6% of SYSAUX )
| Total size of XSOQHIST 23.9 MB ( 5.6% of SYSAUX )
| Total size of SM/OTHER 17.5 MB ( 4.1% of SYSAUX )
| Total size of XSAMD 15.6 MB ( 3.6% of SYSAUX )
| Total size of SM/ADVISOR 10.6 MB ( 2.5% of SYSAUX )
| Total size of WM 7.1 MB ( 1.7% of SYSAUX )
| Total size of LOGMNR 5.9 MB ( 1.4% of SYSAUX )
| Total size of EXPRESSION_FILTER 3.6 MB ( 0.8% of SYSAUX )
| Total size of EM_MONITORING_USER 1.6 MB ( 0.4% of SYSAUX )
| Total size of LOGSTDBY 0.9 MB ( 0.2% of SYSAUX )
| Total size of JOB_SCHEDULER 0.8 MB ( 0.2% of SYSAUX )
| Total size of STREAMS 0.5 MB ( 0.1% of SYSAUX )
| Total size of ORDIM 0.5 MB ( 0.1% of SYSAUX )
| Total size of ODM 0.3 MB ( 0.1% of SYSAUX )
| Total size of TSM 0.3 MB ( 0.1% of SYSAUX )
| Total size of Others -10.3 MB ( -2.4% of SYSAUX )
|

~~~~~~~~~~~~~~~~~~~~
AWR Space Estimation
~~~~~~~~~~~~~~~~~~~~

| To estimate the size of the Automatic Workload Repository (AWR)
| in SYSAUX, we need the following values:
|
| - Interval Setting (minutes)
| - Retention Setting (days)
| - Number of Instances
| - Average Number of Active Sessions
| - Number of Datafiles

|
| For 'Interval Setting',
| Press to use the current value: 60.0 minutes
| otherwise enter an alternative
|
Enter value for interval:

** Value for 'Interval Setting': 60

|
| For 'Retention Setting',
| Press to use the current value: 7.00 days
| otherwise enter an alternative
|
Enter value for retention:

** Value for 'Retention Setting': 7

|
| For 'Number of Instances',
| Press to use the current value: 1.00
| otherwise enter an alternative
|
Enter value for num_instances:

** Value for 'Number of Instances': 1

|
| For 'Average Number of Active Sessions',
| Press to use the current value: 24.0
| otherwise enter an alternative
|
Enter value for active_sessions:

** Value for 'Average Number of Active Sessions': 24

| ***************************************************
| Estimated size of AWR: 440.3 MB
|
| The AWR estimate was computed using
| the following values:
|
| Interval - 60 minutes
| Retention - 7.00 days
| Num Instances - 1
| Active Sessions - 24.00
| Datafiles - 9
| ***************************************************

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Optimizer Stat History Space Estimation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

| To estimate the size of the Optimizer Statistics History
| we need the following values:
|
| - Number of Tables in the Database
| - Number of Partitions in the Database
| - Statistics Retention Period (days)
| - DML Activity in the Database (level)

|
| For 'Number of Tables',
| Press to use the current value: 600.0
| otherwise enter an alternative
|
Enter value for number_of_tables:

** Value for 'Number of Tables': 600

|
| For 'Number of Partitions',
| Press to use the current value: 0.00
| otherwise enter an alternative

|
Enter value for number_of_partitions:

** Value for 'Number of Partitions': 0

|
| For 'Statistics Retention',
| Press to use the current value: 31.0 days
| otherwise enter an alternative

|
Enter value for stats_retention:

** Value for 'Statistics Retention': 31

|
| For 'DML Activity',
| Press to use the current value: 2
| otherwise enter an alternative <1=low, 2=medium, 3=high>
|
Enter value for dml_activity:

** Value for 'DML Activity': 2

| ***************************************************
| Estimated size of Stats history 30.4 MB
|
| The space for Optimizer Statistics history was
| estimated using the following values:
|
| Tables - 600
| Indexes - 1,006
| Columns - 4,507
| Partitions - 0
| Indexes on Partitions - 0
| Columns in Partitions - 0
| Stats Retention in Days - 31
| Level of DML Activity - Medium
| ***************************************************

~~~~~~~~~~~~~~~~~~~~~~
Estimated SYSAUX usage
~~~~~~~~~~~~~~~~~~~~~~

| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Estimated size of AWR: 440.3 MB
|
| The AWR estimate was computed using
| the following values:
|
| Interval - 60 minutes
| Retention - 7.00 days
| Num Instances - 1
| Active Sessions - 24.00
| Datafiles - 9
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Estimated size of Stats history 30.4 MB
|
| The space for Optimizer Statistics history was
| estimated using the following values:
|
| Tables - 600
| Indexes - 1,006
| Columns - 4,507
| Partitions - 0
| Indexes on Partitions - 0
| Columns in Partitions - 0
| Stats Retention in Days - 31
| Level of DML Activity - Medium
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| For all the other components, the estimate
| is equal to the current space usage of
| the component.
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
| ***************************************************
| Summary of SYSAUX Space Estimation
| ***************************************************

| Est size of EM 70.1 MB
| Est size of XDB 48.3 MB
| Est size of SDO 40.9 MB
| Est size of TEXT 32.6 MB
| Est size of AO 23.9 MB
| Est size of XSOQHIST 23.9 MB
| Est size of SM/OTHER 17.5 MB
| Est size of XSAMD 15.6 MB
| Est size of SM/ADVISOR 10.6 MB
| Est size of WM 7.1 MB
| Est size of LOGMNR 5.9 MB
| Est size of EXPRESSION_FILTER 3.6 MB
| Est size of EM_MONITORING_USER 1.6 MB
| Est size of LOGSTDBY 0.9 MB
| Est size of JOB_SCHEDULER 0.8 MB
| Est size of STREAMS 0.5 MB
| Est size of ORDIM 0.5 MB
| Est size of ODM 0.3 MB
| Est size of TSM 0.3 MB
| Est size of Others -10.3 MB

| Est size of SM/AWR 440.3 MB
| Est size of SM/OPTSTAT 30.4 MB
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Total Estimated SYSAUX size: 764.9 MB
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| ***************************************************

Oracle database growth

Oracle database growth by month over 2 years


select to_char(creation_time, 'YYYY') "Month", to_char(creation_time, 'MM') "Month", round(sum(bytes)/1024/1024,0) "Growth in Meg" 
from sys.v_$datafile 
where creation_time > SYSDATE-730 
group by to_char(creation_time, 'YYYY'),to_char(creation_time, 'MM') 
order by to_char(creation_time, 'YYYY') desc, to_char(creation_time, 'MM') desc  
/



Mont Mo Growth in Meg
---- -- -------------
2011 04           650
2010 09          3584


============

set pagesize 300
BREAK ON YEAR SKIP 1
COMPUTE SUM LABEL 'TOTAL' OF "Approx_No_files" ON YEAR

col "YEAR" for a15
col "Month" for a15
select to_char(creation_time, 'YYYY') "YEAR", to_char(creation_time, 'MM') "Month", round(sum(bytes)/1024/1024/1024,0) "Growth in GB",round((round(sum(bytes)/1024/1024/1024,0))/32) "Approx_No_files"
from sys.v_$datafile
where 1=1
--and creation_time > SYSDATE-3000
group by to_char(creation_time, 'YYYY'),to_char(creation_time, 'MM')
order by to_char(creation_time, 'YYYY') desc, to_char(creation_time, 'MM') desc
/

YEAR            MONTH           GROWTH_IN_GB APPROX_NO_FILE
--------------- --------------- ------------ --------------
2022            02                        76              2
                01                       779             24
***************                              --------------
TOTAL                                                    26

sqlplus / as sysdba ORA-12162: TNS:net service name is incorrectly specified

I was getting this error ...


TNS-12555: TNS:permission denied
TNS-12560: TNS:protocol adapter error
sqlplus / as sysdba ORA-12162: TNS:net service name is incorrectly specified



LSNRCTL> start
Starting /opt/oracle/product/10.2/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.4.0 - Production
System parameter file is /opt/oracle/product/10.2/network/admin/listener.ora
Log messages written to /opt/oracle/product/10.2/network/log/listener.log
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
TNS-12555: TNS:permission denied
TNS-12560: TNS:protocol adapter error
TNS-00525: Insufficient privilege for operation
Linux Error: 1: Operation not permitted

Listener failed to start. See the error message(s) above...


oracle@tst-01:/opt/oracle/product/10.2/bin> ./sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Mon Sep 19 09:37:47 2011

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

ERROR:
ORA-12162: TNS:net service name is incorrectly specified


oracle@tst-01:/var/tmp # ls -ltr
total 9
drwxrwxrwt 2 root root 48 2007-05-03 14:43 vi.recover
drwx------ 4 root root 128 2011-02-24 11:49 zypp.qP07gR
drwxrwxrwt 2 root oinstall 560 2011-05-19 17:38 .oracle <<<<<<<<<<<<<<<<------ permission was not correct
drwx------ 4 root root 128 2011-08-03 15:46 zypp.ORXIAp
-rw-r--r-- 1 root root 1 2011-09-19 08:48 jk.shm.4268.lock
-rw-r--r-- 1 root root 384 2011-09-19 08:53 jk.shm.4268


ls -ltr /var/tmp/.oracle <<<<< check the permission of following dir
total 0
srwxrwxrwx 1 dmadmin oinstall 0 2010-09-09 10:43 s#9043.2
srwxrwxrwx 1 dmadmin oinstall 0 2010-09-09 10:43 s#9043.1
srwxrwxrwx 1 dmadmin oinstall 0 2010-09-16 12:37 s#19542.2
srwxrwxrwx 1 dmadmin oinstall 0 2010-09-16 12:37 s#19542.1
srwxrwxrwx 1 dmadmin oinstall 0 2010-09-23 10:34 s#13477.2
srwxrwxrwx 1 dmadmin oinstall 0 2010-09-23 10:34 s#13477.1
srwxrwxrwx 1 dmadmin oinstall 0 2010-10-11 16:41 s#26392.2
srwxrwxrwx 1 dmadmin oinstall 0 2010-10-11 16:41 s#26392.1
srwxrwxrwx 1 dmadmin oinstall 0 2010-10-14 16:54 s#16462.2
srwxrwxrwx 1 dmadmin oinstall 0 2010-10-14 16:54 s#16462.1
srwxrwxrwx 1 dmadmin dba 0 2011-05-03 12:10 s#21515.2
srwxrwxrwx 1 dmadmin dba 0 2011-05-03 12:10 s#21515.1
srwxrwxrwx 1 dmadmin dba 0 2011-05-05 11:33 s#24844.2
srwxrwxrwx 1 dmadmin dba 0 2011-05-05 11:33 s#24844.1
srwxrwxrwx 1 dmadmin dba 0 2011-05-19 17:38 sEXTPROC1
srwxrwxrwx 1 dmadmin dba 0 2011-05-19 17:38 s#9985.2
srwxrwxrwx 1 dmadmin dba 0 2011-05-19 17:38 s#9985.1



oracle@tst-01:/var/tmp # chown -R oracle:oinstall .oracle




oracle@apt-tst-01:/opt/oracle/product/10.2/bin> ./sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Mon Sep 19 09:44:37 2011

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Connected to an idle instance.

Oracle DBA

anuj blog Archive