To remove all Oracle components from a computer on Windows NT, Windows 2000, and Windows XP:
Log in as a member of the Administrators group.
Go to Start Ø Settings Ø Control Panel Ø Administrative Tools Ø Services and stop all Oracle services.
Start the registry at the MS-DOS command prompt:
Go to HKEY_CLASSES_ROOT.
Delete any key that starts with Oracle, ORA, or ORCL.
Go to HKEY_LOCAL_MACHINE\SOFTWARE.
Delete the ORACLE and Apache Group keys.
Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services.
Delete all keys under here that begin with ORACLE.
Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services \Eventlog\Application.
Delete all keys under here that begin with ORACLE.
Go to HKEY_CURRENT_USER.
Delete ORACLE.
Go to HKEY_CURRENT_USER\SOFTWARE\ORACLE.
Delete keys that start with Oracle or ORCL (if any exist).
Delete any Oracle keys (if any exist).
Close the registry.
Restart your computer.
Update the System Variable Path
Go to Start > Settings > Control Panel > System > Environment tab.
Choose the system variable path and modify the Path variable.
Remove any Oracle entries from the path. For example, if JRE was installed by Oracle, remove the %ORACLE_HOME%\BIN path and the JRE path. You may see a path similar to this one:
C:\oracle\ora81\bin;C:\program files\oracle\jre\1.1.7\bin
Exit the Control Panel.
Remove Oracle from the Start Menu
Go to SYSTEM_DRIVE:\Documents and Settings\all users\start menu\programs.
Delete the following icons:
Oracle - HOME_NAME
Oracle Installation Products
where HOME_NAME is the previous Oracle home name.
Delete SYSTEM_DRIVE:\program files\oracle through Windows Explorer.
Delete all ORACLE_BASE directories on your hard drive. In most cases, this will include the Oracle folder that contains the "guts" of your database system, as well as the Oracle folder in "Program Files" on the partion that holds your operating system.
Restart your computer.
On your hard drive, you will see a folder called "Oracle." Inside the folder, you will want to create three additional folders, as follows:
Data
Log
Admin
Edit the init.ora file that you copied from the website. The first thing you must do is to change the name so that it matches the name of your new database. The SID for this database was "SHANGHAI." You must change that to match the name for your new database. Then you need to change the following items:
Make sure the paths to background_dump_dest, core_dump_dest, and user_dump_dest are correct. You will need to create the folders inside the Admin directory.
Change the path of the control files so that the control files will be placed in the Log folder.
If you are using a system with limited memory, you will want to make the following adjustments:
Set db_cache_size to 5000000
Set java_pool_size to 5000000
Set shared_pool_size to 5000000
Set large_pool_size to 0
Place the new init.ora file in the Oracle\Ora92\Database folder.
Create a password file using the ORAPWD utility. The best way to find out how to do this is to go to the command prompt and type:
orapwd
This will bring up the information showing the correct syntax, which is as follows:
orapwd file=pwdNAME.ora password=password entries=5
Place this file in the Database folder along with the init.ora file.
Create a registry string value as follows:
Open the registry editor(regedit)
Drill to HKEY_LOCAL_MACHINE/
SOFTWARE/ORACLE/HOME0
Select New/String Value and enter ORACLE_SID. The value for this string will be the name of your database.
Create a Windows service for the instance at the command prompt:
oradim -new -sid Name -startmode a -pfile c:\oracle\Ora92\database\initNAME.ora
Go to the command prompt and connect to SQL*Plus like this:
sqlplus/nolog
Connect to Oracle: connect sys/password as sysdba
Edit the createdb script in notepad. Be sure that the paths are correct.
rem --使回滚段在线
ALTER ROLLBACK SEGMENT "RBS0" ONLINE;
ALTER ROLLBACK SEGMENT "RBS1" ONLINE;
ALTER ROLLBACK SEGMENT "RBS2" ONLINE;
ALTER ROLLBACK SEGMENT "RBS3" ONLINE;
ALTER ROLLBACK SEGMENT "RBS4" ONLINE;
ALTER ROLLBACK SEGMENT "RBS5" ONLINE;
ALTER ROLLBACK SEGMENT "RBS6" ONLINE;
ALTER ROLLBACK SEGMENT "RBS7" ONLINE;
ALTER ROLLBACK SEGMENT "RBS8" ONLINE;
ALTER ROLLBACK SEGMENT "RBS9" ONLINE;
ALTER ROLLBACK SEGMENT "RBS10" ONLINE;
ALTER ROLLBACK SEGMENT "RBS11" ONLINE;
ALTER ROLLBACK SEGMENT "RBS12" ONLINE;
ALTER ROLLBACK SEGMENT "RBS13" ONLINE;
ALTER ROLLBACK SEGMENT "RBS14" ONLINE;
ALTER ROLLBACK SEGMENT "RBS15" ONLINE;
ALTER ROLLBACK SEGMENT "RBS16" ONLINE;
ALTER ROLLBACK SEGMENT "RBS17" ONLINE;
ALTER ROLLBACK SEGMENT "RBS18" ONLINE;
ALTER ROLLBACK SEGMENT "RBS19" ONLINE;
ALTER ROLLBACK SEGMENT "RBS20" ONLINE;
ALTER ROLLBACK SEGMENT "RBS21" ONLINE;
ALTER ROLLBACK SEGMENT "RBS22" ONLINE;
ALTER ROLLBACK SEGMENT "RBS23" ONLINE;
ALTER ROLLBACK SEGMENT "RBS24" ONLINE;
rem --修改sys用户的临时表空间为TEMP
alter user sys temporary tablespace TEMP;
rem --创建数据字典表
connect system/manager
@$ORACLE_HOME/rdbms/admin/catdbsyn.sql
rem 脚本开始
connect internal
startup nomount pfile="$ORACLE_HOME/admin/web/pfile/initweb.ora"
set echo on
spool makedb.log
create database web
datafile '$ORACLE_HOME/oradata/web/web_syst_01.dbf' size 500M reuse
logfile
'$ORACLE_HOME/oradata/web/web_redo_01.dbf' size 10M reuse,
'$ORACLE_HOME/oradata/web/web_redo_02.dbf' size 10M reuse,
'$ORACLE_HOME/oradata/web/web_redo_03.dbf' size 10M reuse
MAXLOGFILES 32
MAXLOGMEMBERS 2
MAXLOGHISTORY 1
MAXDATAFILES 254
MAXINSTANCES 1
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET ZHS16GBK;
connect INTERNAL/oracle
rem --修改系统表空间
ALTER TABLESPACE SYSTEM DEFAULT STORAGE ( INITIAL 64K NEXT 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 50);
ALTER TABLESPACE SYSTEM MINIMUM EXTENT 64K;
connect INTERNAL/oracle
rem --修改系统表空间
ALTER TABLESPACE SYSTEM DEFAULT STORAGE ( INITIAL 64K NEXT 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 50);
ALTER TABLESPACE SYSTEM MINIMUM EXTENT 64K;
rem --创建回滚表空间
CREATE TABLESPACE RBS DATAFILE '/data/ora816/oradata/web/rbs01.dbf' SIZE 256M REUSE
AUTOEXTEND ON NEXT 5120K
MINIMUM EXTENT 512K
DEFAULT STORAGE ( INITIAL 512K NEXT 512K MINEXTENTS 8 MAXEXTENTS 4096);
rem --创建用户表空间
CREATE TABLESPACE USERS DATAFILE '/data/ora816/oradata/web/users01.dbf' SIZE 128M REUSE
AUTOEXTEND ON NEXT 1280K
MINIMUM EXTENT 128K
DEFAULT STORAGE ( INITIAL 128K NEXT 128K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0);