分类目录归档:系统层级

Oracle建立DBLink相关命令

单节点:

/*drop public database link xx_link;*/

create public database link xx_link
       connect to xx_user identified by xx_user 
       using ' (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.1.2)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XXXX)
    )
  )';

双节点:

/*drop public database link xx_link;*/

create public database link xx_link
connect to xx_user identified by xx_user 
using '(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 10.0.1.92)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP) (HOST = 10.0.1.93)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME =PROD)
)
)';

Oracle数据库表空间增长机制及相关信息

准备写入数据-》寻找可用空间-》找到可用的分区-》找到可用的块-》写满或未发现有可用的块-》需要新的分区并申请-》表空间的数据文件的可用空间已不足以分配一个分区-》申请扩展数据文件空间-》若数据文件已达到最大值或磁盘上无可用空间,则报错。

一、 查看Oracle数据库表空间使用情况

select upper(f.tablespace_name) "表空间名",
       d.tot_grootte_mb "表空间大小(m)",
       d.tot_grootte_mb – f.total_bytes "已使用空间(m)",
       to_char(round((d.tot_grootte_mb – f.total_bytes) / d.tot_grootte_mb * 100,
                     2),
               '990.99') || '%' "使用比",
       f.total_bytes "空闲空间(m)",
       f.max_bytes "最大块(m)"
  from (select tablespace_name,
               round(sum(bytes) / (1024 * 1024), 2) total_bytes,
               round(max(bytes) / (1024 * 1024), 2) max_bytes
          from sys.dba_free_space
         group by tablespace_name) f,
       (select dd.tablespace_name,
               round(sum(dd.bytes) / (1024 * 1024), 2) tot_grootte_mb
          from sys.dba_data_files dd
         group by dd.tablespace_name) d
 where d.tablespace_name = f.tablespace_name
 order by 1;

二、扩大表空间的四种方法

–给表空间增加数据文件

ALTER  TABLESPACE  app_data  ADD  DATAFILE  'D:\dbfile\app_01.dbf'  SIZE  1G;

–新增数据文件,并且允许数据文件自动增长

ALTER  TABLESPACE  app_data  ADD  DATAFILE  'D:\dbfile\app_02.dbf'  SIZE  500M

AUTOEXTEND  ON  NEXT  50M  MAXSIZE  5G;

–允许已存在的数据文件自动增长

ALTER  DATABASE  DATAFILE  'D:\dbfile\app_01.dbf'

AUTOEXTEND  ON  NEXT  50M  MAXSIZE  UNLIMITED;

–手工改变已存在数据文件的大小

ALTER  DATABASE  DATAFILE  'D:\dbfile\app_01.dbf' RESIZE 500M;

三、系统表空间过大的情况

1)system表空间过大(使用率95%以上)

    a)检查aud$表大小

–查看数据库表大小SQL

select bytes,owner,segment_name

from dba_segments

where segment_type='TABLE' order by bytes desc;

–查看aud$表大小SQL

select bytes,owner,segment_name

from dba_segments

where segment_type='TABLE' and segment_name = 'AUD$';

    b) 如果aud$过大,清理.导出aud$表后,用truncate清理.

    c) 如果出现aud$表为空,system表空间使用率照样达到99%,建议增加数据文件,如下:

alter tablespace system add datafile 'D:\dbfile\SYSTEM_02.DBF' size 50M autoextend on;

select * from dba_data_files;

2)sysaux表空间(使用率95%以上)

a) 修改统计信息保存时间

select dbms_stats.get_stats_history_retention from dual;  –检查统计信息保存时间(默认应该是31天);

exec dbms_stats.alter_stats_history_retention(7);  –如果31天将其改为7天;

select dbms_stats.get_stats_history_retention from dual;  –验证是否修改成功;

