暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

某业务系统oracle建表空间

原创 一个老兵 2024-05-07
61

1. 登录操作说明
    ORA数据库:

    set ORACLE_SID=ora

    sqlplus / as sysdba

    切换数据库:

    set ORACLE_SID=pi

    sqlplus / as sysdba

2. 本地登录步骤
    通过命令行运行窗口:

    C:\Users\Administrator>

    设置环境变量

    C:\Users\Administrator>set ORACLE_SID=“指定数据库SID”

    sqlplus / as sysdba

    登陆数据库

    C:\Users\Administrator>sqlplus / as sysdba

3. 查看当前数据库:

    show parameter name

4.  取消密码限制:

    alter profile default 1imit password_life_time unlimited;

5. 查看是否修改成功

     select resource_name,limit from dba_profiles where profile'DEFAULT' and resource_name’=PASSWORD_LIFE_TINE';

6. 表空间扩容、创建表空间

    ORA:

    查看表空间数据文件及大小:

    select tablespace_name,file_id,file_name,bytes/1024/1024 from dba_data_files;

    对现有表空间扩容:

    alter database datafile 'z:\ORADATA\ORA\UNDOTBS1.DBF' resize 2048m;

    alter database datafile 'z:\ORADATA\ORA\SYSTEMO1. DBF' resize 4096m;

    alter database datafile  'z:\ORADATA\ORA\SYSAUX01.DBF’ resize 2048m;

    查看临时表空间

    select tablespace_name,file_id,file_name,bytes/1024/1024 from dba_temp_files;

    对现有临时表空间扩容:

    alter database tempfile 'z:\ORADATA\ORA\TEMP01.DBF' resize 2048m;

    创建表空间:(语句中size和maxsize 根据要求设置,autoextend on代表自动扩展,如果不用自动扩展,可以不要autoextend on和maxsize)

    create tablespace newapp datafile 'z:\ORADATA\ORA\NEWAPPO.DBF size 2g autoextend on maxsize 20g;

    create tablespace newapp_index datafil 'z:\ORADATA\ORA\NEVAPP_INDEXO.DBF size 1g autoextend on maxsize 20g;

    create tablespace angel datatile 'z:\ORADATA\ORA\ANGELO01.DBF size 1g autoextend on maxsize 20g;

    创建临时表空间

    create temporary tablespace newapp_temp tempfile 'Z:\ORADATA\ORAAPP\NEWAPP_TEMP01.DBF size 1g autoextend on maxsize 20g;

    PI:

    系统表空间扩容:

    alter database datafile 'z:\PI\SYSTEM01.DBF' RESIZE 4G;

    alter database datafile 'z:\PI\SYSAUX01.DBF' RESIZE 2G;

    alter database datafile 'z:\PI\UNDOTBS01.DBF' RESIZE 2G;

    alter database datafile 'z:\PI\TEMP01.DBF' RESIZE 2G;

    创建表空间:

     create temporary tablespace pi_local_temp tempfile 'z:\PI\pi_1ocal_temp01.DBF’ size 5g autoextend on maxsize 10g;

    create bigfile tablespace pi_local_dat_datafile 'z\PI\PI_LOCAL_DATA01.DBF' size 10g autoextend on; maxsize 40G; 

    create bigfile tablespace pi_local_IDX datafile 'z:\PI\PI_LOCAL_IDX01.DBF' size 5G autoextend on; maxsize 10G; 

    create bigfile tablespace pi_local_HISTORY_DAT datafile 'z\PI\PI_LOCAL_HISTORY DAT01.DBF' size 10g autoextend on; maxsize 30G; 

    create bigtile tablespace pi_local_HISTORY_IDX datafile 'z\PI\PI_LOCAL_HISTORY_IDX01.DBF' size 5G autoextend on; maxsize 10G;


        

     

     

     

     
















「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论