Thursday, May 31, 2007

How to query server and client environment in PL/SQL

To query the oracle server environment variables inside a pl/sql block that were set when the database was started:

$ . oraenv
ORACLE_SID = [oracle] ? ora1022
$ /usr/ucb/ps auxwwe | sed -n
'/[o]ra_smon_ora1022/s/\(.*\)\(TZ=...\)\(.*\)/\2/p'
TZ=MET
$ export TZ=GMT
$ printf "%s\n" "set lines 10" "var f varchar2(40)" "set autop on" \
> "exec dbms_system.get_env('TZ',:f)" |
> sqlplus -s / as sysdba


To query the client or listener environment, use:

SQL> var f varchar2(40)
SQL> set autop on
SQL> exec sys.dbms_system.get_env('TZ',:f);

or

SQL> $echo %ORACLE_HOME%

Market Articles



  1. All Money Sense

  2. 4 ways to be a millionaire

  3. Google's market share jumped in April

  4. RBS group raises the stakes in ABN Amro bidding

  5. Yahoo CTO is leaving

  6. Dollar Cost Averaging

  7. PSP, XBox, Zen Skins


=>

J2EE Articles




=>

MSSQL Articles



  1. MSSQL 2005 Knowledge Base 1

  2. MCTS 07-431 Sample Questions (1)

  3. Configure MSSQL to use more than 2GB RAM


=>

Wednesday, May 30, 2007

Oracle Articles



=>

Answer - "1Z0-042 sample questions"

Click here for original questions:
1Z0-042 sample questions


1. A. Tables share a namespace with views, sequences, private synonyms, procedures, functions, packages, materialized views, and user-defined types. Objects sharing a namespace cannot have the same name.

2. C. The database is the parameter supplied after the port designation. Therefore, you connect to the orcl database.

3. C. The Memory Monitor (MMON) process gathers performance statistics from the SGA (System Global Area) and stores them in the AWR. MMNL (Memory Monitor Light) also does some AWR- related statistics gathering, but not to the extent that MMON does. QMN1 is the process that monitors Oracle advanced queuing features. MMON is the process that dynamically manages the sizes of each SGA component when directed to make changes by the ADDM (Automatic Database Diagnostic Monitoring)

4. C. STARTUP is not a valid state, but the command used to start the database. For more information.

5. C. The $ORACLE_HOME/install/portlist.ini file contains information about what ports are being used by the various Oracle tools.

6. D. You assign or change comments on a column with the COMMENT ON COLUMN statement. The COMMENT ON TABLE statement is used to add or change the comment assigned to a table.

7. D. The Undo Advisor screen uses the desired time period for undo data retention and analyzes the impact of the desired undo retention setting.

8. B, C, D. The substitution variable %d, which represents the database ID, is required only if multiple databases share the same archive log destination.

9. D. All the four calendaring expressions execute a schedule every Dec. 28 at 8 p.m. ¡°BYYEARDAY=-4" or ¡°BYMONTH=DEC; BYMONTHDAY=28" specifies the date and month for the interval Though all four are correct, the most meaningful and easy to understand would be item 1 or 4.

10. B

11. D

12. D.

13. C In Oracle10g, you can now recover datafile copies by applying changed blocks from a change tracking file to the datafile image copy. This is an important feature as it will significantly speed up datafile recovery times. It is done in 2 stages:1. Use an RMAN command to update the datafile image copy with changed blocks:RMAN> recover copy of datafile ;2. Apply any archived redo logs to fine-tune the datafile to the exact point-in-time or SCN.

14. D

15. A,D When implementing an RMAN-based backup strategy, you can use RMAN moreeffectively if you understand the more common options available to you. Many of thesecan be set in the RMAN environment on a persistent basis, so that you do not have tospecify the same options every time you issue a command.To simplify ongoing use ofRMAN for backup and recovery, the RMAN lets you set a number of persistentconfiguration settings for each target database. These settings control many aspects ofRMAN's behavior when working with that database, such as backup retention policy,default destinations for backups to tape or disk, default backup device type (tape or disk),and so on.

=>


Answer - "1Z0-043 sample questions"

Click for original questions:
1Z0-043 sample questions


