Thursday, May 31, 2007

How to import & export and create new user by using oracle database

1. create new user :
  • sqlplus "/ as sysdba"
  • create user kmportal identified by password;
  • grant connect to kmportal;
  • grant resource to kmportal;
  • grant dba to kmportal;
  • grant create any snapshot to kmportal;
  • exit sqlplus

2. import database:

  • sqlplus kmportal/password
  • imp kmportal/password FILE="/usr/local/../../kmportal.dmp" FULL=y LOG="/../../kmportal.log"

3. export database:

  • sqlplus kmportal/password
  • exp kmportal/password FILE="/usr/local/../../kmportal.dmp"

Monday, May 14, 2007

How To Install Infofusion in Solaris

Installing:
Get the infofusion for the OS version with correct build.
Place the infofusion in a location, lets say '/installer/infofusion'.
If the file tarred, untar infofusion. There is 1 setup file, and a few tar file.
In unix, type 'chmod +x setup' to change the executing permission.


Type './setup' to run the setup.

While installing, infofusion will prompt the user for the cd. Type '/installer/infofusion' to indicate the source or infofusion.

The installer will later prompt the user for the path to install. Type '/export/infofusion' to install it to the directory. The installer will prompt the user for the product key when installation is done. type in '/installer/infofusion'.


Setting Environment Path:

Goto infofusion installation path, eg: '/export/infofusion', goto '/export/infofusion/Config/table'.
Edit the nethost.tbl in it. The content should be 'hostname,protocol,port_num,loopback'.


Eg: 'web4,tcp,7000,YES' where the bolded text is a standard value that should be the same for each machine.
Set the path for infoconfig. Type 'export INFOConfig=/export/infofusion/bin/infoconfig'.
Set the default path for infofusion. Type 'export PATH=$PATH:/export/infofusion/'.

After setting the path, remember to set the 'infonetd'.
nohup infonetd [-log logfile] [-user userid] [-name hostname] &
(eg: nohup infonetd -user ifusion -name tornado) where,


nohup
is the UNIX no hang-up command, which eliminates the possibility of being disconnected mid-process.


infonetd
is the name of the InfoFUSION executable that monitors the specified port.


-log logfile
tells InfoFUSION to record all activity at the specified port. This entry is optional.


-name userid
tells InfoFUSION to start the daemon process using the specified userid.


-name hostname
tells InfoFUSION to use the specified hostname to lookup for the entry in nethost.tbl instead of the default server hostname.


&
is the UNIX parameter that causes processing to take place as a background process.


Or better still, use the startup script if available.



Creating startup script:

To create a startup script, using a text editor, insert the following:

--------------------------------------------------------------
#!/bin/ksh
# env. settings
export INFOConfig=/infofusion/Bin/infoconfig
export PATH=$PATH:/infofusion/Bin
# export INFOConfig
# export PATH
# startup the daemon process
nohup infonetd -user ifusion -name tornado > infonetd.log 2>&1 &
----------------------------------------------------------------------------------------

If infoconfig exist in “/usr/lib/infoconfig”. If exist, do not set the path for it anymore.
save the file as “startup.sh” in a directory, best is with the infofusion, “//infofusion/”.
Goto “//etc/init.d”, create a file call “infofusion”. Using text editor, insert the following statements:

--------------------------------------------------------------
#!/bin/sh
#
# Startup script for InfoFUSION
# for "start", will run the process as userid "ifusion"
# assuming the login profile of ifusion has all the necessary settings
# to run InfoFUSION
case "$1" in
start)
export INFOConfig=/infofusion/Bin/infoconfig
export PATH=$PATH:/infofusion/Bin
cd //infofusion
su - ifusion -c "./startup.sh &"
;;
stop)
INFOConfig=/infofusion/Bin/infoconfig
PATH=$PATH:/infofusion/Bin
export INFOConfig PATH
# do some clean-up
infolock -clear
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 startstoprestart"
exit 1
esac
exit 0
-------------------------------------------------------------------------------------


goto “//etc/rc3.d”. Create a link for infofusion. Type “ln -s ../etc/inti.d/infofusion s96infofusion” where the bolded text shows the source of the link, the italic text shows the new link. The new link must start with “sXX” where the XX represents a number.


Compiling InfoFUSION:


