TZ=ROK+24
dat=`date +%Y%m%d`;

echo $dat

일주일전은

TZ=ROK+164

164=7*24


String.prototype.trim = function()
{
// 문장의 앞과 뒤의 공백 제거
//return this.replace(/^s*(b.*b|)s*$/, "$1");
a = this
var search = 0
while ( a.charAt(search) == " ")
search = search + 1

a = a.substring(search, (a.length))
search = a.length - 1
while (a.charAt(search) ==" ")
search = search - 1
return a.substring(0, search + 1)
}


사용은...

document.forname.object.value.trim()

public static class Singleton1

{
pirvate static final Singleton1 theInstance = new Singleton1();
public static Singleton1 getInstance()
{
return theInstance;
}
}

혹은...

public static class Singleton2

{
private static Singleton2 theInstance;
public static synchronized Singleton2 getInstance()
{
if (theInstance == null)
theInstance = new Singleton2();
return theInstance;
}
}

import java.io.*;
import com.oroinc.net.ftp.*;
import com.oroinc.net.*;

public class MyFtpClient
{

private static final String sServer = "XXXXXXX"; 서버 아이피
private static final int iPort = 21;
private static final String sId = "XXXXX"; 사용자 아이디
private static final String sPassword = "XXXX"; 비밀번호

private static final String sUpDir = "D:/업무/이성호/laredoute_dev/FTP/upload";
private static final String sDownDir = "D:/업무/이성호/laredoute_dev/FTP/download";
private static final String sLogDir = "D:/업무/이성호/laredoute_dev/FTP/log";

FTPClient ftpClient;
private static Log log; // 이놈은 로그 찍을때 사용

public MyFtpClient()
{
ftpClient = new FTPClient();
log = new Log(sLogDir, "ftp");
}

// 서버로 연결
protected void connect()
{
try
{
ftpClient.connect(sServer, iPort);
int reply;
// 연결 시도후, 성공했는지 응답 코드 확인
reply = ftpClient.getReplyCode();

if(!FTPReply.isPositiveCompletion(reply))
{
ftpClient.disconnect();
log.write("서버로부터 연결을 거부당했습니다");
}

}
catch (IOException ioe)
{
if(ftpClient.isConnected())
{
try
{
ftpClient.disconnect();
}
catch(IOException f)
{
//
}
}
log.write("서버에 연결할 수 없습니다");
}
}

// 계정과 패스워드로 로그인
protected boolean login()
{
try
{
this.connect();
return ftpClient.login(sId, sPassword);
}
catch (IOException ioe)
{
log.write("서버에 로그인 하지 못했습니다");
}
return false;
}

// 서버로부터 로그아웃
protected boolean logout()
{
try
{
return ftpClient.logout();
}
catch (IOException ioe)
{
log.write("로그아웃이 하지 못했습니다");
}
return false;
}

// FTP의 ls 명령, 모든 파일 리스트를 가져온다
protected FTPFile[] list()
{
FTPFile[] files = null;
try
{
files = this.ftpClient.listFiles();
return files;
}
catch (IOException ioe)
{
log.write("서버로부터 파일 리스트를 가져오지 못했습니다");
}
return null;
}

// 파일을 전송 받는다
protected boolean get(String source, String target, String name)
{
boolean flag = false;

OutputStream output = null;
try
{
// 받는 파일 생성 이 위치에 이 이름으로 파일 생성된다
File local = new File(sDownDir, name);
output = new FileOutputStream(local);
}
catch (FileNotFoundException fnfe)
{
log.write("다운로드할 디렉토리가 없습니다");
return flag;
}

File file = new File(source);
try
{
if (ftpClient.retrieveFile(source, output))
{
flag = true;
}
}
catch (IOException ioe)
{
log.write("파일을 다운로드 하지 못했습니다");
}
return flag;
}

// 파일을 전송 받는다 위의 method 와 return 값이 달라서 하나 더 만들었다
protected File getFile(String source, String name)
{
OutputStream output = null;
File local = null;
try
{
// 받는 파일 생성
local = new File(sDownDir, name);
output = new FileOutputStream(local);
}
catch (FileNotFoundException fnfe)
{
log.write("다운로드할 디렉토리가 없습니다");
}

File file = new File(source);
try
{
if (ftpClient.retrieveFile(source, output))
{
//
}
}
catch (IOException ioe)
{
log.write("파일을 다운로드 하지 못했습니다");
}
return local;
}

// 파일을 전송 한다
protected boolean put(String fileName, String targetName)
{
boolean flag = false;
InputStream input = null;
File local = null;

try
{
local = new File(sUpDir, fileName);
input = new FileInputStream(local);
}
catch(FileNotFoundException e)
{
return flag;
}

try
{

// targetName 으로 파일이 올라간다
if(ftpClient.storeFile(targetName, input))
{
flag = true;
}
}
catch(IOException e)
{
log.write("파일을 전송하지 못했습니다");
return flag;
}
return flag;
}

// 서버 디렉토리 이동
protected void cd(String path)
{
try
{
ftpClient.changeWorkingDirectory(path);
}
catch (IOException ioe)
{
log.write("폴더를 이동하지 못했습니다");
}
}

// 서버로부터 연결을 닫는다
protected void disconnect()
{
try
{
ftpClient.disconnect();
}
catch (IOException ioe)
{
ioe.printStackTrace();
}
}

protected void setFileType(int iFileType)
{
try
{
ftpClient.setFileType(iFileType);
}
catch(Exception e)
{
log.write("파일 타입을 설정하지 못했습니다");
}
}
}