1. A, C. The DBID and DB_KEY are required to identify the database incarnation when using SQL*Plus to query the recovery catalog tables.

2. C. The correct command sequence for recovering a missing tempfile named temp is as follows:
1. STARTUP MOUNT
2. DROP TABLESPACE temp
3. CREATE TEMPORARY TABLESPACE temp TEMPFILE
The database must be mounted, and then the tablespace information needs to be dropped from the data dictionary. Then the tablespace can be created.

3. B. You can now recover through an incomplete recovery, which uses RESETLOGS to open the database. In previous Oracle versions, you had to take a backup immediately following an incomplete recovery, because the redo log sequences got reset, making the backup unusable.

4. B. The Flashback Query will query the deleted customer 46453 from the undo data, and the insert command will add the customer back to the customers table. There will be minimal impact on the database.

5. D. The AWR does not store optimizer statistics. It stores dynamic performance statistics. Optimizer statistics are stored in the data dictionary.

6. B. The most likely cause is that the Oracle client environment is using a character set that does not match the server and is not a strict subset of the server character set. In this situation, Oracle will perform automatic data conversion, which can impact performance.

7. A. A simple plan can allocate CPU resources for up to eight consumer groups at the same level.By default, SYS_GROUP will be allocated 100 percent of level 1 CPU, and all other CPU allocation is done at level 2. Therefore, a simple plan will meet all of these requirements.

8. C. Server-generated alerts would be the best answer. Oracle has a predefined alert that detects ORA-00600 messages in the alert log and will raise an alert when they are found.

9. C. Block change tracking allows RMAN to back up only changed blocks from the last backup. The blocks are identified in a journaling system to expedite the process.

10. C. Multiplexing a backup is designed to improve the performance of the backup sets by copying multiple database files at the same time. Multiplexing can be used with image copies or backup sets.

11. C. Compressed backups work only with backup sets, not image copies. Thus compressed backups will work only with the BACKUP command.

12. A. The missing redo log must first be dropped even though it doesn't exist physically in the file system. This removes the redo log metadata from the data dictionary. Next the log can be added back to database.

13. A, B, C. You need two credentials when running a recovery with EM: the correct operating system account and the correct database account. The correct operating system account is an account similar to the Oracle account in Unix or the administrator account in Windows. The database account is any account that has SYSDBA privilege.

14. A. The view FLASHBACK_TRANSACTION_QUERY is used as a diagnostic tool to identify version information about transactional changes to the database. This view can be used to view the DML statements that were executed against a row and in a specific table.

15. C. The DBVERIFY utility uses the term pages instead of blocks. The DBVERIFY utility determines the amount of corrupt pages in a datafile.


1Z0-043 sample questions (1)

Click here for answers:
Answer - "1Z0-043 sample questions"


Question
1. What two values are required to identify a database incarnation within the recovery catalog?
A. DBID
B. DATABASE NAME
C. DB_KEY
D. DATABASE_VALUE

2. What is the correct command sequence for recovering a missing tempfile named temp?
A. STARTUP MOUNT, CREATE TEMPORARY TABLESPACE temp TEMPFILE
B. STARTUP NOMOUNT, DROP TABLESPACE temp, CREATE TEMPORARY TABLESPACE temp TEMPFILE
C. STARTUP MOUNT, DROP TABLESPACE temp, CREATE TEMPORARY TABLESPACE temp TEMPFILE
D. STARTUP, DROP TABLESPACE temp, CREATE TEMPORARY TABLESPACE temp TEMPFILE

3. You have a backup from two days ago. It is discovered that corruption was introduced today at 6:30 P.M. You perform an incomplete recovery of the database to 6:25 P.M. before the corruption. One day later you have a media failure, and you need to recover but you only have the same backup that was used to perform an incomplete recovery prior to the corruption. What will happen to the recovery attempt for the media failure? A. The media recovery will fail because you have performed a RESETLOGS to recover from the corruption and you have not taken another backup after the RESETLOGS operation.
B. The media recovery will be successful because you can perform a RESETLOGS torecover from an incomplete recovery to a new point-in-time greater than the RESETLOGS operation.
C. The media recovery will fail because you always must take a backup following an incomplete recovery with RESETLOGS to open the database.
D. The media recovery will only be successful if you recover the database back to the original time of 6:25 P.M. before the corruption.

