Tuesday, January 21, 2014

How to Change Password Expiry to Unlimited in Oracle 11gR2

##########How to change password Expiry to unlimited in Oracle 11gR2##############
----------------------Check user (SCOTT) password expiry date-----------------------------

select username, account_status, to_char(expiry_date, 'DD-MM-YYYY') EXP_DATE from dba_users where username = 'SCOTT';

---------------------------Check User(SCOTT) Profile----------------------------------------------

select profile from dba_users where username='SCOTT';

------------------------------Check this Profile Expiry Limit------------------------------------

select * from dba_profiles where profile = 'DEFAULT' and resource_name LIKE 'PASSWORD_LIFE_TIME';

-----------------------Change Expiry to Unlimited for this Profile-------------------------------

ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

------------------------------Reset Password for User(SCOTT)-------------------------------------

ALTER USER SCOTT IDENTIFIED BY tiger;
-------------------------------------------------------------------------------------------------------------------

To view the definition of the “DEFAULT” profile, you can execute the following query (with user SYS as SYSDBA):
select * from dba_profiles where profile=’DEFAULT’ and resource_name in (‘PASSWORD_LIFE_TIME’,'PASSWORD_GRACE_TIME’)
This is the output for 10g:
PROFILE,RESOURCE_NAME,RESOURCE_TYPE,LIMIT
DEFAULT,PASSWORD_LIFE_TIME,PASSWORD,UNLIMITED
DEFAULT,PASSWORD_GRACE_TIME,PASSWORD,UNLIMITED
And this is how it looks in 11g:
PROFILE,RESOURCE_NAME,RESOURCE_TYPE,LIMIT
DEFAULT,PASSWORD_LIFE_TIME,PASSWORD,180
DEFAULT,PASSWORD_GRACE_TIME,PASSWORD,7
One way to avoid the expiration of passwords after 180 days would be to change the definition of the DEFAULT profile, but I wouldn’t touch this. I would keep the DEFAULT profile for user accounts that require regular password changes, like developer accounts. For the accounts that need to keep their passwords unexpired, you could create a new user profile. Here is an example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
CREATE PROFILE "UNLIMITED_PWD_EXPIRATION" LIMIT
CPU_PER_SESSION UNLIMITED
CPU_PER_CALL UNLIMITED
CONNECT_TIME UNLIMITED
IDLE_TIME UNLIMITED
SESSIONS_PER_USER UNLIMITED
LOGICAL_READS_PER_SESSION UNLIMITED
LOGICAL_READS_PER_CALL UNLIMITED
PRIVATE_SGA UNLIMITED
COMPOSITE_LIMIT UNLIMITED
PASSWORD_LIFE_TIME UNLIMITED
PASSWORD_GRACE_TIME DEFAULT
PASSWORD_REUSE_MAX UNLIMITED
PASSWORD_REUSE_TIME UNLIMITED
PASSWORD_LOCK_TIME 1
FAILED_LOGIN_ATTEMPTS 10
PASSWORD_VERIFY_FUNCTION VERIFY_FUNCTION_11G
Besides having an unlimited password expiration, this user profile also enables the password verification function “VERIFY_FUNCTION_11G”, which adds some required complexity to the user passwords. This function can be installed by running the utlpwdmg.sql script in $ORACLE_HOME/rdbms/admin:
SQL*Plus: Release 11.2.0.3.0 Production on Wed Apr 18 13:03:05 2012
Copyright (c) 1982, 2011, Oracle. All rights reserved.
SQL> connect / as sysdba
Connected.
SQL> @?/rdbms/admin/utlpwdmg.sql
Function created.
Profile altered.
Function created.
SQL> exit
To use the “UNLIMITED_PWD_EXPIRATION” profile, you can specify it in the CREATE USER… statement for new users, or use ALTER USER… to switch existing users to the new profile (note: this will not check the complexity of the passwords!).
Examples:
CREATE USER new_user IDENTIFIED BY <complex password> PROFILE  ”UNLIMITED_PWD_EXPIRATION”;
ALTER USER existing_user PROFILE  ”UNLIMITED_PWD_EXPIRATION” IDENTIFIED BY <new complex password>;

Sunday, January 19, 2014

How to check Memory size in HP-UX


In HP-UX you can use check physical memory allocated to server from command line as well as from SAM.I am going to describe here how to check memory on HP-UX from command line:
1.) Checking phyiscal memory in HP-UX using dmesg :
You can check memory in HP-UX using dmesg output. In HP-UX dmesg print HP-UX server messages and hardware information available to system during the boot time.Here is the command to check physical memory in HP-UX using dmesg output :
hp-uxdev# dmesg |grep Physical
Physical: 8388608 Kbytes, lockable: 5614168 Kbytes, available: 6461644 Kbytes
In dmesg output memory is listed as 8388608 Kbytes or 8 GB.Note: in grep use P(upper) case in word physical to get memory information or “grep –i physical”
2.) Checking HP-UX memory using print_manifest :
HP-UX provides very useful command called print_manifest,i am going to use print_manifest to check how much memory is available :
hp-uxdev# print_manifest |grep –i memory
Main Memory: 8192 MB
Print_manifest is very handy command I don’t even have to
3.) Checking HP-UX memory using cstm:
Check on your HP-UX server if you have cstm installed by running which cstm .If you have CSTM install on your HP-UX server , you can check Physical memory by running following command :
hp-uxdev# which cstm
hp-uxdev# /usr/sbin/cstm
hp-uxdev# print_manifest |grep -i memory
Basic Memory Description
Module Type: MEMORY
Total Configured Memory : 8192 MB
Page Size: 4096 Bytes
Memory interleaving is supported on this machine and is ON.
Memory Board Inventory
Extender
Slot Num Configured and Slot label for each DIMM (MB)
-------- --------------------------------------------
0a 2a 1a 3a 3b 1b 2b 0b
---- ---- ---- ---- ---- ---- ---- ----
EXT 0 1024 1024 1024 1024 1024 1024 1024 1024
------------------------------------------------------
System Total (MB): 8192
Memory Error Log Summary
The memory error log is empty.
Page Deallocation Table (PDT)
PDT Entries Used: 0
PDT Entries Free: 256
PDT Total Size: 256
-- Information Tool Log for MEMORY on path 192 --
Cstm gives detailed memory information and is useful if you experiencing memory errors