b) 删除AWR报告快照

    批注:Oracle 10g中快照会保留7天,11g的快照保留8天,超出会自动删除。AWR快照可以从其他数据库导入,而这部分数据会保存时间极长。有时候也会遇到自动快照不能自动收集,而手工创建的快照又可以成功,对于这种情况就需要把以前的快照清理掉。

    删除AWR有两种方式进行删除:dbms_workload_repository,dbms_swrf_internal。dbms_workload_repository可以删除本地和其他数据库的快照,可以选择不同的快照来进行删除;dbms_swrf_internal只能对其他数据库的快照来进行操作,会把所有的快照直接干掉。

使用dbms_workload_repository包删除:

 select dbid, retention from dba_hist_wr_control;
 select min(snap_id), max(snap_id)from dba_hist_snapshot where dbid = '得到的dbid值';
 exec dbms_workload_repository.drop_snapshot_range('得到的min(snap_id)值','得到的max(snap_id)值','得到的dbid值');
 select * from dba_hist_snapshot where dbid = '得到的dbid值';

使用dbms_swrf_internal包删除:

 select dbid, retention from dba_hist_wr_control;
 select min(snap_id), max(snap_id)from dba_hist_snapshot where dbid = '得到的dbid值';
 exec dbms_swrf_internal.unregister_database('得到的dbid值');
 select * from dba_hist_snapshot where dbid = '得到的dbid值';

——————————sysaux表空间解读————————————–


SYSAUX表空间在Oracle Database 10g中引入,作为SYSTEM表空间的辅助表空间。

以前一些使用独立表空间或系统表空间的数据库组件现在在SYSAUX表空间中创建。

SYSAUX 表空间存放一些其他的 metadata 组件,如 OEM,Streams 等会默认存放在 SYSAUX 表空间里。

通过分离这些组件和功能,SYSTEM表空间的负荷得以减轻.反复创建一些相关对象及组件引起SYSTEM表空间的碎片问题得以避免。

因此SYSAUX 表空间也是在在 DB 创建或者升级时自动创建的。 如果在手工使用SQL 创建 DB 时没有指定 SYSAUX tablespace,那么创建语句会报错。 无法执行。

在正常操作下, 不能 drop 和 rename SYSAUX 表空间。

如果SYSAUX表空间不可用,数据库核心功能将保持有效;使用SYSAUX表空间的特点将会失败或功能受限.。

我们不能使用 alter tablespace 来修改这 4 个属性,同样也不能 drop 和 rename SYSAUX 表空间。

查看SYSAUX表空间信息:

select OCCUPANT_NAME, SCHEMA_NAME,MOVE_PROCEDURE ,SPACE_USAGE_KBYTES from V$SYSAUX_OCCUPANTS;

这些组件占据这 SYSAUX 表空间,所以这些组件的大小也就决定 SYSAUX表空间的大小。

•schema_name 对应的是用户名。

•在v$sysaux_occupants 视图里中的move_procudure字段,是用于迁移组件信息的。就是对于已经安装好的组件,如果想把这些组件放到其他的空间,可以使用这个存储过程。如果没有对应的过程,说明不可移动。

比如我们的AWR。 AWR 是SYSAUX 中占用空间最多的组件。 对于一个有10个并发session 的系统,就需要200M 的空间。当然,也可以修改AWR的保存策略来控制AWR所占用空间的大小。


Oracle EBS12.2.6 克隆问题集合

数据库克隆错误:

AutoConfig could not successfully execute the following scripts: 
    Directory: /u01/TEST/db/12.1.0/perl/bin/perl -I /u01/TEST/db/12.1.0/perl/lib/5.14.1 -I /u01/TEST/db/12.1.0/perl/lib/site_perl/5.14.1 -I /u01/TEST/db/12.1.0/appsutil/perl /u01/TEST/db/12.1.0/appsutil/clone
      ouicli.pl               INSTE8_APPLY       1 

AutoConfig is exiting with status 1

WARNING: RC-50013: Fatal: Instantiate driver did not complete successfully.
/u01/TEST/db/12.1.0/appsutil/driver/regclone.drv

 

当你执行一次时,报错后,会在oraInventory文件夹中生成数据,再此执行会报如上错误,删除这个文件夹内容重新执行克隆命令即可(rm -rf *).

