Monday, July 20, 2015

ORA-28002: the password will expire within 7 days

I have a user getting an ORA-28002 indicating that the password will expire within 7 days.







SQL:  select * from dba_users where username = 'PRABHA'

USERNAME                          USER_ID PASSWORD                       ACCOUNT_STATUS                   LOCK_DATE EXPIRY_DATE DEFAULT_TABLESPACE             TEMPORARY_TABLESPACE           CREATED   PROFILE                        INITIAL_RSRC_CONSUMER_GROUP    EXTERNAL_NAME                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    PASSWORD_VERSIONS EDITIONS_ENABLED AUTHENTICATION_TYPE
------------------------------ ---------- ------------------------------ -------------------------------- --------- ----------- ------------------------------ ------------------------------ --------- ------------------------------ ------------------------------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------------- ---------------- -------------------
PRABHA                                107                                EXPIRED(GRACE)                             13-APR-15   CATALOGTBS                     TEMP                           20-AUG-14 DEFAULT                        DEFAULT_CONSUMER_GROUP                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          10G 11G           N                PASSWORD           

how to Install Sails js On Windows with mysql



1)  First install  node.js.

2)  Go to command prompt and type
     npm -g install sails


     








3) It will install in this path
  C:\Users\User\AppData\Roaming\npm\node_modules\sails

4)      Creating new Sails Project

    sails new honnikeryProject

C:\>sails new honnikeryproject
info: Created a new Sails app `honnikeryproject`!

5)   Now lift the server:
C:\>cd honnikeryproject
C:\honnikeryproject>sails lift

C:\honnikeryproject>sails lift

info: Starting app...

