Jumat, 26 September 2014

Backup otomatis SQLServer 2005 dengan Batch File




Sql Job to run a Batch file


In my recent project, I need to create a Sql server agent job to run a batch file that runs a Sql server integration service package.
Suppose my package name is PRELOAD_SDID\PKG_SSIS_WITH_MOL_PROV.dtsx and it is situated at the file path D:\Projects\Norway_MA\Packages\SSIS WITH MOL AND PROV COVER\SDID_LOAD_COMBINED_V2_TEST_EXCEL.
To create a windows scheduler for running the package, I need to write a batch file in which the command will be :
“C:\Program Files\Microsoft SQL Server\100\DTS\Binn\dtexec.exe” /FILE “D:\Projects\Norway_MA\Packages\SSIS WITH MOL AND PROV COVER\SDID_LOAD_COMBINED_V2_TEST_EXCEL\PRELOAD_SDID \PKG_SSIS_WITH_MOL_PROV.dtsx” /MAXCONCURRENT ” -1 ” /CHECKPOINTING OFF >>logNorwayMA.txt
Now my target is to run this batch file using a sql job. To do so,
  • Open sql server.
  • on object explorer tab, select sql server agent and expand the jobs.
  • select new job.
  • In general tab, named the job and select the category as uncategorized(local).
  • Select steps tab and select new steps. Then name the step name, select type as Operating system(CmdExe). In the command open the batch file or write the command cmd.exe /c “D:\Projects\mybatch.cmd”. Here mybatch.cmd is the batch file and D:\Projects\mybatch.cmd is it’s path.
  •     Then select OK and job is ready.
But in my project, I faced a problem. I created the job as Sql server Agent Service Account. The user of this service account has not the credential to access the database that is used in my package. So, the job failed and said login failure to access database. On the other hand, the user who has credential to access database has no credential to run the CmdExe.  To solve the problem I need to create a proxy and a credential.
To create a credential…….
  • Expand Security and select credential and select new credential. then create the credential.
Then create the proxy……….
  • Expand Sql server Agent and then expand Proxies.
  • Name the proxy
  • Select Credential
  • Select the Subsystem.
Then select this Proxy as Run As when creating the job.
This has worked fine.

Rabu, 24 September 2014

Do’a ke kuburan


Do’a ke kuburan

Dari Abu Hurairah radhiyallahu ‘anhu, bahwa Rasulullah shallallahu ‘alaihi wa sallam pernah mengunjungi kuburan. Kemudian beliau berdoa,
السَّلَامُ عَلَيْكُمْ دَارَ قَوْمٍ مُؤْمِنِينَ، وَإِنَّا إِنْ شَاءَ اللهُ بِكُمْ لَاحِقُونَ
“Keselamatan untuk kalian, wahai penghuni rumah kaum mukiminin. Kami insyaaAllah akan menyusul kalian.” (HR. Muslim 249).


Rasulullah shallallahu ‘alaihi wa sallam telah mengajarkan kepada kita doa ketika berziarah kubur. Teks doanya,
السَّلَامُ عَلَيْكُمْ أَهْلَ الدِّيَارِ مِنَ الْمُؤْمِنِينَ وَالْمُسْلِمِينَ، وَيَرْحَمُ اللهُ الْمُسْتَقْدِمِينَ مِنَّا وَالْمُسْتَأْخِرِينَ، وَإِنَّا إِنْ شَاءَ اللهُ بِكُمْ لَلَاحِقُونَ أَسْأَلُ اللهَ لَنَا وَلَكُمُ الْعَافِيَةَ
ASSALAMU ’ALAIKUM AHLAD-DIYAAR MINAL MU’MINIINA WAL MUSLIMIIN. YARHAMULLOOHUL MUSTAQDIMIINA MINNAA WAL MUSTA’KHIRIIN.
WA INNA INSYAA ALLOOHU BIKUM LA-LAAHIQUUN
WA AS ALULLOOHA LANAA WALAKUMUL ‘AAFIYAH.
“Semoga keselamatan tercurah kepada kalian, wahai penghuni kubur, dari (golongan) orang-orang beriman dan orang-orang Islam, semoga Allah merahmati orang-orang yang mendahului kami dan orang-orang yang datang belakangan. Kami insya Allah akan menyusul kalian, saya meminta keselamatan untuk kami dan kalian.”
Hadis ini diajarkan kepada A’isyah radhiyallahu ‘anha, ketika beliau bertanya kepada Nabi shallallahu ‘alaihi wa sallam tentang doa yang dibaca pada saat ziarah kubur.
(HR. Ahmad 25855, Muslim 975, Ibnu Hibban 7110, dan yang lainnya).

Selasa, 23 September 2014

Pesan Ali bin Abi Tholib

Akan datang suatu masa, Dan aku khawatir terhadap masa itu.

1. Di mana keyakinan hanya tinggal di dalam pemikiran.
2. Di mana keimanan tak berbekas dalam perbuatan.
3. Banyak orang baik tapi tak berakal.
4.Ada pula yang berakal tapi tak beriman.
5. Ada yang lidahnya fasih tapi hatinya lalai.
6. Ada pula yang khusyu' tapi sibuk menyendiri.
7. Ada ahli ibadah tapi mewarisi kesombongan iblis.
8. Ada pula ahli maksiat tapi rendah hati.
9. Ada yang bahagia tertawa tapi hatinya berkarat.
10. Ada pula yang sedih menangis tapi kufur nikmat.
11. Ada yang murah senyum tapi hatinya mengumpat.
12. Ada pula yang berhati tulus tapi wajahnya cemberut.
15. Ada yang berlisan bijak tapi tidak memberi teladan.
16. Ada pula pelacur tapi menjadi figur.
17. Ada yang memiliki ilmu tapi tidak paham.
18. Ada pula yang paham tapi tidak menjalankan.
19.Ada yang pintar tapi membodohi.
20. Ada pula yang bodoh tapi tidak tahu diri.
21. Ada yang beragama tapi tidak berakhlak.
22. Ada pula yang berakhlak tapi tidak ber-TUHAN.