• How to configure mail on SQL Server 2012

    Configure Database Mail In Object Explorer, expand the node for the instance you want to configure Database mail. Expand the Management node. Right-click Database Mail, and then click Configure Database Mail. Welcome Page : click on next Select Configuration Task Page click on next write the profile name then click on add fill up the detail as per need… Continue Reading

  • How to create read only users in SQL Server 2012

    Database Version: SQL Server 2012Step 1.Connect to your database server.Expand Security > Logins > New login. Step 2.Put the login name and  select sql server authentication  and provide password.On this window you may/ may not select the option enfornce password policy. Step 3.From User Mapping option select the database you want to give access.Tick the… Continue Reading

  • Invisible index on oracle 11g

    Database version:- oracle 11.2.0 Invisible Indexes, which are basically indexes that exist and are maintained by Oracle but are “invisible” to the Cost based optimizer(CBO). Specific sessions can be set to see theseinvisible indexes as necessary.The invisible index is an alternative of dropping or making an index unusable.  This feature is also functional when certain… Continue Reading

  • How to migrate oracle users from one server to another

    1. First take all the information using dbm_metadata. set head offset pages 0set long 9999999 select dbms_metadata.get_ddl(‘USER’, username) || ‘/’ usercreatefrom dba_users; ALTER USER “SYS” IDENTIFIED BY VALUES ‘S:1CCB2C8B206B3D3BA9164214F3262051E4C0D076179455300F8674EDBC85;E100B964899CDDDF’      TEMPORARY TABLESPACE “TEMP” /  ALTER USER “SYSTEM” IDENTIFIED BY VALUES ‘S:DC73635359324A39D3636017D54F482E7F3D7CC34D0426EA3C9628FFD120;970BAA5B81930A40′      TEMPORARY TABLESPACE “TEMP” / CREATE USER “SOUMYA” IDENTIFIED BY VALUES ‘S:3F6E037E8574BC8FB1F0CF44651E0DE97C8765DC0924224F19F7F43D583B;6673D7515E467AA4′     … Continue Reading

  • How to drop undo tablespace in oracle 11g?

    SQL> select file_name,tablespace_name from dba_data_files; FILE_NAME                                     TABLESPACE_NAME——————————————— ——————–/u01/app/oracle/oradata/prim/users01.dbf      USERS/u01/app/oracle/oradata/prim/undotbs01.dbf    UNDOTBS1/u01/app/oracle/oradata/prim/sysaux01.dbf     SYSAUX/u01/app/oracle/oradata/prim/system01.dbf     SYSTEM/u01/app/oracle/oradata/prim/example01.dbf    EXAMPLE SQL>  drop tablespace UNDOTBS1 including contents; drop tablespace UNDOTBS1 including contents*ERROR at line 1:ORA-30013: undo tablespace ‘UNDOTBS1’… Continue Reading

  • Last Login Time for nonsys user in oracle 12c

    Sqlplus shows Last Login Time for non system users in oracle12c. In oracle 12c a new security feature has been added which allows us to check when did  a non system user logged in. [oracle@server3 ~]$ sqlplus soumya/soumya SQL*Plus: Release 12.1.0.2.0 Production on Mon Feb 15 08:35:28 2016 Copyright (c) 1982, 2014, Oracle.  All rights… Continue Reading

  • How to Reset SA Password in Sql Server 2012

    I had a scenario where i forgot SA password or windows authentication was not working.So i used the below method to reset the SA password to login into SQL Server. Step 1:-Change SQL SA password from a command prompt Go to the command prompt of the server and type in command prompt osql –LC:\Users\Administrator>osql -L… Continue Reading

  • Mysql up & down status check script with email alert

    create the shell-script which will monitor the up/down status of mysql service:- [oracle@server1 ~]$ vi /home/script/alert.sh #!/bin/bashservername=”server1.example.com”publicip=192.168.72.5servicename=”mysql” for i in $servicenamedo/sbin/service $i statusif [ $? -ne 0 ]; then/sbin/service $i status | mailx -s “Check Status of $i in $servername ($publicip) at `date`”  yourmailid@gmail.comfidone :wq (save & exit) We schedule the script on crontab which… Continue Reading

  • Snapshot database in SQL Server

    Database Version : SQL Server 2012 What is a database snapshot ? Database snapshots are an Enterprise only feature which was introduced  in SQL Server 2005.A database snapshot is a view of what the source database looked like at the time when thesnapshot was created. How does a snapshot work:- a. When you create a… Continue Reading

  • What is Standby snapshot Database?

    What is Standby snapshot Database? Oracle provides an unique feature where the physical standby database can be opened in READ WRITE mode to perform update able transactions.A snapshot standby database is a fully updatable standby database that is created by converting a physical standby database into a snapshot standby database. A snapshot standby databasereceives and… Continue Reading