Wednesday, April 22, 2015

List of Splunk universal forwarders with client OS & version

index=_internal source=*metrics.log group=tcpin_connections | eval sourceHost=if(isnull(hostname), sourceHost,hostname) | dedup sourceHost | table sourceHost sourceIP os version | sort version

Friday, March 27, 2015

Linux Commands

List all Linux users

cut -d: -f1 /etc/passwd

set password never to expire

chage -I -1 -m 0 -M 99999 -E -1 username

Thursday, September 25, 2014

Linux Check last password change, expire date & other info

$chage -l root

Output

Last password change                                    : Sep 25, 2014
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 99999

Number of days of warning before password expires       : 7

 Other options

  -d, --lastday LAST_DAY        set last password change to LAST_DAY
  -E, --expiredate EXPIRE_DATE  set account expiration date to EXPIRE_DATE
  -h, --help                    display this help message and exit
  -I, --inactive INACTIVE       set password inactive after expiration
                                to INACTIVE
  -l, --list                    show account aging information
  -m, --mindays MIN_DAYS        set minimum number of days before password
                                change to MIN_DAYS
  -M, --maxdays MAX_DAYS        set maximim number of days before password
                                change to MAX_DAYS
  -W, --warndays WARN_DAYS      set expiration warning days to WARN_DAYS


Monday, July 14, 2014

Remote connection to Oracle database using SQL*Plus

sqlplus "uname/pwd@ (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = host.network.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl.network.com) ) )"

Friday, July 11, 2014

Script to recreate all tablespaces

select 'create tablespace ' || df.tablespace_name || chr(10)
 || ' datafile ''' || df.file_name || ''' size ' || df.bytes
 || decode(autoextensible,'N',null, chr(10) || ' autoextend on maxsize '
 || maxbytes)
 || chr(10)
 || 'default storage ( initial ' || initial_extent
 || decode (next_extent, null, null, ' next ' || next_extent )
 || ' minextents ' || min_extents
 || ' maxextents ' ||  decode(max_extents,'2147483645','unlimited',max_extents)
 || ') ;'
 from dba_data_files df, dba_tablespaces t
 where df.tablespace_name=t.tablespace_name

Thursday, June 26, 2014

Oracle 12c SQL Error: ORA-65096: invalid common user or role name

Oracle 12c allows either a common user or local user to be created. Common user is created in container database. Common user name starts with c## and local user is created in plugged database

To find container database name

SQL> sho con_name

CON_NAME
------------------------------
CDB$ROOT

To find plugged databases

SQL> select name,open_mode from v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDBORCL                        MOUNTED

To create a common user in CDB$ROOT

SQL> create user c##dummyuser identified by dummypwd;

To create a local user in PDB first set a dummy container

SQL> alter session set container=TEST;

Session altered.

SQL> create user test identified by test;

You cannot create a common user while in test session so if you try following you will get error

SQL> create user c##dummyuser identified by test;
create user c##dummyuser identified by test
            *
ERROR at line 1:
ORA-65094: invalid local user or role name

Note:-
The reason for the error is that Local user name cannot be started with C##.

Tuesday, June 24, 2014

Oracle 11g Installation error WFMLRSVCApp.ear not found

While installing Oracle 11g I got following error "WFMLRSVCApp.ear not found"


Solution

  1. Download both files from OTN
    win64_11gR2_database_1of2.zip
    win64_11gR2_database_2of2.zip
  2. Extract them to a single directory. In my case c:\Setup\disk1 & Disk2
  3. Copy contents of C:\Setup\Disk2\database\stage\Components to C:\Setup\Disk1\database\stage\Components
  4. Run setup.exe under C:\Setup\Disk1\database as administrator.