Wednesday, August 31, 2022

MYSQL Error : This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA

 Error while executing script in MYSQL workbench


Error

Error Code: 1418. This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

Solution

Execute the below Command in the MySQL console or Workbench:

SET GLOBAL log_bin_trust_function_creators = 1;
 

For Permanent solution add the below parameter in mysql.ini file:

log_bin_trust_function_creators = 1;


Friday, August 26, 2022

Open Office Writer : Table of Index / Hyperlink

 How to Enable Hyperlink in Index Table. 

You must have a Open office writer with content and make sure content is marked as Heading 1, Heading 2 , Heading 3,.... Heading n

 

 

Next Add Index table Go to  Insert > Table of Contents and Index >  Table of Contents and Index or bibliography

Index will be added, and you may noticed no hyperlink on index data. 

Now right click on Index > Edit Index > Tab "Entries"

Make sure the structure is same as given image LS, E#, E , T, #, LE and Edit LS and LE as Internet Link. Do it for level 1,2,3 as per requirement



Wednesday, August 10, 2022

ORA-39001 ORA-39000 ORA-31640 ORA-27041 OSD-04002 : Oracle IMPDP Error

impdp Scott/tiger full=Y directory=data_pump_dir dumpfile=scott.dmp TABLE_EXISTS_ACTION=SKIP SKIP_UNUSABLE_INDEXES=y EXCLUDE=STATISTICS DATA_OPTIONS=skip_constraint_errors  REMAP_SCHEMA=old_schedma_in_dmp:scott logfile=data_pump_dir:scott_full_094358_1.log EXCLUDE=GRANT

After executing above command received error :

ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31640: unable to open dump file "D:\backups\scott_full.dmp" for read
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 5) Access is denied.


As per error
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 5) Access is denied.

i was assuming that the files or folder do not have correct permission either for window user or oracle user (which is owner of directory)

Looked for many websites while googling, no one able to give the correct resolution for this error, every one is assuming for permission issue.


Problem :

- Using parameter log file wrongly "logfile=data_pump_dir:scott_full_094358_1.log", it should be without "data_pump_dir"
- For another Log File Name ( I am not sure about this), when i use logfile parameter "logfile=scott_full_094358_1.log" it was still giving issue.
Then i modified the log file name to "logfile=scott_full.log" then only it worked for me.

Working IMPDP command
impdp Scott/tiger full=Y directory=data_pump_dir dumpfile=scott.dmp TABLE_EXISTS_ACTION=SKIP SKIP_UNUSABLE_INDEXES=y EXCLUDE=STATISTICS DATA_OPTIONS=skip_constraint_errors  REMAP_SCHEMA=old_schedma_in_dmp:scott logfile=scott_full.log EXCLUDE=GRANT

Friday, August 5, 2022

CMD : code to copy the files from 1 folder to another

 requirement : Here i have scenario like i have all the files name or image name which i need to copy over to new directory in same computer or on any external drive.

Code

@echo off
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
SET "source=D:\srcdir\"
SET "source1="D:\srcdir""
SET "destination=D:\Destination"
SET "FileNameFromTExtFile=.\Path1.txt"

if not exist "D:\Destination\" mkdir D:\Destination 
rem copy Folder Structure as of source in Destination
XCOPY "%source1%" "%destination%" /t /e
 
FOR /F "usebackq eol=| delims=" %%f IN ("%FileNameFromTExtFile%") DO (
    where /Q /R %source1% %%f
rem echo !ERRORLEVEL!
    IF "!ERRORLEVEL!" == "1" (
@copy /y "%source1%%%f" "%destination%%%f" 
        )
     IF "!ERRORLEVEL!" == "2" (
        echo "%source1%%%f" is not found!
    )
)

 In above code it will copy all the files which are mentioned in Path1.txt file and it will loop through all the files and copy to Destination folder from source folder (srcdir).

It will also copy all directory structure before copying the fles.

Feel free to edit code as per your requirement.

how data need to pass in Path1.txt file?

\1C9A7356.JPG
\1C9A7360.JPG
\1C9A7364.JPG
\cam1\1C9A8147.JPG
\cam1\1C9A8163.JPG
\cam1\1C9A8165.JPG
\cam2\SHP04337.jpg
\cam2\SHP04353.jpg
\cam2\SHP04388.jpg
\cam1\DSC_3568.JPG
\cam1\DSC_3571.JPG
\cam1\DSC_3575.JPG
\cam1\DSC_3576.JPG
\cam2\SHP05260.jpg
\cam2\SHP05263.jpg
\cam2\SHP05288.jpg
\cam2\SHP05334.jpg
\cam3\1C9A8935.JPG
\cam3\1C9A8938.JPG
\cam3\1C9A8940.JPG
\cam3\1C9A8942.JPG

CMD : Copy the Folder Structure only

Command to copy the folder structure on disk drive without copy the files on cmd

D:\Source>XCOPY "D:\Source" "D:\MyDrive" /t /e
Does D:\Source specify a file name
or directory name on the target
(F = file, D = directory)?

After execution of command CMD will ask to enter A or D.

Give Input A if you would like to add output in file and D if you would like create directories.

This command will create folders ( including sub folders) on your specified path without copying the files.

web stats