oracle12c安裝,串連,使用等,oracle12c安裝

來源:互聯網
上載者:User

oracle12c安裝,串連,使用等,oracle12c安裝

1.  oracle12c的安裝

參照如下連結:

http://jingyan.baidu.com/article/f96699bbab21c0894e3c1bf8.html


2. 串連資料庫時,出現ORA-12514錯誤。

解決方案參考如下連結:

http://blog.sina.com.cn/s/blog_6f7b73770101b6l5.html

1)確保Oracle 基本服務都已啟動

    OracleDBConsoleorcl

    OracleOraDb11g_home1TNSListener

    OracleServiceORCL

2)開啟命令列,使用 sqlplus nokia_user/oracle@202.206.0.233/orcl 命令登入 oracle ,顯示如下:


C:\Documents and Settings\Administrator>sqlplus nokia_user/oracle@202.206.0.233/orcl

SQL*Plus: Release 11.2.0.1.0 Production on 星期五 12月 23 10:37:52 2011

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

ERROR:
ORA-12541: TNS: 無監聽程式

在ORA-12541: TNS: 無監聽程式 錯誤下,無論是否在本地登入都是會提示ORA-12541: TNS: 無監聽程式錯誤的

3)在命令列中,執行lsnrctl status

C:\Documents and Settings\Administrator>lsnrctl status

LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 23-12月-2011 09:27:35

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

正在串連到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
LISTENER 的 STATUS
------------------------
別名                      LISTENER
版本                      TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
啟動日期                  23-12月-2011 09:17:19
正常已耗用時間              0 天 0 小時 10 分 16 秒
追蹤層級                  off
安全性                    ON: Local OS Authentication
SNMP                      OFF
監聽程式參數檔案         C:\Program_Files\Oracle\DataBase_11G_R2\product\11.2.0\dbhome_1\network\admin\listener.ora
監聽程式記錄檔          c:\program_files\oracle\database_11g_r2\diag\tnslsnr\dbserver-7ec4a9\listener\alert\log.xml
監聽端點概要...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
服務摘要..
服務 "CLRExtProc" 包含 1 個執行個體。
  執行個體 "CLRExtProc", 狀態 UNKNOWN, 包含此服務的 1 個處理常式...
服務 "orcl" 包含 1 個執行個體。
  執行個體 "orcl", 狀態 READY, 包含此服務的 1 個處理常式...
服務 "orclXDB" 包含 1 個執行個體。
  執行個體 "orcl", 狀態 READY, 包含此服務的 1 個處理常式...
命令執行成功

在這裡可以看到監聽程式參數檔案的位置


4)修改監聽程式參數檔案

初次開啟時,內容如下

# listener.ora Network Configuration File: C:\Program_Files\Oracle\DataBase_11G_R2\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\Program_Files\Oracle\DataBase_11G_R2\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:C:\Program_Files\Oracle\DataBase_11G_R2\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST =localhost)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = C:\Program_Files\Oracle\DataBase_11G_R2

修改為:

# listener.ora Network Configuration File: C:\Program_Files\Oracle\DataBase_11G_R2\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = orcl)
      (ORACLE_HOME = C:\Program_Files\Oracle\DataBase_11G_R2\product\11.2.0\dbhome_1)
      #(PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:C:\Program_Files\Oracle\DataBase_11G_R2\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = orcl))
      (ADDRESS = (PROTOCOL = TCP)(HOST =202.206.0.233)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = C:\Program_Files\Oracle\DataBase_11G_R2

SID_NAME,KEY 的值修改為要訪問的oracle執行個體的名稱,HOST 修為 oracle 伺服器使用的地址


5)重啟listener,在命令列中依次執行 lsnrctl stop,lsnrctl start

C:\Documents and Settings\Administrator>lsnrctl stop

LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 23-12月-2011 09:46:17

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

正在串連到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=orcl)))
TNS-12541: TNS: 無監聽程式
 TNS-12560: TNS: 協議適配器錯誤
  TNS-00511: 無監聽程式
   32-bit Windows Error: 2: No such file or directory