4. A user accidentally deleted a customer identified by 46435 from the customers table on September 6, 2004 at 3:30 P.M. Which of the following recovery approaches will successfully recover CUSTOMER_ID 46435 with the least impact on database operations?
A. Perform the following RMAN incomplete recovery after restarting the database in MOUNT mode: run { set until time ‘06-SEP-2004 15:25:00’; restore database; recover database; }
B. Perform the following DML transaction utilizing Flashback Query: insert into customers select * from customers where customer_id = 46435 as of timestamp to_timestamp (’06-SEP-2004 15:25:00’) where customer_id = 46435;
C. Perform a user-managed recovery after restoring database files after starting the database in MOUNT mode: recover database until time ’06-SEP-2004 15:25:00’ alter database open resetlogs
D. None of the above.

5. You have created a new table. How long do you have to wait to be sure that Oracle has automatically gathered optimizer statistics for the table and loaded them into the AWR?
A. Not more than 30 minutes.
B. Up to seven days.
C. Until the next scheduled automated statistics collection job is run.
D. Optimizer statistics are not stored in the AWR. E. You must gather the statistics manually when a new table is created. Oracle will collect them automatically after that.

6. A new workstation has been added at your location in Spain. This machine will be used to run an application that connects to your database in the United States. A technician installs the Oracle client and the application. The user on the new machine notices that performance seems to be sluggish compared to the existing workstations. The technician swears that the application is configured identically on all machines, and has ruled out network issues. What is the most likely cause? (Choose the best answer.)
A. Defective hardware
B. Client character set
C. Client NLS_LANGUAGE setting
D. Server NLS_LANGUAGE setting E. Routing tables

7. You want to set up DRM to allocate CPU resources between seven resource consumer groups. The groups should be allocated only CPU unused by the SYS_GROUP group. Six of the groups will get 15 percent and the remaining group will receive 10 percent. Which of the following would achieve all of these objectives with the least amount of effort?
A. Create a simple plan.
B. Create a complex plan with one sub-plan.
C. Create a complex plan with more than one sub-plan.
D. Create a simple plan with one sub-plan.
E. Create a simple plan with more than one sub-plan.

8. You are concerned about ORA-00600 messages that have been appearing in the alert log, and you want to know if any new ones appear. Which Oracle feature might be of use? (Choose the best answer.)
A. AWR
B. Advisory framework
C. Server-generated alerts
D. Alert monitor
E. ADDM

9. Which new 10g feature allows Oracle RMAN to back up larger databases more efficiently?
A. The COMPRESSED BACKUPSET command
B. The Oracle Flashback Database
C. Block change tracking
D. Automated tablespace point-in-time recovery (TSPITR)

10. What method is used to improve backup performance when creating backup sets?
A. Multicopy
B. Multiplecopy
C. Multiplex
D. Multiply

11. Compressed backups work with which of the following commands?
A. COPY AS BACKUP
B. BACKUP AS COPY
C. BACKUP
D. COPY

12. What must be done to recover a missing redo log file member?
A. First perform a ALTER DATABASE DROP LOGFILE MEMBER filename and then ALTER DATABASE ADD LOGFILE MEMBER filename on the missing logfile member.
B. Perform ALTER DATABASE ADD LOGFILE MEMBER filename on the missing logfile.
C. Nothing is required if you have multiplexed redo logs.

13. Which credentials are needed to perform a recovery with EM? (Choose all that apply.) A. Database account with SYSDBA privilege B. Administrator account in Windows C. Oracle account in Unix 14. What view can be used to query diagnostic information about transactional changes in the database?
A. FLASHBACK_TRANSACTION_QUERY
B. DBA_TRANSACTION_QUERY
C. V$TRANSACTION_QUERY
D. V$FLASHBACK_TRANSACTION_QUERY

15. The DBVERIFY utility reports output about corruption in which manner?
A. The DBVERIFY utility identifies the amount of corrupt objects, not the amount of blocks in a table.
B. The DBVERIFY utility identifies the amount of corrupt blocks, not the amount of objects in a datafile.
C. The DBVERIFY utility identifies the amount of corrupt pages, not the amount of blocks in a datafile.
D. The DBVERIFY utility identifies the amount of corrupt pages, not the amount of blocks in the database.



