ORACLE 11g 2 研究,redhat5.4

来源:互联网 发布:6s数据漫游要不要打开 编辑:程序博客网 时间:2024/05/29 19:59

1、安装oracle(参考官方英文文档)

安装的时候,把redhat5.4的版本号改为4.5

(root 权限登录,vi /etc/redhat-release)

SQLPLUS 登录

sqlplus /nolog

conn / as sysdba

 conn zkeco/zkeco2012

2、listener.ora

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST =localhost.domain)(PORT = 1521))
    )
  )

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = ORCL)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1/)
      (SID_NAME = ORCL)
    )
  )

ADR_BASE_LISTENER = /u01/app/oracle

tnsnames.ora :


LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.domain)(PORT = 1521))


ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.domain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ORCL)
    )
  )

/etc/host

127.0.0.1               test.localdomain test
192.168.10.178          localhost.domain localhost
::1             localhost6.localdomain6 localhost6

3、//创建临时表空间

create temporary tablespace test_temp
tempfile 'E:\oracle\product\10.2.0\oradata\testserver\test_temp01.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;

//创建数据表空间
create tablespace test_data
logging
datafile 'E:\oracle\product\10.2.0\oradata\testserver\test_data01.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;

//创建用户并指定表空间
create user user_test identified by 123456
default tablespace test_data
temporary tablespace test_temp;

//给用户授予权限

grant connect,resource to user_test;

//以后以该用户登录,创建的任何数据库对象都属于test_temp 和test_data表空间,这就不用在每创建一个对象给其指定表空间了。