26. Nov. 2008

When you want to use SQL*Plus or exp/imp on the same server on which you have installed your database you might get errors like these:

sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory

or

Error 6 initializing SQL*Plus
Message file sp1us.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory

Syntax:
$ sqlplus username/password

You get this error only when you execute ‘sqlplus’ as a user outside of the dba or Oracle group, because in Oracle Database 10g Release 2 the Oracle Home was locked down by setting umask to 007 prior to installation, so that the files that sqlplus needs to execute do not have read/execute permissions for group “others” and some directories under $ORACLE_HOME have no world read nor execute permission (rwxr-x—)

Warning , don’t use the following command to lower the permissions, this may corrupt your Oracle-Installation:
chmod -R 755 $ORACLE_HOME/

The better way is to use an script which is provided by oracle:
$ORACLE_HOME/install/changePerm.sh

This script will relax the permissions on most files and directories in your Oracle Home, and allow “others” to execute them.

21. Nov. 2008

When transferring data from one server to another – maybe for backup reason – most people use tar to create an archive. Then they copy it to the new server and untar it or leave it as a tarfile as backup.

Working with UNIX and using a trick  you can transfer it with compression and speed up the whole transfer time a lot.

Using the output result of  a command directly as the command line input of a second command  using a  Unix Pipe the need of writing it down to disk first no longer exists. Finally accessing the remote system though a ssh tunnel will even transfer the compressed data over the network within one single step.

Invoking the following single command will transfer all your data within sourcedirectory an Server B and immediately store it locally  on Server B within a compress archive:

ssh username@hostname “cd /sourcedirectory/ ; tar czf – .” > /targetdirectory/filename.tgz

While the following variation:

ssh username@hostname “cd /sourcedirectory/ ; tar czf – .”> /targetdirectory/filename.tgz| tar xvf –

will directly extract it again for you on the your local system.

10. Nov. 2008

As for todays hosting is mainly done on UNIX systems transfering websites can be done quick and reliable using UNIX commands. And therefore a changing your Hosting Provider can become fairly easy.

Instead of downloading all content from Server A to your local system using a however clever FTP Client and later uploading it again to Server B, this whole file transfer can be done within one step using a server to server copying command.

As a basic requirement to use this feature, you have to have secure shell access onto both servers. Being logged in to one server (it doesn’t matter which one) you can use SCP command to transfer all your files. The syntax of the command is fairly easy and it is part of the command to specify source and target system and therefore is doesn’t matter if you are pulling or pushing the files.

Easy command line examples for an SCP command would be:

Copying file to host:

scp SourceFile user@host:directory/TargetFile

Copying file from host:

scp user@host:directory/SourceFile TargetFile

Using the -R option as well will allow you to transfer whole directory trees within one single copy command.

While transfering all files and perhaps several domain can take up several days depending on the size and complexity of your hosting, it can occur that parts of the original files are already changed again until the final go life.

To prevent differences in between source and new target system a final update of both system shortly before switching over does make sense. Here now the command RSYNC will help us.

With RSYNC you can syncronize files and folders between systems.

Again an easy command line example would be:

rsync -r user@host:directory/SourceFolder TargetFolder

Also here source and target system needs to be specified and therefore both sending and receiving are possible.

« previousnext »