公司最近正好搭建oracle服务器
- # 切换到 root用户
- su - root
- # 创建oraData目录用于存储Oracle数据文件
- mkdir /oraData
- # 授权给Oracle用户
- chown -R oracle:oinstall /oraData
- -- create temp tablespace
- CREATE TEMPORARY TABLESPACE ips_tmp
- TEMPFILE '/oraData/ips_temp01.dbf'
- SIZE 100M
- AUTOEXTEND ON
- NEXT 100M MAXSIZE 10240M
- EXTENT MANAGEMENT LOCAL;
- -- create data tablespace
- CREATE TABLESPACE ips_data
- LOGGING
- DATAFILE '/oraData/ips_data01.dbf'
- SIZE 200M
- AUTOEXTEND ON
- NEXT 200M MAXSIZE 20480M
- EXTENT MANAGEMENT LOCAL;
- -- create user to tablespeace
- CREATE USER hzsg IDENTIFIED BY rt345
- DEFAULT TABLESPACE ips_data
- TEMPORARY TABLESPACE ips_tmp;
- -- grant permissions to user
- GRANT CONNECT,RESOURCE TO hzsg;
- -- drop table space
- DROP TABLESPACE ips_tmp INCLUDING CONTENTS AND DATAFILES;
- -- add data file
- ALTER TABLESPACE ips_data
- ADD DATAFILE '/oraData/ips_data02.dbf' SIZE 500M;