–数据库克隆完全日志(数据库用户操作)

cd /u01/DEV/db/12.1.0/appsutil/clone/bin

perl adcfgclone.pl dbTier

[oradev@devfin bin]$ perl adcfgclone.pl dbTier

                     Copyright (c) 2002, 2015 Oracle Corporation

                        Redwood Shores, California, USA

                        Oracle E-Business Suite Rapid Clone

                                 Version 12.2

                      adcfgclone Version 120.63.12020000.56

Enter the APPS password : 输入apps密码

Running: Context clone…

Log file located at /u01/DEV/db/12.1.0/appsutil/clone/bin/CloneContext_1107124902.log

Provide the values required for creation of the new Database Context file.

Target System Hostname (virtual or normal) [devfin] :

Target Instance is RAC (y/n) [n] : n

Target System Database SID : DEV

Target System Base Directory : /u01/DEV/db

Target System utl_file_dir Directory List : /u01/DEV/temp

Number of DATA_TOP's on the Target System [1] : 1

Target System DATA_TOP Directory 1 [/u01/DEV/db/data] : /u01/DEV/db/data

Target System RDBMS ORACLE_HOME Directory [/u01/DEV/db/12.1.0] : /u01/DEV/db/12.1.0

Do you want to preserve the Display [devfin:1.0] (y/n)  : n

Target System Display [devfin:0.0] :

Target System Port Pool [0-99] : 0

Checking the port pool 0

done: Port Pool 0 is free

Report file located at /u01/DEV/db/12.1.0/appsutil/temp/portpool.lst

The new database context file has been created :

  /u01/DEV/db/12.1.0/appsutil/DEV_devfin.xml

Check Clone Context logfile /u01/DEV/db/12.1.0/appsutil/clone/bin/CloneContext_1107124902.log for details.

Running Rapid Clone with command:

Running:

perl /u01/DEV/db/12.1.0/appsutil/clone/bin/adclone.pl java=/u01/DEV/db/12.1.0/appsutil/clone/bin/../jre mode=apply stage=/u01/DEV/db/12.1.0/appsutil/clone component=dbTier method=CUSTOM dbctxtg=/u01/DEV/db/12.1.0/appsutil/DEV_devfin.xml showProgress contextValidated=true

Beginning database tier Apply – Tue Nov  7 12:50:41 2017

/u01/DEV/db/12.1.0/appsutil/clone/bin/../jre/bin/java -Xmx600M -DCONTEXT_VALIDATED=true -Doracle.installer.oui_loc=/u01/DEV/db/12.1.0/oui -classpath /u01/DEV/db/12.1.0/appsutil/clone/jlib/xmlparserv2.jar:/u01/DEV/db/12.1.0/appsutil/clone/jlib/ojdbc6.jar:/u01/DEV/db/12.1.0/appsutil/clone/jlib/java:/u01/DEV/db/12.1.0/appsutil/clone/jlib/oui/OraInstaller.jar:/u01/DEV/db/12.1.0/appsutil/clone/jlib/oui/ewt3.jar:/u01/DEV/db/12.1.0/appsutil/clone/jlib/oui/share.jar:/u01/DEV/db/12.1.0/appsutil/clone/jlib/oui/srvm.jar:/u01/DEV/db/12.1.0/appsutil/clone/jlib/ojmisc.jar   oracle.apps.ad.clone.ApplyDBTier -e /u01/DEV/db/12.1.0/appsutil/DEV_devfin.xml -stage /u01/DEV/db/12.1.0/appsutil/clone   -showProgress

APPS Password : Log file located at /u01/DEV/db/12.1.0/appsutil/log/DEV_devfin/ApplyDBTier_11071250.log

  /     15% completed      

Completed Apply…

Tue Nov  7 12:56:59 2017

Starting database listener for DEV:

Running:

/u01/DEV/db/12.1.0/appsutil/scripts/DEV_devfin/addlnctl.sh start DEV

