Home | Mirror | Search

第 19 章 Manager

目錄

1. listener.ora
1.1. TNS 配置
1.1.1. 11gR2
2. Account
2.1. show user
2.2. DEFAULT_TABLESPACE
2.3. unlock/lock
3. 顯示表
4. oracle 817 script
5. Script for automatic startup on boot
6. Run level shell script to start Oracle 10g services on RedHat Enterprise Linux (RHAS 4)

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))
    )
  )		
		
		

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
		

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