Blog Has been temporary transmited

Hi, guys

I will temporary transmit this blog to http://miloluo.blog.chinaunix.net

Pls kindly known that.

Milo.

Posted in 未分类 | Leave a comment

Penetrating...



I love you, mom !
I love you, dad !
I love you all and I will always do !


No mater how hard we have been though and are being thought...
No mater what kinds of situations our family meets...
No mater how other people thinks...

I will always do what should be in my dreams...
I will try all my energies to solve problems...
I will ingore all prejudices...

Anyway, all the fires and all the courages will penetrate all my life!

Posted in 未分类 | 1 Comment

Deeply Moved by the brave little boy

Clik here ,if you can't watch directly.

The nine year's old boy named Lin Hao.He was at classroom when the big earthquake occured on PM 2:28 ,May 12,2008.His teacher told him and his classmates to run outside.While running outside,the boy found his two classmates fainted on the half way. The boy turned round immediate and carried his two classmates on his back and shoulder without hesitate.Because of these action,he got hurt on his arms. And the boy and his little sister and elder sister walked from Yin Xiu town to Du Jiangyan city,but he still have got any news about his parents. This little boy  impressed  me as brave ,kind-hearted and iron will.
Hope all his families all good !

Let us pray for all the people in this big disaster !
Let us thank those people for rescuing people and curing people that hurted !
Let us be a family !
                   
                                                              Milo Luo
                                                                       May 21 2008

Posted in 美丽照片 | Leave a comment

PL/SQL Studying (2)

Well,firtst thing I wanna mention is that login.sql file in d :o racleora92bin. It works in white sqlplus but not sqlplus.It's not like what Eric said to me.To fixed this problem ,we can add a SYSTEM ENVIRONMENT VARIABLE called "SQLPATH",then add that path in it.Then login.sql file works at the loading time while sqlplus login.

Here are some codes , i wrote in Eric's Assignments.

  • The first one is used for caculating the area of circle.

DECLARE
   R NUMBER := &radius;
   PI CONSTANT NUMBER  := 3.14;
BEGIN
   DBMS_OUTPUT.PUT_LINE('The area of the circle is ' || PI * R * R );
END;
/

These is another way to do it:
DECLARE
       r NUMBER(5,2);
       PI CONSTANT number(5,2) := 3.1415;
BEGIN
       DBMS_OUTPUT.put_line('The area of circle is : ' || PI * power(&r,2) );
END;

I dont know which is more faster.May be it's too small calculation for cpu or for oracle software.I did some experiences and it haven't show me the very differeces.

SQL> DECLARE
  2         r NUMBER(5,2);
  3         PI CONSTANT number(5,2) := 3.1415;
  4  BEGIN
  5         DBMS_OUTPUT.put_line('The area of circle is : ' || PI * power(&r,2) );
  6  END;
  7  /
Enter value for r: 3.14
The area of circle is : 30.959144

PL/SQL procedure successfully completed.

Elapsed: 00:00:00.00
SQL> DECLARE
  2     R NUMBER := &radius;
  3     PI CONSTANT NUMBER  := 3.14;
  4  BEGIN
  5     DBMS_OUTPUT.PUT_LINE('The area of the circle is ' || PI * R * R );
  6  END;
  7  /
Enter value for radius: 3.14
The area of the circle is 30.959144

PL/SQL procedure successfully completed.

Elapsed: 00:00:00.00
SQL> /
Enter value for radius: 3.1415926536987932384626433832795028841971693993
The area of the circle is 30.99055782157106906641289334720356321367

PL/SQL procedure successfully completed.

Elapsed: 00:00:00.00

Posted in 未分类 | Leave a comment

PL/SQL Studying (1)

Author : Milo

Here we introduce some basic skill of PL/SQL and its tools.

First,I wanna introduce settings we wanna set before we coding.
1.set serveroutput on
2.set verify off

Second,You should keep your code styles more readable.

If you want your output pretty neat,you should follow this rules:
Oracle KEY WORDS should in UPCASE,such as DECLARE,BEGIN,END,IF and so on.
Here is a example:

/*              Author: Milo       Date: April,16th ,2008        Specification:A script to calculate circle area.*/DECLARE          R NUMBER := &radius;   PI CONSTANT NUMBER  := 3.14;BEGIN      DBMS_OUTPUT.PUT_LINE('The area of the circle is ' || PI * R * R );END;/


And also try to put some commends when necessary.


Third,We can use only three ways to assign values to pl/sql variable:


Assigning Values to VariablesYou can use assignment statements to assign values to variables. For example, thefollowing statement assigns a new value to the variable bonus, overwriting its oldvalue:bonus := salary * 0.15;


Variables and constants are initialized every time a block or subprogram is entered. Bydefault, variables are initialized to NULL. Unless you expressly initialize a variable, itsvalue is undefined (NULL) as shown in Example 2–20.Example 2–20 Initialization of Variables and ConstantsDECLAREcounter INTEGER;BEGIN-- COUNTER is initially NULL, so 'COUNTER + 1' is also null.counter := counter + 1;IF counter IS NULL THENDBMS_OUTPUT.PUT_LINE('COUNTER is NULL not 1.');END IF;END;/To avoid unexpected results, never reference a variable before you assign it a value.The expression following the assignment operator can be arbitrarily complex, but itmust yield a datatype that is the same as or convertible to the datatype of the variable.PL/SQL Expressions and ComparisonsFundamentals of the PL/SQL Language 2-19


Assigning BOOLEAN ValuesOnly the values TRUE, FALSE, and NULL can be assigned to a BOOLEAN variable asshown in Example 2–21. You can assign these literal values, or expressions such ascomparisons using relational operators.Example 2–21 Assigning BOOLEAN ValuesDECLAREdone BOOLEAN; -- DONE is initially NULLcounter NUMBER := 0;BEGINdone := FALSE; -- Assign a literal valueWHILE done != TRUE -- Compare to a literal valueLOOPcounter := counter + 1;done := (counter > 500); -- If counter > 500, DONE = TRUEEND LOOP;END;/


Assigning a SQL Query Result to a PL/SQL VariableYou can use the SELECT statement to have Oracle assign values to a variable. For eachitem in the select list, there must be a corresponding, type-compatible variable in theINTO list as shown in Example 2–22.Example 2–22 Assigning a Query Result to a VariableDECLAREemp_id employees.employee_id%TYPE := 100;emp_name employees.last_name%TYPE;wages NUMBER(7,2);BEGINSELECT last_name, salary + (salary * nvl(commission_pct,0))INTO emp_name, wages FROM employeesWHERE employee_id = emp_id;DBMS_OUTPUT.PUT_LINE('Employee ' || emp_name || ' might make ' || wages);END;/Because SQL does not have a BOOLEAN type, you cannot select column values into aBOOLEAN variable. For additional information on assigning variables with the DMLstatements, including situations when the value of a variable is undefined.
Posted in 未分类 | 2 Comments

[转]在linux中控制台下,怎么做才能禁用终端响铃

转自http://www.gentoo.org/doc/zh_cn/faq.xml#beeping

因为最近在linux服务器做实验,没有GUI,只有CUI。在用TAB补全命令时,老是“嘀。。”响,声音太响,想关掉。终于搜索到这个方法,在Centos和ubuntu上都可以关掉终端响铃。

终端响铃声可以使用setterm关闭,如下所示:

代码 7.1: 使用setterm
# setterm -blength 0


如果想在启动时就关闭终端响铃,你要把这条命令加入/etc/conf.d/local.start 之中。然而,这只是禁用掉了现在正在使用终端的响铃。想要在其他的终端上禁用响铃的话,把这条命令的输出重定向到目标终端去即可,如下所示:

代码 7.2: 使用setterm (bis)
# setterm -blength 0 >/dev/vc/1


你需要用想要禁用响铃的那个终端来替换/dev/vc/1.

Posted in 我的新得 | Leave a comment

Using RMAN for Full Backup

Tonight ,I tried to use RMAN to a full backup for my Oracle 10g database,here are the scripts:

SQL> set linesize 200

SQL> create user rman identified by change_me
2 default tablespace users
3 temporary tablespace temp;

User created.

SQL> alter user rman identified by passwd;

User altered.

SQL> grant resource, connect to rman;

Grant succeeded.



SQL> alter user rman quota unlimited on users;

