asm 降级实验

--降级实验
--1 环境确认
[grid@localhost ~]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 15 11:24:32 2015


Copyright (c) 1982, 2013, Oracle.  All rights reserved.




Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Automatic Storage Management option


SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Automatic Storage Management option
[grid@localhost ~]$ asmcmd
ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  1048576     20473    17502                0           17502              0             N  DG1/
ASMCMD> 


--2 关闭服务
[grid@localhost ~]$ crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'localhost'
CRS-2673: Attempting to stop 'ora.DG1.dg' on 'localhost'
CRS-2677: Stop of 'ora.DG1.dg' on 'localhost' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'localhost'
CRS-2677: Stop of 'ora.asm' on 'localhost' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'localhost'
CRS-2677: Stop of 'ora.cssd' on 'localhost' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'localhost'
CRS-2677: Stop of 'ora.evmd' on 'localhost' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'localhost' has completed
CRS-4133: Oracle High Availability Services has been stopped.




--卸载集群【命令清楚集群信息】
[root@localhost ~]# /app/app/11.2.0/grid_1/crs/install/rootcrs.pl -verbose -deconfig -force 
Using configuration parameter file: /app/app/11.2.0/grid_1/crs/install/crsconfig_params
Usage: srvctl <command> <object> [<options>]
    commands: enable|disable|start|stop|status|add|remove|modify|getenv|setenv|unsetenv|config|upgrade
    objects: database|service|asm|diskgroup|listener|home|ons
For detailed help on each command and object and its options use:
  srvctl <command> -h or
  srvctl <command> <object> -h
PRKO-2012 : nodeapps object is not supported in Oracle Restart
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Stop failed, or completed with errors.
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Modify failed, or completed with errors.
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Delete failed, or completed with errors.
CRS-4013: This command is not supported in a single-node configuration.
CRS-4000: Command Stop failed, or completed with errors.
################################################################
# You must kill processes or reboot the system to properly #
# cleanup the processes started by Oracle clusterware          #
################################################################
error: package cvuqdisk is not installed
Successfully deconfigured Oracle clusterware stack on this node
[root@localhost ~]# reboot
Broadcast message from root (pts/1) (Mon Jun 15 11:31:48 2015):
The system is going down for reboot NOW!
[root@localhost ~]#   




--恢复还原11g gi
[root@localhost ~]# /app/app/grid/product/11.2.0/root.sh
Running Oracle 11g root.sh script...


The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /app/app/grid/product/11.2.0


Enter the full pathname of the local bin directory: [/usr/local/bin]: 
The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n) 
[n]: y
   Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n) 
[n]: y
   Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n) 
[n]: y
   Copying coraenv to /usr/local/bin ...


Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
/app/app/grid/product/11.2.0/perl/bin/perl -I/app/app/grid/product/11.2.0/perl/lib -I/app/app/grid/product/11.2.0/crs/install /app/app/grid/product/11.2.0/crs/install/roothas.pl




To configure Grid Infrastructure for a Cluster perform the following steps:
1. Provide values for Grid Infrastructure configuration parameters in the file - /app/app/grid/product/11.2.0/crs/install/crsconfig_params. For details on how to do this, see the installation guide. 
2. Run the following command as the root user:
 /app/app/grid/product/11.2.0/perl/bin/perl -I/app/app/grid/product/11.2.0/perl/lib -I/app/app/grid/product/11.2.0/crs/install /app/app/grid/product/11.2.0/crs/install/rootcrs.pl
To update inventory properties for Grid Infrastructure, perform the following
steps. If a pre-11.2 home is already configured, execute the following:
11.2_Home/oui/bin/runInstaller -updateNodeList -silent -local CRS=false ORACLE_HOME=pre-11.2_Home
Always execute the following to register the current home:
11.2_Home/oui/bin/runInstaller -updateNodeList -silent -local CRS=true ORACLE_HOME=11.2_Home.
If either home is shared, provide the additional argument -cfs.
[root@localhost ~]# /app/app/grid/product/11.2.0/perl/bin/perl -I/app/app/grid/product/11.2.0/perl/lib -I/app/app/grid/product/11.2.0/crs/install /app/app/grid/product/11.2.0/crs/install/roothas.pl
2015-06-15 11:36:07: Checking for super user privileges
2015-06-15 11:36:07: User has super user privileges
2015-06-15 11:36:07: Parsing the host name
Using configuration parameter file: /app/app/grid/product/11.2.0/crs/install/crsconfig_params
LOCAL ADD MODE 
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
CRS-4664: Node localhost successfully pinned.
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting
ADVM/ACFS is not supported on oraclelinux-release-5-7.0.2