Logfile: /u01/DEV/db/12.1.0/appsutil/log/DEV_devfin/addlnctl.txt

You are running addlnctl.sh version 120.4

Starting listener process DEV…

Listener DEV has already been started.

addlnctl.sh: exiting with status 0

addlnctl.sh: check the logfile /u01/DEV/db/12.1.0/appsutil/log/DEV_devfin/addlnctl.txt for more information … 

Do you want to change the password for all EBS Schemas? (y/n) [n]) : n

Do you want to change the password for sysadmin user? (y/n) [n]) : n

Do you want to change the apps password? (y/n) [n]) : n

Do you want to change the sys and system passwords? (y/n) [n]) : n

Running ETCC to check status of DB technology patches…

 +===============================================================+

 |    Copyright (c) 2005, 2016 Oracle and/or its affiliates.     |

 |                     All rights reserved.                      |

 |             Oracle E-Business Suite Release 12.2              |

 |          Database EBS Technology Codelevel Checker            |

 +===============================================================+

Using context file from command line argument:

/u01/DEV/db/12.1.0/appsutil/DEV_devfin.xml

Starting Database EBS Technology Codelevel Checker, Version 120.38

Tue Nov  7 12:57:24 CST 2017

Log file for this session : /u01/DEV/db/12.1.0/appsutil/etcc/checkDBpatch_21112.log

Bugfix XML file version: 120.0.12020000.32

This file will be used for identifying missing bugfixes.

Mapping XML file version: 120.0.12020000.5

This file will be used for mapping bugfixes to patches.

[WARNING] DB-ETCC: Bugfix XML file (txk_R1220_DB_base_bugs.xml) in current directory is more than 30 days old.

 Check if a newer version is available in patch 17537119.

Identifying database release.

Database release set to 12.1.0.2.

Connecting to database.

Database connection successful.

Database DEV is in READ WRITE mode.

Identifying APPS and APPLSYS schema names.

 – APPS schema : APPS

 – APPLSYS schema : APPLSYS

Checking for DB-ETCC results table.

Table to store DB-ETCC results already exists in the database.

Checking if InMemory option is enabled.

InMemory option is not enabled in the Database.

Checking Bugfix XML file for 12.1.0.2_PSU

Obtained list of bugfixes to be applied and the list to be rolled back.

Now checking Database ORACLE_HOME.

The opatch utility is version 12.2.0.1.7.

DB-ETCC is compatible with this opatch version.

Found patch records in the inventory.

Checking Mapping XML file for 12.1.0.2.160719

All the required one-off bugfixes are present in Database ORACLE_HOME.

Stored Technology Codelevel Checker results in the database DEV successfully.

Finished prerequisite patch testing : Tue Nov  7 12:57:32 CST 2017

Log file for this session: /u01/DEV/db/12.1.0/appsutil/etcc/checkDBpatch_21112.log

 

–应用克隆完全日志(应用用户操作)

cd /u01/DEV/app/fs1/EBSapps/comn/clone/bin

perl adcfgclone.pl appsTier dualfs

[appldev@devfin ~]$ cd /u01/DEV/app/fs1/EBSapps/comn/clone/bin

[appldev@devfin bin]$ perl adcfgclone.pl appsTier dualfs

                     Copyright (c) 2002, 2015 Oracle Corporation

                        Redwood Shores, California, USA

                        Oracle E-Business Suite Rapid Clone

                                 Version 12.2

                      adcfgclone Version 120.63.12020000.56

                ***********************************************************

                In AD-TXK Delta 7, we recommend you clone the run and patch

                file systems in a single operation using the 'dualfs' option.

                Separate cloning of the run and patch file systems will be deprecated

                ************************************************************

Enter the APPS password :

Enter the Weblogic AdminServer password :

Do you want to add a node (yes/no) [no] :

Running: Context clone…

Log file located at /u01/DEV/app/fs1/EBSapps/comn/clone/bin/CloneContext_1107125941.log

Target System File Edition type [run] :

Provide the values required for creation of the new APPL_TOP Context file.