User altered.

SQL> grant recovery_catalog_owner to rman;

Grant succeeded.

=============

[oracle@localhost ~]$ rman catalog rman@LOVEU

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Mar 4 23:20:17 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.

recovery catalog database Password:
connected to recovery catalog database

RMAN> create catalog;

recovery catalog created

RMAN> exit
Recovery Manager complete.

SQL> conn rman/passwd;
Connected.
SQL> select table_name from user_tables;

TABLE_NAME
------------------------------
DB
NODE
CONF
DBINC
CKP
TS
TSATT
DF
DFATT
TF
TFATT

TABLE_NAME
------------------------------
OFFR
RR
RT
ORL
RLH
AL
BS
BP
BCF
CCF
XCF

TABLE_NAME
------------------------------
BSF
BDF
CDF
XDF
BRL
BCB
CCB
SCR
SCRL
CONFIG
XAL

TABLE_NAME
------------------------------
RSR
FB
ROUT
RCVER

37 rows selected.

SQL> select view_name from user_views;

VIEW_NAME
------------------------------
RC_DATABASE
RC_DATABASE_INCARNATION
RC_RESYNC
RC_CHECKPOINT
RC_TABLESPACE
RC_DATAFILE
RC_TEMPFILE
RC_REDO_THREAD
RC_REDO_LOG
RC_LOG_HISTORY
RC_ARCHIVED_LOG

VIEW_NAME
------------------------------
RC_BACKUP_SET
RC_BACKUP_PIECE
RC_BACKUP_DATAFILE
RC_BACKUP_CONTROLFILE
RC_BACKUP_SPFILE
RC_DATAFILE_COPY
RC_CONTROLFILE_COPY
RC_BACKUP_REDOLOG
RC_BACKUP_CORRUPTION
RC_COPY_CORRUPTION
RC_OFFLINE_RANGE

VIEW_NAME
------------------------------
RC_STORED_SCRIPT
RC_STORED_SCRIPT_LINE
RC_PROXY_DATAFILE
RC_PROXY_CONTROLFILE
RC_RMAN_CONFIGURATION
RC_DATABASE_BLOCK_CORRUPTION
RC_PROXY_ARCHIVEDLOG
RC_RMAN_STATUS
RC_RMAN_OUTPUT
RC_BACKUP_FILES
RC_RMAN_BACKUP_SUBJOB_DETAILS

VIEW_NAME
------------------------------
RC_RMAN_BACKUP_JOB_DETAILS
RC_BACKUP_SET_DETAILS
RC_BACKUP_PIECE_DETAILS
RC_BACKUP_COPY_DETAILS
RC_PROXY_COPY_DETAILS
RC_PROXY_ARCHIVELOG_DETAILS
RC_BACKUP_DATAFILE_DETAILS
RC_BACKUP_CONTROLFILE_DETAILS
RC_BACKUP_ARCHIVELOG_DETAILS
RC_BACKUP_SPFILE_DETAILS
RC_BACKUP_SET_SUMMARY

VIEW_NAME
------------------------------
RC_BACKUP_DATAFILE_SUMMARY
RC_BACKUP_CONTROLFILE_SUMMARY
RC_BACKUP_ARCHIVELOG_SUMMARY
RC_BACKUP_SPFILE_SUMMARY
RC_BACKUP_COPY_SUMMARY
RC_PROXY_COPY_SUMMARY
RC_PROXY_ARCHIVELOG_SUMMARY
RC_UNUSABLE_BACKUPFILE_DETAILS
RC_RMAN_BACKUP_TYPE

53 rows selected.

SQL> select table_name from user_tables;

TABLE_NAME
------------------------------
DB
NODE
CONF
DBINC
CKP
TS
TSATT
DF
DFATT
TF
TFATT

TABLE_NAME
------------------------------
OFFR
RR
RT
ORL
RLH
AL
BS
BP
BCF
CCF
XCF

TABLE_NAME
------------------------------
BSF
BDF
CDF
XDF
BRL
BCB
CCB
SCR
SCRL
CONFIG
XAL

TABLE_NAME
------------------------------
RSR
FB
ROUT
RCVER

37 rows selected.

SQL> select view_name from user_views;