==>

1Z0-042 sample questions (1)

Click here for answers:
Answer - "1Z0-042 sample questions"

Question
1. Which of the following objects share the same namespace and therefore cannot have the same name?
A. Tables and sequences
B. Tables and indexes
C. Tables and tablespaces
D. Tables and constraints

2. You connect to the database using the command sqlplus scott/tiger@abc.com:1522/orcl. To which database are you connecting?
A. abc.com
B. tiger
C. orcl
D. scott
E. None of the above

3. The Automatic Workload Repository (AWR) is primarily populated with performance statistics by which Oracle 10g background process?
A. MMNL
B. QMN1
C. MMON
D. MMAN

4. Which of the following is not a valid database state?
A. OPEN
B. SHUTDOWN
C. STARTUP
D. MOUNT
E. NOMOUNT

5. On your Unix database server, you have installed and configured a database using the DBCA. You need to find out what ports are being used for the various Oracle tools. Where would you find this information?
A. $ORACLE_HOME/bin/portlist.ini
B. $ORACLE_HOME/rdbms/admin/portlist.ini
C. $ORACLE_HOME/install/portlist.ini
D. $ORACLE_HOME/bin/portlist.ini

6. How can you change the comment assigned to the columns in a table?
A. Use the ALTER TABLE MODIFY COLUMN statement.
B. Use the COMMENT ON TABLE statement.
C. Use the RENAME statement.
D. Use the COMMENT ON COLUMN statement.

7. The EM Database Control Undo Advisor screen uses ___________ to recommend the new size of the undo tablespace.
A. The value of the parameter UNDO_RETENTION
B. The number of Snapshot too old errors
C. The current size of the undo tablespace
D. The desired amount of time to retain undo data
E. The most recent undo generation rate

8. Which of the following substitution variables formats are always required for specifying the names of the archived redo log files? (Choose all that apply.)
A. %d
B. %s
C. %r
D. %t

9. The following are valid calendaring expressions:
1 FREQ=YEARLY; BYYEARDAY=-4; BYHOUR=20
2 FREQ=MONTHLY; BYMONTH=12; BYMONTHDAY=28; BYHOUR=20
3 FREQ=MONTHLY; BYYEARDAY=-4; BYHOUR=20
4 FREQ=YEARLY; BYMONTH=DEC; BYMONTHDAY=28; BYHOUR=20
Choose from the following options the expressions that specify to run a schedule every Dec. 28 at 8 p.m.?
A. Items 1, 2, and 4
B. Items 1 and 4
C. Items 2 and 3
D. Items 1, 2, 3, and 4

10. You work as a database administrator for Certkiller .com. Your database is functional. One of the disks containing a mirrored redo log member has bad sectors in it. You are unable to fix the damaged file.
How does the loss of a redo log member affect the instance of the database that is currently running?
A.The instance would normally abort.
B.The instance would not be affected.
C.The instance would be invalid, so would have to be aborted.
D.The instance would remain open, but the LGWR process would fail.
E.The instance would remain open and would automatically create the missing file

11. What advantage would you get if you increase the length of time during which the undo information would be stored in the database?
A. roll back of large transactions
B. roll forward to redo a transaction
C. data concurrency for large updates
D. read consistency for long-running transactions

12. Users in your PROD database complain about the slow response of the transactions. While investigating the reason, you find that the transactions are waiting for the undo segments to be available, and undo retention has been set to zero. What would you do to overcome this problem?
A. increase the undo retention
B. create more undo segments
C. create another undo tablespace
D. increase the size of the undo tablespace

13. You executed the following command:
RMAN> RECOVER COPY OF DATAFILE /U01/app/oracle/oradata/orcl/users01.dbf';
Which statement regarding the above command is correct?
A. The '/u01/app/oracle/ordata/orcl/users01.dbf' data file is recovered from the image copy.
B. The '/u01/app/oracle/ordata/orcl/users01.dbf' data file is recovered from the last incremental backup.
C. Image copies of the '/u01/app/oracle/ordata/orcl/users01.dbf' data file are updated with all changes up to incremental backup SCN.
D. Image copies of the '/u01/app/oracle/ordata/orcl/users01.dbf' data file are recovered using the above command if data file recovery fails.