Target System Hostname (virtual or normal) [devfin] :

Target System Database SID : DEV

Target System Database Server Node [devfin] :

Target System Database Domain Name [guobaojinrong.com] :

Target System Base Directory : /u01/DEV/app

Target System Base Directory set to /u01/DEV/app

Target System Current File System Base set to /u01/DEV/app/fs1

Target System Other File System Base set to /u01/DEV/app/fs2

Target System Fusion Middleware Home set to /u01/DEV/app/fs1/FMW_Home

Target System Web Oracle Home set to /u01/DEV/app/fs1/FMW_Home/webtier

Target System Appl TOP set to /u01/DEV/app/fs1/EBSapps/appl

Target System COMMON TOP set to /u01/DEV/app/fs1/EBSapps/comn

Target System Instance Home Directory [/u01/DEV/app] :

Target System Instance Top set to /u01/DEV/app/fs1/inst/apps/DEV_devfin

Do you want to preserve the Display [devfin:1.0] (y/n)  : n

Target System Display [devfin:0.0] :

Target System Root Service [enabled] :

Target System Web Entry Point Services [enabled] :

Target System Web Application Services [enabled] :

Target System Batch Processing Services [enabled] :

Target System Other Services [disabled] :

Target System Port Pool [0-99] : 0

Checking the port pool 0

done: Port Pool 0 is free

Report file located at /u01/DEV/app/fs1/inst/apps/DEV_devfin/admin/out/portpool.lst

UTL_FILE_DIR on database tier consists of the following directories.

1. /usr/tmp

2. /u01/DEV/temp

3. /u01/DEV/db/12.1.0/appsutil/outbound/DEV_devfin

4. /usr/tmp

Choose a value which will be set as APPLPTMP value on the target node [1] : 2

The new APPL_TOP context file has been created :

  /u01/DEV/app/fs1/inst/apps/DEV_devfin/appl/admin/DEV_devfin.xml

Check Clone Context logfile /u01/DEV/app/fs1/EBSapps/comn/clone/bin/CloneContext_1107125941.log for details.

Running Rapid Clone with command:

Running:

perl /u01/DEV/app/fs1/EBSapps/comn/clone/bin/adclone.pl java=/u01/DEV/app/fs1/EBSapps/comn/clone/bin/../jre mode=apply stage=/u01/DEV/app/fs1/EBSapps/comn/clone component=appsTier method=CUSTOM appctxtg=/u01/DEV/app/fs1/inst/apps/DEV_devfin/appl/admin/DEV_devfin.xml showProgress contextValidated=true

FMW Pre-requisite check log file location : /u01/DEV/app/fs1/EBSapps/comn/clone/FMW/logs/prereqcheck.log

Running: /u01/DEV/app/fs1/EBSapps/comn/clone/FMW/t2pjdk/bin/java -classpath /u01/DEV/app/fs1/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/engine.jar:/u01/DEV/app/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraPrereq.jar:/u01/DEV/app/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraPrereqChecks.jar:/u01/DEV/app/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraInstaller.jar:/u01/DEV/app/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraInstallerNet.jar:/u01/DEV/app/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/srvm.jar:/u01/DEV/app/fs1/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/ojdl.jar:/u01/DEV/app/fs1/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/ojdl2.jar:/u01/DEV/app/fs1/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/ojdl-log4j.jar:/u01/DEV/app/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/xmlparserv2.jar:/u01/DEV/app/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/share.jar:/u01/DEV/app/fs1/EBSapps/comn/clone/jlib/java oracle.apps.ad.clone.util.FMWOracleHomePreReqCheck -prereqCheckFMW -e /u01/DEV/app/fs1/inst/apps/DEV_devfin/appl/admin/DEV_devfin.xml -stage /u01/DEV/app/fs1/EBSapps/comn/clone -log /u01/DEV/app/fs1/EBSapps/comn/clone/FMW/logs/prereqcheck.log

Beginning application tier Apply – Tue Nov  7 13:02:18 2017