info:
info:                .-..-.
info:
info:    Sails              <|    .-..-.
info:    v0.11.0             |\
info:                       /|.\
info:                      / || \
info:                    ,'  |'  \
info:                 .-'.-==|/_--'
info:                 `--'-------'
info:    __---___--___---___--___---___--___
info:  ____---___--___---___--___---___--___-__
info:
info: Server lifted in `C:\honnikeryproject`
info: To see your app, visit http://localhost:1337
info: To shut down Sails, press <CTRL> + C at any time.

debug: --------------------------------------------------------
debug: :: Mon Jul 20 2015 15:02:20 GMT+0530 (India Standard Time)

debug: Environment : development
debug: Port        : 1337
debug: --------------------------------------------------------


 http://localhost:1337
 you will see the default home page







Monday, July 13, 2015

MySQL DB import/export command line

 1) mysqldump -u [honnikery] –p[password]  [honnikery] > (dump_honnikery.sql)


Backup MySQL Database Structure Only

2) mysqldump -u [honnikery] –p[password] –no-data [honnikery] > (dump_honnikery.sql)


Backup MySQL Database Data Only

3) mysqldump -u [honnikery] –p[password] –no-create- [honnikery] > [dump_honnikery.sql]


Backup Multiple MySQL Databases into a Single File


4) mysqldump -u [honnikery] –p[password] –all-database > [dump_honnikery.sql]

MySQL Database  to import

mysql -u username -p databasename < filename.sql 

 mysql --u [username] --password=[password] [database name] < [dump file]

Friday, July 10, 2015

How to Backup Databases in MYSQL



1) mysqldump -u [honnikery] –p[password]  [honnikery] > (dump_honnikery.sql)


Backup MySQL Database Structure Only

2) mysqldump -u [honnikery] –p[password] –no-data [honnikery] > (dump_honnikery.sql)


Backup MySQL Database Data Only

3) mysqldump -u [honnikery] –p[password] –no-create- [honnikery] > [dump_honnikery.sql]


Backup Multiple MySQL Databases into a Single File


4) mysqldump -u [honnikery] –p[password] –all-database > [dump_honnikery.sql]


Monday, March 23, 2015

Displays the SQL statements for currently running processes

SELECT s.sid,
       s.status "Status",
       p.spid "Process",
       s.schemaname " Name",
       s.osuser "OS User",
       Substr(a.sql_text,1,100) "SQL Text file",
       s.program "Program"
FROM   v$session s,
       v$sqlarea a,
       v$process p
WHERE  s.sql_hash_value = a.hash_value (+)
AND    s.sql_address    = a.address (+)
AND    s.paddr          = p.addr;


       SID Status   Process                  Schema Name                    OS User                        SQL Text                                                                                                                 Program                                                       
---------- -------- ------------------------ ------------------------------ ------------------------------ ------------------------------------------------------------------------------------------------------------------------ ----------------------------------------------------------------
       125 ACTIVE   3132                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (PMON)                                               
       187 ACTIVE   3136                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (VKTM)                                               
         1 ACTIVE   3140                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (GEN0)                                               
        64 ACTIVE   3144                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (DIAG)                                               
       126 ACTIVE   3148                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (DBRM)                                               
       188 ACTIVE   3152                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (PSP0)                                               
         2 ACTIVE   3156                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (DIA0)                                               
        65 ACTIVE   3160                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (MMAN)                                               
       127 ACTIVE   3168                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (DBW0)                                               
       189 ACTIVE   3172                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (LGWR)                                               
         3 ACTIVE   3176                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (CKPT)                                               
        66 ACTIVE   3180                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (SMON)                                               
       128 ACTIVE   3184                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (RECO)                                               
       192 ACTIVE   3188                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (MMON)                                               
         4 ACTIVE   3192                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (MMNL)                                               
       191 ACTIVE   3856                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (Q000)                                               
        14 ACTIVE   3512                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (SMCO)                                               
        72 ACTIVE   3104                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (W000)                                               
       135 ACTIVE   7768                     SYSTEM                         Prabhakar                      SELECT s.sid,        s.status "Status",        p.spid "Process",        s.schemaname "Schema Name",        s.osuser "OS  SQL Developer                                                   
       194 ACTIVE   3264                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (ARC0)                                               
         5 ACTIVE   3284                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (ARC1)                                               
        63 ACTIVE   3288                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (ARC2)                                               
       129 ACTIVE   3292                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (ARC3)                                               
       195 ACTIVE   3328                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (QMNC)                                               
         8 ACTIVE   3852                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (CJQ0)                                               
        74 ACTIVE   3884                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (J000)                                               
       133 ACTIVE   6252                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (J001)                                               
       197 ACTIVE   3860                     SYS                            SYSTEM                                                                                                                                                  ORACLE.EXE (Q001)                                               

 28 rows selected

Thursday, February 26, 2015

how to Processing SQL in Oracle

The following steps show how Oracle processes SQL
1. Statement is passed to Oracle for processing
2. Before it is placed in the library cache, a hash value is computed that
represent s a number of characteristics of the SQL.
3. Oracle compares the computed hash value against those values in a hash
table where it maintains for SQL statements already in the cache.
4. If a match is found, the new SQL statement is thrown away and the one
sitting in the cache is executed on its behalf.
5. In no match is found, further processing is done on the new SQL
statement, an entry is made in the library cache hash table for newly
arrived code, and it is placed in the library cache.
6. There are 3 stages of SQL processing – parse, execute and fetch
· During parsing, Oracle server checks the syntax and validates
table, column names against data dictionary
· Determines whether user has privilege to execute the statement
· Determines optimal execution plans for statement
· Finds a shared SQL area for the statement
· In execution stage, for UPDATE and DELETE statement, Oracle
locks the affected rows, looks for data blocks in DB buffer cache,
if found, executes becomes faster, if not then Oracle has to read
from physical data files to buffer cache. For SELECT and INSERT
statements, locking is not necessary.
· During fetch operation, rows are fetched to user process.

Background processes in oracle

Database Writer (DBWn)
:It is responsible to redo log buffer management. Almost all activities against the database are tracked in the online redo logs. As transaction are initiated and
eventually committed or rolled back, a record of this activity is written to these
log files.

Checkpoint (CKPT):
A checkpoint is an event that flushes modified data from buffer cache to disk and updates control file and data files. The CKPT process updates header of data files and control files and
DBWn writes actual blocks to file. Checkpoint occurs automatically when an
online redo log file fills (log switch).

System Monitor (SMON):
At startup, SMON’s job is to ensure that all the database files are consistent and
perform recovery if required. There is also an assortment of other cleanup
activities that may need to be done, which are SMON’s responsibility. The
SMON process by itself checks every so often to see whether there are any tasks
waiting for its attention.

Process Monitor (PMON):
Cleans up failed user processes and frees all resources used by failed process.

Archiver (ARCn):
It automatically saves copies of redo logs in a DBA specified storage location
when media recovery is enabled.

Recover (RECO):
Is used with distributed transaction to resolve failure.