14. You want to have a compatible audit trail of everything that has happened to thejobs in the job class named JOB_CLASSA. What should the logging level be for JOB_CLASSA?
A. DBMS_SCHEDULER.ENABLE
B. DBMS_SCHEDULER.LOGGING_OFF
C. DBMS_SCHEDULER.LOGGING_RUNS
D. DBMS_SCHEDULER.LOGGING_FULL
E. DBMS_SCHEDULER.LOGGING_COMPLETE

15. Which statements are true regarding the new Persistent CONFIGURATION FEATURE IN RMAN? (Choose two)
A. It allows you to set the retention period of backups.
B. It remember the last backup command you used so that you can rescheule it easily.
C. It enables you to store your channel attribute settings in the Recovery catalog with each script.
D. It enables you to store the settings for channel attributes so that you do not have to specify them in each backup o restore command



1Z0-043 Questions

==>




  1. OCA references

  2. OCP References

  3. 1Z0-042 sample questions (1)

  4. Answer - "1Z0-042 sample questions"

  5. 1Z0-043 sample questions (1)

  6. Answer - "1Z0-043 sample questions"

  7. How to query server and client environment in PL/SQL


=>

MCTS 07-431 Sample Questions (1)

1.You have a custom application that employees use to manage product data. They often search for products based on the product description, so you decide to implement full-text search.
What version of SQL Server can you use to support this? (Choose all that apply.)
A. Express Edition
B. Workgroup Edition
C. Standard Edition
D. Enterprise Edition

2.In the scenario from question 9, how much space will the Vendors table take?
A. 167MB
B. 185KB
C. 200MB
D. 156MB

3. You are the database administrator of your company. One of your company’s applications should maintain data integrity and return custom error messages when the entry data is incorrect.
How can you achieve that with minimum effort?
A. Add check constraints to necessary columns.
B. Use a DDL trigger.
C. Use a CLR trigger.
D. Use a DML trigger.

4. You want to start a distributed transaction using MS DTC. Which statement can you use?
A. BEGIN DISTRIBUTED TRAN
B. BEGIN TRAN
C. SAVE TRAN
D. ROLLBACK TRAN

5. A small automotive parts company has four shops, each with its own inventory database to maintain. The owner wants the shops to be able to share inventory so that employees can pick up a part from another nearby store rather than waiting for a shipment from the manufacturer. To do this, employees at each shop should be able to update their local copy of the inventory database, decrement the other store’s inventory, and then go pick up the part. This way, the other store won’t sell their part because it will have already been taken out of stock.
Which replication model should you use to accomplish this?
A. Central subscriber/multiple publishers
B. Multiple publishers/multiple subscribers
C. Central publisher/central distributor
D. Remote distribution

6. You have created an operator with an email address and a Net Send address. You have also created several alerts for which the new operator should be notified. When any of the alerts fire, the operator gets the email but never receives the Net Send message. What should you do to fix this?
A. Start the Messenger service on the operator’s computer.
B. Start the alerter service on the operator’s computer.
C. Reinstall the SQL Server Agent on the SQL Server.
D. Reconfigure the SQL Server Agent service to log in using the Network Service account.

7. You need to install a new production installation of SQL Server 2005. The server purchased for your installation has four CPUs. Which edition of SQL Server 2005 should you choose to make use of all the CPUs?
A. SQL Server Express Edition
B. SQL Server Workgroup Edition
C. SQL Server Developer Edition
D. SQL Server Standard Edition

8. Which command is used to save the data modified in a transaction so that other connections can see it?
A. DELETE FROM TRANSACTION
B. COMMIT TRANSACTION
C. UPDATE TRANSACTION
D.SELECT TRANSACTION

9. You are a DBA working at a SQL Server hosting company. You need to ensure that none of your company’s client installations wastes disk space. As part of your maintenance tasks, you are charged with periodically shrinking databases.
You want to automatically shrink entire databases at a time. How can you achieve this maintenance goal?
A. Execute the DBCC SHRINKDATABASE statement.
B. Execute the DBCC SHRINKFILE statement.
C. Set each database to shrink automatically by using the ALTER DATABASE statement against each database.
D.You cannot shrink SQL Server 2005 database files automatically.

