Saturday, July 14, 2012

How do switch to another user or reset that user password temporary in Oracle

As DBA, there are situations you need to upgrade an Oracle application or schema by log-in as that user but you might don't know the password. The best way to get around this is to change that user password temporary and change it back to that password again after you finish your task.
The problem is always that encrypted password  cannot be de-crypted so that password can be reset to its original one easy.We have to use VALUES keyboard which is same as what import or data pump does when it creates users.
For instance, if you as DBA you don't know SCOTT password, first you can save the password and do your task and then change it back to what it was.
You can follow the steps below to accomplish this:


Sqlplus system/password
In 10g and before:
SQL>select password from dba_users where username = 'SCOTT';
PASSWORD
------------------------------
F894844C34402B67
For 11g and above:
SQL>select password from sys.user$ where name='SCOTT';

PASSWORD
------------------------------
F894844C34402B67
SQL>alter user scott identified by temporary;

Now you can connect to scott with new password and do the job you need and then change the password back to what it was after you done as below:
SQL>alter user SCOTT identified by VALUES 'F894844C34402B67';





Friday, July 6, 2012

How to change dynamic port of SQL Server instance to static ?

One of the requirements for named instance of SQL Server compare to default instance is using static port.
In default instance of SQL Server there is a listener, listing to port 1433. When we create named instance the port is randomly dynamic as default behaviour of instance when it's not configured.In default instance, connection goes to TCP port 1433 and in named instance, connection goes through service browser and it goes to UDP port 1434 and then SQL browser responds by port number.The default instance of SQL Server regularly just support static port but named instance can support dynamic and also static. For named instance you might need to change dynamic port to static. For example, in SharePoint secure farm environment, the recommendation is to block UDP port and use named instance with a port different from 1433.
In order to change SQL Server port you can go to the SQL Server Configuration Manager:
Start=>Program Files=> Microsoft sql server =>Configuration Tools=> SQL server configuration manager
In Configuration Manager,on the left panel side, expand Sql Server Network configuration.Click on protocol for instance name then in right hand panel, right click and go to properties on the TCP/IP.
As you see below, click on IP Address tab then scroll down in IPALL section blank  for TCP Dynamic Port row and your desired port in TCP Port row.
After this change you have to restart SQL Server service to make this change happens.




Note1:Remember if you doing this change in SharePoint instance you have to create alias for each application server.
SQL Server client aliases are necessary on all computers that communicate with the computer running SQL Server
Note 2:For changing port in clustered named instance do following:
Bring the SQL Server service offline from cluster administrator.
Disable the checkpointing to the quorum.
Change the Dynamic port of the sql server to static in all the nodes .
Enable the checkpointing to the quorum.
Bring SQL Server online.

Tuesday, July 3, 2012

How to find which port SQL Server instance currently listening?


There are different ways to find the current port that SQL Server instance using (compare to default port:1433) and I listed some of them in below:
1)Go to SQl Server error log and find thr entry for instance:
SQL server listening on 127.0.0.1: 1433.
2)Open the Sql Server Network Utility(in 2000) or SQL configuration manager(2005 and higher) and click on properties for TCP/IP in instance
3)Issue netstat -an from an MS-DOS command window produces the following results showing three established connections for SQL Server
This example uses 157.54.178.40 as the IP address of SQL Server and 157.54.178.30 as the client IP address. The ports opened by the client are 1749, 1750, and 1751 respectively.

Proto   Local Address          Foreign Address                State
 TCP    157.54.178.40:1433     0.0.0.0:0                       LISTENING
 TCP    157.54.178.40:1433     157.54.178.30:1749     ESTABLISHED
 TCP    157.54.178.40:1433     157.54.178.30:1750     ESTABLISHED
 TCP    157.54.178.40:1433     157.54.178.30:1751     ESTABLISHED
4) Check Registry entry: HKLM\Software\Microsoft\MSSQLServer\MSSQLServer\SuperSocketNetLib\TCP

and you will see TCP Port as one of the entries and it’s value represents the port number for that instance.
In case you are using a named instance, then the registry entry will be
: HKLM\Software\Microsoft\Microsoft SQL Server\
<name of the instance>\MSSQLServer\SuperSocketNetLib\TCP

Sunday, July 1, 2012

About me

Senior Consultant with a wide range of experience in architecture,database, data warehouse ,application integration,Ecommers and ERP. particularly interested in area of migration to Cloud, Cloud Automation, SAP Architect,Business Intelligence,data architect and application deployment & solution.
Expert in migration specifically migration to cloud , as well as close interaction with DBMS and ERP manufacturer,telecommunication , and Oil & Gas.
-I have been working as IT consultant, Architect , and Advisor for different companies.In my current role, part of my job for our clients is providing solution for business ,implement the latest IT technology , resolve performance & tuning issue ,and support migration to cloud .
-Expert in setting up data warehouse and ETL solutions.
-Extensive experience on cloud technology like SAP Cloud, Amazon AWS,Microsoft Azure, and Google Cloud .
Specialties: Recent deploy, implement,support, and upgrade : SAP Hybris, SAP BPC, Remedy, Primavera, Meridium, Altiris , SAP ERP, Prism Vanguard, Visions ,Smart Plant, Intools,Traccess,Surfcontrol ,PAS,Citrix,BizTalk,Livelink,SharePoint,Maximo,RightAngle,SMO,JDE,Oracle RAC,Oracle Data Guard ,Golden Gate ,Informatica,SAP HANA, Puppet, Dell Boomi, Docker and kubernetes,Vm vSphire,Dynatrace,Opsview HANA,Azure and AWS.

I have my own company "Fast IT Consulting LTD." and provide solution for different projects in North America.
Thanks for visiting this blog!
Amin