me,myself,english and programming..

Restore mysql database using shell script in OSX

This simple script will help you to save your time doing all the routine job when you need to restore database and doing some sql manipulation.

You can pass a filename else the script will use default file.

Step 1 : create new file and name it to restoreMyDB.sh


#!/bin/bash
# DROP DATABASE,CREATE AND RESTORE
# RUN mysql command using console

echo "JOB START AT => $(date)"
echo Drop and Create MyDB
mysql -u root -proot -e "drop database mydb;create database mydb;";

if [ "$1" = "" ] ; then
echo LOAD USING DEFAULT DB..
mysql -u root -proot mydb < mydb.sql
else
echo LOAD myDB USING $1
mysql -u root -proot mydb < $1
fi

echo DONE. NOW UPDATING SOMETHING....

mysql -u root -proot -e "use mydb;update myusers set somethingTo='jLIjfQZ5yojbZGTqxg2pY0VROWQ=';"

echo "JOB DONE AT => $(date)"

 

Step 2 : run the script in your osx console.

Read the rest of this entry »

It’s year 2016 and Alhamdulillah…I’m still alive

Dear blog, it’s year 2016 already hokeyyy.

Alhamdulillah, masih lagi bernafas cuma blog ini yang nyawa-nyawa ikan dah.

Tak pasti sama ada untuk teruskan atau hentikan sharing di blog ini.

Still thinking….anyway…happy programming guys.

 

Just Me,
-RJ

How to resolve ORA-011033: ORACLE initialization or shutdown in progress

cmd > sqlplus /nolog

SQL> connect / as sysdba

Connected.

SQL> shutdown abort

ORACLE Instance shut down.

SQL> startup nomount

ORACLE Instance started

SQL> alter database mount;

SQL> alter database open;

Which still gave the error:

ORA-00600: internal error code, arguments: [kcratr1_lostwrt]

I then found the advice to do the following:

SQL> startup mount

ORACLE Instance started

SQL> recover database

Media recovery complete

SQL> alter database open;

Database altered

tq to http://stackoverflow.com/questions/53676/how-to-resolve-ora-011033-oracle-initialization-or-shutdown-in-progress

Hello world…this is pre-GST post.

Dear my blog…

It has been a long long time after my last post…since last year.

Just to let you know that….I’m alive.

JustMe,

-AreJae-

SVN Error : redirect cycle detected for URL- solved

add this line to the httpd.conf solve this error.

BrowserMatch “TortoiseSVN” redirect-carefully