/u01/DEV/app/fs1/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -DCONTEXT_VALIDATED=true -Doracle.installer.oui_loc=/oui -classpath /u01/DEV/app/fs1/EBSapps/comn/clone/jlib/xmlparserv2.jar:/u01/DEV/app/fs1/EBSapps/comn/clone/jlib/ojdbc6.jar:/u01/DEV/app/fs1/EBSapps/comn/clone/jlib/java:/u01/DEV/app/fs1/EBSapps/comn/clone/jlib/oui/OraInstaller.jar:/u01/DEV/app/fs1/EBSapps/comn/clone/jlib/oui/ewt3.jar:/u01/DEV/app/fs1/EBSapps/comn/clone/jlib/oui/share.jar:/u01/DEV/app/fs1/FMW_Home/webtier/../Oracle_EBS-app1/oui/jlib/srvm.jar:/u01/DEV/app/fs1/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/DEV/app/fs1/FMW_Home/wlserver_10.3/server/lib/weblogic.jar:/u01/DEV/app/fs1/EBSapps/comn/clone/jlib/obfuscatepassword.jar  oracle.apps.ad.clone.ApplyAppsTier -e /u01/DEV/app/fs1/inst/apps/DEV_devfin/appl/admin/DEV_devfin.xml -stage /u01/DEV/app/fs1/EBSapps/comn/clone    -showProgress -nopromptmsg

Log file located at /u01/DEV/app/fs1/inst/apps/DEV_devfin/admin/log/clone/ApplyAppsTier_11071302.log

提醒:应用克隆命令中perl adcfgclone.pl appsTier dualfs,建议加上“dualfs”,这样系统会自动将fs2节点进行克隆,否则需要单独去做fs2节点克隆。

–新安装的R12.2.6大小(总共192G)

[oraprod@ebsdb u01]$ du -sh PROD/
102G    PROD/

[applprod@ebs u01]$ du -sh PROD/
90G     PROD/

[oraprod@ebsdb ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
                       47G  4.2G   41G  10% /
tmpfs                  16G  1.9M   16G   1% /dev/shm
/dev/sda1             477M   41M  411M   9% /boot
/dev/sdb1             985G  118G  817G  13% /u01
/u01/stageR12/rpmfiles/Oracle_Enterprise_Linux_64_位-file1.iso
                      3.8G  3.8G     0 100% /media

[applprod@ebs ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
                       47G  4.4G   40G  10% /
tmpfs                  16G   68K   16G   1% /dev/shm
/dev/sda1             477M   35M  418M   8% /boot
/dev/sdb1             985G  110G  825G  12% /u01
/u01/stageR12/rpmfiles/Oracle_Enterprise_Linux_64_位-file1.iso
                      3.8G  3.8G     0 100% /media

 

Linux mount及umount相关操作命令

1.卸载挂载命令

[root@fin-db-bak ~]# fdisk -l

Disk /dev/ram0: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram1: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram2: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram3: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram4: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram5: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram6: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram7: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram8: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram9: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram10: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram11: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram12: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram13: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram14: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram15: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/xvda: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009aac3

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/xvda2              64        6528    51915776   8e  Linux LVM

Disk /dev/xvde: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup-lv_root: 47.8 GB, 47789899776 bytes
255 heads, 63 sectors/track, 5810 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup-lv_swap: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

[root@fin-db-bak ~]# fdisk /dev/xvde
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xb7c0464c.
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): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-65270, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-65270, default 65270): 
Using default value 65270

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@fin-db-bak ~]# fdisk -l

Disk /dev/ram0: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram1: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram2: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram3: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram4: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram5: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram6: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram7: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram8: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram9: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram10: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram11: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram12: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram13: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram14: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram15: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/xvda: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009aac3

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/xvda2              64        6528    51915776   8e  Linux LVM

Disk /dev/xvde: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xb7c0464c

    Device Boot      Start         End      Blocks   Id  System
/dev/xvde1               1       65270   524281243+  83  Linux