正在串連到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=202.206.0.233)(PORT=1521)))
命令執行成功

C:\Documents and Settings\Administrator>lsnrctl start

LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 23-12月-2011 09:46:31

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

啟動tnslsnr: 請稍候...

TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
系統參數檔案為C:\Program_Files\Oracle\DataBase_11G_R2\product\11.2.0\dbhome_1\network\admin\listener.ora
寫入c:\program_files\oracle\database_11g_r2\diag\tnslsnr\dbserver-7ec4a9\listener\alert\log.xml的日誌資訊
監聽: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\orclipc)))
監聽: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=202.206.0.233)(PORT=1521)))

正在串連到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=orcl)))
LISTENER 的 STATUS
------------------------
別名                      LISTENER
版本                      TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
啟動日期                  23-12月-2011 09:46:34
正常已耗用時間              0 天 0 小時 0 分 3 秒
追蹤層級                  off
安全性                    ON: Local OS Authentication
SNMP                      OFF
監聽程式參數檔案         C:\Program_Files\Oracle\DataBase_11G_R2\product\11.2.0\dbhome_1\network\admin\listener.ora
監聽程式記錄檔          c:\program_files\oracle\database_11g_r2\diag\tnslsnr\dbserver-7ec4a9\listener\alert\log.xml
監聽端點概要...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\orclipc)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=202.206.0.233)(PORT=1521)))
服務摘要..
服務 "orcl" 包含 1 個執行個體。
  執行個體 "orcl", 狀態 UNKNOWN, 包含此服務的 1 個處理常式...
命令執行成功

6)查看狀態 lsnrctl start

C:\Documents and Settings\Administrator>lsnrctl start

LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 23-12月-2011 09:46:31

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

啟動tnslsnr: 請稍候...

TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
系統參數檔案為C:\Program_Files\Oracle\DataBase_11G_R2\product\11.2.0\dbhome_1\network\admin\listener.ora
寫入c:\program_files\oracle\database_11g_r2\diag\tnslsnr\dbserver-7ec4a9\listener\alert\log.xml的日誌資訊
監聽: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\orclipc)))
監聽: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=202.206.0.233)(PORT=1521)))

正在串連到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=orcl)))
LISTENER 的 STATUS
------------------------
別名                      LISTENER
版本                      TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
啟動日期                  23-12月-2011 09:46:34
正常已耗用時間              0 天 0 小時 0 分 3 秒
追蹤層級                  off
安全性                    ON: Local OS Authentication
SNMP                      OFF
監聽程式參數檔案         C:\Program_Files\Oracle\DataBase_11G_R2\product\11.2.0\dbhome_1\network\admin\listener.ora
監聽程式記錄檔          c:\program_files\oracle\database_11g_r2\diag\tnslsnr\dbserver-7ec4a9\listener\alert\log.xml
監聽端點概要...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\orclipc)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=202.206.0.233)(PORT=1521)))
服務摘要..
服務 "orcl" 包含 1 個執行個體。
  執行個體 "orcl", 狀態 UNKNOWN, 包含此服務的 1 個處理常式...
命令執行成功

7)再次登入 sqlplus nokia_user/oracle@202.206.0.233/orcl

C:\Documents and Settings\Administrator>sqlplus nokia_user/oracle@202.206.0.233/orcl

SQL*Plus: Release 11.2.0.1.0 Production on 星期五 12月 23 11:06:28 2011

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


串連到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

出現上面資訊說明登入成功


3. 如果要使用VS連攜技能,即DDEX技能,需安裝

Oracle Developer Tools for Visual Studio xxxxxx組件,此組件在Oracle搜尋ODT找到,例以下連結中的軟體。

http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html


4. TNS形式的DataSource的建立:

 在
xx\product\12.1.0\client_1\Network\Admin下tnsnames.ora中添加。例:


oracle12c =
   (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 193.160.18.91)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl) 
    )
  )

ODTwithODAC121021.zip

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.