Home | Mirror | Search | 雜文 | ITEYE 博客 | OSChina 博客 | 51CTO 博客

第 32 章 Manager

目錄

32.1. listener.ora
32.1.1. TNS 配置
32.1.1.1. 11gR2
32.2. Account
32.2.1. show user
32.2.2. DEFAULT_TABLESPACE
32.2.3. unlock/lock
32.3. 顯示表
32.4. oracle 817 script
32.5. Script for automatic startup on boot
32.6. Run level shell script to start Oracle 10g services on RedHat Enterprise Linux (RHAS 4)

32.1. listener.ora

		
[root@database ~]# cat /u01/app/oracle/product/10.2.0.1/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0.1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/app/oracle/product/10.2.0.1)
      (PROGRAM = extproc)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = database.example.com)(PORT = 1521))
    )
  )		
		
		

32.1.1. TNS 配置

tnsnames.ora 檔案預設在 network/admin/tnsnames.ora

有些情況如你沒有權限修改network/admin/tnsnames.ora, 你可以在$HOME下創建一個.tnsnames.ora檔案

		
oradb10g =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = db1.domain.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = oradb10g)
    )
  )

oradb =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = db2.domain.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = oradb)
    )
  )	
		
		

測試TNS

$ sqlplus user@oradb
		

32.1.1.1. 11gR2

ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.5)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl.example.com)
    )
  )
			

SERVICE_NAME通過show parameter service_name;查詢

comments powered by Disqus