VIEW_NAME
------------------------------
RC_DATABASE
RC_DATABASE_INCARNATION
RC_RESYNC
RC_CHECKPOINT
RC_TABLESPACE
RC_DATAFILE
RC_TEMPFILE
RC_REDO_THREAD
RC_REDO_LOG
RC_LOG_HISTORY
RC_ARCHIVED_LOG

VIEW_NAME
------------------------------
RC_BACKUP_SET
RC_BACKUP_PIECE
RC_BACKUP_DATAFILE
RC_BACKUP_CONTROLFILE
RC_BACKUP_SPFILE
RC_DATAFILE_COPY
RC_CONTROLFILE_COPY
RC_BACKUP_REDOLOG
RC_BACKUP_CORRUPTION
RC_COPY_CORRUPTION
RC_OFFLINE_RANGE

VIEW_NAME
------------------------------
RC_STORED_SCRIPT
RC_STORED_SCRIPT_LINE
RC_PROXY_DATAFILE
RC_PROXY_CONTROLFILE
RC_RMAN_CONFIGURATION
RC_DATABASE_BLOCK_CORRUPTION
RC_PROXY_ARCHIVEDLOG
RC_RMAN_STATUS
RC_RMAN_OUTPUT
RC_BACKUP_FILES
RC_RMAN_BACKUP_SUBJOB_DETAILS

VIEW_NAME
------------------------------
RC_RMAN_BACKUP_JOB_DETAILS
RC_BACKUP_SET_DETAILS
RC_BACKUP_PIECE_DETAILS
RC_BACKUP_COPY_DETAILS
RC_PROXY_COPY_DETAILS
RC_PROXY_ARCHIVELOG_DETAILS
RC_BACKUP_DATAFILE_DETAILS
RC_BACKUP_CONTROLFILE_DETAILS
RC_BACKUP_ARCHIVELOG_DETAILS
RC_BACKUP_SPFILE_DETAILS
RC_BACKUP_SET_SUMMARY

VIEW_NAME
------------------------------
RC_BACKUP_DATAFILE_SUMMARY
RC_BACKUP_CONTROLFILE_SUMMARY
RC_BACKUP_ARCHIVELOG_SUMMARY
RC_BACKUP_SPFILE_SUMMARY
RC_BACKUP_COPY_SUMMARY
RC_PROXY_COPY_SUMMARY
RC_PROXY_ARCHIVELOG_SUMMARY
RC_UNUSABLE_BACKUPFILE_DETAILS
RC_RMAN_BACKUP_TYPE

53 rows selected.

SQL>


============

[oracle@localhost ~]$ rman catalog rman@LOVEU target /

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Mar 4 23:27:56 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: LOVEU (DBID=891266886)
recovery catalog database Password:
connected to recovery catalog database

RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

RMAN> report schema
2> ;

Report of database schema

List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 480 SYSTEM YES /u01/app/oracle/oradata/LOVEU/system01.d bf
2 30 UNDOTBS1 YES /u01/app/oracle/oradata/LOVEU/undotbs01. dbf
3 260 SYSAUX NO /u01/app/oracle/oradata/LOVEU/sysaux01.d bf
4 10 USERS NO /u01/app/oracle/oradata/LOVEU/users01.db f
5 100 UNDO1 YES /u01/app/oracle/oradata/LOVEU/undo1

List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 20 TEMP 32767 /u01/app/oracle/oradata/LOVEU/temp01 .dbf

RMAN> spool

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "newline": expecting one of: "log, msglog, trace"
RMAN-01007: at line 1 column 6 file: standard input

RMAN> show all;

RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/10.2.0/db_1/dbs/snapcf_LOVEU.f'; # default


RMAN> configure controlfile autobackup on;

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete


RMAN> backup database tag=FULL_BACKUP;

Starting backup at 05-MAR-08
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/LOVEU/system01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/LOVEU/sysaux01.dbf
input datafile fno=00005 name=/u01/app/oracle/oradata/LOVEU/undo1
input datafile fno=00002 name=/u01/app/oracle/oradata/LOVEU/undotbs01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/LOVEU/users01.dbf
channel ORA_DISK_1: starting piece 1 at 05-MAR-08
channel ORA_DISK_1: finished piece 1 at 05-MAR-08
piece handle=/u01/app/oracle/flash_recovery_area/LOVEU/backupset/2008_03_05/o1_mf_nnndf_FULL_BACKUP_3wtwqbn5_.bkp tag=FULL_BACKUP comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:36
Finished backup at 05-MAR-08

