Friday 16 November 2012

Disabling DEFAULT nagging by ORA-28002

After firing up an old database VM I noticed a change password screen appeared in OEM database control and also an ORA-28002 when logging in as system via sqlplus.
[oracle@database ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.3.0 Production on Thu Nov 15 19:26:24 2012

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

SQL> conn system@database01
Enter password: 
ERROR:
ORA-28002: the password will expire within 7 days


Connected.
SQL>
Checking the relevant users and profiles values shows;
SQL> select username, profile from dba_users where username in ('SYS','SYSTEM','SYSMAN','DBSNMP');

USERNAME                       PROFILE
------------------------------ ------------------------------
SYS                            DEFAULT
DBSNMP                         MONITORING_PROFILE
SYSMAN                         DEFAULT
SYSTEM                         DEFAULT

SQL> select resource_name,liMit from dba_profiles where profile='DEFAULT';

RESOURCE_NAME                    LIMIT
-------------------------------- ----------------------------------------
COMPOSITE_LIMIT                  UNLIMITED
SESSIONS_PER_USER                UNLIMITED
CPU_PER_SESSION                  UNLIMITED
CPU_PER_CALL                     UNLIMITED
LOGICAL_READS_PER_SESSION        UNLIMITED
LOGICAL_READS_PER_CALL           UNLIMITED
IDLE_TIME                        UNLIMITED
CONNECT_TIME                     UNLIMITED
PRIVATE_SGA                      UNLIMITED
FAILED_LOGIN_ATTEMPTS            10
PASSWORD_LIFE_TIME               180

RESOURCE_NAME                    LIMIT
-------------------------------- ----------------------------------------
PASSWORD_REUSE_TIME              UNLIMITED
PASSWORD_REUSE_MAX               UNLIMITED
PASSWORD_VERIFY_FUNCTION         NULL
PASSWORD_LOCK_TIME               1
PASSWORD_GRACE_TIME              7

16 rows selected.

SQL> 

I change PASSWORD_LIFE_TIME for the DEFAULT profile since this is only a reference database for testing, and reset the password to stop being nagged. Note that there was no expiry date for SYS (most likely because OS Authentication is also enabled by default - too lazy to proove this today though...).
SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED; Profile altered. SQL> alter user system identified by xxxxxx; User altered. SQL> select username, profile, expiry_date from dba_users where username in ('SYS','SYSTEM','SYSMAN','DBSNMP'); USERNAME PROFILE EXPIRY_DA ------------------------------ ------------------------------ --------- SYS DEFAULT SYSTEM DEFAULT DBSNMP MONITORING_PROFILE 22-NOV-12 SYSMAN DEFAULT 22-NOV-12 SQL> alter user sysman identified by xxxxxx; User altered. SQL> alter user dbsnmp identified by xxxxxx; User altered. SQL> select username, profile, expiry_date from dba_users where username in ('SYS','SYSTEM','SYSMAN','DBSNMP'); USERNAME PROFILE EXPIRY_DA ------------------------------ ------------------------------ --------- DBSNMP MONITORING_PROFILE SYSMAN DEFAULT SYS DEFAULT SYSTEM DEFAULT SQL>
Interestingly if we check the profile for DBSNMP, we see that PASSWORD_LIFE_TIME refers to the DEFAULT profile anyway.
SQL> select resource_name,liMit from dba_profiles where profile='MONITORING_PROFILE';

RESOURCE_NAME                    LIMIT
-------------------------------- ----------------------------------------
COMPOSITE_LIMIT                  DEFAULT
SESSIONS_PER_USER                DEFAULT
CPU_PER_SESSION                  DEFAULT
CPU_PER_CALL                     DEFAULT
LOGICAL_READS_PER_SESSION        DEFAULT
LOGICAL_READS_PER_CALL           DEFAULT
IDLE_TIME                        DEFAULT
CONNECT_TIME                     DEFAULT
PRIVATE_SGA                      DEFAULT
FAILED_LOGIN_ATTEMPTS            UNLIMITED
PASSWORD_LIFE_TIME               DEFAULT

RESOURCE_NAME                    LIMIT
-------------------------------- ----------------------------------------
PASSWORD_REUSE_TIME              DEFAULT
PASSWORD_REUSE_MAX               DEFAULT
PASSWORD_VERIFY_FUNCTION         DEFAULT
PASSWORD_LOCK_TIME               DEFAULT
PASSWORD_GRACE_TIME              DEFAULT

16 rows selected.

SQL>
Here is an amusing thread just in case DEFAULT wasn't obvious enough. As usual it's all in the Doc if you look hard enough. Under create profile in this case.

Tuesday 13 November 2012

Expired OVS account

Recently an unmonitored OVMM machine (OVM 3.03 Manager machine - another VM in this case) ran out of disk on the root volume. Symptoms being exhibited were frozen VMs, and VMs not being able to start with the unhelpful message "Failed to begin a transaction". Otherwise monitored systems were behaving well. Once the source of the incidents was determined, and adequate free diskspace reclaimed, further resolution involved the following steps to unexpire the OVS account and resume the OVM manager to service.
SQL> conn / as sysdba
Connected.
SQL> 
SQL> select username , account_status from dba_users;

USERNAME                       ACCOUNT_STATUS
------------------------------ --------------------------------
ANONYMOUS                      OPEN
SYSTEM                         OPEN
SYS                            OPEN
OVS                            EXPIRED
APEX_040000                    LOCKED
APEX_PUBLIC_USER               LOCKED
HR                             EXPIRED & LOCKED
XDB                            EXPIRED & LOCKED
CTXSYS                         EXPIRED & LOCKED
MDSYS                          EXPIRED & LOCKED
FLOWS_FILES                    EXPIRED & LOCKED

USERNAME                       ACCOUNT_STATUS
------------------------------ --------------------------------
XS$NULL                        EXPIRED & LOCKED
OUTLN                          EXPIRED & LOCKED

13 rows selected.

SQL> select password from sys.user$ where name='OVS';

PASSWORD
------------------------------
855EB008C84C5841

SQL> alter user ovs identified by values '855EB008C84C5841';

User altered.

SQL> select username , account_status from dba_users;

USERNAME                       ACCOUNT_STATUS
------------------------------ --------------------------------
OVS                            OPEN
ANONYMOUS                      OPEN
SYSTEM                         OPEN
SYS                            OPEN
APEX_040000                    LOCKED
APEX_PUBLIC_USER               LOCKED
HR                             EXPIRED & LOCKED
XDB                            EXPIRED & LOCKED
CTXSYS                         EXPIRED & LOCKED
MDSYS                          EXPIRED & LOCKED
FLOWS_FILES                    EXPIRED & LOCKED

USERNAME                       ACCOUNT_STATUS
------------------------------ --------------------------------
XS$NULL                        EXPIRED & LOCKED
OUTLN                          EXPIRED & LOCKED

13 rows selected.

SQL> 
[root@OVMM3 ~]# service ovmm status
Oracle VM Manager is running...
[root@OVMM3 ~]# service ovmm stop
Stopping Oracle VM Manager                                 [  OK  ]
[root@OVMM3 ~]# service ovmm start
Starting Oracle VM Managernohup: ignoring input and redirecting stderr to stdout
                                                           [  OK  ]
[root@OVMM3 ~]#

Thursday 21 June 2012

EM status pending or agent unreachable

After a recent Oracle Database service_name change, an installation of Oracle Enterprise Manager Database Control stopped being operable. As a quick fix I dropped and then recreated the repository to get the Database Control installation working.
All seemed well until I noticed a perpetual "Status Pending" message with the "Clock" symbol on the EM Home page. I returned to the problem a while later at which point the status had changed to "Agent Unreachable" with the "Disconnect" symbol. Upon further investigation I noticed that there were two agents installed. I suspected that EM DC was looking at the wrong one. After much diagnosis and many red herrings I finally discovered on EM, a link to a page to resolve the issue.
The "Clock" symbol

From the any page, select "Setup" on the top right, then the "Management Services and Repository" tab. At the bottom of the page is an "Alerts" panel. In this case an alert with the Metric Name "Target Count" had appeared. Clicking on the Target Count metric displays a "Duplicate Targets" page showing "Monitoring Agents" and "Conflicting Agents". On this page is a button to "Change the monitoring Agent". By selecting each "Internal Target Name" and pressing the button it was possible to one by one switch the monitoring agent of each target.
Whilst there are numerous other reasons why "Status Pending" or "Agent Unreachable" status messages may appear on the EM DC or GC Home page, none of the various information sources I reviewed was relevant to the problem at hand. The online documentation was scant on such troubleshooting and most MOS documents referred to RDA and EMDIAG as the omniscient sources of truth (very handy utilities I'm sure but no help for quick fixes unless you're familiar with them).
Suffice to say I'm glad there was a simple solution. Hope this helps others.
NB. Oracle EM Version 10.2.0.4.4 (packaged with Oracle Database Version 11.2.0.3.0)
See also; Master Note for Enterprise Manager Configuration Assistant (EMCA) in Single Instance Database Environment [ID 1099271.1]

Tuesday 12 June 2012

include the parentheses

When changing the initialisation parm DB_DOMAIN remember to include the parentheses or you will get an unhelpful message.

SQL> alter system set db_domain=rosspdc.com.au scope=spfile;
alter system set db_domain=dbathrift.com scope=spfile
                 *
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified


SQL> alter system set db_domain='dbathrift.com' scope=spfile;

System altered.

SQL> 

Thursday 7 June 2012

Oracle Solaris and Oracle Database


Oracle Solaris 11 now supports Oracle Database as of 11.2.0.3

Ivan Kartik posted and install article for the Express version here.

Wednesday 6 June 2012

Ora Doc for processes and related initialisation parameters


The Ora Doc for processes, sessions, and transactions details formulas used by Oracle to derive related parameter values. There is also at least one other parameter value derived from these hierarchical-related parameters, being dml_locks.

My findings are that essentially the formulas hold true for 11.1 but have changed in 11.2, but these changes are not reflected in the current Ora Doc.

I contributed to Charles Hooper's blog post on the topic where he explains the behaviour as a Doc Bug.

Tuesday 5 June 2012

The minutia of parameters between editions


Today I was comparing Oracle Database parameters of a recently upgraded database to the original parameters (this upgrade used export import based upgrade, from 11.1.0.6.0 to 11.2.0.3.0)
In this circumstance we have performed a crossgrade in addition to an upgrade, moving from Enterprise Edition to Standard Edition (yes people do it for a variety of reasons, most related to cost).

Well to cut a long story short, I discovered that audit_syslog_level is an EE parameter that does not appear in an SE database.

----
[oracle@thingy ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mon Jun 4 19:40:17 2012

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


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

SQL> show parameter syslog

NAME                                 TYPE        VALUE
------------------------------------ ----------- -----------------
audit_syslog_level                   string
SQL> 
----
[oracle@thingy2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue Jun 5 09:47:51 2012

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


Connected to:
Oracle Database 11g Release 11.2.0.3.0 - 64bit Production

SQL> show parameter syslog
SQL>
----

Friday 1 June 2012

sqlplus without tnsnames


I sometimes find it useful to connect without tnsnames. Occasionally this can be a must when using an instant client.

For example;
sqlplus developer@'(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(COMMUNITY=TCP.world)(PROTOCOL=TCP)(Host=DEVDB)(Port=1521)))(CONNECT_DATA=(SID=DEV)))'

NB. Note the use of the single apostrophe's.

Thursday 31 May 2012

Thrift

Thrift is the careful management of resources, and is in essence what being a DBA is all about.

thrift noun 1 careful spending, use or management of resources, especially money. 2 a wild plant with narrow bluish-green leaves and dense round heads of pink flowers, usually found near the coast. Also called sea pinkthriftless adj not thrifty. 
ETYMOLOGY: 16c in these senses: Norse, meaning 'prosperity'.
Source Chambers.

As a kid I used to pore over encyclopedias, dictionaries, and such. These days we have Google and Wikipedia and the like. I often still peruse a myriad of information sources related to Oracle Database technology as part of my role as a DBA. This blog will be a place to post some gems from of my research as well as an eclectic collection of whatever else I find interesting in this world.

Interestingly in preparing this post I came across the handy Google Search define: operator when reading Google Dictionary.

Credit to the other thrift below.