分享更有价值
被信任是一种快乐

Oracle扩充磁盘空间的方法是什么

文章页正文上

本篇内容介绍了“Oracle扩充磁盘空间的方法是什么”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!Oracle 扩充磁盘空间环境:OS:Oracle Linux Server release 6.3DB:Oracle 11.2.0.4.0问题:根目录磁盘空间不足,还剩6.5G解决办法:扩容磁盘空间;由于安装操作系统时没有使用LVM,不能直接扩容根目录,并且磁盘上的数据库相关文件不能删除;可以添加新盘,并将数据库文件迁移到新盘上;1 查看数据库相关文件均在/u01目录下[root@cjc ~]# cat /home/oracle/.bash_profile……export ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1……SQL> select file_name from dba_data_files;FILE_NAME——————————————————————————–/u01/app/oracle/oradata/dapuchai/users01.dbf/u01/app/oracle/oradata/dapuchai/undotbs01.dbf/u01/app/oracle/oradata/dapuchai/sysaux01.dbf/u01/app/oracle/oradata/dapuchai/system01.dbf/u01/app/oracle/oradata/dapuchai/cjc_tbs01a.dbf/u01/app/oracle/oradata/dapuchai/ogg_tbs01.dbf6 rows selected.2 Linux 添加新分区—关机添加100G磁盘,/dev/sdb[root@dapuchai ~]# df -hFilesystem Size Used Avail Use% Mounted on/dev/sda3 28G 20G 6.5G 76% /tmpfs 1004M 239M 765M 24% /dev/shm/dev/sda1 194M 51M 134M 28% /boot[root@cjc ~]# fdisk -lDisk /dev/sda: 32.2 GB, 32212254720 bytes255 heads, 63 sectors/track, 3916 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x000ccbd2 Device Boot Start End Blocks Id System/dev/sda1 * 1 26 204800 83 LinuxPartition 1 does not end on cylinder boundary./dev/sda2 26 287 2097152 82 Linux swap / SolarisPartition 2 does not end on cylinder boundary./dev/sda3 287 3917 29154304 83 LinuxDisk /dev/sdb: 107.4 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x000000003 分区/dev/sdb1[root@cjc ~]# fdisk /dev/sdbDevice contains neither a valid 免费主机域名DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel with disk identifier 0xf58baf0e.Changes will remain in memory only, until you decide to write them.After that, of course, the previous content won’t be recoverable.Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)WARNING: DOS-compatible mode is deprecated. It’s strongly recommended to switch off the mode (command ‘c’) and change display units to sectors (command ‘u’).Command (m for help):
p —查看Disk /dev/sdb: 107.4 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0xf58baf0e Device Boot Start End Blocks Id SystemCommand (m for help):
n —新增Command action e extended p primary partition (1-4)pPartition number (1-4):Value out of range.Partition number (1-4):
1First cylinder (1-13054, default 1):Using default value 1Last cylinder, +cylinders or +size{K,M,G} (1-13054, default 13054):Using default value 13054Command (m for help): pDisk /dev/sdb: 107.4 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0xf58baf0e Device Boot Start End Blocks Id System/dev/sdb1 1 13054 104856223+ 83 LinuxCommand (m for help): w —写入 保存The partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.[root@cjc ~]# fdisk -lDisk /dev/sda: 32.2 GB, 32212254720 bytes255 heads, 63 sectors/track, 3916 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x000ccbd2 Device Boot Start End Blocks Id System/dev/sda1 * 1 26 204800 83 LinuxPartition 1 does not end on cylinder boundary./dev/sda2 26 287 2097152 82 Linux swap / SolarisPartition 2 does not end on cylinder boundary./dev/sda3 287 3917 29154304 83 LinuxDisk /dev/sdb: 107.4 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0xf58baf0e Device Boot Start End Blocks Id System/dev/sdb1 1 13054 104856223+ 83 Linux4 格式化[root@cjc ~]# mkfs -t ext4 /dev/sdb1mke2fs 1.41.12 (17-May-2010)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)Stride=0 blocks, Stripe width=0 blocks6553600 inodes, 26214055 blocks1310702 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=4294967296800 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks:32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,4096000, 7962624, 11239424, 20480000, 23887872Writing inode tables: done Creating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 21 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.5 挂载[root@cjc ~]# mkdir /u02[root@cjc ~]# mount /dev/sdb1 /u02[root@cjc ~]# df -hFilesystem Size Used Avail Use% Mounted on/dev/sda3 28G 20G 6.5G 76% /tmpfs 1004M 88K 1004M 1% /dev/shm/dev/sda1 194M 51M 134M 28% /boot/dev/sdb1 99G 188M 94G 1% /u026 迁移/u01到新加的盘[root@cjc ~]# mv /u01 /u03[root@cjc ~]# mv /u02 /u01mv: cannot move `/u02′ to `/u01′: Device or resource busy[root@cjc ~]# umount /u02[root@cjc ~]# mv /u02 /u01[root@cjc ~]# mount /dev/sdb1 /u01[root@cjc ~]# mv /u03/* /u01[root@cjc ~]# df -hFilesystem Size Used Avail Use% Mounted on/dev/sda3 28G 14G 13G 54% /tmpfs 1004M 88K 1004M 1% /dev/shm/dev/sda1 194M 51M 134M 28% /boot/dev/sdb1 99G 6.0G 88G 7% /u01[root@cjc /]# lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsr0 11:0 1 1024M 0 romsr1 11:1 1 1024M 0 romsda 8:0 0 30G 0 disk├─sda1 8:1 0 200M 0 part /boot├─sda2 8:2 0 2G 0 part [SWAP]└─sda3 8:3 0 27.8G 0 part /sdb 8:16 0 100G 0 disk└─sdb1 8:17 0 100G 0 part /u017 添加自动挂载[root@cjc ~]# vi /etc/fstab……/dev/sdb1 /u01 ext4 defaults 0 08 启动数据库[root@cjc ~]# su免费主机域名 – oracle[oracle@cjc ~]$ lsnrctl start[oracle@cjc ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Sat Jan 11 15:00:47 2020Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to an idle instance.SQL> startupORACLE instance started.Total System Global Area 839282688 bytesFixed Size
2257880 bytesVariable Size
541068328 bytesDatabase Buffers
289406976 bytesRedo Buffers
6549504 bytesDatabase mounted.Database opened.SQL> conn cjcEnter password:Connected.SQL> select count(*) from t1; COUNT(*)“Oracle扩充磁盘空间的方法是什么”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注云技术网站,小编将为大家输出更多高质量的实用文章!

相关推荐: 怎么判断和修改SQL中的动态参数与静态参数

本篇内容主要讲解“怎么判断和修改SQL中的动态参数与静态参数”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“怎么判断和修改SQL中的动态参数与静态参数”吧!视图 v$parameter 中 ISSYS_MODIFIA…

文章页内容下
赞(0) 打赏
版权声明:本站采用知识共享、学习交流,不允许用于商业用途;文章由发布者自行承担一切责任,与本站无关。
文章页正文下
文章页评论上

云服务器、web空间可免费试用

宝塔面板主机、支持php,mysql等,SSL部署;安全高速企业专供99.999%稳定,另有高防主机、不限制内容等类型,具体可咨询QQ:360163164,Tel同微信:18905205712

主机选购导航云服务器试用

登录

找回密码

注册