Get the infoFUSION source.
Goto 'sol/makes/tdmake'.
Remove the 'tdmake' file by typing 'rm tdmake' if the 'tdmake' file exist.
Edit the 'makefile' file using any text editor. There is a part where you'll see ' gcc -c $<'. change it to ' gcc -D__XOPEN_OR_POSIX -c $<' and save the file.
Run 'make'.
Browse into the 'sol/makes/build' directory.
Type 'chmod +x *' to give change all the files in the directory to executable files.
Type './makelibs' and after done, type './makerest' to compile.
Get the 'install' folder (that consist of Bin, Config, Databases, etc etc.) and place it in the same level as 'sol'.
Go back to the 'sol' directory, browse to 'sol/setup'.
Type 'chmod +x *' to change the permission for execution.
Type './buildtar' to build the tar file.
After building of the tar file is done, you will noticed that there are a four tar files built in the setup directory.
Run the setup by typing './setup' and follow the instruction for the installation.

*Make sure that 'gcc, make and ar' is running and the environment path is there.
** gcc --> usr/local/binmake & ar --> usr/ccs/bin

InfoFUSION Client/Server Environment Setup in Solaris

2.1 InfoFUSION Client/Server Environment Setup
2.1.1 Nethost.tbl file
When the server daemon (infonetd) is started, it performs the following:

  • get the hostname or IP address using system API gethostname()
  • looks into the nethost.tbl file (in the Tables area) for an entry that begins with the hostname

Each entry in the nethost.tbl file must be in the following format:
hostname, protocol, port_num, loopback
where,


hostname
the host name or IP address of the server.

protocol
the name of the communications protocol. Always set to “tcp”.

port_num
the port number on the host that the server daemon will monitor for client requests. The port number should not be used by another application. Check /etc/hosts. Always use port number higher than 5000.

loopback
loopback is either YES or NO, depending upon whether the host’s communications protocol allows a bypass feature when connecting to the local host. Always set to YES.

Note:
For the client/server connection to work, you must have an identical entry in the nethost.tbl file on the client machine.

Sample entries:
sunny, tcp, 6800, YES
192.9.200.1, tcp, 6003, YES

The first entry specifies that the server daemon on the host machine sunny shall monitor port number 6800 for client activity. The second entry specifies that the server, identified by IP address, shall monitor port 6003. In both cases, the communications protocol is TCP/IP with loopback feature enabled.

2.1.2 The Meta-Configuration file

For UNIX platform:
By default, InfoFUSION looks for the meta-configuration table in the file /usr/lib/infoconfig. The meta-configuration table is a file that lets you configure InfoFUSION system. This file specifies the location of the InfoFUSION root directory and other non-default locations for one or more InfoFUSION areas.

A meta-configuration file must at least contain the ROOT entry, where it specifies the directory where InfoFUSION is installed.

For example, if you installed InfoFUSION in the directory called /infofusion, then the entry should read
ROOT = /infofusion/
Other useful entries include DBROOT and DATABASES.


DBROOT
indicates the directory where your databases are located.

DATABASES
indicates the directory where the database configuration tables are located.
This meta-configuration file must be validated. This is done by placing the full path and the full name of the file in the file /usr/lib/infovalid. You are responsible for creating and maintaining the file.


For example, if you create a new meta-configuration file called newmeta in the /usr/lib directory, then you would validate this file by placing the following entry in the /usr/lib/infovalid file:
/usr/lib/newmeta


For Windows NT platform:
The meta-configuration is found in $ROOT\Bin directory. The entries in the infoconfig file is exactly the same as the one in UNIX platform.
However, no validation is required in this platform and therefore the infovalid file is not required.

2.1.3 The INFOConfig Environment Variable

You need to set the INFOConfig environment variable to the name and path of the meta-configuration table. Upon startup, InfoFUSION will query this environment variable and the specified meta-configuration.
The INFOConfig environment variable can either be defined in the user’s login script (.profile or .login) or it can be defined from the command line.


2.1.4 The INFONETD Server Daemon

Before any InfoFUSION client application can communicate with the InfoFUSION server, you must ensure that the InfoFUSION server daemon (infonetd), a program that causes the server to monitor a particular port on the host machine is running.

To start the infonetd on UNIX
Issue the following command:
nohup infonetd [-log logfile] [-user userid] [-name hostname] & where,


nohup
is the UNIX no hang-up command, which eliminates the possibility of being disconnected mid-process.

infonetd
is the name of the InfoFUSION executable that monitors the specified port.

-log logfile
tells InfoFUSION to record all activity at the specified port. This entry is optional.

-name userid
tells InfoFUSION to start the daemon process using the specified userid.

-name hostname
tells InfoFUSION to use the specified hostname to lookup for the entry in nethost.tbl instead of the default server hostname.
&
is the UNIX parameter that causes processing to take place as a background process.

Man Utd's next generation of wonderkids

Manchester United have set off on their pre-season United States tour with a number of young stars involved, but some other talents have lef...