<html>
<head>
<title> new document </title>
</head>
<body>
<input type="text" name="1" tabindex="1">
<input type="text" name="3" tabindex="3">
<input type="text" name="5" tabindex="5">
<input type="text" name="7" tabindex="7">
<input type="text" name="9" tabindex="9">
<input type="text" name="8" tabindex="8">
<input type="text" name="6" tabindex="6">
<input type="text" name="4" tabindex="4">
<input type="text" name="2" tabindex="2">
</body>
</html>

GRANT SELECT ON OBJECT_NAME TO USER_NAME

tar cvf temp.tar `find ./backup -name '*.txt'`

`와 '의 구분을 잘 할것!!!


'UNIX-Networking' 카테고리의 다른 글

[UNIX] crontab 변경내용이 실행되지 않는다?  (0) 2007.11.14
[UNIX] find명령 활용 2  (0) 2007.05.11
[UNIX] find 명령 활용하기  (0) 2007.04.12
[UNIX sh] 하루 전 날짜 가져오기  (0) 2007.01.09
[UNIX] 백업받기  (0) 2007.01.09

클라이언트가 될 오라클 서버의 $ORACLD_HOME/network/admin/tnsnames.ora 파일에

서버가 될 DB의 TNSNAME 정보를 추가한다.

DANGJIK =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 100.1.26.38)(PORT = 1521))
)
(CONNECT_DATA =
(SID = APPSVR29)
)
)


1. 사용하실 오라클 유저권한으로 DATABASE LINK를 생성합니다.

userid : dangjikuser, userpw : dangjikpw 라고 한다면...

CREATE DATABASE LINKDANGJIK_DB
CONNECT TOdangjikuser
IDENTIFIED BYdangjikpw

USING 'DANGJIK';

2. 사용하실 오라클 유저권한으로 SYNONYM을 생성합니다.

CREATE SYNONYM 사용할이름

FOR DGVORGIF0@DATABASE링크명

이상입니다.

try
{
int port = 443;
String hostname = "hostname";
SocketFactory socketFactory = SSLSocketFactory.getDefault();
Socket socket = socketFactory.createSocket(hostname, port);

// Create streams to securely send and receive data to the server
InputStream in = socket.getInputStream();
OutputStream out = socket.getOutputStream();

// Read from in and write to out...

// Close the socket
in.close();
out.close();
}
catch(IOException e)
{
}

백업

#!/bin/sh

dat=`date +%Y%m%d%H%M`
/app/oracle/product/920/bin/exp userid/passwd file=/user/userid/backup/oracle_$dat.dmp

복구

FULL 백업을 한경우

user와 tablespace정보까지 함께 백업이 되므로

import할때 특별한 방법이 필요하다.

오라클관리자

1. drop user scott cascade;

2. create user scott identified by tiger

default tablespace scott_tablespace

temporary tablespace temp;

3. grant connect , resource to scott

4. imp scott/tiger file=aaa.dmp



+ Recent posts