Determining your HP-UX version
To determine which HP-UX version is running on your system, use the following command:
 uname -r
Determining your Java version
To find your Java version, assuming the directory where it is installed is in your PATH variable, run the following at the command prompt:
 java -version
If your Java JDK or JRE is installed in a non-default location, or if you have multiple versions installed on your system, run the following command:
 <java-home>/bin/java -version
Alternately, if you installed your Java JDK or JRE using SD (swinstall), you can run the following command:

 /usr/sbin/swlist | grep -i java



Locating the WWPN for an HP-UX host

Complete this task to locate the WWPN for a Hewlett-Packard Server host.

  1. Go to the root directory of your HP-UX host.
  2. Type ioscan -fnC fc| more for information on the fibre-channel adapters installed on the host.
    The following is example output:
    fc 0 0/2/0/0 td CLAIMED INTERFACE HP Tachyon XL2 Fibre Channel Mass Storage Adapter /dev/td0
    fc 1 0/4/0/0 td CLAIMED INTERFACE HP Tachyon XL2 Fibre Channel Mass Storage Adapter /dev/td1
    fc 2 0/6/2/0 td CLAIMED INTERFACE HP Tachyon XL2 Fibre Channel Mass Storage Adapter /dev/td2 
  3. Look under the description for the Fibre Channel Mass Storage adapter.
    For example, look for the device path name /dev/td1.
  4. Type: fcmsutil /dev/td1 | grep world where /dev/td1 is the path.
    The following is example output:

    # fcmsutil /dev/td1 | grep World
                N_Port Node World Wide Name = 0x50060b000024b139
                N_Port Port World Wide Name = 0x50060b000024b138
    (root@hpmain)/home/root# fcmsutil /dev/td0 | grep World
                N_Port Node World Wide Name = 0x50060b000023a521
                N_Port Port World Wide Name = 0x50060b000023a520
    (root@hpmain)/home/root# fcmsutil /dev/td2 | grep World
                N_Port Node World Wide Name = 0x50060b0000253a8f
                N_Port Port World Wide Name = 0x50060b0000253a8e
    (root@hpmain)/home/root#
Example:
root@dcpib01 [/]# ioscan -fnC fc| more


Class     I  H/W Path  Driver S/W State   H/W Type     Description
================================================================
fc        0  0/2/1/0   fcd   CLAIMED     INTERFACE    HP AB378-60101      4Gb Single Port PCI/PCI-X Fibre Channel Adapter (FC Port 1)
                      /dev/fcd0
root@dcpib01 [/]# cmsutil /dev/fcd0 | grep World
sh: cmsutil:  not found.
root@dcpib01 [/]# fcmsutil /dev/fcd0 | grep World
            N_Port Node World Wide Name = 0x5001438007d18819
            N_Port Port World Wide Name = 0x5001438007d18818
            Switch Port World Wide Name = 0x200400051eed11c3
            Switch Node World Wide Name = 0x100000051eed11c3

Tuesday, January 7, 2014

Oracle Grid Infrastructure for a Standalone Server

From this text we will get brief idea about oracle restart & oracle ASM:

The Oracle Grid Infrastructure for a standalone server is the Oracle software that provides system support for an Oracle database including volume management, file system, and automatic restart capabilities. If you plan to use Oracle Restart or Oracle Automatic Storage Management (Oracle ASM), then you must install Oracle Grid Infrastructure before you install and create the database. Oracle Grid Infrastructure for a standalone server is the software that includes Oracle Restart and Oracle ASM. Oracle combines the two infrastructure products into a single set of binaries that is installed as the Oracle Grid Infrastructure home.
Oracle ASM is a volume manager and a file system for Oracle database files that supports single-instance Oracle Database and Oracle Real Application Clusters (Oracle RAC) configurations. Oracle ASM also supports a general purpose file system for your application needs including Oracle Database binaries. Oracle ASM is Oracle's recommended storage management solution that provides an alternative to conventional volume managers, file systems, and raw devices.

Oracle Restart improves the availability of your Oracle database by providing the following:
  • When there is a hardware or a software failure, Oracle Restart automatically starts all Oracle components, including the Oracle database instance, Oracle Net Listener, database services, and Oracle ASM.
  • Oracle Restart starts components in the proper order when the database host is restarted.
  • Oracle Restart runs periodic checks to monitor the status of Oracle components. If a check operation fails for a component, then the component is shut down and restarted.
Note:
  • If you want to use Oracle ASM or Oracle Restart, then you must install Oracle Grid Infrastructure for a standalone server before you install and create the database. Otherwise, you must manually register the database with Oracle Restart.
  • Oracle Restart is used in single-instance (nonclustered) environments only.