2008년 4월 23일 수요일

OWC를 이용한 CHart 표현

 

From the July 2001 issue of MSDN Magazine.

Office Chart Control, Opening Windows in ASP, Getting a Referred URL, and More
Edited by Nancy Michell
Download the code for this article: WebQA0107.exe (39KB)
Browse the code for this article at Code Center: :Track('ctl00_ContentPlaceHolder1_ctl00|ctl00_ContentPlaceHolder1_ctl02',this);" href="http://msdn.microsoft.com/code/default.asp?URL=/code/sample.asp?url=/MSDN-FILES/026/002/386/msdncompositedoc.xml">Office Chart Control

Q Can you recommend any sample files or code for creating dynamic charts or graphs from XML data? I'd like them to look like the graphs in Microsoft® Office.

A The following is a good solution that uses Office Web Components. Look at the two charts in Figure 1. The top one uses Office Web Components that ship with Office XP, and the bottom one uses Office 2000 Web Components. The HTML for the page is shown in :Track('ctl00_ContentPlaceHolder1_ctl00|ctl00_ContentPlaceHolder1_ctl03',this);" href="http://msdn2.microsoft.com/ko-kr/magazine/bb985943(en-us).aspx">Figure 2. To include the chart control from Office XP, use the class ID listed first in :Track('ctl00_ContentPlaceHolder1_ctl00|ctl00_ContentPlaceHolder1_ctl04',this);" href="http://msdn2.microsoft.com/ko-kr/magazine/bb985943(en-us).aspx">Figure 2. To use the chart control from Windows 2000, use the second class ID. The code also alerts the user if Office XP components are not installed.


Figure 1 Using Office Web Components

      The data for the charts is taken from chartXP.xml and chartme.xml. The formatting is found in chartXP.xsl. All of these files are available for download from the link at the top of this article.
      More information on using XML as an API can be found on the MSDN Online Web Workshop at :Track('ctl00_ContentPlaceHolder1_ctl00|ctl00_ContentPlaceHolder1_ctl05',this);" href="http://msdn2.microsoft.com/ko-kr/magazine/ms950804(en-us).aspx">http://msdn.microsoft.com/xml/articles/xml10162000.asp.

Q I'd like to be able to pop up a small overlay window, allow someone to fill in some database information, and then have the window close. I'm not sure how to create and close the window or if there are any special tricks using ASP code.

