curl -s http://checkip.dyndns.org/ | cut -d ' ' -f 6 | sed s/"body\|html\|<\|>\|\/"//g
or just visit http://www.whatismyip.com/
3 November 2011
11 October 2011
LINUX - su: incorrect password
20 June 2011
ORACLE - Disable password expiry
Unlike older releases, Oracle11g sets password expiry by DEFAULT. Get rid of these with:
SQL> alter profile default limit
failed_login_attempts unlimited
password_life_time unlimited;
SQL> alter profile default limit
failed_login_attempts unlimited
password_life_time unlimited;
6 June 2011
PostgreSQL - Calculating DB size
SQL> select pg_size_pretty(pg_database_size(current_database())) as dbsize
18 May 2011
ORACLE - Instance started using a PFILE or an SPFILE ?
Use the following query on a started instance (nomount, mount or open):
SQL> select count(*) from v$spparameter where value is not null;
If the result of this query is zero, the instance was started using a PFILE. If the result is a non-zero value, the instance was started using an SPFILE.
Explanation:When an instance has been started using a server side parameter file (SPFILE), which is a new feature in Oracle Server 9.0.1, the v$spparameter contains NOT NULL values for several parameters. When an instance has been started using the 'classic' PFILE, this view only contains NULL values.
To check which spfile you are using run below command. If you are using spfile you will get a value otherwise you will not see any value.
SQL> show parameter spfile
SQL> select count(*) from v$spparameter where value is not null;
If the result of this query is zero, the instance was started using a PFILE. If the result is a non-zero value, the instance was started using an SPFILE.
Explanation:When an instance has been started using a server side parameter file (SPFILE), which is a new feature in Oracle Server 9.0.1, the v$spparameter contains NOT NULL values for several parameters. When an instance has been started using the 'classic' PFILE, this view only contains NULL values.
To check which spfile you are using run below command. If you are using spfile you will get a value otherwise you will not see any value.
SQL> show parameter spfile
26 April 2011
ORACLE - To check list of inactive users or inactive sessions
In many cases you need to check the list of inactive users or inactive sessions in your database.
The script below produces the list of inactive users and inactive sessions. Run the script using sysdba
set heading on feedback on pages 100 lines 140
column userinfo heading "ORACLE/OS User" format a19
column machine heading "Client Machine" format a20
column terminal heading "Terminal" format a10
column process heading "Parent|Process ID" format a10
column spid heading "Shadow|Process ID" format a10
column seq# heading "Wait|Sequence" format 99999990
select s.username||' '||s.osuser userinfo,s.machine, s.terminal, s.sid, s.serial#,
p.spid,
s.process , w.seq#
from v$session s, v$process p
,v$session_wait w
where p.addr = s.paddr
and s.sid = w.sid
and w.event = 'SQL*Net message from client'
and s.status = 'INACTIVE'
order by s.osuser, s.machine
/
The script below produces the list of inactive users and inactive sessions. Run the script using sysdba
set heading on feedback on pages 100 lines 140
column userinfo heading "ORACLE/OS User" format a19
column machine heading "Client Machine" format a20
column terminal heading "Terminal" format a10
column process heading "Parent|Process ID" format a10
column spid heading "Shadow|Process ID" format a10
column seq# heading "Wait|Sequence" format 99999990
select s.username||' '||s.osuser userinfo,s.machine, s.terminal, s.sid, s.serial#,
p.spid,
s.process , w.seq#
from v$session s, v$process p
,v$session_wait w
where p.addr = s.paddr
and s.sid = w.sid
and w.event = 'SQL*Net message from client'
and s.status = 'INACTIVE'
order by s.osuser, s.machine
/
Subscribe to:
Posts (Atom)
Wordpress - Local installation in Vmware
If you're interested in exploring website design with WordPress, this guide will help you set up a WordPress instance on your local mach...
-
To print single column from a text file #awk -F: '{print $1}' /etc/passwd To print multiple columns from a text file # awk -F: '...
-
[Tested On] CentOS Linux release 7.4.1708 (Core) # wget https://ftp.postgresql.org/pub/source/v9.6.6/postgresql-9.6.6.tar.gz # tar xvzf post...
-
Your new IT project requires you to setup postgresql database and most of the time we get to the postgresql website and download the version...