Author: Rizwan Ansari
This is a step by step guide to create Physical Standby database in Oracle using Oracle Data Guard. Force Logging on Primary Instance Set Force Logging on Primary database instance. alter database force logging; Verify by running below query. SELECT force_logging FROM v$database; Add standby redo log files ALTER DATABASE ADD STANDBY LOGFILE 'C:\ORACLE\ORADATA\ORCL\SREDO01.log' SIZE […]
It is more likely that there are many WiFi networks in neighborhood and sometimes you’ve had problems with wireless connections dropping out or it is not fast enough. One way to fix this is to select optimum channel for your wireless network in wireless router setting. Figure out Right WiFi Channel You can use my […]
You have a router running in your network which is connected to internet. You want to connect second router/switch in your network thru Ethernet cable. And you want to access devices connected to both routers from any router then follow below steps. Setup steps Unplug the second router/switch from network. Connect computer to the router/switch […]
There are many ways you can Export and then Import MySQL on other server like phpMyAdmin and MySQL WorkBench. But most efficient way (though not much user friendly) is command line option. This is helpful when you don’t have other option to transfer database but you have SSH access to the server and you want […]
Sometimes you need APK file from the Android device. Easiest way is to use ADB. You need to connect android device to computer and have the required drivers of Android device installed along with Android SDK tools. Run below command to display all the packages installed on your device. adb shell pm list packages Find […]
There are situation when you need to provide download option for a big file located somewhere on server or generated at runtime. Below function could be used to download files of any size. Sometimes downloading big file throws exception OutOfMemoryException showing “Insufficient memory to continue execution of the program”. So this function also handle this […]
VI is a wonderful, full feature text editor. However, some might lack experience with VI and prefer a simpler text editor for quick configuration and other edits. Install nano yum -y install nano System Default Editor cat <<EOF >>/etc/profile.d/nano.sh export VISUAL="nano" export EDITOR="nano" EOF User Default Editor cat <<EOF >>~/.bash_profile export VISUAL="nano" export EDITOR="nano" EOF
Option 1 Detach Original Database, copy its MDF and LDF files and create a new Database from copied files. USE master; GO EXEC sp_detach_db @dbname = N'OriginalDB'; GO copy "c:\\OriginalDB.mdf" "c:\\NewDB.mdf" copy "c:\\OriginalDB_log.ldf" "c:\\NewDB_log.ldf" USE master; GO CREATE DATABASE OriginalDB ON (FILENAME = 'C:\\OriginalDB.mdf'), (FILENAME = 'C:\\OriginalDB_log.ldf') FOR ATTACH; GO CREATE DATABASE NewDB ON (FILENAME […]
Format Date in SQL Server by using a user defined functions. /* author: Rizwan Ansari */ create function dbo.fnFormatDate (@datetime datetime, @format varchar(35)) returns varchar(35) as begin declare @date varchar(35) set @date = @format if (charindex ('yyyy',@date) > 0) set @date = replace(@date, 'yyyy', datename(YY, @datetime)) else if (charindex ('yy',@date) > 0) set @date = […]
In C# You can create instance of any class dynamically using Activator.CreateInstance method public object GetInstance(string FullyQualifiedNameOfClass) { Type t = Type.GetType(FullyQualifiedNameOfClass); return Activator.CreateInstance(t); } If FullyQualifiedNameOfClass is in another assembly then loop through all assemblies and find the Type. For that use below code: public object GetInstance(string FullyQualifiedNameOfClass) { Type type = Type.GetType(FullyQualifiedNameOfClass); if […]