Disk /dev/mapper/VolGroup-lv_root: 47.8 GB, 47789899776 bytes
255 heads, 63 sectors/track, 5810 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup-lv_swap: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

[root@fin-db-bak ~]# cat /proc/partitions
major minor  #blocks  name

   1        0      16384 ram0
   1        1      16384 ram1
   1        2      16384 ram2
   1        3      16384 ram3
   1        4      16384 ram4
   1        5      16384 ram5
   1        6      16384 ram6
   1        7      16384 ram7
   1        8      16384 ram8
   1        9      16384 ram9
   1       10      16384 ram10
   1       11      16384 ram11
   1       12      16384 ram12
   1       13      16384 ram13
   1       14      16384 ram14
   1       15      16384 ram15
 202        0   52428800 xvda
 202        1     512000 xvda1
 202        2   51915776 xvda2
 202       64  524288000 xvde
 202       65  524281243 xvde1
  11        0    1048575 sr0
 251        0   46669824 dm-0
 251        1    5242880 dm-1
[root@fin-db-bak ~]# mkfs -t ext4 /dev/xvde1
mke2fs 1.43-WIP (20-Jun-2013)
文件系统标签=
OS type: Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
32768000 inodes, 131070310 blocks
6553515 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=4294967296
4000 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
        102400000

Allocating group tables: 完成                            
正在写入inode表: 完成                            
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成     

[root@fin-db-bak ~]# mkdir /u01
[root@fin-db-bak ~]# chmod -R 777 /u01
[root@fin-db-bak ~]# df -k
Filesystem           1K-blocks    Used Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
                      45805980 4507252  38948856  11% /
tmpfs                  3943868      72   3943796   1% /dev/shm
/dev/xvda1              487652  110106    347850  25% /boot
[root@fin-db-bak ~]# mount /dev/xvde1 /u01
[root@fin-db-bak ~]# df -k
Filesystem           1K-blocks    Used Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
                      45805980 4507252  38948856  11% /
tmpfs                  3943868      72   3943796   1% /dev/shm
/dev/xvda1              487652  110106    347850  25% /boot
/dev/xvde1           515923792   71448 489621900   1% /u01
[root@fin-db-bak ~]# vi /etc/fstab
#
# /etc/fstab
# Created by anaconda on Fri Sep  8 16:02:15 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=d7f678b2-e53e-4fa8-8887-b9cadc8f5955 /boot                   ext4    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
~
~
~
~
~
~

#
# /etc/fstab
# Created by anaconda on Fri Sep  8 16:02:15 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/VolGroup-lv_root /                       ext4    defaults        1 1
UUID=d7f678b2-e53e-4fa8-8887-b9cadc8f5955 /boot                   ext4    defaults        1 2
/dev/mapper/VolGroup-lv_swap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
"/etc/fstab" 17L, 858C written
[root@fin-db-bak ~]# df -k
Filesystem           1K-blocks    Used Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
                      45805980 4507252  38948856  11% /
tmpfs                  3943868      72   3943796   1% /dev/shm
/dev/xvda1              487652  110106    347850  25% /boot
/dev/xvde1           515923792   71448 489621900   1% /u01
 

[root@ebs ~]# exit

Logout

2.卸载挂载命令

直接fdisk /dev/sdc

然后输入d

选择出需要删除的挂载盘即可,w写入。

参考文件:

http://blog.csdn.net/tianlesoftware/article/details/5642883

https://jingyan.baidu.com/article/ab0b56307a939fc15bfa7d63.html?qq-pf-to=pcqq.c2c

有三种方法可以对Swap 分区进行扩展:

一、扩展正在使用的Swap 分区的逻辑卷(Recommended);

二、新建Swap 分区;

三、新建swap file。

具体步骤如下:

一、扩展正在使用的Swap 分区的逻辑卷

设定用作Swap 分区的逻辑卷为:/dev/VolGroup00/LogVol01

#swapoff -v /dev/VolGroup00/LogVol01    //关闭该卷的Swap分区