10. Users are complaining about sometimes being disconnected when using the secondary database of a log shipping configuration. How would you explain this behavior?
A. The secondary server is having performance issues and is losing user connections; you need to increase the secondary server’s hardware resources.
B. This is the default behavior for the No Recovery mode; you need to change the secondary database configuration to Standby mode.
C. This is the default behavior for the Standby mode. Using SSMS, clear the Disconnect Users In The Database When Restoring Backups check box of the log shipping configuration.
D. The primary server is having performance issues and is losing user connections; you need to increase the primary server’s hardware resources.

Answers of "SCJP 310-035 Sample Questions (1)"

Click here for original questions:
SCJP 310-035 Sample Questions (1)

Answers:

1) A, B, D. The angle-bracket notation is part of release 5.0's generic collections. See Chapter 6for more information.

2) B, D. All the choices are valid method signatures. However, in order to be the entry point of an application, a main() method must be public, static, and void; it must take a single argument of type String[].

3) C. In this code, the optional result values for the conditional operator, 99.99 (a double) and 9 (an int), are of different types. The result type of a conditional operator must be fully determined at compile time, and in this case the type chosen, using the rules of promotion for binary operands, is double. Because the result is a double, the output value is printed in a floatingpoint format. If the two possible argument types had been entirely incompatible, for example, (x > 4) ? "Hello" : then the compiler would have issued an error at that line.

4) C, D. If a class does not provide implementations for all methods of all interfaces that the class declares it implements, that class must be declared abstract. Abstract classes may not be instantiated.

5) C. When a numeric primitive is cast or converted to a wider type, the original value is preserved, so naturally the original sign cannot change.

6) E, F. The Cat class is a subclass of the Pet class, and as such should extend Pet, rather than contain an instance of Pet. B and C should be members of the Pet class and as such are inherited into the Cat class; therefore, they should not be declared in the Cat class. D would declare a reference to an instance of the Cat class, which is not generally appropriate inside the Cat class (unless, perhaps, you were asked to give the Cat a member that refers to its mother). Finally, the neutered flag and markings descriptions, E and F, are the items called for by the specification; these are correct items.

7) A. The Runnable interface defines a run() method with void return type and no parameters. The method given in the problem has a String parameter, so the compiler will complain that class Greebo does not define void run() from interface Runnable. B is wrong, because you can definitely pass a parameter to a thread¡¯s constructor; the parameter becomes the thread¡¯s target. C, D, and E are nonsense.

8) A. The StringBuffer class is mutable. After execution of line 2, sbuf refers to the same object, although the object has been modified.

9) D. Default serialization is bypassed only if the writeObject() method has private access.

10) A, C. All exceptions declared by an overriding method must be compatible with types thrown by the overridden version.

==>

SCJP 310-035 Sample Questions (1)

Click here for answer:
Answers of "SCJP 310-035 Sample Questions (1)"

Questions:

1)
Which of the following are valid declarations? Assume java.util.* is imported.
A. Vector <map> v;
B. Set <string> s;
C. Map <string> m;
D. Map <string,> m;

2)
Which of the following signatures are valid for the main() method entry point of an application?
(Choose all that apply.)
A. public static void main()
B. public static void main(String arg[])
C. public void main(String [] arg)
D. public static void main(String[] args)
E. public static int main(String [] arg)

3)
What results from attempting to compile and run the following code?
1. public class Conditional {
2. public static void main(String args[]) {
3. int x = 4;
4. System.out.println("value is " +
5. ((x > 4) ? 99.99 : 9));
6. }
7. }

A. The output: value is 99.99
B. The output: value is 9
C. The output: value is 9.0
D. A compiler error at line 5

4)
Suppose interface Inty defines five methods. Suppose class Classy declares that it implements Inty but does not provide implementations for any of the five interface methods. Which is/are true?
A. The class will not compile.
B. The class will compile if it is declared public.
C. The class will compile if it is declared abstract.
D. The class may not be instantiated.

5)
When a negative byte is cast to a long, what are the possible values of the result?
A. Positive
B. Zero
C. Negative