Starting Control File and SPFILE Autobackup at 05-MAR-08
piece handle=/u01/app/oracle/flash_recovery_area/LOVEU/autobackup/2008_03_05/o1_mf_s_648518730_3wtwtf0g_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 05-MAR-08

RMAN>




Posted in 实践所得 | Leave a comment

Oracle数据库静默安装实践

Oracle数据库静默安装实践
转自:http://www.oracle.com/technology/global/cn/pub/articles/10gdba/wininst_otn.html
作者:曲卓

2006 年 4 月 21 日
目录 前言
静默安装Oracle数据库10g篇
静默安装Oracle数据库9i篇
参考资料

前言

本文是作者进行Oracle数据库静默安装的实践过程记录及经验总结。其中10g的静默安装实践是在RHEL AS3U4上进行的,9i的静默安装实践是在Windows XP Professional(SP2)上进行的。9i的普通安装有3张光盘,Oracle专门为嵌入式安装定制了9i的一张安装光盘的版本9204e,可在OPN网站上下载该版本的安装文件。本文的9i安装实践所使用的版本即为9204e。

可通过本文了解Oracle数据库静默安装的主要步骤和过程,亦可将本文作为简明的静默安装指南进行参考。如果需要详细的静默安装过程和参数说明,请根据实际的操作系统和数据库版本参考OEIKit工具包中的相应文档。


返回主题列表
静默安装Oracle数据库10g篇

以下是在Linux系统上静默安装Oracle数据库10g的实践过程,主要分为以下两个步骤:

Step 1.静默安装Oracle数据库10g软件1.
使用OUI录制响应文件,记录安装过程

执行以下命令,然后在OUI中根据提示执行安装数据库软件的操作
$./runInstaller -record -destinationFile /tmp/install_database.rsp

注意:

录制过程中选择只安装数据库软件不创建数据库

当安装界面到达最后一步时选择cancel
2.
回放响应文件静默安装Oracle数据库软件

执行以下命令静默安装Oracle数据库软件

$./runInstaller -silent -responseFile /tmp/install_database.rsp

安装完成后执行以下脚本

#. $ORACLE_BASE/oraInventory/orainstRoot.sh
#. $ORACLE_HOME/root.sh


可选参数:

可使用$./runInstaller -help查看OUI的所有可选参数
举例:$./runInstaller -silent -force -ignoreSysprereqs ORACLE_HOME=/oracle ORACLE_HOME_NAME=OHOME_1 -responseFile /tmp/install_database.rsp
3.
静默卸载Oracle数据库软件

执行以下命令静默卸载Oracle数据库软件
$./runInstaller -silent -deinstall -removeallfiles -removeAllPatches "REMOVE_HOMES={$ORACLE_HOME}" -responseFile /tmp/install_database.rsp


Step 2.静默安装Oracle数据库1.
用DBCA创建一个种子数据库――ISV实际需要使用的数据库

(1) 创建初始数据库的时候选择Custom Database模板
(2) 建议使用File System存储机制
(3) 数据文件的存放地点建议选择

Use Oracle-Managed Files
Database Area: {ORACLE_BASE}/oradata


(4) 内存建议选择Custom,指定SGA和PGA大小
(5) 字符集根据实际需要设定
(6) 数据库创建选项里面选择Create Database
(7) 创建应用程序需要的表空间和用户,导入初始数据


2.
用DBCA根据种子数据库创建一个模板

(1) 启动DBCA,选择Manage Templates
(2) 按照提示创建一个模板
3.
将Oracle DB安装盘里面response目录下的dbca.rsp拷贝到本机上
4.
修改dbca.rsp文件,将模板名和DB名添加进去

GDBNAME=
SID=
TEMPLATENAME=
如果需要使用Oracle Enterprise Manager,则还需要修改以下参数如下:
EMCONFIGURATION="LOCAL"
SYSMANPASSWORD="password"
DBSNMPPASSWORD="password"
5.
执行以下命令使用DBCA根据模板创建新数据库