# lvm lvresize /dev/VolGroup00/LogVol01 -L +1024M    //为该卷的容量增加1024M

# mkswap /dev/VolGroup00/LogVol01    //格式化Swap分区

# swapon -va    //启用Swap分区

# free    //验证结果

二、新建Swap 分区

设定新建的Swap 分区的逻辑卷为:/dev/VolGroup00/LogVol02

# lvm lvcreate VolGroup00 -n LogVol02 -L 1024M    //新建一个1024M大小的逻辑卷

# mkswap /dev/VolGroup00/LogVol02    //格式化成Swap分区

#/dev/VolGroup00/LogVol02 swap swap defaults 0 0    //将这个分区信息写进fstab文件(相当于分区表)

# swapon -va    //启动Swap分区

# free    //验证结果

三、新建swapfile

通过此种方式进行Swap 的扩展,首先要计算出block的数目。具体为根据需要扩展的swapfile的大小,以M为单位。block=swap分区大小*1024, 例如,需要扩展1024M的swapfile,则:block=1024*1024=1048576。

然后做如下步骤:

#dd if=/dev/zero of=/swapfile bs=1024 count=1048576

#mkswap /swapfile   //使该文件成为Swap配置文件

#swapon /swapfile   //启用swapfile

#/swapfile swap swap defaults 0 0   //使该文件加入开机启动项并写入fstab文件

#free   //验证结果 

总结:三种方法都能对Swap分区进行扩展,但是推荐使用第一种方法。

Oracle EBS克隆可能用到的命令

克隆前需先执行预克隆命令:

在终端分别执行以下命令,来实现在数据库侧和应用服务侧的adpreclone。

以orastg用户登录,数据库侧

cd $ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME

perl adpreclone.pl dbTier

以applstg用户登录,应用服务侧

cd $INST_TOP/admin/scripts

perl adpreclone.pl appsTier先后停止应用服务器和数据库服务器

以applstg用户登录应用服务器

cd $INST_TOP/admin/scripts

./adstpall.sh apps/apps

以orastg用户登录数据库服务器

cd $ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME

./addlnctl.sh stop PROD

./addbctl.sh stop immediate

–打包源文件
tar -cvzf /app/stageR12/apps_20170629.tgz /app/YS/apps
tar -cvzf /data/stageR12/db_20170629.tgz /data/YS/db

拷贝远程数据:
scp -r root@10.1.1.1:apps0629.tgz /app/stageR12
scp -r root@10.1.1.2:db0629.tgz /data/stageR12

–解压远程拷贝文件
tar -xvzf /app/stageR12/db0629.tgz -C /app/CHK/
tar -xvzf /data/stageR12/apps0629.tgz -C /data/CHK/

–新增用户
useradd -g dba orachk
useradd -g dba applchk

–变更宿主
chown -hR orachk:dba /app/CHK/db
chown -hR applchk:dba /data/CHK/apps

–执行克隆
cd /data/CHK/db/tech_st/11.2.0/appsutil/clone/bin
perl adcfgclone.pl dbTier

cd /app/CHK/apps/apps_st/comn/clone/bin
perl adcfgclone.pl appsTier

IP搞错误,EXEC FND_CONC_CLONE.SETUP_CLEAN;

后autoconfig。
 

DB 11.2版本在克隆的过程中可能出现以下错误:

AutoConfig could not successfully execute the following scripts:

 Directory: /data/CHK/db/tech_st/11.2.0/perl/bin/perl -I /data/CHK/db/tech_st/11.2.0/perl/lib/5.8.3 -I /data/CHK/db/tech_st/11.2.0/perl/lib/site_perl/5.8.3 -I /data/CHK/db/tech_st/11.2.0/appsutil/perl /data/CHK/db/tech_st/11.2.0/appsutil/clone

      ouicli.pl               INSTE8_APPLY       255

Root执行:

cd /data/CHK/db/tech_st/11.2.0/perl/lib/

ln -s 5.10.0 5.8.3

cd site_perl

ln -s 5.10.0 5.8.3