Wednesday 31 January 2018

 



       Take backup with password and multiple file for faster speed

                       Backup:

                  BACKUP DATABASE [Leave_Management] TO
'                  DISK = 'E:\Leave_Management_file1.bak',
                      DISK = 'F:\Leave_Management_file2.bak'
                     WITH MEDIAPASSWORD='Securepassword'



                      filelist for verification:-


          RESTORE FILELISTONLY FROM DISK = 'E:\Leave_Management_file1.bak',
          DISK = 'F:\Leave_Management_file2.bak'
          WITH MEDIAPASSWORD='Securepassword'



                      
           Restoration for multiple files with password:

          RESTORE database [Leave_Management] FROM DISK = 'E:\Leave_Management_file1.bak',
           DISK = 'F:\Leave_Management_file2.bak'
           WITH MEDIAPASSWORD='Securepassword',
            MOVE 'Leave_Management' TO 'C:\Program Files\Microsoft SQL                  Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Leave_Management.mdf',
           MOVE 'Leave_Management_Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Leave_Management_log.ldf'







Putty use for caputre screen output



Putty is used for take remote linux machine from window machine.





Tuesday 30 January 2018

installation on centos:-

Requirement:

  • You need at least 3.25GB of memory to run SQL Server on Linux.
  • SQL Server Engine has been tested up to 1 TB of memory at this time. The file system must be XFS or EXT4. Other file systems, such as BTRFS, are unsupported. 
                mount | grep "^/dev"       --check file system should             
  • you need  administrative access for installation.
            sudo -l -U msdba   -->User msdba is not allowed to run sudo on servername

Login with superuser

Sudo su 
#cat /etc/centos-release  --check version
     CentOS Linux release 7.3.1611 (Core)

 copy repo file in  /etc/yum.repos.d/ directory only using winscp. 

Install mssql using yum install.  

sudo yum install -y mssql-server




Configuration and setting SA password with strong password.

sudo /opt/mssql/bin/mssql-conf setup

 Check mssql services  packages is installed 

  root #rpm -qa | grep mssql

Check mssql services is running.


  root # systemctl status mssql-server

Enable firewall rule  


sudo firewall-cmd --zone=public --add-port=1433/tcp  --permanentsudo firewall-cmd --reload   

Install mssql agent 


sudo yum install mssql-server-agent
sudo systemctl restart mssql-server

remove old version


sudo yum update
sudo yum remove unixODBC-utf16 unixODBC-utf16-devel

 Install mssql tools with unixODBC developer packages. 



sudo yum update
sudo yum install mssql-tools unixODBC-devel

 Login in mssql using Sqlcmd


[root]# sqlcmd -S 10.16.1.54 -U sa
Password:
1> select @@version
2> go
Microsoft SQL Server vNext (CTP2.0) - 14.0.500.272 (X64)         Apr 13 2017 11:44:40         Copyright (C) 2017 Microsoft Corporation. All rights reserved.  Developer Edition (64-bit) on Linux (CentOS Linux 7 (Core))
check packgae information of mssql

# yum info mssql-server

Putty use for screen command and output summary

                                  Uninstall mssql  from cenetos server                         1) check os version                     ...