命令列建庫Oracle11.2.0.1 for RHEL5 x86_64

cow977發表於2011-12-20

參考:http://yangtingkun.itpub.net/post/468/514506

 

測試一下dbcasilent建庫。不用GUI,直接透過命令列來建庫,對遠端維護ORACLE資料庫也會有用處的,特別是一些要透過中間跳轉的Oracle資料庫伺服器的維護。

下面開始,先編輯responseFile檔案Demo.create.txt如下:

[GENERAL]

RESPONSEFILE_VERSION = "11.2.0"

OPERATION_TYPE = "createDatabase"

[CREATEDATABASE]

GDBNAME = "DEMODB"

SID = "demodb"

TEMPLATENAME = "New_Database.dbt"

SYSPASSWORD = "demodb"

SYSTEMPASSWORD = "demodb"

SYSMANPASSWORD = "demodb"

DBSNMPPASSWORD = "demodb"

DATAFILEDESTINATION ="/home/oracle/oradata"

STORAGETYPE=FS

CHARACTERSET = "ZHS16GBK"

DATABASETYPE = "MULTIPURPOSE"

AUTOMATICMEMORYMANAGEMENT = "FALSE"

然後利用silent模式建立資料庫:

[oracle@Oracle111 ~]$ dbca -silent -responseFile Demo.create.txt

Creating and starting Oracle instance

1% complete

3% complete

Creating database files

4% complete

7% complete

Creating data dictionary views

8% complete

9% complete

10% complete

11% complete

12% complete

13% complete

14% complete

16% complete

17% complete

18% complete

19% complete

Adding Oracle JVM

25% complete

30% complete

36% complete

38% complete

Adding Oracle Text

40% complete

41% complete

Adding Oracle XML DB

43% complete

44% complete

45% complete

46% complete

47% complete

48% complete

49% complete

Adding Oracle Multimedia

50% complete

51% complete

60% complete

Adding Oracle OLAP

61% complete

62% complete

63% complete

64% complete

Adding Oracle Spatial

65% complete

66% complete

67% complete

71% complete

Adding Enterprise Manager Repository

73% complete

75% complete

Adding Oracle Application Express

78% complete

82% complete

Adding Oracle Warehouse Builder

86% complete

90% complete

Completing Database Creation

91% complete

92% complete

93% complete

96% complete

100% complete

Look at the log file "/home/oracle/cfgtoollogs/dbca/DEMODB/DEMODB.log" for further details.

安裝過程一切順利,檢查資料庫安裝情況:

[oracle@rhel5 ~]$ export ORACLE_SID=demodb

[oracle@rhel5 ~]$ sqlplus /nolog

 

SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 27 15:03:51 2011

 

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

 

SQL> conn / as sysdba

Connected.

SQL> select * from v$instance;

 

INSTANCE_NUMBER INSTANCE_NAME

--------------- ----------------

HOST_NAME

----------------------------------------------------------------

VERSION           STARTUP_T STATUS       PAR    THREAD# ARCHIVE LOG_SWITCH_WAIT

----------------- --------- ------------ --- ---------- ------- ---------------

LOGINS     SHU DATABASE_STATUS   INSTANCE_ROLE      ACTIVE_ST BLO

---------- --- ----------------- ------------------ --------- ---

              1 demodb

rhel5

11.2.0.1.0        27-DEC-11 OPEN         NO           1 STOPPED

ALLOWED    NO  ACTIVE            PRIMARY_INSTANCE   NORMAL    NO

 

SQL> select * from v$version;

 

BANNER

------------------------------------------------------------------------

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

PL/SQL Release 11.2.0.1.0 - Production

CORE    11.2.0.1.0      Production

TNS for Linux: Version 11.2.0.1.0 - Production

NLSRTL Version 11.2.0.1.0 – Production

 

SQL> select name, open_mode from v$database;

 

NAME      OPEN_MODE

--------- --------------------

DEMODB    READ WRITE

 

 

[oracle@rhel5 ~]$ lsnrctl status

 

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 27-DEC-2011 15:20:28

 

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rhel5)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production

Start Date                08-DEC-2011 16:38:28

Uptime                    18 days 22 hr. 42 min. 0 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /home/oracle/product/11.2/db_1/network/admin/listener.ora

Listener Log File         /home/oracle/diag/tnslsnr/rhel5/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rhel5)(PORT=1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))

Services Summary...

Service "PLSExtProc" has 1 instance(s).

  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...

Service "demodb" has 1 instance(s).

  Instance "demodb", status READY, has 1 handler(s) for this service...

Service "demodbXDB" has 1 instance(s).

  Instance "demodb", status READY, has 1 handler(s) for this service...

The command completed successfully

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/81227/viewspace-714042/,如需轉載,請註明出處,否則將追究法律責任。

相關文章