6)
You have been given a design document for a veterinary registration system for implementation in Java. It states:
"A pet has an owner, a registration date, and a vaccination- due date. A cat is a pet that has a flag indicating whether it has been neutered, and a textual description of its markings."
Given that the Pet class has already been defined, which of the following fields would be appropriate for inclusion in the Cat class as members?
(Choose all that apply.)

A. Pet thePet;
B. Date registered;
C. Date vaccinationDue;
D. Cat theCat;
E. boolean neutered;
F. String markings;

7)
Which one statement is true concerning the following code?
1. class Greebo extends java.util.Vector
2. implements Runnable {
3. public void run(String message) {
4. System.out.println("in run() method: " +
5. message);
6. }
7. }
8.
9. class GreeboTest {
10. public static void main(String args[]) {
12. Greebo g = new Greebo();
13. Thread t = new Thread(g);
14. t.start();
15. }
16. }

A. There will be a compiler error, because class Greebo does not correctly implement the Runnable interface.
B. There will be a compiler error at line 13, because you cannot pass a parameter to the constructor of a Thread.
C. The code will compile correctly but will crash with an exception at line 13.
D. The code will compile correctly but will crash with an exception at line 14.
E. The code will compile correctly and will execute without throwing any exceptions.

8)
In the following code fragment, after execution of line 1, sbuf references an instance of the StringBuffer class. After execution of line 2, sbuf still references the same instance.
1. StringBuffer sbuf = new StringBuffer("abcde");
2. sbuf.insert(3, "xyz");

A. True
B. False

9)
Suppose you are writing a class that will provide custom serialization. The class implements
java.io.Serializable (not java.io.Externalizable). What access mode should the writeObject() method have?
A. public
B. protected
C. default
D. private

10)
EOFException and ObjectStreamException both extend IOException. NotSerializable- Exception extends ObjectStreamException. AWTException does not extend any of these. All are checked exceptions. Suppose class AClass has a method callMe() whose declaration is void callMe() throws ObjectStreamException
Which of the following may appear in a subclass of AClass?
A. void callMe()
B. void callMe() throws IOException
C. void callMe() throws NotSerializableException
D. void callMe() throws ObjectStreamException, AWTException


==>

J2EE Patterns






MSSQL 2005 Knowledge Base 1

-- Estimating table storage requirements
1. Calculate the space used by a single row of the table.
Row_Size = Fixed_Data_Size + Variable_Data_Size + Null_Bitmap + Row_Header
Variable_data_size = 2 + (num_variable_columns × 2) + max_varchar_size
Null_bitmap = 2 + ((number of columns + 7) ÷ 8)
Row_Header = 4
2. Calculate the number of rows that will fit on one page.
8096 ÷ (RowSize + 2)
3. Estimate the number of rows the table will hold.
4. Calculate the total number of pages that will be required to hold these rows.
Number of rows in the table ÷ number of rows per page (rounded up to the nearest whole number).
5. Multiply the number of pages by the actual size of a page (8,192 bytes),

-- Partitioning table
1. Creating a partition function
2. Creating a partition scheme
3. Creating table using partitioned scheme

-- Implementing indexes
1. Specify the filegroups
2. Specify the index type
3. Specify the relational index option
4. Specify the columns
5. Specify the partition scheme when creating an index
6. Creating an online index by using an ONLINE argument

-- Implementing a full-text search
1. Creating a full-text search catalog
2. Creating an index
3. Specify a full-text population method

-- Implementing a Service Broker Architecture
1. Enable broker architecture
2. Create message type on initiator and target
3. Create contract
4. Create queues
5. Create service on the sender and recipient
6. Create a conversation dialog to send messages
7. Alter queue for automatic activation & create store procedure to process messages

-- Set up database mirroring
1. Prepare for mirroring
a. Configure security and communication between instances
b. Creating the Mirror Database
c. Establish a Mirror session
2. Creating Endpoints
3. Specifying Partners and Witnesses
a. Configure the pricipal as a partner on the mirror
b. Configure the mirror as a partner on the pricipal
c. Optionally configure the witness
4. Configuring the operating mode
5. Switching roles

-- Implementing Log Shipping
1. Backup the transaction log on the primary database
2. Copy the log files to the secondary database
3. Restore the log file onto the secondary server

