|
THIS SITE IS NOMORE UPDATED.THE CONTENT HERE MAY BE OUTDATEDSORRY FOR INCONVENIENCE::Author::Ricky
Post / Read Comments Import with different tablespace and user names Pre-requisites before going for import. -Tablespaces should be there already or create a new one. A.Login as system & Use the following sql stmt to create customised tablespace of your own choice create tablespace <data_tablespace_name> Datafile '<data_tablespace_path>\<dat_tablespace_name>.dbf' size <data_tablespace_size_in_mb> reuse autoextend on NEXT 1M MAXSIZE UNLIMITED; Note: Provide tablespace size in Megabyte structure e.g: 200M for 200Megabyte B.Use below query to create customised indexspace create tablespace <index_tablespace_name> Datafile '<index_tablespace_path>\<index_tablespace_name<.dbf' size <index_tablespace_size_in_mb> reuse autoextend on NEXT 1M MAXSIZE UNLIMITED; -User should be already existing with assigned tablespaces or create a new user and assign the tablespaces. -Use below query to crete user: create user <schema_user_name> identified by <schema_user_password> default tablespace <data_tablespace_name> temporary tablespace temp_tablespace_name; Note: For temp tablespace "temp" name can be used. -Give the newly created user DBA to let it import, as only a DBA can import a DBA created dump file. login as system user & use below command to give DBA permission: grant dba to <schema_user_name>; C. Run the import in command prompt using the INDEXFILE option. This will create a file called index.sql. imp <schema_user_name>/<schema_user_password>@<SID> file=Dump.dmp indexfile=index.sql fromuser=<from_user_name> touser=<to_user_name>; Note: here from_user_name is the user name of the previous schema from where dump file is taken and to_user_name is same as the schema_user_name to which the data will be imported. D. Edit the index.sql file, Remove all the "REM ", and replace all instances of old tablespace names and old indexspace names with newly created tablespace and indexspace names respectively. And also remove a sentence like "CONNECT <to_user_name>". This statement will come only once in index.sql file. E. Login as <to_user_name> into the DB using SQL*Plus and execute the index.sql file. This will create all the objects in the new schema. -Use below commands to login and run the index.sql file. sqlplus <to_user_name>/<to_user_password>@SID; sql>@index.sql; F. Run the import again with the IGNORE=Y option in command prompt. imp <to_user_name>/<to_user_password>@SID file=dump.dmp full=Y ignore=Y log=Dumplog.log G. This will import all the data to the new schema with different tablespace and indexspace name. Note: <I> Ignore errors during import which says table or objects already exists. This is a normal error as we have already created all the objects by running index.sql file in sqlplus. <II> Ignore compilation errors as it will all go once you compile all after importing is done. Labels: ORACLE
Post / Read Comments using struts2 with tomcat6.0.1in netbeans 6.1 with jdk1.6 Problem: Giving a relative path fire fox is telling it’s not a valid protocol
Labels: JAVA
Post / Read Comments RPM Commands This document contains an overview of the principal RPM commands for installing, uninstalling, upgrading, querying, listing, and checking RPM packages on your Red Hat Linux system. # rpm -ivh foo-2.0-4.i386.rpm # rpm -i ftp://ftp.redhat.com/pub/redhat/RPMS/foo-1.0-1.i386.rpm # rpm -i http://oss.oracle.com/projects/firewire/dist/files/kernel-2.4.20-18.10.1.i686.rpm Used to install a RPM package. Note that RPM packages have file naming conventions like foo-2.0-4.i386.rpm, which include the package name (foo), version (2.0), release (4), and architecture (i386). Also notice that RPM understands FTP and HTTP protocols for installing and querying remote RPM files. # rpm -e foo To uninstall a RPM package. Note that we used the package name foo, not the name of the original package file foo-2.0-4.i386.rpm above. # rpm -Uvh foo-1.0-2.i386.rpm # rpm -Uvh ftp://ftp.redhat.com/pub/redhat/RPMS/foo-1.0-1.i386.rpm # rpm -Uvh http://oss.oracle.com/projects/firewire/dist/files/kernel-2.4.20-18.10.1.i686.rpm To upgrade a RPM package. Using this command, RPM automatically uninstall the old version of the foo package and install the new package. It is safe to always use rpm -Uvh to install and upgrade packages, since it works fine even when there are no previous versions of the package installed! Also notice that RPM understands FTP and HTTP protocols for upgrading from remote RPM files. # rpm -qa To query all installed packages. This command will print the names of all installed packages installed on your Linux system. # rpm -q foo To query a RPM package. This command will print the package name, version, and release number of the package foo only if it is installed. Use this command to verify that a package is or is not installed on your Linux system. # rpm -qi foo To display package information. This command display package information including the package name, version, and description of the installed program. Use this command to get detailed information about the installed package. # rpm -ql foo To list files in installed package. This command will list all of files in an installed RPM package. It works only when the package is already installed on your Linux system. # rpm -qf /usr/bin/mysql mysql-3.23.52-3 Which package owns a file? This command checks to determine which installed package a particular file belongs to. # rpm -qpl kernel-2.4.20-18.10.1.i686.rpm # rpm -qpl ftp://ftp.redhat.com/pub/redhat/RPMS/foo-1.0-1.i386.rpm # rpm -qpl http://oss.oracle.com/projects/firewire/dist/files/kernel-2.4.20-18.10.1.i686.rpm List files in RPM file. This command allows you to query a (possibly) uninstalled RPM file with the use of the the "-p" option. You can use the "-p" option to operate on an RPM file without actually installing anything. This command lists all files in an RPM file you have in the current directory. Also note that RPM can query remote files through the FTP and HTTP protocols. # rpm --verify mysql To verify an installed package. This command will list all files that do NOT pass the verify tests (done on size, MD5 signature, etc). Where a file does NOT pass, the output is listed using the following codes that signify what failed: S File size M Mode (includes permissions and file type) 5 MD5 sum L Symlink D Device U User G Group T Mtime Take for example the following: # rpm --verify mysql S.5....T c /etc/my.cnf This example indicates that file /etc/my.cnf failed on: File size MD5 Sum Modified Time However, the "c" tells us this is a configuration file so that explains the changes. It should still be looked at to determine what the changes were. # rpm --checksig foo To check a RPM signature package. This command checks the PGP signature of specified package to ensure its integrity and origin. Always use this command first before installing a new RPM package on your system. Also, GnuPG or Pgp software must be already installed on your system before you can use this command.
Post / Read Comments All About ls Command Lists the contents of a directory. Syntax ls [-a] [-A] [-b] [-c] [-C] [-d] [-f] [-F] [-g] [-i] [-l] [-L] [-m] [-o] [-p] [-q] [-r] [-R] [-s] [-t] [-u] [-x] [pathnames] -a Shows you all files, even files that are hidden (these files begin with a dot.) -A List all files including the hidden files. However, does not display the working directory (.) or the parent directory (..). -b Force printing of non-printable characters to be in octal \ddd notation. -c Use time of last modification of the i-node (file created, mode changed, and so forth) for sorting (-t) or printing (-l or -n). -C Multi-column output with entries sorted down the columns. Generally this is the default option. -d If an argument is a directory it only lists its name not its contents. -f Force each argument to be interpreted as a directory and list the name found in each slot. This option turns off -l, -t, -s, and -r, and turns on -a; the order is the order in which entries appear in the directory. -F Mark directories with a trailing slash (/), doors with a trailing greater-than sign (>), executable files with a trailing asterisk (*), FIFOs with a trailing vertical bar (|), symbolic links with a trailing at-sign (@), and AF_Unix address family sockets with a trailing equals sign (=). -g Same as -l except the owner is not printed. -i For each file, print the i-node number in the first column of the report. -l Shows you huge amounts of information (permissions, owners, size, and when last modified.) -L If an argument is a symbolic link, list the file or directory the link references rather than the link itself. -m Stream output format; files are listed across the page, separated by commas. -n The same as -l, except that the owner's UID and group's GID numbers are printed, rather than the associated character strings. -o The same as -l, except that the group is not printed. -p Displays a slash ( / ) in front of all directories. -q Force printing of non-printable characters in file names as the character question mark (?). -r Reverses the order of how the files are displayed. -R Includes the contents of subdirectories. -s Give size in blocks, including indirect blocks, for each entry. -t Shows you the files in modification time. -u Use time of last access instead of last modification for sorting (with the -t option) or printing (with the -l option). -x Displays files in columns. -1 Print one entry per line of output. pathnames File or directory to list. Examples ls -l In the above example this command would list each of the files in the current directory and the files permissions, the size of the file, date of the last modification, and the file name or directory. Below is additional information about each of the fields this command lists. Permissions Directories Group Size Date Directory or file drwx------ 2 users 4096 Nov 2 19:51 mail/ drwxr-s--- 35 www 32768 Jan 20 22:39 public_html/ -rw------- 1 users 3 Nov 25 02:58 test.txt Below is a brief description of each of the above categories shown when using the ls -l command. Permissions - The permissions of the directory or file. Directories - The amount of links or directories within the directory. The default amount of directories is going to always be 2 because of the . and .. directories. Group - The group assigned to the file or directory Size - Size of the file or directory. Date - Date of last modification. Directory of file - The name of the file or file. ls ~ List the contents of your home directory by adding a tilde after the ls command. ls / List the contents of your root directory. ls ../ List the contents of the parent directory. ls */ List the contents of all sub directories. ls -d */ Only list the directories in the current directory.
Post / Read Comments How to manipulate a Microsoft Access Database via JDBC Using JavaAnd Quick Overview of JDBC BasicsThis will teach you how to connect to a Microsoft Access database. Once you are connected, you may run any SQL statement that is allowable on Access, such as: :- a SELECT statement to retrieve data :-an INSERT statement to add data :-a DELETE statement to remove data :-an CREATE TABLE statement to build a new table :-a DROP TABLE statement to destroy a table This document is designed for people who are entirely new to JDBC,If you have prior knowledge of JDBC then no need to read entire document some parts can be ommited. Steps Taken: There are three things we need to do to manipulate a MS Access database: 1) Set up Java to understand ODBC. 2) Get a connection to our MS Access Database 3) Run a SQL statement. Step 1) Set up your DriverManager to understand ODBC data sources The first thing we must do in order to manipulate data in the database is to be granted a connection to the database. This connection, referenced in the Java language as an Object of type "java.sql.Connection", is handed out by the DriverManager. We tell the DriverManager what type of driver to use to handle the connections to databases, and from there, ask it to give us a connection to a particular database of that type. Here we are interested in accessing a Microsoft Access database. Microsoft has developed a data access method called ODBC, and MS Access databases understand this method. We cannot make a connection directly to an ODBC data source from Java, but Sun has provided a bridge from JDBC to ODBC. This bridge gives the DriverManager the understanding of how to communicate with an ODBC (i.e a MS Access) data source. So the first thing we'll do is set up our DriverManager and let it know that we want to communicate with ODBC data sources via the JDBC:ODBC bridge. We do this by calling the static forName() method of the Class class. Here is an entire program that accomplishes what we're after: //**********************************RK*************************************** class Test { public static void main(String[] args) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch (Exception e) { System.out.println("Error: " + e); } } } //save this code into a file called Test.java and compile it //***************************************************************************** Notice the TRY-CATCH block. The forName() method might throw a ClassNotFoundException. This really can't happen with the JDBC:ODBC bridge, since it's built in to the Java API, but we still have to catch it. If you compile and run this code,if it produces any output, then that means that you've encountered an error! But it shows how to get your DriverManager set. We're now ready to try and get a connection to our specific database so we can start to run SQL statements on it! Step 2 method 1) Get a connection by direct access One way to get a connection is to go directly after the MS Access database file. This can be a quick and easy way to do things, but I have seen this not work on some windows machines. Here is a complete sample program getting a connection to a MS Access database on my hard drive at D:\java\mdbTEST.mdb. This sample includes the lines required to set the DriverManager up for ODBC data sources: //******************************************************************************** import java.sql.*; class Test { public static void main(String[] args) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); // set this to a MS Access DB you have on your machine String filename = "d:/java/mdbTEST.mdb"; String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="; database+= filename.trim() + ";DriverID=22;READONLY=true}"; // add on to the end // now we can get the connection from the DriverManager Connection con = DriverManager.getConnection( database ,"",""); } catch (Exception e) { System.out.println("Error: " + e); } } } //save this code into a file called Test.java and compile it //************************************************************************************* Notice that this time I imported the java.sql package - this gives us usage of the java.sql.Connection object. The line that we are interested in here is the line Connection con = DriverManager.getConnection( database ,"",""); What we are trying to do is get a Connection object (named con) to be built for us by the DriverManager. The variable database is the URL to the ODBC data source, and the two sets of empty quotes ("","") indicate that we are not using a username or password. In order to have this program run successfully, you have to have an MS Access database located at filename location. Edit this line of code and set it to a valid MS Access database on your machine. If you do not already have an MS Access database, please jump down to Set the Access Database up as an ODBC DSN section, which shows how to create an empty MS Access database. If you do have a MS Access database, and this is working correctly, then you're ready to Run an SQL Statement! Step 2 method 2) Set up a DSN and get a connection through DSN Microsoft has provided a method to build a quick Jet-Engine database on your computer without the need for any specific database software (it comes standard with Windows). Using this method, we can even create a blank Microsoft Access database without having MS Access installed! As we learned earlier, MS Access data bases can be connected to via ODBC. Instead of accessing the database directly, we can access it via a Data Source Name (DSN). Here's how to set up a DSN on your system: 1. Open Windows' ODBC Data Source Administrator as follows: * In Windows 95, 98, or NT, choose Start > Settings > Control Panel, then double-click the ODBC Data Sources icon. Depending on your system, the icon could also be called ODBC or 32bit ODBC. * In Windows 2000, choose Start > Settings > Control Panel > Administrative Tools > Data Sources. 2. In the ODBC Data Source Administrator dialog box, click the System DSN tab. 3. Click Add to add a new DSN to the list. 4. Scroll down and select the Microsoft Access (.MDB) driver 5. Type in the name "mdbTEST" (no quotes, but leave the cases the same) for the Data Source Name 6. Click CREATE and select a file to save the database to (I chose "d:\java\mdbTEST.mdb") - this creates a new blank MS Access database! 7. Click "ok" all the way out Now our data source is done! Here's a complete program showing how to access your new DSN data source: //***************************************RK*************************** import java.sql.*; public class Test { public static void main(String[] args) { // change this to whatever your DSN is String dataSourceName = "mdbTEST"; String dbURL = "jdbc:odbc:" + dataSourceName; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection(dbURL, "",""); } catch (Exception err) { System.out.println( "Error: " + err ); } } } //save this code into a file called Test.java and compile it //*****************************************RK****************************** As stated in the code, modify the variable dataSourceName to whatever you named your DSN in step 5 from above. If this complies and runs successfully, it should produce no output. If you get an error, something isn't set up right - give it another shot! Once this is working correctly, then you're ready to Run an SQL Statement! Step 3) Running a SQL Statement on your Access Database Once you have your connection, you can manipulate data within the database. In order to run a SQL query, you need to do 2 things: 1. Create a Statement from the connection you have made 2. Get a ResultSet by executing a query (your insert/delete/etc. statement) on that statement Now lets learn how to make a statement, execute a query and display a the ResultSet from that query. Refer to the following complete program for an understanding of these concepts (details follow): This code assumes that you have used the DSN method (Step 2 method 2) to create a DSN named mdbTest. If you have not, you'll need to modify this code to work for a direct connection as explained in Step 2 method 1. //***************************************RK********************************************* import java.sql.*; public class Test { public static void main(String[] args) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); /* the next 3 lines are Step 2 method 2 from above - you could use the direct access method (Step 2 method 1) istead if you wanted */ String dataSourceName = "mdbTEST"; String dbURL = "jdbc:odbc:" + dataSourceName; Connection con = DriverManager.getConnection(dbURL, "",""); // try and create a java.sql.Statement so we can run queries Statement s = con.createStatement(); s.execute("create table TEST12345 ( column_name integer )"); // create a table s.execute("insert into TEST12345 values(1)"); // insert some data into the table s.execute("select column_name from TEST12345"); // select the data from the table ResultSet rs = s.getResultSet(); // get any ResultSet that came from our query if (rs != null) // if rs == null, then there is no ResultSet to view while ( rs.next() ) // this will step through our data row-by-row { /* the next line will get the first column in our current row's ResultSet as a String ( getString( columnNumber) ) and output it to the screen */ System.out.println("Data from column_name: " + rs.getString(1) ); } s.execute("drop table TEST12345"); s.close(); // close the Statement to let the database know we're done with it con.close(); // close the Connection to let the database know we're done with it } catch (Exception err) { System.out.println("ERROR: " + err); } } } //save this code into a file called Test.java and compile it //******************************************************************************************* If this program compiles and runs successfully, you should see some pretty boring output: Data from column_name: 1 While that may not seem like much, let's take a quick look at what we've accomplished in the code. 1. First, we set the DriverManager to understand ODBC data sources. Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); 2. Then, we got a connection via the DSN as per Step 2 method 2: String dataSourceName = "mdbTEST"; String dbURL = "jdbc:odbc:" + dataSourceName; Connection con = DriverManager.getConnection(dbURL, "",""); We could have used the direct method instead to get our connection. 3. Next, we created a java.sql.Statement Object so we could run some queries: Statement s = con.createStatement(); 4. Then came the exciting stuff - we ran some queries and made some changes! s.execute("create table TEST12345 ( column_name integer )"); // create a table s.execute("insert into TEST12345 values(1)"); // insert some data into the table s.execute("select column_name from TEST12345"); // select the data from the table 5. The next part might be a little strange - when we ran our select query (see above), it produced a java.sql.ResultSet. A ResultSet is a Java object that contains the resulting data from the query that was run - in this case, all the data from the column column_name in the table TEST12345. ResultSet rs = s.getResultSet(); // get any ResultSet that came from our query if (rs != null) // if rs == null, then there is no ResultSet to view while ( rs.next() ) // this will step through our data row-by-row { /* the next line will get the first column in our current row's ResultSet as a String ( getString( columnNumber) ) and output it to the screen */ System.out.println("Data from column_name: " + rs.getString(1) ); } As you can see, if the ResultSet object rs equals null, then we just skip by the entire while loop. But since we should have some data in there, we do this while ( rs.next() ) bit. What that means is: while there is still data to be had in this result set, loop through this block of code and do something with the current row in the result set, then move on to the next row. What we're doing is looping through the result set, and for every row grabbing the first column of data and printing it to the screen. We are using the method provided in the result set called getString(int columnNumber) to get the data from the first column in our result set as as String object, and then we're just printing it out via System.out.println. We know that the data in our ResultSet is of type String, since we just built the table a couple of lines before. There are other getXXX methods provided by ResultSet, like getInt() and getFloat(), depending on what type of data you are trying to get out of the ResultSet. Please refer to the JSDK API for a full description of the ResultSet methods. 6. After that we just cleaned up our database by dropping (completely removing) the newly created table: s.execute("drop table TEST12345"); 7. Lastly, we need to close the Statement and Connection objects. This tells the database that we are done using them and that the database can free those resources up for someone else to use. It is very important to close your connections - failure to do so can over time crash your database! While this isn't too important with a MS Access database, the same rules apply for any data base (like Oracle, MS SQL, etc.) s.close(); // close the Statement to let the database know we're done with it con.close(); // close the Connection to let the database know we're done with it That's it!! Now you know the basics for connecting to a MS Access Database via JDBC! If you found this useful then please leave a comment below!!! What I assume you already know This document assumes that you are working on a Windows machines since we'll be connecting to a Microsoft Access database. I assume you are familiar with database concepts. If you don't know anything about what a database is or what it is for, please take 5 minutes and read This Description From Wikipedia. I do assume that you understand Java syntax to a degree, and that you are comfortable compiling and executing Java code. If not, please point your browser to the Java Tutorials provided by Sun Microsystems. Labels: JAVA
Post / Read Comments Oracle Database Windows/UNIX Differences This chapter lists major differences between Oracle Database on Windows and UNIX. For Oracle Database developers and database administrators moving from a UNIX platform to Windows, this information can be helpful in understanding Windows features that are relevant to Oracle Database. This chapter contains these topics: -Automatic Startup and Shutdown -Background Processing and Batch Jobs -Diagnostic and Tuning Utilities -Direct Writes to Disk -Dynamic Link Libraries (DLLs) -Hot Backups -Initialization Parameters: Multiple Database Writers -Install Accounts and Groups -Installation -Memory Resources -Microsoft Transaction Server -Multiple Oracle Homes and OFA -Processes and Threads -Raw Partitions -Services F.1 Automatic Startup and Shutdown On UNIX, several files and scripts in different directories are used to start an instance automatically Other scripts are run on computer shutdown, allowing applications such as Oracle Database to shut down cleanly. For automatic startup on Windows, set registry parameter ORA_SID_AUTOSTART to true using an Oracle Database tool such as ORADIM. Enter the following with parameters at the command prompt: C:\> oradim options To start the listener automatically, set services startup type to automatic. For automatic shutdown on Windows, set registry parameters ORA_SHUTDOWN and ORA_SID_SHUTDOWN to stop the relevant OracleServiceSID and shut down. Set registry parameter ORA_SID_SHUTDOWNTYPE to control shutdown mode (default is i, or immediate). F.2 Background Processing and Batch Jobs UNIX provides sophisticated control mechanisms for background processing and batch jobs. For similar functionality on Windows, use the AT command or a GUI version in the Microsoft Resource Kit. F.3 Diagnostic and Tuning Utilities On UNIX, utilities such as sar and vmstat are used to monitor Oracle Database background and shadow processes. These utilities are not integrated with Oracle Database. Performance utilities available on Windows include Oracle Counters for Windows Performance Monitor, Task Manager, Control Panel, Event Viewer, User Manager, and Microsoft Management Console (included only with Windows 2000). Oracle Database is integrated with several of these tools. For example: Oracle Counters for Windows Performance Monitor displays key Oracle Database information. This tool is the same in appearance and operation as Windows Performance Monitor, except it has been preloaded with Oracle Database performance elements. Event Viewer displays system alert messages, including Oracle Database startup/shutdown messages and audit trail. Task Manager on Windows displays currently running processes and their resource usage, similar to the UNIX ps -ef command or HP OpenVMS SHOW SYSTEM. But Task Manager is easier to interpret and the columns can be customized. F.4 Direct Writes to Disk On both UNIX and Windows platforms, bypassing the file system buffer cache ensures data is written to disk. On UNIX, Oracle Database uses the O_SYNC flag to bypass the file system buffer cache. The flag name depends on the UNIX port. On Windows, Oracle Database bypasses the file system buffer cache completely. F.5 Dynamic Link Libraries (DLLs) Shared libraries on UNIX are similar to shared DLLs on Windows. Object files and archive libraries are linked to generate Oracle Database executables. Relinking is necessary after certain operations, such as installation of a patch. On Windows, Oracle Database DLLs form part of the executable at run time and are therefore smaller. DLLs can be shared between multiple executables. Relinking by the user is not supported, but executable images can be modified using ORASTACK. Modifying executable images on Windows reduces the chances of running out of virtual memory when using a large SGA or when supporting thousands of connections. However, Oracle recommends doing this only under the guidance of Oracle Support Services. F.6 Hot Backups A (manual) hot backup is equivalent to backing up a tablespace that is in offline backup mode. Backup strategy on UNIX is as follows: put the tablespace into backup mode, copy the files to the backup location, and bring the tablespace out of backup mode. Windows supports the same backup strategy, but you cannot copy files in use with normal Windows utilities. Use OCOPY to copy open database files to another disk location. Then use a utility to copy the files to tape. F.7 Initialization Parameters: Multiple Database Writers On UNIX, you can specify more than one database writer process with initialization parameter DB_WRITERS. Multiple database writers can help, for example, when a UNIX port does not support asynchronous I/O. DB_WRITERS is supported but typically unnecessary on Windows, which has its own asynchronous I/O capabilities. F.8 Install Accounts and Groups UNIX uses the concept of a DBA group. The root account cannot be used to install Oracle Database. A separate Oracle Database account must be created manually. On Windows, Oracle Database must be installed by a Windows username in the Administrators group. The username is automatically added to the Windows local group ORA_DBA, which receives the SYSDBA privilege. This allows the user to log in to the database using CONNECT / AS SYSDBA and not be prompted for a password. Password files are located in the ORACLE_BASE\ORACLE_HOME\database directory and are named pwdSID.ora, where SID identifies the Oracle Database instance. F.9 Installation The following manual setup tasks, all required on UNIX, are not required on Windows: Set environment variables Create a DBA group for database administrators Create a group for users running Oracle Universal Installer Create an account dedicated to installing and upgrading Oracle Database components F.10 Memory Resources The resources provided by the UNIX default kernels are often inadequate for a medium or large instance of Oracle Database. The maximum size of a shared memory segment (SHMMAX) and maximum number of semaphores available (SEMMNS) may be too low for Oracle Database recommendations. On Windows, fewer resources are needed for interprocess communication (IPC), because the Oracle Database relational database management system is thread-based and not process-based. These resources, including shared memory and semaphores, are not adjustable by the user. F.11 Microsoft Transaction Server UNIX does not support Microsoft Transaction Server. Windows supports Microsoft Transaction Server beginning with Oracle8. Using Oracle Services for Microsoft Transaction Server, you can develop and deploy applications based on COM/COM+. Microsoft Transaction Server coordinates application transactions for Oracle Database. F.12 Multiple Oracle Homes and OFA The goal of OFA is to place all Oracle Database software under one ORACLE_HOME directory and to spread database files across different physical drives as databases increase in size. OFA is implemented on Windows and UNIX in the same way, and main subdirectory and filenames are the same on both operating systems. Windows and UNIX differ, however, in their OFA directory tree top-level names and in the way variables are set. On UNIX, ORACLE_BASE is associated with a user's environment. ORACLE_HOME and ORACLE_SID must be set in system or user login scripts. Symbolic links are supported. Although everything seems to be in one directory on the same hard drive, files may be on different hard drives if they are symbolically linked or have that directory as a mount point. On Windows, ORACLE_BASE is defined in the registry (for example, in HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0). ORACLE_HOME and ORACLE_SID are variables defined in the registry. Symbolic links like those on UNIX are not supported, although Microsoft has announced the intention to support them in a future release. F.13 Processes and Threads On UNIX, Oracle Database uses a process to implement each of such background tasks as database writer (DBW0), log writer (LGWR), shared server process dispatchers, and shared servers. Each dedicated connection made to the database causes another operating system process to be spawned on behalf of that session. On Windows, each background process is implemented as a thread inside a single, large process. For each Oracle Database instance or system identifier, there is one corresponding process for Oracle Database. For example, 100 Oracle Database processes for a database instance on UNIX are handled by 100 threads inside one process on Windows. All Oracle Database background, dedicated server, and client processes are threads of the master Oracle Database Windows process, and all threads of the Oracle Database process share resources. This multithreaded architecture is highly efficient, allowing fast context switches with low overhead. To view processes or end individual threads, use Oracle Administration Assistant for Windows. Choose Start > Programs > Oracle - HOME_NAME > Configuration and Migration Tools > Administration Assistant for Windows. Right-click the SID and choose Process Information Note: Microsoft Management Console (MMC) is started when Oracle Administration Assistant for Windows is started. Oracle Database has integrated several database administration snap-ins into MMC F.14 Raw Partitions Datafiles for tablespaces may be stored on a file system or on raw partitions. A raw partition is a portion of a physical disk that is accessed at the lowest possible level. UNIX supports raw partitions (logical drives). There is no limitation on the number of disk drives. Windows is limited to using drive letters A-Z, but creating raw partitions lets you bypass the disk drive limitation and divide disks into smaller sections. Use Windows disk management tools to create an extended partition on a physical drive. An extended partition points to raw space on the disk that can be assigned multiple logical partitions for database files. An extended partition avoids the four-partition limit on Windows by allowing you to define large numbers of logical partitions to accommodate applications using Oracle Database. Logical partitions can then be given symbolic link names to free up drive letters. Note: Raw partitions are necessary for shared datafiles in an Oracle Real Application Clusters environment, available on Windows. Oracle Real Application Clusters, in which Oracle Database instances run on all nodes simultaneously, provides clustering and high availability. Oracle Real Application Clusters is not supported on Windows XP. F.15 Services Windows services are similar to UNIX daemons. Oracle Database registers a database instance as a service (OracleServiceSID). Services start background processes. To connect to and use an Oracle Database instance, an Oracle Database service is created during database creation and associated with Oracle Database. Once a service is created with Oracle Database, the service can run even while no user is logged on. By default, services run under the SYSTEM account. Choose Start > Settings > Control Panel > Services to access the Services dialog. Labels: ORACLE
Post / Read Comments How to Make Packages of Files on UNIX 1 Introduction One often needs to put a group of files into one single package file. This is typically for the purpose of copying the files from one machine to another. 2 Tar Files On UNIX systems, the most commonly used pack/unpack program is tar. One uses the c (“create”) command to pack, and the x (“extract”) command to unpack. For example, suppose I have files A, B and C, of which I wish to put copies into a file g.tar. I could type tar cf g.tar A B C The c option means I am creating a tar-file, while the f says that the next item on my command line will be the tar-file name. So, I am creating a tar-file named g.tar from the files A, B and C. Important note: Make sure to include the command-line argument which specifies your tar-file name, in this example g.tar. In the example above, if we were to mistakenly type tar cf A B C then tar would think we wish A to be the tar-file. That would destroy the contents of the original A! I can now copy the single file g.tar to another machine. At that machine, I can type tar xf g.tar to extract all the files from g.tar. By the way, if say, B had been a subdirectory, then the g.tar file would also include all the files within B, and the B subdirectory and its files would then be created by the unpacking at Machine 2. When you unpack a tar-file, in some cases you should use the p option, e.g. as tar xpf g.tar This preserves the original file permissions. 3 File Compression In many cases, a tar-file will also be compressed, both to reduce network transfer time and to save space on the disk. On UNIX machines, this compression is usually done with gzip or bzip2. (The latter is newer and generally more efficient at compression.) For instance, if in the example above I type gzip g.tar Similarly, if I use gzip, the original file g.tar will be replaced by compressed file with a .gz suffix added to its name. I can uncompress by using the -d option. In other words gzip -d g.tar.gz would replace g.tar.gz by the original uncompressed file g.tar. An acceptable suffix is .tgz, which means a file that has first been created as .tar and then compressed by gzip. So, to unpack the file y.tgz one could type gzip -d y.tgz tar xf y.tar The syntax of using the bzip2 program is like that of gzip. 4 Unpacking Windows Packages Programs for Windows are generally bundled and compressed using the zip program (not gzip). You can spot them by their .zip prefix. Most UNIX machines include a program unzip which can unpack .zip files. You may wish to use this program with the -a option, which changes Windows text files to UNIX format
Post / Read Comments 10G Bugs Questions And Answers Q.How to create tablespaces of your own ? Ans: CREATE TABLESPACE Example: CREATE TABLESPACE CONFLUENCE_DATA NOLOGGING DATAFILE 'D:\oracle\product\10.1.0\oradata\confluen ce\confluence1.dbf' SIZE 512M AUTOEXTEND ON NEXT 64M MAXSIZE UNLIMITED, 'D:\oracle\product\10.1.0\or adata\confluence\confluence2.dbf' SIZE 512M AUTOEXTEND ON NEXT 64M MAXSIZE UNLIMITED EXTENT MANAGEME NT LOCAL SEGMENT SPACE MANAGEMENT MANUAL; Q.How to create & assign a user tablespaces with unlimited option. Ans: CREATE USER GRANT CONNECT,CREATE SESSION,RESOURCE TO GRANT CONNECT,CREATE SESSION,RESOURCE TO CONFLUENCE; Q.How to drop a user with all its data and tablespaces. Ans:
Example:
Ans: >Show recyclebin; >Flashback table
>conn / as sysdba or connect sys/ >shutdown abort; >startup; { DEFAULT [ table_compression ] storage_clause | MINIMUM EXTENT integer [ K | M ] | RESIZE size_clause | COALESCE | RENAME TO new_tablespace_name | { BEGIN | END } BACKUP | datafile_tempfile_clauses | tablespace_logging_clauses | tablespace_group_clause | tablespace_state_clauses | autoextend_clause | flashback_mode_clause | tablespace_retention_clause } ; Q. How to debug ORA-12638 Error Database credential retrieval failed. Q.How to Unlock a User with unlimited login attempts privilege. Select username, account_status from dba_users where username=’ Q.How to know the privileges a user possess. WARNING: Subscription for node down event still pending
ORA-00312: online log 3 thread 1: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\S156DB\REDO03.LOG' VERSION INFORMATION: TNS for 64-bit Windows: Version 10.2.0.3.0 - Production Oracle Bequeath NT Protocol Adapter for 64-bit Windows: Version 10.2.0.3.0 - Production Windows NT TCP/IP NT Protocol Adapter for 64-bit Windows: Version 10.2.0.3.0 - Production Time: 30-JAN-2008 10:47:16 Tracing not turned on. Tns error struct: ns main err code: 12535 TNS-12535: TNS:operation timed out ns secondary err code: 12606 nt main err code: 0 nt secondary err code: 0 nt OS err code: 0 Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=172.17.1.13)(PORT=1539)) SQL> connect system/manager@bn259db as sysdba ERROR: ORA-01031: insufficient privileges SQL> connect system/manager as sysdba ERROR: ORA-12560: TNS:protocol adapter error Ans: Check the TNS Listeners status by typing “lsnrctl status” To Stop/Start type: lsnrctl stop/start Else Restart all the Started oracle Services. Else reconfigure the local net service naming configuration Labels: ORACLE
Post / Read Comments |