$./dbca -silent -createdatabase -responseFile /home/oracle/embed/dbca.rsp
6.
建议直接写.ora文件配置listener
7.
使用Netca配置listener的方法如下

(1) 将Oracle DB安装盘里面response目录下的netca.rsp拷贝到本机上
(2) 修改netca.rsp文件


INSTALL_TYPE=""custom""
LISTENER_NAMES={"LISTENER_EMBED"}
LISTENER_PROTOCOLS={"TCP;1521"}
LISTENER_START=""LISTENER_EMBED""


(3) 执行以下命令静默配置Listener
$./dbca /silent /responseFile /home/oracle/embed/netca.rsp




返回主题列表
静默安装Oracle数据库9i篇

以下是在Windows系统上静默安装Oracle数据库9204e的实践过程,主要分为以下三个步骤:

Step 1.静默安装Oracle数据库9i软件
Step 2.静默安装Oracle数据库
Step 3.静默升级ODBC Driver(可选)

Step 1.静默安装Oracle数据库9i软件1.
获取响应文件

(1)方法一:在$MountPoint/install目录下执行以下命令录制响应文件: setup.exe -record -destinationFile destinationFile.rsp

举例: D:SoftOracle_productrdbms_9204e_wininstall>setup.exe -record -destinationFile D:Tmpinstall_oracle.rsp

注意:

(1) 需要在录制好的响应文件中添加INSTALL_TYPE="EE"以指定安装oracle数据库企业版 (2) 需要在录制好的响应文件中更改以下参数为: ACCEPT_LICENSE_AGREEMENT=true

(2)方法二:根据实际需要修改$MountPoint/stage/Response/oracle.server.EE.rsp:

其中以下参数是需要根据实际情况设定的:

FROM_LOCATION="..stageproducts.xml"

FROM_LOCATION_CD_LABEL="LABEL1"

ORACLE_HOME= ORACLE_HOME_NAME="OHOME1"
2.
回放响应文件安装Oracle数据库软件

执行以下命令静默安装Oracle数据库软件 setup.exe -silent -responseFile responseFile Name

3.
静默卸载Oracle数据库软件

(1) 执行以下SQLPlus脚本关闭数据库:
shutdown immediate
exit;
(2) 停止Oracle服务
(3) 在$ORACLE_HOME/bin目录下执行以下命令删除Oracle数据库
oradim -delete -sid %MY_ORACLE_SID%
(4) 在OEIKit工具包的removeService.exe所在目录下执行以下命令删除Oracle网络服务
removeService Oracle%ORACLE_HOME_NAME%TNSListener
(5) 执行以下命令静默卸载Oracle数据库软件
setup.exe -noconsole -silent -deinstall -waitforcompletion -monitorFile %monitorFile% ORACLE_HOME=%MY_ORACLE_HOME% ORACLE_HOME_NAME=%ORACLE_HOME_NAME% REMOVE_HOMES="{"%MY_ORACLE_HOME%"}" -responseFile %responseFileDir%oracle9iserver_singlecd.rsp
举例:
D:SoftOracle_productrdbms_9204e_wininstall>setup.exe -noconsole -silent -deinstall -waitforcompletion ORACLE_HOME=d:OraHome_2 ORACLE_HOME_NAME=OUIHome2 REMOVE_HOMES="D:OraHome_2" -responseFile d:tmpinstall_test.rsp


Step 2.静默安装Oracle数据库1.
用DBCA创建一个种子数据库――ISV实际需要使用的数据库

(1) 创建初始数据库的时候选择Custom Database模板
(2) 字符集根据实际需要设定
(3) 数据库创建选项里面选择Create Database
(4) 创建应用程序需要的表空间和用户,导入初始数据
2.
2.2.2 DBCA根据种子数据库创建一个模板

(1) 启动DBCA,选择Manage Templates
(2) 按照提示创建一个模板
(3) 将创建好的模板文件(.dbc及.dfj)复制到%ORACLE_HOME%assistantsdbcatemplates
3.
执行以下命令使用DBCA根据模板创建新数据库