A ASP is a server-side scripting environment. Any instance of an opened window would need to run on the client side in the user's browser utilizing client-side scripting (such as VBScript or JScript®). When running VBScript on the server, user interface elements such as msgBox are actually disabled. ASP comes into play here for inserting the form data into your database.
      First, create a small JScript function that will launch the popup window and create the form when the Enter Company data link is clicked (see Figure 3). An interesting point to note about the code for this (shown in :Track('ctl00_ContentPlaceHolder1_ctl00|ctl00_ContentPlaceHolder1_ctl06',this);" href="http://msdn2.microsoft.com/ko-kr/magazine/bb985943(en-us).aspx">Figure 4) is that it creates the form dynamically. It is not actually opening an existing page containing the form elements. The HTML and form elements are created within the body of the function. You could expand on this idea to create your form based on the link the user selected.


Figure 3 Popup Window

      The LaunchWin function is called by clicking on the link:
<a href="#" onClick="LaunchWin()">Enter Company data</a>
After the user has selected an option, the window is launched with a form that presents the user with two textboxes, ready to accept input that will end up in the database (in this case, the classic Northwind database that ships with SQL Server™). When the Submit button is selected, the data is sent to the enterFormData.asp page. The code in :Track('ctl00_ContentPlaceHolder1_ctl00|ctl00_ContentPlaceHolder1_ctl07',this);" href="http://msdn2.microsoft.com/ko-kr/magazine/bb985943(en-us).aspx">Figure 5 belongs at the top of the enterFormData.asp page to extract and enter the form data. In this code, you are simply creating a Recordset object and using ADO to insert the values of your requesting form fields into the database. Then you close the connection and release the object reference from memory.
      Next, use the following logic to close the top layer window when the onLoad event is triggered during page loading.
<BODY onLoad="window.close()">
At this point, the new window containing the form has been opened, the user has entered their information, that information has been inserted into the database, and the opened window has been closed. It is good practice to provide the user with some kind of feedback to inform them that their information has been entered into the database. Figure 3 shows a view of both windows.
      Note that this example doesn't contain validation and error detection; you'd need to include these in a production environment.

Q I'm usually able to grab the referring URL sent via a form POST with the following code:
  strReferrer =    
    Request.ServerVariables("HTTP_REFERER")
But that fails if I get transferred via something like window.location.href.
      Is there a single ASP object that will return the URL regardless of the way you were transferred, or is there a nice technique to pick up the various possible transfers and redirects? Can I always read the header?

A Well, not all cases are actually catchable—not all requests have a referrer header in them. So the real question is whether the client request even had a referrer header in it to begin with. If the request did have a referrer header, then you should be able to get it with that code; if it didn't, then you would never be able to get it.
       Some of the MSN® pages employ the method of passing the referrer via a URL such as this:
http://server/page.asp?from=prevpage.asp
      In the ASP page you can then just use request.querystring("from") to get the value.
      It sounds like the problem in your case is that Microsoft Internet Explorer (or WinInet) is deciding not to add the referrer header because it's not coming from an <A HREF> tag. There may be some different client-side code that would result in Internet Explorer sending the referrer header, but for simplicity you may just want to use the solution I just presented.

Q I am looking for a way to add "Export to Microsoft Excel" functionality to one of my Web projects. I would like to take the data from an ADO recordset or a client-side HTML table and export it to an Excel file on the client, so the user can view HTML data and simply click a button to open the data in Excel. The closest thing I have found is piping HTML data (HTML table on a Web page) to a spreadsheet object on a Web page (see Figure 6). The code for this example is in :Track('ctl00_ContentPlaceHolder1_ctl00|ctl00_ContentPlaceHolder1_ctl08',this);" href="http://msdn2.microsoft.com/ko-kr/magazine/bb985943(en-us).aspx">Figure 7.


Figure 6 Excel Spreadsheet

      I am looking to export data with one click to the user, so ideally I'd like to create an Excel file on the server, then have it download to the client automatically. But maybe I should have SQL export to a csv file, then e-mail it to the user.

A If you upgrade to version 10 of the spreadsheet control, you can query data directly into the control. The user then has Export to Microsoft Excel capabilities right there.
      If upgrading is not possible, then you could use the version 9 Pivot Control. It can connect to data and has detail or recordset viewing and an Export to Microsoft Excel option. However, with the Pivot Control Export to Microsoft Excel you get a PivotTable® in Excel.
      Instead of exporting to Excel, a good option is to have the user get the data from within Excel. A simple sheet containing a macro can get the data from a Web page in XML format and then inject it into the sheet. Since you probably want this functionality only on specific pages that report data, this is a clean option that respects the security settings at both ends (client and server).
      Create a csv file on the Web vroot, configure the Internet Information Services (IIS) vroot to process .csv extensions with the ASP engine, then in the local csv file put a little ASP code that generates a comma-delimited list of all the columns you want to export. Put the following at the bottom:
Response.ContentType = "application/msexcel" 
This tells Internet Explorer to download the file (which is a .csv file that can be opened by Excel) and the user can choose to download it or open it. So far it works quite nicely.
      Also check out Andrew Clinick's article at :Track('ctl00_ContentPlaceHolder1_ctl00|ctl00_ContentPlaceHolder1_ctl09',this);" href="http://msdn2.microsoft.com/ko-kr/magazine/ms974608(en-us).aspx">http://msdn.microsoft.com/workshop/languages/clinic/scripting10162000.asp, which describes how to get ASP pages to generate Office content.

Q I use window.open to load a Web page that takes in a comma-delimited list of IDs. This works great if I pass in a few dozen. But once I go over roughly 700 IDs on the URL (approximately 4000 bytes of data), the list just gets cut off.
      How many bytes can a single URL be under Internet Explorer 5.01? How many bytes can you POST to a form in another window? What's the maximum number of bytes you can pass in as a window argument with window.open? Are there any other ways to pass data from one window to another?

A You may be running into limits with IIS as well as the limits for POST. IIS 5.0 has a limit of 128KB for the HTTP request (before the entity body), which is much smaller than the 2MB limit of IIS 4.0. This can be set via the MaxClientRequestBuffer setting in the registry (see :Track('ctl00_ContentPlaceHolder1_ctl00|ctl00_ContentPlaceHolder1_ctl10',this);" href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;q260694">http://support.microsoft.com/default.aspx?scid=kb;EN-US;q260694).
      You can run into a 4096-byte limit for a URL and window parameter. If you use the POST you shouldn't run into any limit.
       If you're opening the new window with window.open, (and if the information you're passing to the page does not have to go to the server), why pass it as GET or POST at all? Why not just do the following on the client in the page being opened?
var w = window.opener;
myData = w.SomeFunctionDefinedOnMainPage();

Q I am trying to add a dropshadow effect to some of the text in my Web pages, but when I try using the TEXT-SHADOW attribute in my stylesheet file, nothing happens. Could you please show me how this should look?

A You can use DropShadow filter to achieve the result you're looking for. Figure 8 shows the effect.


Figure 8 The DropShadow Effect

:Track('ctl00_ContentPlaceHolder1_ctl00|ctl00_ContentPlaceHolder1_ctl11',this);" href="http://msdn2.microsoft.com/ko-kr/magazine/bb985943(en-us).aspx">Figure 9 shows how to use the DropShadow filter. If you have any further questions, check out the dropshadow reference at http://msdn.microsoft.com/workshop/author/filter/reference/filters/dropShadow.asp.
Thanks to the following Microsoft developers for their technical expertise: Tim Aranki, Pete Baxter, Dean Bell, Smitha Bhat, Daniel Boerner, Stephane Bouillon, Mike Christensen, Andrew Clinick, Zeb DeMeerleer, Rick Engle, John Frum, Geoff Gray, Deepak Gulati, Michael Kaplan, Andy Macourek, Jeremy Phelps, Dan Ricker.

 

 

Extreme XML
XML as the API
 

Chris Lovett
Microsoft Corporation

October 16, 2000


Download :Track('ctl00_ContentPlaceHolder1_ctl00|ctl00_ContentPlaceHolder1_ctl01',this);" href="http://download.microsoft.com/download/xml/utility/1/w982kmexp/en-us/test.exe">Test.exe.

Contents

First Attempt
XSL/T to the Rescue
Conclusion

Have you ever used Office Web Components? I recently had a very interesting experience— and I want to make a big deal about it, because I think it perfectly illustrates the difference between XML and object-oriented APIs.

I was writing some Active Server Pages (ASP) code to chart our team's bug-fix progress. We have a SQL Server database that contains all the bugs, to whom they are assigned, when they were opened, resolved, or closed, and their current status.

Our SQL Server database doesn't retain enough history to generate this exact graph, so I also had to create an XML file that could act as a cache for storing the results of a daily query made against the database. From the XML file, I generated the graph. This XML file is also a :Track('ctl00_ContentPlaceHolder1_ctl00|ctl00_ContentPlaceHolder1_ctl02',this);" href="http://msdn2.microsoft.com/ko-kr/magazine/ms950773(en-us).aspx">ListEditor file so that it can be directly edited with other information that does not come from the database, such as the target bug fix goal numbers (the black line in the chart above).

The XML file contains items that look like this:

   <item>
      <id>32</id><date>8/31/2000</date>
      <target>146</target><active>167</active>
      <dev>69</dev><pm>19</pm><test>1</test><ue>58</ue>
      <resolved>484</resolved>
      <rdev>15</rdev><rpm>36</rpm><rtest>396</rtest><rue>0</rue>
      <in>33</in><out>36</out>
   </item>

First Attempt

I read up on the Office 2000 Web Chart component API documented in MSOWCVBA.CHM, and I discovered that you can build charts from multiple input sources, including arrays, strings, recordsets, and spreadsheets. I looked at the samples and decided that arrays would be the easiest.

I then wrote a bunch of ASP code that generated the client-side JScript code for building the chart from these arrays. The ASP code looked something like this:

<object id=ChartSpace1 classid=CLSID:0002E500-0000-0000-C000-000000000046 style="width:100%;height:350"></object>

<script language=vbs>
Sub Window_OnLoad()
' The colors that I will use for the different chart series.
Dim colors(10)
colors(0) = "black"
colors(1) = "blue"
colors(2) = "red"
colors(3) = "green"
colors(4) = "magenta"
colors(5) = "orange"
colors(6) = "brown"
colors(7) = "gray"
colors(8) = "purple"
colors(9) = "yellow"
colors(10) = "lightgreen"

ChartSpace1.Charts.Add
Set c = ChartSpace1.Constants

' Create array of strings that describes each series.
<% var xpath = "//Schema/ElementType/element[@view = '']"
   var nodes = doc.selectNodes(xpath);%>
Dim series(<%=nodes.length%>)
<%
var series = new Array()
var node = nodes.nextNode();
i = 0
while (node != null) {
    var name = node.getAttribute("type");
    if (name != "id" && name != "date") {
        series[i] = name;
%>
series(<%=i%>) = "<%=name%>"
<%    i++;
    }
    node = nodes.nextNode();
}%>

' Now get the names of each category.
Dim dates()
<% nodes = doc.selectNodes("//item/date");%>
Dim categories(<%=nodes.length%>)
<%
k = 0
var node = nodes.nextNode();
while (node != null) {
    d = node.text.substr(0,node.text.length-5)
%>  categories(<%=k%>) = "<%=d%>"
<%
    k = k + 1
    node = nodes.nextNode();
}%>

' Now get the values for each series.
<%
var values = new Array();
for (j = 0; j < i; j++)
{
    name = series[j];
    nodes = doc.selectNodes("//item[date]");%>
Dim values(<%=k%>)
<%
    x = 0
    first = true
    var node = nodes.nextNode();
    while (node != null) {
        var child = node.selectSingleNode(name);
        if (child && child.text != "") {
            values[x] = parseInt(child.text);%>
values(<%=x%>) = <%=child.text%>
<%
            first = false;
        } else if (first) {
            values[x] = 0;%>
values(<%=x%>) = 0
<%      }
        x = x + 1;
        node = nodes.nextNode();
    } %>
ChartSpace1.Charts(0).SeriesCollection.Add
set chartseries = ChartSpace1.Charts(0).SeriesCollection(<%=j%>)
chartseries.Caption = series(<%=j%>)
chartseries.Line.Color = colors(<%=j%>)
chartseries.SetData c.chDimCategories, c.chDataLiteral, categories
chartseries.SetData c.chDimValues, c.chDataLiteral, values
<% } %>

ChartSpace1.Charts(0).HasLegend = True
ChartSpace1.Charts(0).Type = c.chChartTypeLine
ChartSpace1.Charts(0).Axes(c.chAxisPositionLeft).MajorUnit = 25

End Sub
</script>

I didn't particularly like this solution, because the ASP code was a nightmare to maintain. I changed it so that it would generate an HTML page that downloaded the XML to the client and built the chart entirely on the client side. This also took some of the load off my Web server.

Everything was moving along just fine until I hit a brick wall in the charting API itself. If you've played with Excel charts much, you may have run into their cool combination charts—which can display two vertical axes with a different scale on the same chart. If you look closely at the above chart, this is exactly what I wanted to do. I set up the chart so that the lines use the left axis, which goes up to 700; the bars use the right axis, which goes up to 160. It turns out that you cannot build such a chart using the charting API in Office 2000 Web components. I was stumped. I sent an e-mail to the Office guys to see whether they had some sort of workaround.

The Office team showed me a nifty little XmlData property on the ChartSpace object, which returns a complete XML format for the chart I had built. All I had to do was to tweak that XML a bit to insert the different scale on the right axis, set the XmlData property with the fixed version of the XML, and voilà, the right axis was fixed!

The XML format looks like this:

<xml xmlns:x="urn:schemas-microsoft-com:office:excel">
    <x:WebChart>
        <x:OWCVersion>9.0.0.2710</x:OWCVersion>
        <x:Width>20664</x:Width>
        <x:Height>9260</x:Height>
        <x:Chart>
            <x:PlotArea>
                <x:Interior>
                    <x:Color>#F0F0F0</x:Color>
                </x:Interior>
                <x:Graph>
                    <x:Type>Line</x:Type>
                    <x:SubType>Standard</x:SubType>
                    <x:Series>
                        <x:Line>
                            <x:Color>............</x:Color>
                        </x:Line>
                        <x:Caption>
                            <x:DataSource>-1</x:DataSource>
                            <x:Data>............</x:Data>
                        </x:Caption>
                        <x:Index>2</x:Index>
                        <x:Category>
                            <x:DataSource>-1</x:DataSource>
                            <x:Data>............</x:Data>
                        </x:Category>
                        <x:Value>
                            <x:DataSource>-1</x:DataSource>
                            <x:Data>............</x:Data>
                        </x:Value>
                    </x:Series>
...
Note   As of this writing, the Office team does not commit to supporting this XML format, as it may change.

XSL/T to the Rescue

I put two and two together and decided I didn't need all that code after all. I needed only a simple XSL style sheet, built from the XML representation of the chart that I really wanted. The XSL style sheet could insert the numbers that I wanted from my little XML file.

The client-side code became quite clean:

<HTML>
<object id=ChartSpace1 classid=CLSID:0002E500-0000-0000-C000-000000000046
        style="width:100%;height:350"></object>
<xml id="XmlDoc" src="daily.xml"></xml>
<xml id="Xsl" src="chart.xsl"></xml>
<script for=window event=onload>
    ChartSpace1.XMLData = XmlDoc.transformNode(Xsl.XMLDocument);
</script>
</HTML>

The result is the following:

File
Description
Test.asp The HTML page that displays the chart. You can view the chart if you have Internet Explorer 5.x and Office 2000 Web Components installed.
Daily.xml The XML file that contains the bug history.
Chart.xsl The XSL file that builds the chart in XML format.
Tableview.xsl The XSL file that builds the raw data HTML table view.
Mycss.css A cascading style sheet that defines the look of the HTML page.

Conclusion

What just happened here? A tightly bound, object-oriented API for manipulating charts was bigger and richer than my application required.

The high-powered charting API hit a brick wall. The feature for implementing different scales on multiple axes was not exposed. Developing high-powered, tightly coupled APIs is expensive. It takes time and effort, and the APIs are hard to test. Imagine having to test all the call sequences over scores of classes and hundreds of methods. It's almost impossible, which is why important features like this get cut.

I didn't need to animate the chart. I just needed a simple chart built from some simple XML—that wouldn't change much over time, except for the data.

Fortunately, the application exposed the loosely coupled, low-tech XML format. This XML format rips all the API stuff out of the way and gives you raw access to every piece of data that makes up the real chart. It enables you to reach into the guts of the chart and tweak whatever you need to.

The tradeoff is that the granularity is now much coarser. You cannot make the line colors animate in different colors every millisecond. You cannot make the line width pulse to the rhythm of a heartbeat. It turns out, however, that this coarser granularity is just perfect for most Web-based applications of the Office Web Chart component.

This is a perfect example of how a loosely coupled, coarse-grained XML API can also result in a deeper integration between components (in this case, the Office Web Chart Component and my ASP application), because the object-oriented interfaces that could get in the way have been bypassed. This assumes that your component's XML format is well designed, and that all the capabilities are exposed in that XML format.

The XML interface to your component should also be a lot cheaper to build, because it doesn't have the call sequence test matrix explosion. It simply accepts the XML in one specific schema—and if the XML doesn't validate against that schema, it is rejected. You have to test lots of different XML inputs, but that is still less work than testing all the possible call sequences through a rich API.

Don't get me wrong. I love objects and I love rich APIs—because I'm a programmer, after all. But there is now a paradigm shift in which, for many cases, a rich API is overkill—and customers are demanding simplicity paired with deeper integration between components. XML is the answer to this problem.

Chris Lovett is a program manager for Microsoft's XML team

2008년 1월 2일 수요일

“이 제품에 대한 설치 원본을 사용할 수 없습니다.”

“이 제품에 대한 설치 원본을 사용할 수 없습니다.” 해결방법 프로그래밍

2007/03/14 10:30

http://blog.naver.com/onlybell/80035726485

Developent 2007/03/10 23:55

Microsoft Visual Studio 2005 Service Pack 1 설치 시 , 일부 시스템에서
"이 제품에 대한 설치 원본을 사용할 수 없습니다. 원본이 있는지 또는 액세스할 수 있는지 확인하십시오."라는 에러 메시지를 만나실 수 있을 것입니다.
오늘 드디어 그 방법을 해결했는데 너무 허무하게 끝나다 보니 내가 지금 것 뭐했나 쉽기도 하고… 그런 생각이 드네요.
어쨌던 방법은 로컬 보안 정책을 변경함으로써 가능합니다.

1. <제어판> - <관리 도구> - <로컬 보안 정책>을 엽니다.


2. "새 소프트웨어 제한 정책"을 생성합니다.


3. "강요" 항목의 속성을 엽니다.


4. 소프트웨어 제한 정책을 "로컬 관리자를 제외한 모든 사용자"로 선택을 바꿉니다.


5. 소프트웨어 설치

해당 VS80SP1을 설치를 합니다.

6. 설치가 완료되면, 새로 설정한 소프트웨어 제한 정책을 삭제합니다.

2007년 12월 22일 토요일

2007년 12월 15일 토요일

datafile + redo log 파일 위치 변경하기.

- 데이터 파일의 위치를 변경하여 오라클을 올려보겠다.

- 이동파일은 데이터 파일 + redo log 파일이다.

- 테스트 환경은 : redhat9 + oracle 9.2.0.4 / vmware 상에서 실시

- 현재 dbf 파일들이  OS 영역에 위치하고 있으므로 디스크 하나 추가후 oradata로 마운트하고 datafile 과 redolog 파일의 위치를 바꾸어 오라클을 정상 가동 시키겠다.

 

- 현재상황

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              14G  8.4G  4.6G  65% /
/dev/sda1              99M  9.3M   85M  10% /boot
/dev/sdb1             5.0G  2.1G  2.6G  45% /backup
none                  147M     0  147M   0% /dev/shm

- 데이터 파일 위치

SQL> select name from v$datafile ;

NAME
--------------------------------------------------------------------------------
/oracle/oradata/orcl/system01.dbf
/oracle/oradata/orcl/undotbs01.dbf
/oracle/oradata/orcl/cwmlite01.dbf
/oracle/oradata/orcl/drsys01.dbf
/oracle/oradata/orcl/example01.dbf
/oracle/oradata/orcl/indx01.dbf
/oracle/oradata/orcl/odm01.dbf
/oracle/oradata/orcl/tools01.dbf
/oracle/oradata/orcl/users01.dbf
/oracle/oradata/orcl/xdb01.dbf

10 rows selected.

- redo log 파일 위치

SQL> col member format a45
SQL> select * from v$logfile ;

    GROUP# STATUS  TYPE    MEMBER
---------- ------- ------- ---------------------------------------------
         3         ONLINE  /oracle/oradata/orcl/redo03.log
         2         ONLINE  /oracle/oradata/orcl/redo02.log
         1         ONLINE  /oracle/oradata/orcl/redo01.log

- controlfile 위치

SQL> col name format a40
SQL> select * from v$controlfile ;

STATUS  NAME
------- ----------------------------------------
        /oracle/oradata/orcl/control01.ctl
        /oracle/oradata/orcl/control02.ctl
        /oracle/oradata/orcl/control03.ctl

- 모두 /oracle/oradata/orcl/ 밑에 위치해 있음을 알수 있다.

- datafile 들은 /oradata/datafile 밑에 위치시키고

- redolog file은 /oradata/redolog 밑에 위치시키고

- control file 은 현재의 디렉토리와 /oradata/controlfile/ 밑에 하나를 위치시켜겠다.

 

- 오라클을 정상종료 시킨다.

[oracle@oracle oracle]$ sh oracle_stop.sh

SQL*Plus: Release 9.2.0.4.0 - Production on Fri Mar 16 09:55:26 2007

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

SQL> Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 16-MAR-2007 09:55:33

Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
The command completed successfully

SQL> Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
###################################################################
###################### oracle daemon check ########################
###################################################################
oracle    1473  1472  0 09:37 pts/0    00:00:00 -bash
oracle    1604  1473  0 09:55 pts/0    00:00:00 sh oracle_stop.sh
oracle    1608  1604  0 09:55 pts/0    00:00:00 ps -ef
oracle    1609  1604  0 09:55 pts/0    00:00:00 grep ora

 

- 시스템(리눅스)상에서 디스크 추가 후 /oradata 로 마운트시킨다.(생략)

- 마운트 하고 나서의 정보

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              14G  8.4G  4.6G  65% /
/dev/sda1              99M  9.3M   85M  10% /boot
/dev/sdb1             5.0G  2.1G  2.6G  45% /backup
none                  147M     0  147M   0% /dev/shm
/dev/sdc1             5.0G   33M  4.7G   1% /oradata  <-- 추가된것

 

- 시스템 명령을 이용하여 dbf 파일과 redolog 파일과 controlfile 을 copy한다(copy할것, 괜히 move 했다가 안올라오면 원복시켜야함으로)

[oracle@oracle oracle]$ more move.sh

#!/bin/bash

cp /oracle/oradata/orcl/system01.dbf /oradata/datafile
cp /oracle/oradata/orcl/undotbs01.dbf /oradata/datafile
cp /oracle/oradata/orcl/cwmlite01.dbf /oradata/datafile
cp /oracle/oradata/orcl/drsys01.dbf /oradata/datafile
cp /oracle/oradata/orcl/example01.dbf /oradata/datafile
cp /oracle/oradata/orcl/indx01.dbf /oradata/datafile
cp /oracle/oradata/orcl/odm01.dbf /oradata/datafile
cp /oracle/oradata/orcl/tools01.dbf /oradata/datafile
cp /oracle/oradata/orcl/users01.dbf /oradata/datafile
cp /oracle/oradata/orcl/xdb01.dbf /oradata/datafile

cp /oracle/oradata/orcl/redo03.log /oradata/redolog
cp /oracle/oradata/orcl/redo02.log  /oradata/redolog
cp /oracle/oradata/orcl/redo01.log  /oradata/redolog


cp /oracle/oradata/orcl/control03.ctl /oradata/controlfile

- 왠만하면 스크립터를 간단히 만들어서 수행하기 바란다. 나중에 내가 멀했는지 모르는건 골치아프다.

- 자 이제 pfile(pfile 로 오라클 가동중이였으므로) 을 고쳐서 controlfile 의 위치를 수정해주고 오라클을 마운트 단계까지 올린다.

[oracle@oracle dbs]$ vi initorcl.ora

*.aq_tm_processes=1
*.background_dump_dest='/oracle/admin/orcl/bdump'
*.compatible='9.2.0.0.0'
*.control_files='/oracle/oradata/orcl/control01.ctl','/oracle/oradata/orcl/control02.ctl','/oradata/controlfile/control03.ctl'

 

SQL> startup mount
ORACLE instance started.

Total System Global Area  236000356 bytes
Fixed Size                   451684 bytes
Variable Size             201326592 bytes
Database Buffers           33554432 bytes
Redo Buffers                 667648 bytes
Database mounted.
SQL>

 

- 데이터베이스 이름을 rename 한다. 이것도 간단한 script 를 만들어서 수행한다.

[oracle@oracle oracle]$ more rename.sh

alter database rename file '/oracle/oradata/orcl/system01.dbf' to '/oradata/datafile/system01.dbf' ;
alter database rename file '/oracle/oradata/orcl/undotbs01.dbf' to '/oradata/datafile/undotbs01.dbf';
alter database rename file '/oracle/oradata/orcl/cwmlite01.dbf'to '/oradata/datafile/cwmlite01.dbf' ;
alter database rename file '/oracle/oradata/orcl/drsys01.dbf' to '/oradata/datafile/drsys01.dbf' ;
alter database rename file '/oracle/oradata/orcl/example01.dbf' to '/oradata/datafile/example01.dbf' ;
alter database rename file '/oracle/oradata/orcl/indx01.dbf' to '/oradata/datafile/indx01.dbf' ;
alter database rename file '/oracle/oradata/orcl/odm01.dbf' to '/oradata/datafile/odm01.dbf' ;
alter database rename file '/oracle/oradata/orcl/tools01.dbf' to '/oradata/datafile/tools01.dbf' ;
alter database rename file '/oracle/oradata/orcl/users01.dbf' to '/oradata/datafile/users01.dbf' ;
alter database rename file '/oracle/oradata/orcl/xdb01.dbf' to '/oradata/datafile/xdb01.dbf' ;

alter database rename file '/oracle/oradata/orcl/redo03.log' to '/oradata/redolog/redo03.log' ;
alter database rename file '/oracle/oradata/orcl/redo02.log'  to '/oradata/redolog/redo02.log';
alter databsse rename file '/oracle/oradata/orcl/redo01.log'  to '/oradata/redolog/redo01.log';

 

 

SQL> @rename.sh

Database altered.

.

.

.

..


SQL> alter database open ;

Database altered.

 

- 자 이제 다 잘돼서 올라왔다. 정보를 확인해보고 기존의 dbf 파일과 redolog 파일은 지우든지 내버려두든지 알아서 하면 된다(내버려두면 cold 백업본이 되는 셈이다.)

 


SQL> select name from v$datafile
  2  ;

NAME
--------------------------------------------------------------------------------
/oradata/datafile/system01.dbf
/oradata/datafile/undotbs01.dbf
/oradata/datafile/cwmlite01.dbf
/oradata/datafile/drsys01.dbf
/oradata/datafile/example01.dbf
/oradata/datafile/indx01.dbf
/oradata/datafile/odm01.dbf
/oradata/datafile/tools01.dbf
/oradata/datafile/users01.dbf
/oradata/datafile/xdb01.dbf

 

SQL> select * from v$logfile ;

    GROUP# STATUS  TYPE    MEMBER
---------- ------- ------- ---------------------------------------------
         3 STALE   ONLINE  /oradata/redolog/redo03.log
         2         ONLINE  /oradata/redolog/redo02.log
         1         ONLINE  /oracle/oradata/orcl/redo01.log

- 들고갈때 덧글.. 출처를 명시해 주기 바랍니다.

2007년 12월 1일 토요일

12월 휴가테르메덴에서

테르메덴으로 출발하는 모습... 현서가 무거운 가방을 들고 차로 가는 모습..(아파트 주차장에서 출발..)

아빠랑 점심을 기다리며 이야기하는 모습.. "저기 번호가 보이면 가서 가져오면되 현서야.." (2층식당에서 점심식사)

현서와 잠자는 모습... 현서 많이 피곤했나보다.. (2층 휴게소에서 취침)

아빠와 같이 휴게실에서 음료수한잔...

수영 후 집에가기전 ..

저녁 이천 쌀밥집에서... 맛있는 저녁이었당... 정일품에 갈려고 했는데... 아쉽게 못찾고 ..담에 갈땐 ^^

저녁 식사한곳에서 휴대폰을 잊어버려 어쩔수 없이 엔젤 서비스 받아 휴대폰 빌림

2007년 11월 21일 수요일

왕벌의 비행 악보

 

Rimsky Korsakov - 왕벌의비행 Maksim Ver.

 

막심므라비차 (Maksim Mrvica) 왕벌의 비행 악보

 

왠지 Rimsky Korsakov보다 Maksim Ver.이 더 유명해진...

2007년 11월 17일 토요일

컨트롤키 사용 못하게 하는 KeyCode 및 KeyCodeList

1.컨트롤키 사용 못하게 하고 function 키도 사용 못하게 하는 자바스크립트

<script language="javascript">
function processKey()
{
    if((event.ctrlKey == true && (event.keyCode == 78 || event.keyCode == 82)) ||

           (event.keyCode >= 112 && event.keyCode <= 123) || event.keyCode == 8)
    {
       event.keyCode = 0;
       event.cancelBubble = true;
       event.returnValue = false;
    }
}
document.onkeydown = processKey;
</script>

2.키코드 알아내는 스크립트

<html>
<head>
<script>
function key_check(){
alert("키번호는 [" +event.keyCode+ "] 입니다.");
}
</script>
</head>
<body onKeyDown='key_check();'>
알고싶은 키패드를 꽉! 눌러주세요...ㅡㅡ;
</body>
</html>

-----------------------------------------------------------------------

event.KeyCode 리스트

←(백스패이스) = 8
TAB = 9
ENTER = 13
SHIFT = 16
CTRL = 17
ALT = 18
PAUSEBREAK = 19
CAPSLOOK = 20
한/영 = 21
한자 = 25
ESC = 27

스패이스 = 32
PAGEUP = 33
PAGEDN = 34
END = 35
HOME =36

←(중간) = 37
↑(중간) = 38
→(중간) = 39
↓(중간) = 40

INSERT = 45
DELETE = 46

0 = 48
1 = 49
2 = 50
3 = 51
4 = 52
5 = 53
6 = 54
7 = 55
8 = 56
9 = 57

A = 65
B = 66
C = 67
D = 68
E = 69
F = 70
G = 71
H = 72
I = 73
J = 74
K = 75
L = 76
M = 77
N = 78
O = 79
P = 80
Q = 81
R = 82
S = 83
T = 84
U = 85
V = 86
W = 87
X = 88
Y = 89
Z = 90

윈도우(왼쪽) = 91
윈도우(오른쪽) = 92
기능키 = 93

0(오른쪽) = 96
1(오른쪽) = 97
2(오른쪽) = 98
3(오른쪽) = 99
4(오른쪽) = 100
5(오른쪽) = 101
6(오른쪽) = 102
7(오른쪽) = 103
8(오른쪽) = 104
9(오른쪽) = 105


.(오른쪽) = 110
/(오른쪽) = 111
*(오른쪽) = 106
+(오른쪽) = 107
-(오른쪽) = 109

F1 = 112
F2 = 113
F3 = 114
F4 = 115
F5 = 116
F6 = 117
F7 = 118
F8 = 119
F9 = 120
F10 = 121
F11 = 122
F12 = 123

NUMLOCK = 144
SCROLLLOCK = 145
=(중간) = 187
-(중간) = 189
`(왼쪽콤마) = 192
\(중간) = 220

 

출처:http://phpschool.com/bbs2/inc_view.html?id=9722&code=tnt2&start=0&mode=search&field=title&search_name=&operator=or&period=all&category_id=&s_que=event