sh -x 사용sh -x 스크립트경로/스크립트이름.sh
사용자 환경에 맞추어 실행을 시뮬레이션 해보아야 한다.
실행시킬 사용자로 반드시 해볼 것을 추천.
Installing an SSH server on Windows 2000 or Windows XP
Cygwin is a collection of free software tools originally developed by Cygnus Solutions to allow various versions of Microsoft Windows to act somewhat like a UNIX system. It is a Linux-like environment for Windows that consists of two parts - a DLL (cygwin1.dll) which acts as a Linux API emulation layer providing substantial POSIX system call functionality and a collection of tools.Install Cygwin and the SSH server
In order to install the OpenSSH sshd server on Windows you will need to do the following:- Log on to Windows as an Administrator
- Create the folder C:\Cygwin
- Download Cygwin's setup.exe from here and save it in C:\Cygwin
- Launch the installer by double clicking on C:\Cygwin\setup.exe
- It is possible that you will get an Open File - Security Warning
- Simply click the Run button if you do
- Click Next
- Select Install from Internet and click Next
- At the Choose Installation Directory screen:
- Choose C:\Cygwin as the Root Directory
- Select Install For: All Users (RECOMMENDED)
- Click Next
- Choose C:\Cygwin as the Local Package Directory
- Click Next
- At the Select Connection Type menu - choose Direct Connection unless you know you are using another setting
- Click Next
- Choose a Download Site
- Click Next
- At the Cygwin Setup - Select packages Screen - click on the View button for "Full" view (the default view is "Category").
- Scroll down to find the package "openssh: The OpenSSH server and client programs" in the Package column. Click on the word "skip" so that a checked box appears in the Bin? column
- Scroll down to find the package "tcp_wrappers: Tools providing host-based access restrictions on tcp services" in the Package column. Click on the word "skip" so that a checked box appears in the Bin? column.
- Scroll down to find the package "vim: Vi Mproved - enhanced vi editor" in the Package column. Click on the word "skip" so that a checked box appears in the Bin? column.
- Click Next to begin the installation process
- Click Finish to close the installer
Configuring the SSH server
- Right click on My Computer --> Properties --> Advanced --> Environment Variables
- The upper portion contains a list of User variables and the lower
portion contains a list of System variables. Click the New button
underneath the System variables section to add a new system variable and
add:
- Variable name: cygwin
- Variable value: ntsec
- Click OK to create the variable
- Click OK to close the Edit User Variable screen
- Click OK to close the Environmental Variables screen
- Click OK to close the System Properties screen
- Open a Cygwin window by launching C:\Cygwin\cygwin.bat - a black screen will appear. At the prompt type: ssh-host-config
- When the script asks "Should privilege separation be used?", answer yes
- When the script asks to "Create a new local account 'sshd'?", answer yes
- When the script asks to "Install sshd as a service?", answer yes
- When the script asks to "Enter the value of CYGWIN for the daemon:", answer ntsec
Starting the SSH server
- To start the sshd service, open a Cygwin window and type one of the following commands (they both accomplish the same thing):
- net start sshd
- cygrunsrv --start sshd
- In order to harmonize Windows user information with Cygwin - open a
Cygwin window and type in the following commands (separately):
- mkpasswd --local > /etc/passwd
- mkgroup --local > /etc/group
Configure the Windows Firewall
If you are running Windows XP Service Pack 2 or Service Pack 3 - you have to configure the Windows Firewall to allow SSH traffic through it- Click on Start --> Control Panel --> Windows Firewall --> Exceptions Tab
- Click the Add Port... button
- Name: SSH
- Port Number: 22
- TCP
- Click OK to add the SSH exception to the firewall
- Click OK to close the Windows Firewall screen
Executing UNIX commands within a DOS window
If you want to be able to execute certain UNIX commands within a DOS command prompt window, do the following:- Right click on My Computer --> Properties --> Advanced --> Environment Variables
- In the System variables section, highlight the Path variable and click the Edit button
- Append the System variable by adding ;C:\Cygwin\bin to the end of the existing variable string
- Click OK to close the Edit System Variable screen
- Click OK to close the Environmental Variables screen
- Click OK to close the System Properties screen
Names with spaces
If you have a Windows username that contains a space, you could expand the [space] into \[space] or use quotes. For example: If the Windows username is Ezra Cornell, you could log in with either of the following commands:- ssh Ezra\ Cornell@localhost
- ssh "Ezra Cornell"@localhost
Reinstalling the SSH server
If you re-install Cygwin or run ssh-host-config when sshd is already installed, ssh-host-config will not ask for CYGWIN value. In that case, you have to stop and remove the sshd service, and then run the ssh-host-config script again.- cygrunsrv --stop sshd
- cygrunsrv --remove sshd
- ssh-host-config (enter the information as indicated above)
- cygrunsrv --start sshd
1. 원본 exp받기
# exp aaa/aaa123 file=aaa.dmp log=aaa.log buffer=40960
2. index script 생성하기
- indexfile Option을 이용하여 index script 생성
# imp aaa/aaa123 file=aaa.dmp indexfile=index.sql fromuser=aaa touser=aaa(tablespace 부분 수정)
3. 수정한 sql문을 실행시켜서 테이블 만들기/index만들기
4. exp받아둔 파일로 진짜 import 하기/ignore=y하여 에러안나게
껍데기만 만들어진 상태에서 ignore없이하면 또 만들려다 에러남
# imp aaa/aaa123 file=aaa.dmp buffer=40960 log=imp0522.log commit=y fromuser=aaa touser=aaa ignore=y