-- Changing roles in log shipping
1. Manually failover the primary server to the secondary server
2. Disable the log shipping backup job on the primary server, copy and restore opetions on the secondary server
3. Enable log shipping job on the secondary server

OCP References


(1) Advanced Security Administrator's Guide

(2)
Backup and Recovery Advanced User's Guide

(3)
Enterprise Manager Advanced Configuration

(4)
Globalization Support Guide

(5)
Secure Backup Administrator's Guide

=>

OCA references


(1) Oracle® Database Platform Guide10g Release 2 (10.2) for Microsoft Windows (32-Bit)
(2) Oracle® Database Installation Guide10g Release 2 (10.2) for Linux x86 Number B15660-02
(3) Oracle® Database Concepts10g Release 2 (10.2) Part Number B14220-02
(4) Oracle® Database Administrator’s Guide10g Release 2 (10.2) Part Number B14231-02
(5) Oracle® Database Security Guide10g Release 2 (10.2) Part Number B14266-01
(6) Oracle® Database Performance Tuning Guide10g Release 2 (10.2) Part Number B14211-01
(7) Oracle® Database Utilities10g Release 2 (10.2) Part Number B14215-01
(8) Backup and Recovery Basics
(9) Enterprise Manager Concepts
(10) Enterprise User Administrator's Guide
(11) Net Services Administrator's Guide

Tuesday, May 29, 2007

RBS group raises the stakes in ABN Amro bidding

Banks add more cash to $95 billion offer, seeking to thwart rival Barclays.

A consortium led by Royal Bank of Scotland on Tuesday officially launched its offer for ABN Amro, seeking to thwart rival Barclays by raising the cash portion of its 71।1 billion euros ($95.5 billion) proposal.

Read full story ...

Monday, May 28, 2007

Google's market share jumped in April

Web search leader Google Inc. in April showed a sharp gain in market share among U.S. Web search users, taking business from its three closest rivals, research firm comScore Inc. said on Friday.

Google held 49.7 percent of the U.S. search market, up 1.4 percentage points over March.

By contrast, the No. 2-ranked Web search provider, Yahoo Inc. saw its U.S. search share in April fall 0.7 points to 26.8 percent. Microsoft Corp.'s sites lost 0.6 percentage points to 10.3 percent, comScore data showed. IAC/InterActiveCorp's Ask.com fell 0.1 percentage points in April to 5.1 percent of the U.S market, it said.

Outside of the United States, various surveys put Google's share of the Web search market at 60 percent or better।

Saturday, May 26, 2007

4 ways to be a millionaire

1. Make saving automatic
Sign up for automatic investing plans, which will funnel the savings directly from your paycheck into your investment account. That way the money starts compounding immediately. Plus, you'll never miss it.

Beginning at age 30, if you save $671 each month at an 8% return, you'll have $1 million by age 60. Begin at age 40, and you need to save $1,698 each month.

2. Make stocks work for you
Stocks give you the best shot at high returns, having returned more than 10% a year since 1926, twice the return of bonds. So stash a big chunk of your portfolio in equities - 70% is a reasonable amount if you are investing over a couple of decades, says Kevin Sale, a financial adviser in Bloomington, Minn.

If you don't consider yourself a stock picker, a broadly diversified index fund - tracking either the S&P 500 or Wilshire 5000 - is a perfectly reasonable option.

3. Boost your earning power
As the numbers show, the fastest way to amass seven figures is to pull down a big salary. If you're young enough, a professional degree such as an M.B.A. or a J.D. will pay off. If more school isn't in the cards, make sure to get the most out of your current profession. Keep up with market so you can negotiate for as much pay as possible and if possible. And keep up with trade publications that will help you advance in your current field.

4. Don't stop saving
Remember, just because you've stopped doesn't mean inflation will. As the years tick by, a million dollars will become worth less and less - and you'll need more and more to lead the lifestyle you were counting on. So when you hit the seven-figure mark, keep going.


Friday, May 25, 2007

All Money Sense

All Money Sense Matters:

  1. Keep watching your money
  2. Do not over-spent
  3. Think big
  4. Dare dream
  5. 100000000000000000000000000000000
  6. I am the one

etc

Latest Posts