Monday, June 18, 2007

Change Rename hostname for Oracle Application Server Midtier

Reference: http://download-west.oracle.com/docs/cd/B25221_03/core.1013/b25209/host.htm#sthref485

It is ok to change / rename hostname for Oracle Application Server Infrastructure and Midtier. However documentation says it does not support Oracle AS with Metadata Repository.

Simply execute the following command to change hostname for Midtier.
% $ORACLE_HOME/chgip/scripts/chgiphost.sh -mid

The script is clever enough to pick up the host information. So you just need to accept the default prompt 4 times, that's it.

Thursday, June 07, 2007

Oracle SQL command to create user

Since everytime I'll forget the exact commands, I shall record it here.

The following is the simplest way to create an Oracle user:

-- 1. Create Tablespace "MYDB"
CREATE TABLESPACE "MYDB"
LOGGING DATAFILE '/u02/oradata/ora10gdb/mydb.dbf'
SIZE 200M AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED;

-- 2. If temporary table space is needed, script to create temporary table space.
CREATE TEMPORARY TABLESPACE "TEMPORARY"
TEMPFILE '/u02/oradata/ora10gdb/TEMPORARY.dbf'
SIZE 50M
EXTENT MANAGEMENT LOCAL
UNIFORM SIZE 10M;

-- 3. Create User "MYDB"
CREATE USER "MYDB" PROFILE "DEFAULT" IDENTIFIED BY "MYDB"
DEFAULT TABLESPACE "MYDB" TEMPORARY TABLESPACE "TEMP" ACCOUNT UNLOCK;
GRANT "CONNECT" TO "MYDB";
GRANT "RESOURCE" TO "MYDB";