dbca -silent -createDatabase -templateName templateName -gdbname gdbname -sid sidName -sysPassword sysPassword -systemPassword systemPassword

举例:
D:OraHome_2BIN>dbca -silent -createDatabase -templateName test.dbc -gdbname "zesl.cn.oracle.com" -sid "zesl" -sysPassword "oracle" -systemPassword "oracle"

4.
建议直接写.ora文件配置listener
5.
使用Netca配置listener的方法同1.2.7


Step 3.静默升级ODBC Driver(可选)

Oracle DB 9204e Windows版安装完成后,ODBC Driver的版本是9.02.00.00,鉴于9.02.00.02版本中的一些优化,有些用户需要将ODBC Driver升级为9.02.00.02,以下是静默升级过程:

(1) 参考odbc.rsp创建一个响应文件,其中以下参数需要根据实际情况来设定: FROM_LOCATION,ORACLE_HOME,ORACLE_HOME_NAME;

(2) 使用以下命令启动OUI,指定使用这个响应文件来完成静默升级: setup.exe -silent -responseFile responseFile Name 举例: D:SoftOracle_productrdbms_9204e_wininstall>setup.exe -silent -responseFile D:SoftOracle_productODBCora9202odbc.rsp

(3) 9202ODBC driver 的下载地址http://www.oracle.com/technology/software/tech/windows/odbc/htdocs/utilsoft.html


返回主题列表
参考资料

(1) Website文件包
(2) OEIKit工具包



Posted in 未分类 | Leave a comment

How to activate the driver in JBuilder?




Today when I have finished the data source and trying  to connect oracle 9i with data pilot in JBuilder 2005.I found the data pilot can't find the oracle dirver or the characters "oracle.jdbc.driver.OracleDriver" are in red.

data pilot

Why? I have already added the class12.jar and class12.zip to the library on JBuilder.It 's very confused me. After I try a lot of methods,I made it.
data pilot works


hostname_sid   oracle data in data pilot



The solution is you should add the class12.jar in D:BorlandJBuilder2005jdk1.4jrelibext,then restart the data pilot.You will find the item of oralce is available now.
Then you can change the hostname  and the sid of you oracle database.then press ok.

Posted in 实践所得 | 1 Comment

Learning Logs

what I did tonight:
create a tablespace for a user and set it to default tablespace.

Enter user-name: system
Enter password: ********

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> conn milo/milo;
Connected.
SQL> create tablespace milo;
create tablespace milo
                     *
ERROR at line 1:
ORA-02199: missing DATAFILE/TEMPFILE clause

SQL> create tablespace milo datafile '/home/milo/datafile/milo.dbf'
  2  size  10M;
create tablespace milo datafile '/home/milo/datafile/milo.dbf'
*
ERROR at line 1:
ORA-01119: error in creating database file '/home/milo/datafile/milo.dbf'
ORA-27037: unable to obtain file status
Linux Error: 13: Permission denied
Additional information: 1

SQL> select tablespace_name,file_name from dba_data_files;

TABLESPACE_NAME
------------------------------
FILE_NAME
--------------------------------------------------------------------------------
USERS
/u01/app/oracle/oradata/LOVEU/users01.dbf

SYSAUX
/u01/app/oracle/oradata/LOVEU/sysaux01.dbf

UNDOTBS1
/u01/app/oracle/oradata/LOVEU/undotbs01.dbf

TABLESPACE_NAME
------------------------------
FILE_NAME
--------------------------------------------------------------------------------
SYSTEM
/u01/app/oracle/oradata/LOVEU/system01.dbf

SQL> create tablespace milo '/u01/app/oracle/oradata/LOVEU/milo.dbf' size 10M;
create tablespace milo '/u01/app/oracle/oradata/LOVEU/milo.dbf' size 10M
                       *
ERROR at line 1:
ORA-02180: invalid option for CREATE TABLESPACE

SQL> create tablespace milo datafile '/u01/app/oracle/oradata/LOVEU/milo.dbf' size 10M;

Tablespace created.

SQL> create tablespace snowball datafile '/home/oracle/snowball.dbf' size 10M;
Tablespace created.

SQL> alter user milo default tablespace milo;

User altered.

Posted in 未分类 | Leave a comment