linux+oracle常用的命令

1.在linux平台下用file命令查看oracle执行文件判断oracle是64位还是32位
[oracle@cuigq /]$ file $ORACLE_HOME/bin/oracle
/u01/app/oracle/product/10.2.0/db_1/bin/oracle: setuid setgid ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
2.strings命令查看二进制文件,例子截取了部分内容。
[oracle@cuigq dbs]$ strings spfilechshsid.ora
chshsid.__db_cache_size=327155712
chshsid.__java_pool_size=4194304
chshsid.__large_pool_size=4194304
chshsid.__shared_pool_size=100663296
chshsid.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/chshdb/adump'
*.background_dump_dest='/u01/app/oracle/admin/chshdb/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/u01/app/oracle/oradata/chshdb/control01.ctl','/u01/app/oracle/ oradata/chshdb/control02.ctl','/u01/app/oracle/oradata/chshdb/control03.ctl'
3.查看进程信息:
[oracle@cuigq dbs]$ ps -ef | grep ora_
oracle 3444 1 0 May25 ? 00:00:11 ora_pmon_chshsid
oracle 3446 1 0 May25 ? 00:00:07 ora_psp0_chshsid
oracle 3448 1 0 May25 ? 00:00:02 ora_mman_chshsid
4.printenv指令的使用
oracle@cuigq bin]$ printenv|grep SID
ORACLE_SID=chshsid
5.输出信息到文件
[oracle@cuigq opt]$ echo "db_name=cuigq" > /opt/bb.txt
SQL> ! echo "db_name=chshdb" > /u01/app/oracle/product/10.2.0/db_1/dbs/initcuigq.ora
SQL> ! ps -ef | grep ora_smon_cuigq
6.查看对应不同的ORACLE_SID
[oracle@cuigq db_1]$ sysresv -l chshsid cuigq
IPC Resources for ORACLE_SID "chshsid" :
Shared Memory:
ID KEY
884747 0x4422513c
Semaphores:
ID KEY
131072 0xa79a7f3c
163841 0xa79a7f3d
196610 0xa79a7f3e
Oracle Instance alive for sid "chshsid"
IPC Resources for ORACLE_SID "cuigq" :
Shared Memory:
ID KEY
1048588 0x6a1123dc
Semaphores:
ID KEY
753675 0x413a8f7c
Oracle Instance alive for sid "cuigq"
7.#tail -30/-f alter_cuigq.log
8.diff指令对比两个文件的不同。
[root@cuigq opt]# diff test1.txt test2.txt
1c1
< 123456
---
> 123
9.orapw创建口令文件
[oracle@cuigq dbs]$ orapwd file=$ORACLE_HOME/dbs/orapwchshsid password=cuigq_hr entries=10 force=y
Tags: 

延伸阅读

最新评论

发表评论