Thursday, October 6, 2011

Oracle Data Loader

Oracle Data Loader takes Data from any external file. Here I'll perform Oracle Data Loader from an excel file (CSV Format).
First make an excel file. Check the Image. Kindly save it in CSV format. I have saved the Excel File as 'Emp_Info.csv' as destination 'E:\Ex_Dir\Emp_Info.csv'
After making Excel Sheet, Connect to SysDba to make directory and also to give the privileges to any common user for read and write the directory. Mostly Scott and other Users unable to make directory and read, write it because of less priveleges.
Conn sys/oracle as Sysdba;
Create Directory EXDIR as 'E:\Ex_Dir';
You can give any name as Directory name but make sure the destination would be the same where you have saved the excel sheet like (as 'E:\Ex_Dir')
After that give the rights to any user you want.
Grant All on Directory EXDIR to Scott;
or 
GRANT READ, WRITE ON DIRECTORY EXDIR TO SCOTT;

Now Connect to Scott.
& Write the following Code.

CREATE TABLE EX_ABC
(
ID NUMBER,
FNAME VARCHAR2(20),
JOB VARCHAR2(20)
)
ORGANIZATION EXTERNAL
(
TYPE ORACLE_LOADER DEFAULT DIRECTORY EXDIR
ACCESS PARAMETERS
(
FIELDS TERMINATED BY ','
)
LOCATION ('EMP_INFO.csv'))

The Attributes should be in the same manner/format datatype like your excel sheet. 
Here (FIELDS TERMINATED BY ',')  indicates that you have made comma separated file,
LOCATION ('EMP_INFO.csv')) indicates your excel file name.

 Thank you. . .  !!
Have a Nice Day...!!!! 




Saturday, October 1, 2011

SQL Server- Encryption/Decryption (functions, procedures, triggers and views)


I have made some functions, procedures, triggers and views in SQL Server 2008 its level was encrypted by using “WITH ENCRYPTION”. I was looking to secure my functions, procedures, triggers and views secure so that no one would be able to use it.
After having some sort of working, I came to know that if the procedure or user defined function created “WITH ENCRYPTION”, there is no possible ways to decrypt it by SQL Server commands.
Well, if anyone wants to decrypt it then you will have to use the freeware “Optillect SQL Decryptor”. It will decrypt your functions, procedures, triggers and views.
Just download “Optillect SQL Decryptor” , connect it by using your desired connection and decrypt it whatever you want.
Have a nice Day..!