localhost     2015/06/15 11:36:37     /app/app/grid/product/11.2.0/cdata/localhost/backup_20150615_113637.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server


--查看验证
[grid@localhost ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.cssd       ora.cssd.type  OFFLINE   OFFLINE               
ora.diskmon    ora....on.type OFFLINE   OFFLINE               
[grid@localhost ~]$ srvctl add asm
[grid@localhost ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.asm        ora.asm.type   OFFLINE   OFFLINE               
ora.cssd       ora.cssd.type  OFFLINE   OFFLINE               
ora.diskmon    ora....on.type OFFLINE   OFFLINE               
[grid@localhost ~]$ srvctl start asm 
[grid@localhost ~]$ ps -ef|grep asm
grid      4960     1  0 11:41 ?        00:00:00 asm_pmon_+ASM
grid      4964     1  0 11:41 ?        00:00:00 asm_vktm_+ASM
grid      4970     1  0 11:41 ?        00:00:00 asm_gen0_+ASM
grid      4974     1  0 11:41 ?        00:00:00 asm_diag_+ASM
grid      4978     1  0 11:41 ?        00:00:00 asm_psp0_+ASM
grid      4982     1  0 11:41 ?        00:00:00 asm_dia0_+ASM
grid      4986     1  0 11:41 ?        00:00:00 asm_mman_+ASM
grid      4990     1  0 11:41 ?        00:00:00 asm_dbw0_+ASM
grid      4994     1  0 11:41 ?        00:00:00 asm_lgwr_+ASM
grid      4998     1  0 11:41 ?        00:00:00 asm_ckpt_+ASM
grid      5002     1  0 11:41 ?        00:00:00 asm_smon_+ASM
grid      5006     1  0 11:41 ?        00:00:00 asm_rbal_+ASM
grid      5010     1  0 11:41 ?        00:00:00 asm_gmon_+ASM
grid      5014     1  0 11:41 ?        00:00:00 asm_mmon_+ASM
grid      5018     1  0 11:41 ?        00:00:00 asm_mmnl_+ASM
grid      5035  4646  0 11:41 pts/1    00:00:00 grep asm
[grid@localhost ~]$ asmcmd
ASMCMD> lsdg
ASMCMD> 




--asmca 添加dg


ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  1048576     20473    17502                0           17502              0             N  DG1/
ASMCMD> 




总结:升级的时候对asm底层修改 并不是很大...


基于安全要求,我还是决定备份元数据信息*****
ASMCMD> md_backup /tmp/oradgbackup20110322


[grid@localhost ~]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 15 11:45:07 2015


Copyright (c) 1982, 2009, Oracle.  All rights reserved.




Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Automatic Storage Management option


SQL> 
<think>我们正在解决一个具体问题:在VMware上基于CentOS7搭建Linux0.11环境。Linux0.11是一个非常古老的内核版本,因此我们需要一个兼容的编译环境。通常,我们会选择较旧的Linux发行版(如RedHat9.0)来编译,但用户要求使用CentOS7。CentOS7相对较新,因此我们需要做一些调整。参考引用[2]中提到,在VMware中安装RedHat9.0并制作Docker镜像,但用户希望用CentOS7。我们可以尝试在CentOS7上构建一个类似RedHat9.0的编译环境。步骤概述:1.准备VMware虚拟机,安装CentOS7。2.安装必要的开发工具和库。3.获取Linux0.11源码。4.修改Makefile或源码以适应CentOS7的环境(因为gcc版本过高,可能需要降级或调整编译选项)。5.编译Linux0.11内核。详细步骤:1.**创建VMware虚拟机并安装CentOS7**-下载CentOS7镜像(例如从阿里云镜像站:https://mirrors.aliyun.com/centos/7/isos/x86_64/)-在VMware中创建新的虚拟机,选择CentOS7镜像,完成安装。建议最小化安装,然后安装开发工具。2.**安装基础开发环境**-安装必要的软件包:```bashsudoyumgroupinstall"DevelopmentTools"sudoyuminstallncurses-develbisonflexelfutils-libelf-devel```-由于Linux0.11需要较老的编译器,我们可能需要安装较旧版本的gcc。但CentOS7默认的gcc版本是4.8.5,已经比Linux0.11所需的版本(如gcc2.x)高很多。因此,我们需要调整编译选项或使用兼容模式。3.**获取Linux0.11源码**-可以从官方或镜像站点下载,例如:```bashwgethttps://mirrors.edge.kernel.org/pub/linux/kernel/Historic/linux-0.11.tar.gztarzxvflinux-0.11.tar.gzcdlinux-0.11```4.**调整编译环境**-由于gcc版本过高,直接编译会报错。我们可以尝试修改Makefile来降低警告和错误级别,或者使用特定的编译选项。-常见的做法是修改Makefile中的CFLAGS,添加`-fno-stack-protector-m32-fno-builtin`等选项,以规避高版本gcc的安全特性。-另外,可能需要修改源码中的一些头文件引用和函数声明。5.**编译**-在源码目录下执行:```bashmake```-如果遇到错误,根据错误信息进行修改。常见的错误包括:-缺少头文件:可以创建对应的符号链接或从其他位置复制。-函数未声明:在源码中添加函数声明。-类型不匹配:修改源码中的类型。6.**运行**-编译成功后,会生成一个名为`Image`的内核映像文件。-我们可以使用Bochs或QEMU来运行这个内核。在CentOS7上安装QEMU:```bashsudoyuminstallqemu```-然后使用QEMU运行:```bashqemu-system-i386-kernelarch/i386/boot/Image```由于在较新的系统上编译旧内核存在挑战,如果遇到难以解决的问题,也可以考虑在CentOS7虚拟机中再创建一个Docker容器,容器内使用较旧的环境(如引用[2]中提到的RedHat9.0的Docker镜像)进行编译。另一种方法是使用现成的编译环境,例如从网上下载已经配置好的Docker镜像(如引用[2]中提到的`yy20190811/rh9:1.00`),然后在CentOS7上运行Docker容器进行编译。因此,我们提供两种方案:方案一:直接在CentOS7上编译(可能需要较多调整)方案二:在CentOS7上安装Docker,然后使用旧版编译环境的Docker镜像这里我们先给出方案一的步骤,如果方案一遇到困难再考虑方案二。由于时间有限,我们无法预测所有错误,但以下是一个常见的调整示例:在编译Linux0.11时,可能会遇到`asm/segment.h`文件找不到的问题。这是因为高版本内核的头文件结构发生了变化。我们可以尝试:```bashmkdirasmln-s/usr/include/asm-genericasm```另一个常见错误是`gcc:error:unrecognizedcommandlineoption‘-fno-stack-protector’`,这是因为旧版gcc没有这个选项,但在CentOS7的gcc4.8.5中是有这个选项的,所以这个错误可能不会出现。如果出现,可以去掉这个选项。考虑到上述步骤的复杂性,对于初学者,推荐使用Docker方案(方案二)可能更简单。**方案二:使用Docker编译**1.在CentOS7上安装Docker:```bashsudoyuminstall-yyum-utilssudoyum-config-manager--add-repohttps://download.docker.com/linux/centos/docker-ce.reposudoyuminstalldocker-cedocker-ce-clicontainerd.iosudosystemctlstartdockersudosystemctlenabledocker```2.拉取旧版编译环境的Docker镜像(如引用[2]中提到的):```bashdockerpullyy20190811/rh9:1.00```3.运行容器并挂载源码目录:```bashdockerrun-it-v/path/to/linux-0.11:/linux-0.11yy20190811/rh9:1.00/bin/bash```然后进入容器内的`/linux-0.11`目录进行编译。4.在容器内编译:```bashcd/linux-0.11make```这样,编译生成的内核映像文件会留在宿主机的`/path/to/linux-0.11`目录中。总结:用户可以根据自己的情况选择方案。如果希望直接在CentOS7上编译,需要做好面对编译错误的准备并进行调整;如果希望快速搭建编译环境,推荐使用Docker方案。注意:在VMware虚拟机中运行CentOS7时,请确保网络连接正常,以便下载软件包和Docker镜像。最后,关于防火墙配置(参考引用[3]),在实验环境中可以关闭防火墙,但在生产环境中需谨慎:```bashsudosystemctlstopfirewalldsudosystemctldisablefirewalld```但请注意,关闭防火墙会降低系统安全性,仅在实验环境使用。希望这些步骤能帮助用户成功搭建Linux0.11环境。</think>### 如何在 VMware 上基于 CentOS 7 搭建 Linux 0.11 环境 #### 步骤 1:准备基础环境 1. **安装 VMware 和 CentOS 7** - 下载 CentOS 7 镜像(推荐阿里云镜像站): ```bash https://mirrors.aliyun.com/centos/7/isos/x86_64/ ``` - 在 VMware 中创建新虚拟机: - 选择 "典型安装" → 加载 CentOS 7 ISO - 磁盘分配 ≥ 20GB,内存 ≥ 2GB - 网络模式选择 NAT 或桥接 2. **初始系统配置** ```bash # 关闭防火墙(实验环境) sudo systemctl stop firewalld sudo systemctl disable firewalld # 禁用 SELinux sudo sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config sudo setenforce 0 # 更新系统 sudo yum update -y ``` #### 步骤 2:安装编译依赖 ```bash # 安装开发工具链 sudo yum groupinstall "Development Tools" -y # 安装必要依赖 sudo yum install -y ncurses-devel bison flex elfutils-libelf-devel glibc-devel.i686 gcc-c++ # 验证 GCC 版本(需 ≥ 4.8) gcc --version ``` #### 步骤 3:获取 Linux 0.11 源码 ```bash # 下载源码包 wget https://mirrors.edge.kernel.org/pub/linux/kernel/Historic/linux-0.11.tar.gz # 解压并进入目录 tar zxvf linux-0.11.tar.gz cd linux-0.11 ``` #### 步骤 4:修复兼容性问题 由于 CentOS 7 的 GCC 较新,需修改源码: 1. **编辑 `Makefile`** ```makefile # 在 CFLAGS 中添加兼容参数 CFLAGS = -m32 -fno-stack-protector -fno-builtin -fno-PIC ``` 2. **修改头文件** ```bash # 创建兼容头文件链接 sudo ln -s /usr/include/asm-generic /usr/include/asm ``` #### 步骤 5:编译内核 ```bash # 清理旧编译文件 make clean # 开始编译 make ``` - 编译成功后生成 `Image` 文件(位于 `arch/i386/boot/`) #### 步骤 6:安装模拟器运行 ```bash # 安装 QEMU 模拟器 sudo yum install -y qemu-system-i386 # 启动 Linux 0.11 qemu-system-i386 -kernel arch/i386/boot/Image -append "root=/dev/sda" ``` #### 验证结果 - 成功启动后显示经典提示符: ```bash Welcome to Linux 0.11 / $ ``` - 可执行基本命令:`ls`, `cat /etc/issue` 等 --- ### 常见问题解决 1. **编译错误:`asm/segment.h` 缺失** ```bash # 手动创建头文件链接 mkdir -p include/asm ln -s /usr/include/asm-generic include/asm/segment.h ``` 2. **QEMU 启动黑屏** ```bash # 添加 console 参数 qemu-system-i386 -kernel Image -append "console=ttyS0 root=/dev/sda" ``` 3. **32 位支持缺失** ```bash # 安装多库支持 sudo yum install -y glibc-devel.i686 libgcc.i686 ``` --- ### 相关问题 1. 如何在 Linux 0.11 环境中添加自定义内核模块? 2. 有哪些工具可以调试 Linux 0.11 内核代码? 3. 如何将编译好的 Linux 0.11 内核部署到物理机? > 提示:建议在虚拟机中定期创建快照,避免环境损坏[^3]。CentOS 7 的软件包管理比古老系统更便捷,但需注意 32/64 位兼容性问题[^2]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值