Questões para prova 1Z0-050 OCP ORACLE 11g NEW FEATURES FOR ADMINSTRATOR

DUMP da prova 1Z0-050 ORACLE 11g NEW FEATURES FOR ADMINSTRATORS

1Z0-050

 – 1

Identify two situations in which you can use Data Recovery Advisor for recovery.

(Choose two.)

A. The user has dropped an important table that needs to be recovered.

B. The database files are corrupted when the database is open.

C. You are not able to start up the database instance because the required database files

are missing.

D. The archived log files are missing for which backup is not available.

Answer: B,C

 – 2

In your database, the LDAP_DIRECTORY_SYSAUTH initialization parameter has been

set to YES and the users who need to access the database as DBAs have been granted

SYSDBA enterprise role in Oracle Internet Directory (OID). SSL and the password file

have been configured. A user SCOTT with the SYSDBA privilege tries to connect to the

database instance from a remote machine using the command:

$ SQLPLUS scott/tiger@DB01 AS SYSDBA

where DB01 is the net service name.

Which authentication method would be used first?

A. authentication by using the local OS of the database server

B. authentication by using the Oracle Internet Directory

C. authentication by password file

D. authentication by using certificates over SSL

Answer: C

 – 3

Examine the following values of the initialization parameters in the database having the

SID ORCL:

BACKGROUND_DUMP_DEST=/u01/app/oracle/product/11.1.0/db_1/bdump

USER_DUMP_DEST=/u01/app/oracle/product/11.1.0/db_1/udump

CORE_DUMP_DEST=/u01/app/oracle/product/11.1.0/db_1/cdump

DIAGNOSTIC_DEST=

The environment variables have the following value:

ORACLE_BASE=/u01/app/oracle

ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1

What is the location of the Automatic Diagnostic Repository (ADR) home?

A. /u01/app/oracle/product/11.1.0/db_1

B. /u01/app/oracle

C. $ORACLE_HOME/bdump

D. $ORACLE_HOME/log

 

 

Answer: B

 – 4

Observe the following PL/SQL block:

BEGIN

dbms_spm.configure(‘SPACE_BUDGET_PERCENT’, 30);

END;

Which statement is correct regarding the above PL/SQL block?

A. It automatically purges the SQL management objects when SMB occupies more than

30% of the SYSAUX tablespace.

B. It reserves 30% of the space in the SYSAUX tablespace for SQL Management Base

(SMB).

C. It reserves 30% of the space in the SYSTEM tablespace for SMB.

D. It generates a weekly warning in the alert log file when SMB occupies more than 30%

of the SYSAUX tablespace.

Answer: D

 – 5

Exhibit:

 

 

View the Exhibit to examine the output produced by the following query at three

different times since the database instance started and has undergone workloads of

different capacities:

SQL> SELECT substr(component, 0, 10) COMP, current_size CS,

user_specified_size US

FROM v$memory_dynamic_components

WHERE current_size!=0;

What do you infer from this?

A. All sessions are connected to the database instance in dedicated mode, and no RMAN

or parallel query operations have been performed.

B. The database instance is running with manual shared memory management.

C. The database instance is running with manual PGA management.

D. The database instance has the MEMORY_TARGET value set to a nonzero value.

Answer: D

 

 

 – 6

You are managing an Oracle Database 11g ASM instance having three disks in a disk

group with ASM compatibility attribute set to 11.1.0 and redundancy set to high. One of

the disks in the disk group becomes unavailable because of power failure. Which

statements will be true in this scenario? (Choose all that apply.)

A. The disk is immediately dropped from the disk group.

B. The ASM tracks the extents that are modified during the outage.

C. The ASM migrates the extents from the unavailable disk to the remaining disks.

D. The disk automatically goes offline.

Answer: B,D

 – 7

The SQL Tuning Advisor has been configured with default configurations in your

database instance. Which recommendation is automatically implemented without the

DBA’s intervention after the SQL Tuning Advisor is run as part of the AUTOTASK

framework?

A. statistics recommendations

B. SQL profile recommendations

C. restructuring of SQL recommendations

D. index-related recommendations

Answer: B

 – 8

Exhibit:

 

 

View the Exhibit to examine the Automatic Database Diagnostic Monitor (ADDM) tasks.

You executed the following commands:

SQL> VAR tname VARCHAR2(60);

SQL> BEGIN

:tname := ‘my_instance_analysis_mode_task';

DBMS_ADDM.INSERT_SEGMENT_DIRECTIVE(:tname,’Sg_directive’,’SCOTT’);

END;

Which statement describes the consequence?

A. All subsequent ADDM tasks including my_instance_analysis_mode_task are filtered

to suppress the Segment Advisor suggestions for the SCOTT schema.

B. The ADDM task is filtered to produce the Segment Advisor suggestions for the

SCOTT schema only.

C. The ADDM task is filtered to suppress the Segment Advisor suggestions for the

SCOTT schema.

D. The PL/SQL block produces an error because the my_instance_analysis_mode_task

task has not been reset to its initial state.

Answer: D

 – 9

Which statements are true regarding table compression? (Choose all that apply.)

 

 

A. It saves disk space and reduces memory usage.

B. It saves disk space but has no effect on memory usage.

C. It incurs extra CPU overhead during DML as well as direct loading operations.

D. It incurs extra CPU overhead during DML but not direct loading operations.

E. It requires uncompress operation during I/O.

Answer: A,C

 – 10

You are working as a DBA on the decision support system. There is a business

requirement to track and store all transactions for at least three years for a few tables in

the database. Automatic undo management is enabled in the database. Which

configuration should you use to accomplish this task?

A. Enable Flashback Data Archive for the tables.

B. Specify undo retention guarantee for the database.

C. Enable supplemental logging for the database.

D. Query V$UNDOSTAT to determine the amount of undo that will be generated and

create an undo tablespace for that size.

E. Create Flashback Data Archive on the tablespace on which the tables are stored.

Answer: A

 – 11

USER_DATA is a nonencrypted tablespace that contains a set of tables with data. You

want to convert all existing data in the USER_DATA tablespace and the new data into

the encrypted format. Which methods would you use to achieve this? (Choose all that

apply.)

A. Encrypt the USER_DATA tablespace using the ALTER TABLESPACE statement so

that all the data in the tablespace is automatically encrypted.

B. Use Data Pump to transfer the existing data to a new encrypted tablespace.

C. Use ALTER TABLE..MOVE to transfer the existing data to a new encrypted

tablespace.

D. Enable row movement for each table to be encrypted and then use ALTER

TABLESPACE to encrypt the tablespace.

E. Use CREATE TABLE AS SELECT to transfer the existing data to a new encrypted

tablespace.

Answer: B,C,E

 – 12

Exhibit:

 

 

View the Exhibit to observe the error.

You receive this error regularly and have to shut down the database instance to overcome

the error. What can the solution be to reduce the chance of this error in future, when

implemented?

A. setting the PRE_PAGE_SGA parameter to TRUE

B. locking the SGA in memory

C. increasing the value of SGA_MAX_SIZE

D. automatic memory management

Answer: D

 – 13

Which three are the valid statements in relation to SQL plan baselines? (Choose three.)

A. The plans generated for every SQL statement are stored in the SQL plan baseline by

default.

B. The plans can be manually loaded to the SQL plan baseline.

C. The plan baselines are stored temporarily in the memory as long as the database

instance is running.

D. The plans in the SQL plan baseline are verified and accepted plans.

E. For the SQL plan baselines to be accessible to the optimizer, the SYSAUX tablespace

must be online.

Answer: B,D,E

 – 14

You plan to use SQL Performance Analyzer to analyze the SQL workload. You created a

SQL Tuning Set as a part of the workload capturing. What information is captured as part

of this process? (Choose all that apply.)

A. the system change number (SCN)

B. the execution plan

C. the execution context

D. the SQL text

E. the execution frequency

Answer: C,D,E

 

 

 – 15

Which two statements are true regarding the Automatic Diagnostic Repository (ADR) in

Oracle Database 11g? (Choose two.)

A. The BACKGROUND_DUMP_DEST initialization parameter overrides the

DIAGNOSTIC_DEST initialization parameter for the location of the alert log file.

B. A single ADR can support multiple ADR homes for different database instances.

C. The alert files are stored in XML file format in the TRACE directory of each ADR

home.

D. If the environmental variable ORACLE_BASE is set, then DIAGNOSTIC_DEST is

set to $ORACLE_BASE.

Answer: B,D

 – 16

While deploying a new application module, the software vendor ships the application

software along with appropriate SQL plan baselines for the new SQLs being introduced.

Which two statements describe the consequences? (Choose two.)

A. The optimizer does not generate new plans for the SQL statements for which the SQL

plan baseline has been imported.

B. The new SQL statements initially run with the plans that are known to produce good

performance under standard test configuration.

C. The plan baselines can be evolved over time to produce better performance.

D. The newly generated plans are directly placed into the SQL plan baseline without

being verified.

Answer: B,C

 – 17

Your system has been upgraded from Oracle Database 10g to Oracle Database 11g. You

imported SQL Tuning Sets (STS) from the previous version. After changing the

OPTIMIZER_FEATURE_ENABLE parameter to 10.2.0.4 and running the SQL

Performance Analyzer, you observed performance regression for a few SQL statements.

What would you do with these SQL statements?

A. Set OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES to FALSE to prevent the

plans from being loaded to the SQL plan baseline.

B. Capture the plans from the previous version using STS and then load them into the

stored outline.

C. Set OPTIMIZER_USE_PLAN_BASELINES to FALSE to prevent the use of

regressed plans.

D. Capture the plans from the previous version using STS and then load them into SQL

Management Base (SMB).

 

 

Answer: D

 – 18

Evaluate the following statements:

CREATE TABLE purchase_orders

(po_id NUMBER(4),

po_date TIMESTAMP,

supplier_id NUMBER(6),

po_total NUMBER(8,2),

CONSTRAINT order_pk PRIMARY KEY(po_id))

PARTITION BY RANGE(po_date)

(PARTITION Q1 VALUES LESS THAN (TO_DATE(?1-apr-2007?d-mon-yyyy?),

PARTITION Q2 VALUES LESS THAN (TO_DATE(?1-jul-2007?d-mon-yyyy?),

PARTITION Q3 VALUES LESS THAN (TO_DATE(?1-oct -2007?d-mon-yyyy?),

PARTITION Q4 VALUES LESS THAN (TO_DATE(?1-jan-2008?d-mon-yyyy?));

CREATE TABLE purchase_order_items

(po_id NUMBER(4) NOT NULL,

product_id NUMBER(6) NOT NULL,

unit_price NUMBER(8,2),

quantity NUMBER(8),

CONSTRAINT po_items_fk

FOREIGN KEY (po_id) REFERENCES purchase_orders(po_id))

PARTITION BY REFERENCE(po_items_fk);

What are the two consequences of the above statements? (Choose two.)

A. Partitions of PURCHASE_ORDER_ITEMS have system-generated names.

B. The PURCHASE_ORDER_ITEMS table inherits the partitioning key from the parent

table by automatically duplicating the key columns.

C. Both PURCHASE_ORDERS and PURCHASE_ORDER_ITEMS tables are created

with four partitions each.

D. Partition maintenance operations performed on the PURCHASE_ORDER_ITEMS

table are automatically reflected in the PURCHASE_ORDERS table.

E. Partitions of the PURCHASE_ORDER_ITEMS table exist in the same tablespaces as

the partitions of the PURCHASE_ORDERS table.

Answer: C,E

 – 19

You are managing an Oracle Database 11g instance with ASM storage. You lost an ASM

disk group DAT

A. You have RMAN backup of data as well as ASM metadata backup.

You want to re-create the missing disk group by using the ASMCMD md_restore

command. Which of these methods would you use to achieve this? (Choose all that

apply.)

 

 

A. Restore the disk group with the exact configuration as the backed-up disk group, using

the same disk group name, same set of disks, failure group configurations, and data on

the disk group.

B. Restore the disk group with the exact configuration as the backed-up disk group, using

the same disk group name, same set of disks, and failure group configurations.

C. Restore the disk group with changed disk group specification, failure group

specification, disk group name, and other disk attributes.

D. Restore metadata in an existing disk group by passing the existing disk group name as

an input parameter.

Answer: B,C,D

 – 20

Examine the following RMAN command:

BACKUP DATABASE

TAG TESTDB

KEEP UNTIL ‘SYSDATE+1′

RESTORE POINT TESTDB06;

Which two statements are true regarding the backup taken by using the above RMAN

command? (Choose two.)

A. Archived redo logs are backed up only if the database is open during the backup.

B. The backup is deleted after one day, regardless of the default retention policy settings.

C. The backup becomes obsolete after one day, regardless of the default retention policy

settings.

D. Only data files and the control file are backed up.

Answer: A,C

 – 21

Which statement describes the information returned by the

DBMS_SPACE.SPACE_USAGE procedure for LOB space usage?

A. It returns space usage of only SecureFile LOB chunks.

B. It returns space usage of only BasicFile LOB chunks.

C. It returns both BasicFile and SecureFile LOB space usage for both partitioned and

nonpartitioned tables.

D. It returns both BasicFile and SecureFile LOB space usage for only nonpartitioned

tables.

Answer: A

 – 22

Evaluate the following command:

SQL>ALTER SYSTEM SET db_securefile = ‘IGNORE';

What is the impact of this setting on the usage of SecureFiles?

 

 

 

A. It forces SecureFiles to be created even if the BASICFILE option is specified to create

the LOB.

B. It forces BasicFiles to be created even if the SECUREFILE option is specified to

create the LOB.

C. It does not allow the creation of SecureFiles and generates an error if the

SECUREFILE option is specified to create the LOB.

D. It ignores the SECUREFILE option only if a Manual Segment Space Management

tablespace is used and creates a BasicFile.

Answer: B

 – 23

Which two statements are true regarding the functionality of the remap command in

ASMCMD? (Choose two.)

A. It reads the blocks from a good copy of an ASM mirror and rewrites them to an

alternate location on disk if the blocks on the original location cannot be read properly.

B. It repairs blocks by always reading them from the mirror copy and writing them to the

original location.

C. It repairs blocks that have read disk I/O errors.

D. It checks whether the alias metadata directory and the file directory are linked

correctly.

Answer: A,C

 – 24

Which tasks can be accomplished using the DBMS_LOB.SETOPTIONS procedure?

A. only encryption and deduplication settings for only SecureFile CLOBs

B. only encryption and compression settings for all SecureFile LOBs

C. deduplication, encryption, and compression settings for all SecureFile LOBs

D. deduplication, encryption, and compression settings only for SecureFile CLOBs

Answer: C

 – 25

Which statement describes the effect of table redefinition on the triggers attached to the

table?

A. All triggers on the table are invalidated and are automatically revalidated with the next

DML execution on the table.

B. All triggers on the table are invalidated and must be manually recompiled before the

next DML execution on the table.

C. All triggers on the table remain valid.

D. Only triggers that are affected by the changes to the structure of the table are

 

 

invalidated and automatically revalidated with the next DML execution on the table.

Answer: A

 – 26

Evaluate the following code:

SQL>VARIABLE task_name VARCHAR2(255);

SQL>VARIABLE sql_stmt VARCHAR2(4000);

SQL>BEGIN

:sql_stmt := ‘SELECT COUNT(*) FROM customers

WHERE cust_state_province =”CA”';

:task_name := ‘MY_QUICKTUNE_TASK';

DBMS_ADVISOR.QUICK_TUNE(DBMS_ADVISOR.SQLACCESS_ADVISOR,

:task_name, :sql_stmt);

END;

What is the outcome of this block of code?

A. It creates a task and workload but does not execute the task.

B. It produces an error because the SQL Tuning Set has not been created.

C. It produces an error because a template has not been created.

D. It creates a task and workload, and executes the task.

Answer: D

 – 27

What is the advantage of setting the ASM-preferred mirror read for the Stretch cluster

configuration?

A. It improves performance by reading from a copy of an extent closest to the node.

B. This feature enables much faster file opens.

C. It improves performance as fewer extent pointers are needed in the shared pool.

D. It improves resync operations.

Answer: A

 – 28

You run the SQL Tuning Advisor (STA) to tune a SQL statement that is part of a fixed

SQL plan baseline. The STA generates a SQL profile for the SQL statement, which

recommends that you accept the profile. Which statement is true when you accept the

suggested SQL profile?

A. The tuned plan is not added to the SQL plan baseline.

B. The tuned plan is added to the fixed SQL plan baseline as a fixed plan.

C. The tuned plan is added to a new nonfixed SQL plan baseline as a nonfixed plan.

D. The tuned plan is added to the fixed SQL plan baseline as a nonfixed plan.

 

 

Answer: D

 – 29

You plan to collect the Automatic Workload Repository (AWR) data every Monday

morning for a month. You want Oracle Database to automatically create a baseline every

Monday and remove the old baseline. What is the correct action to achieve this?

A. Create and populate a SQL Tuning Set from the AWR on every Monday.

B. Change the RETENTION setting for the AWR snapshots to 7 days on Monday.

C. Create a repeating baseline template.

D. Insert a finding directive for future ADDM tasks.

Answer: C

 – 30

Which three statements are true regarding persistent lightweight jobs? (Choose three.)

A. Persistent lightweight jobs modify several tables in the data dictionary to generate a

lot of redo.

B. The user cannot set privileges on persistent lightweight jobs.

C. Persistent lightweight jobs are useful when users need to create a large number of jobs

in a short time.

D. Persistent lightweight jobs are useful when users need to create a small number of jobs

that run infrequently.

E. The use of a template is mandatory to create persistent lightweight jobs.

Answer: B,C,E

 – 31

In which two aspects does hot patching differ from conventional patching? (Choose two.)

A. It takes more time to install or uninstall compared with conventional patching.

B. It can be installed and uninstalled via OPatch unlike conventional patching.

C. It does not require down time to apply or remove unlike conventional patching.

D. It is not persistent across instance startup and shutdown unlike conventional patching.

E. It consumes more memory compared with conventional patching.

Answer: C,E

 – 32

View the following SQL statements:

Transaction T1

INSERT INTO hr.regions VALUES (5,’Pole’);

COMMIT;

Transaction T2

 

 

UPDATE hr.regions SET region_name=’Poles’ WHERE region_id = 5;

COMMIT;

Transaction T3

UPDATE hr.regions SET region_name=’North and South Poles’ WHERE

region_id = 5;

You want to back out transaction T2. Which option would you use?

A. It is possible, but transaction T3 also backs out.

B. It is possible with the NOCASCADE_FORCE option.

C. It is not possible because it has conflicts with transaction T3.

D. It is possible with the NONCONFLICT_ONLY option.

Answer: B

 – 33

Which statement is true when Automatic Workload Repository (AWR) baselines are

created using baseline templates?

A. AWR baselines are always created with infinite expiration duration.

B. AWR baselines are always created as repeating baselines.

C. AWR baselines are always created using the Automatic Workload Repository (AWR)

retention period as expiration duration.

D. AWR baselines can be created on the basis of two time values.

Answer: D

 – 34

Your database initialization parameter file has the following entry:

SEC_MAX_FAILED_LOGIN_ATTEMPTS=3

Which statement is true regarding this setting?

A. It drops the connection after the specified number of login attempts fail for any user.

B. It is enforced only if the password profile is enabled for the user.

C. It locks the user account after the specified number of attempts.

D. It drops the connection after the specified number of login attempts fail only for users

who have the SYSDBA privilege.

Answer: A

 – 35

Which statement is true regarding virtual private catalogs?

A. A virtual private catalog owner can create a local stored script, and have read/write

access to a global stored script.

B. The virtual private catalog owner cannot create and modify the stored scripts.

C. The set of views and synonyms that make up the virtual private catalog is stored in the

 

 

 

schema of the RMAN recovery catalog owner.

D. To perform most of the RMAN operations, the virtual catalog owner must have the

SYSDBA or SYSOPER privilege on the target database.

Answer: D

 – 36

Evaluate the following command:

SQL> CREATE TABLE design_data (id NUMBER,

doc CLOB)

LOB(doc) STORE AS SECUREFILE(DEDUPLICATE);

Which statement is true regarding the above command?

A. All LOB data that is identical in two or more rows in a LOB column share the same

data blocks.

B. The LOB values are cached by default in the buffer cache.

C. The LOB values are automatically stored in encrypted mode.

D. The LOB values are automatically compressed.

Answer: A

 – 37

Which statements are true regarding the Query Result Cache? (Choose all that apply.)

A. It can store the results from normal as well as flashback queries.

B. It can be set at the system, session, or table level.

C. It is used only across statements in the same session.

D. It can store the results of queries based on normal, temporary, and dictionary tables.

Answer: A,B

 – 38

You are working on a CATDB database that contains an Oracle Database version 11.1

catalog schema owned by the user RCO11. The INST1 database contains an Oracle

Database version 10.1 catalog schema owned by the user RCAT10.

You want the RMAN to import metadata for database IDs 1423241 and 1423242,

registered in RCAT10, into the recovery catalog owned by RCO11.

You executed the following RMAN commands:

RMAN> CONNECT CATALOG rco11/password@catdb

RMAN> IMPORT CATALOG rcat10/oracle@inst1;

What happens when you execute the above commands? (Choose all that apply.)

A. They import metadata for all registered databases in the RCAT10 database.

B. They register all the RCAT10-catalog registered databases in the RCO11 catalog.

C. They overwrite all stored scripts in the RCO11 catalog with the same name as that in

the RCAT10 catalog.

 

 

 

D. They deregister all databases registered in the RCAT10 catalog.

Answer: A,B,D

 – 39

Evaluate the following function code:

CREATE FUNCTION get_dept_avg(dept_id NUMBER)

RETURN NUMBER

RESULT_CACHE RELIES_ON (EMPLOYEES)

IS

avgsal NUMBER(6);

BEGIN

SELECT AVG(SALARY)INTO avgsal

FROM EMPLOYEES

WHERE DEPARTMENT_ID = dept_id;

RETURN avgsal;

END get_dept_avg;

Which statement is true regarding the above function?

A. The cached result becomes invalid when any structural change is done to the

EMPLOYEES table.

B. If the function is invoked with a different parameter value, the existing result in the

result cache gets overwritten by the latest value.

C. Each time the function is invoked in a different session, the current result in the result

cache gets overwritten.

D. If the function execution results in an unhandled exception, the exception result is also

stored in the cache.

Answer: A

 – 40

Which tasks can be accomplished using the Enterprise Manager Support Workbench in

Oracle Database 11g? (Choose all that apply.)

A. Generate reports on data failure such as data file failures.

B. You can track the Service Request (SR) and implement repairs.

C. You can package and upload diagnostic data to Oracle Support.

D. You can manually run health checks to gather diagnostic data for a problem.

Answer: B,C,D

 – 41

Exhibit #1:

 

 

Exhibit #2:

View the Exhibit exhibit1 to examine the series of SQL commands.

View the Exhibit exhibit2 to examine the plans available in the SQL plan baseline. The

baseline in the first row of the Exhibit is created when OPTIMIZER_MODE was set to

FIRST_ROWS.

Which statement is true if the SQL query in exhibit1 is executed again when the value of

OPTIMIZER_MODE is set to FIRST_ROWS?

A. The optimizer uses the plan in the first row of the exhibit2 because

OPTIMIZER_MODE was set to FIRST_ROW during its creation.

B. The optimizer uses the plan in the second row of the exhibit2 because it is an accepted

plan.

C. The optimizer uses the plan in the first row of the exhibit2 because it is the latest

generated plan.

D. The optimizer uses a new plan because none of the plans in the exhibit2 are fixed

plans.

Answer: B

 – 42

What are the advantages of variable extent size support for large ASM files? (Choose

two.)

 

 

A. It improves resync operations when the disk comes online after being taken offline for

maintenance purposes.

B. It improves performance in the extended cluster configuration by reading from a local

copy of an extent.

C. Fewer extent pointers are needed to describe the file and less memory is required to

manage the extent maps in the shared pool.

D. This feature enables faster file opens because of the reduction in the amount of

memory that is required to store file extents.

Answer: C,D

 – 43

Which two are the uses of the ASM metadata backup and restore (AMBR) feature?

(Choose two.)

A. It can be used to back up all data on ASM disks.

B. It can be used to recover the damaged ASM disk group along with the data.

C. It can be used to gather information about a preexisting ASM disk group with disk

paths, disk name, failure groups, attributes, templates, and alias directory structure.

D. It can be used to re-create the ASM disk group with its attributes.

Answer: C,D

 – 44

Which two changes and their effect on the system can be tested by using the Database

Replay feature? (Choose two.)

A. multiplexing of the control file

B. adding the redo log member to the database

C. database and operating system upgrades

D. changing the database storage to ASM-managed storage

Answer: C,D

 – 45

Which is the source used by Automatic SQL Tuning that runs as part of the AUTOTASK

framework?

A. SQL statements that are part of the AWR baseline only

B. SQL statements based on the AWR top SQL identification

C. SQL statements that are part of the available SQL Tuning Set (STS) only

D. SQL statements that are available in the cursor cache and executed by a user other

than SYS

Answer: B

 

 

 – 46

While performing the backup of the flash recovery area, you notice that one of the

archived redo log files is missing. You have multiple destinations for archived redo log

files. What implications does it have on the backup of the flash recovery area?

A. The backup fails because one of the archived redo log files is missing.

B. The backup succeeds but it would be without the missing archived log.

C. During backup, you are prompted for the alternative destination for the missing

archived redo log file.

D. The backup succeeds because it fails over to one of the alternative archived redo log

destinations.

Answer: D

 – 47

You are working on a CATDB database that contains an Oracle Database version 11.1

catalog schema owned by the user RCO11. The INST1 database contains an Oracle

Database version 10.1 catalog schema owned by the user RCAT10.

You want the RMAN to import metadata for database IDs 1423241 and 1423242,

registered in RCAT10, into the recovery catalog owned by RCO11. You executed the

following commands:

RMAN> CONNECT CATALOG rco11/password@catdb

RMAN> IMPORT CATALOG rcat10/oracle@inst1 NO UNREGISTER;

Which two statements are true regarding the tasks accomplished with these commands?

(Choose two.)

A. They register all databases registered in the RCAT10 catalog.

B. They import all metadata from the RCAT10 catalog.

C. They do not register the databases registered in the RCAT10 catalog.

D. They unregister the database from the RCAT10 catalog.

Answer: A,B

 – 48

You are managing an Oracle Database 11g instance and an Oracle Database 10g instance

on the same machine. Both instances use the ASM instance as storage. Which statements

regarding the ASM disk group compatibility attributes are true in this scenario? (Choose

all that apply.)

A. The database-compatibility version settings for each instance must be greater than or

equal to the RDBMS compatibility of all ASM disk groups used by that database

instances.

B. RDBMS compatibility and the database version determines whether a database

instance can mount the ASM disk group.

C. The RDBMS compatibility settings for a disk group control the format of data

 

 

structures for ASM metadata on the disk.

D. ASM compatibility controls which features for the ASM will be enabled.

Answer: A,B,D

 – 49

Which two statements about Oracle Direct Network File System (NFS) are true? (Choose

two.)

A. It uses the operating system kernel NFS layer for user tasks and network

communication modules.

B. File systems need not be mounted by the kernel NFS system when being served

through Direct NFS.

C. Oracle Disk Manager can manage NFS on its own, without using the operating system

kernel NFS driver.

D. A separate NFS interface is required for use across Linux, UNIX, and Windows

platforms.

E. It bypasses the OS file system cache.

Answer: C,E

 – 50

Which three statements are true regarding the functioning of the Autotask Background

Process (ABP)? (Choose three.)

A. It creates jobs without considering the priorities associated with them.

B. It translates tasks into jobs for execution by the scheduler.

C. It determines the list of jobs that must be created for each maintenance window.

D. It is spawned by the MMON background process at the start of the maintenance

window.

E. It maintains a repository in the SYSTEM tablespace to store the history of the

execution of all tasks.

Answer: B,C,D

 – 51

Which two statements are true with respect to the maintenance window? (Choose two.)

A. A DBA can enable or disable an individual task in all maintenance windows.

B. In case of a long maintenance window, all Automated Maintenance Tasks are restarted

every four hours.

C. A DBA cannot change the duration of the maintenance window after it is created.

D. A DBA can control the percentage of the resource allocated to the Automated

Maintenance Tasks in each window.

Answer: A,D

 

 

 

 – 52

Which statements are true regarding the concept of problems and incidents in the fault

diagnosability infrastructure for Oracle Database 11g? (Choose all that apply.)

A. Only the incident metadata and dumps are stored in the Automatic Diagnostic

Repository (ADR).

B. The problem key is the same as the incident number.

C. The database sends an incident alert to the Oracle Enterprise Manager Database Home

page.

D. Every problem has a problem key, which is a text string that describes the problem.

E. The database makes an entry into the alert log file when problems and incidents occur.

Answer: C,D,E

 – 53

What two statements are true regarding the recommendations received from the SQL

Access Advisor? (Choose two.)

A. It cannot generate recommendations that support multiple workload queries.

B. It can recommend partitioning on tables provided that the workloads have some

predicates and joins on the columns of the NUMBER or DATE type.

C. It can recommend partitioning only on tables that have at least 10,000 rows.

D. It can recommend only B-tree indexes and not bitmap or function-based indexes.

Answer: B,C

 – 54

Which two statements about the SQL Management Base (SMB) are true? (Choose two.)

A. It stores plans generated by the optimizer using a stored outline.

B. It is part of the data dictionary and stored in the SYSTEM tablespace.

C. It is part of the data dictionary and stored in the SYSAUX tablespace.

D. It contains only SQL profiles generated by SQL Tuning Advisor.

E. It contains the statement log, the plan history, plan baselines, and SQL profiles.

Answer: C,E

 – 55

Exhibit:

 

 

View the Exhibit to examine the metrics with a threshold.

Which statement is true regarding the Number of Transactions (per second) metric?

A. Oracle determines when an adaptive threshold has been breached based on the

maximum value captured by the baseline.

B. The total concurrent number of threshold violations, which must occur before an alert

is raised for the metric, has been set to zero.

C. Oracle uses statistical relevance to determine when an adaptive threshold has been

breached for the metric.

D. The statistics for the metric values observed over the baseline time period are not

examined to determine threshold values.

Answer: C

 – 56

Which two statements are true regarding the starting of the database instance using the

following command? (Choose two.)

SQL>STARTUP UPGRADE

A. It allows only SYSDBA connections.

B. It enables all system triggers.

C. It ensures that all job queues remain active during the upgrade process.

D. It sets system initialization parameters to specific values that are required to enable

database upgrade scripts to be run.

Answer: A,D

 – 57

To generate recommendations to improve the performance of a set of SQL queries in an

application, you execute the following blocks of code:

BEGIN

dbms_advisor.create_task(dbms_advisor.sqlaccess_advisor,’TASK1′);

END;

/

BEGIN

dbms_advisor.set_task_parameter(‘TASK1′,’ANALYSIS_SCOPE’,’ALL’);

dbms_advisor.set_task_parameter(‘TASK1′,’MODE’,’COMPREHENSIVE’);

END;

 

 

/

BEGIN

dbms_advisor.execute_task(‘TASK1′);

dbms_output.put_line(dbms_advisor.get_task_script(‘TASK1′));

END;

/

The blocks of code execute successfully; however, you do not get the required outcome.

What could be the reason?

A. The partial or complete workload scope needs to be associated with the task.

B. The type of structures (indexes, materialized views, or partitions) to be recommended

need to be specified for the task.

C. A template needs to be associated with the task.

D. A workload needs to be associated with the task.

Answer: D

 – 58

You opened the encryption wallet and then issued the following command:

SQL>CREATE TABLESPACE securespace

DATAFILE ‘/home/user/oradata/secure01.dbf’

SIZE 150M

ENCRYPTION USING ‘3DES168′

DEFAULT STORAGE(ENCRYPT);

Then you closed the wallet. Later, you issued the following command to create the

EMPLOYEES table in the SECURESPACE tablespace and you use the NO SALT option

for the EMPID column.

What is the outcome?

A. It generates an error because the NO SALT option cannot be used with the ENCRYPT

option.

B. It generates an error because the wallet is closed.

C. It creates the table but does not encrypt the data in it.

D. It creates the table and encrypts the data in it.

Answer: B

 – 59

Which statement about the enabling of table compression in Oracle Database 11g is true?

A. Compression can be enabled only at the table level for both direct loads and

conventional DML.

B. Compression can be enabled at the table, tablespace, or partition level for direct loads

only.

C. Compression can be enabled at the table, tablespace, or partition level for both direct

loads and conventional DML.

 

 

 

D. Compression can be enabled at the table, tablespace, or partition level for

conventional DML only.

Answer: C

 – 60

You are managing Oracle Database 11g with an ASM storage with high redundancy. The

following command was issued to drop the disks from the dga disk group after five

hours:

ALTER DISKGROUP dga OFFLINE DISKS IN FAILGROUP f2 DROP AFTER 5H;

Which statement is true in this scenario?

A. It starts the ASM fast mirror resync.

B. All the disks in the dga disk group would be OFFLINE and the DISK_REPAIR_TIME

disk attribute would be set to 5 hours.

C. It drops all disk paths from the dga disk group.

D. All the disks in the dga disk group in failure group f2 would be OFFLINE and the

DISK_REPAIR_TIME disk attribute would be set to 5 hours.

Answer: D

 – 61

Exhibit:

View the Exhibit to examine the parameters set for your database instance.

You execute the following command to perform I/O calibration after the declaration of

bind variables in the session that are used in the command:

SQL> EXECUTE dbms_resource_manager.calibrate_io( num_physical_disks=>1, –

 

 

max_latency=>50, –

max_iops=>:max_iops, –

max_mbps=>:max_mbps, –

actual_latency=>:actual_latency);

Which statement describes the consequence?

A. The calibration process runs successfully and populates all the bind variables.

B. The calibration process runs successfully but the latency time is not computed.

C. The calibration process runs successfully but only the latency time is computed.

D. The command produces an error.

Answer: D

 – 62

You upgraded Oracle Database 10g to Oracle Database 11g. How would this affect the

existing users’ passwords?

A. All passwords automatically become case-sensitive.

B. All passwords remain non-case-sensitive till they are changed.

C. All passwords remain non-case-sensitive until their password attribute in the profile is

altered.

D. All passwords remain non-case-sensitive and cannot be changed.

Answer: B

 – 63

While tuning a SQL statement, the SQL Tuning Advisor finds an existing SQL profile for

the statement that has stale statistics available. What would the optimizer do in this

situation?

A. It updates the existing SQL profiles with current statistics.

B. It logs a warning message in the alert log so that the DBA can perform statistics

collection manually.

C. It initiates the statistics collection process by running GATHER_STATS_JOB.

D. It makes the statistics information available to GATHER_STATS_JOB.

Answer: D

 – 64

You executed the following PL/SQL block successfully:

VARIABLE tname VARCHAR2(20)

BEGIN

dbms_addm.insert_finding_directive (NULL, DIR_NAME=>’Detail CPU Usage’,

FINDING_NAME=>’CPU Usage’,

MIN_ACTIVE_SESSIONS=>0, MIN_PERC_IMPACT=>90);

:tname := ‘database ADDM task4′;

 

 

 

dbms_addm.analyze_db(:tname, 150, 162);

END;

/

Then you executed the following command:

SQL> SELECT dbms_addm.get_report(:tname) FROM DUAL;

The above command produces Automatic Database Diagnostic Monitor (ADDM)

analysis ____.

A. with the CPU Usage finding if it is less than 90

B. without the CPU Usage finding if it is less than 90

C. with the CPU Usage finding for snapshots not between 150 and 162

D. with the CPU Usage finding for snapshots below 90

Answer: B

 – 65

You have a range-partitioned table in your database. Each partition in the table contains

the sales data for a quarter. The partition related to the current quarter is modified

frequently and other partitions undergo fewer data manipulations. The preferences for the

table are set to their default values. You collect statistics for the table using the following

command in regular intervals:

SQL> EXECUTE

DBMS_STATS.GATHER_TABLE_STATS(‘SH’,’SALES’,GRANULARITY=>’GLOBAL’);

You need statistics to be collected more quickly. What can you do to achieve this?

A. Set the STATISTICS_LEVEL parameter to BASIC.

B. Set the INCREMENTAL value to TRUE for the partition table.

C. Set DYNAMIC_SAMPLING to level 4.

D. Increase the value of STALE_PERCENT for the partition table.

Answer: B

 – 66

You create a new Automatic Database Diagnostic Monitor (ADDM) task:

instance_analysis_mode_task. To view the ADDM report, you use the following

command:

SQL> SELECT dbms_addm.get_report(‘my_instance_analysis_mode_task’) FROM dual;

You want to suppress ADDM output relating to Segment Advisor actions on user

SCOTT’s segments. What would you do to achieve this?

A. Add a segment directive for the ADDM task.

B. Disable the Segment Advisor from the Automatic Maintenance Task.

C. Add a finding directive for the ADDM task.

D. Add a parameter directive for the ADDM task.

Answer: A

 

 

 

 – 67

Evaluate the following SQL statement used to create the PRODUCTS table:

CREATE TABLE products

(product_id NUMBER(3) PRIMARY KEY,

product_desc VARCHAR2(25),

qty NUMBER(8,2),

rate NUMBER(10,2),

total_value AS ( qty * rate))

PARTITION BY RANGE (total_value)

(PARTITION p1 VALUES LESS THAN (100000),

PARTITION p2 VALUES LESS THAN (150000),

PARTITION p3 VALUES LESS THAN (MAXVALUE))

COMPRESS FOR ALL OPERATIONS;

Which statement is true regarding this command?

A. It produces an error because compression cannot be used for the TOTAL_VALUE

partition key.

B. It executes successfully but partition pruning cannot happen for this partition key.

C. It produces an error because the TOTAL_VALUE column cannot be used as a

partition key.

D. It executes successfully but the values in the TOTAL_VALUE column would not be

physically stored in the partitions.

Answer: D

 – 68

Exhibit:

 

 

View the Exhibit to examine the details for an incident.

Which statement is true regarding the status of the incident?

A. The incident has been newly created and is in the process of collecting diagnostic

information.

B. The incident is now in the Done state and the ADR can select the incident to be

purged.

C. The DBA is working on the incident and prefers that the incident be kept in the ADR.

D. The data collection for the incident is complete and the incident can be packaged and

sent to Oracle Support.

Answer: D

 – 69

Which statement describes the significance of the CHANGE FAILURE command in

RMAN? (Choose all that apply.)

A. It is used to change failure priority only for HIGH or LOW priorities.

B. It is used to execute the advised repair script.

C. It is used to change failure priority only for the CRITICAL priority.

D. It is used to explicitly close the open failures.

E. It is used to inform the database about the repair after the repair script executes.

Answer: A,D

 

 

 – 70

Which statements describe the capabilities of the DBMS_NETWORK_ACL_ADMIN

package? (Choose all that apply.)

A. It can be used to control the time interval for which the access privilege is available to

a user.

B. It can be used to allow the access privilege settings for users but not roles.

C. It can be used to selectively restrict a user’s access to different applications in a

specific host computer.

D. It can be used to selectively restrict the access for each user in a database to different

host computers.

E. It can be used to allow the access privilege settings for users as well as roles.

Answer: A,D,E

 – 71

Identify the two direct sources from where SQL plans can be loaded into the SQL plan

baselines. (Choose two.)

A. SQL Tuning Set

B. Cursor cache

C. Stored outline

D. Automatic Workload Repository (AWR) snapshots

Answer: A,B

 – 72

Which statements are true regarding the creation of an incident package file by using the

EM Workbench Support? (Choose all that apply.)

A. You can add or remove the trace files to the package.

B. You can create the incremental incident package ZIP file for new or modified

diagnostic information for the incident package already created.

C. You can add SQL test cases to the incident package.

D. You cannot create an incremental incident package when the physical files are purged

from the ADR.

Answer: A,B,C

 – 73

Exhibit:

 

 

View the Exhibit to examine the error during the database startup.

You open an RMAN session for the database instance. To repair the failure, you executed

the following as the first command in the RMAN session:

RMAN> REPAIR FAILURE;

Which statement describes the consequence of the command?

A. The command performs the recovery and closes the failures.

B. The command executes the RMAN script to repair the failure and removes the entry

from the Automatic Diagnostic Repository (ADR).

C. The command only displays the advice and the RMAN script required for repair.

D. The command produces an error because the ADVISE FAILURE command has not

been executed before the REPAIR FAILURE command.

Answer: D

 – 74

Which of the following information will be gathered by the SQL Test Case Builder for

the problems pertaining to SQL-related problems? (Choose all that apply.)

A. ADR diagnostic files

B. PL/SQL functions, procedures, and packages

C. the table and index definitions and actual data

D. all the optimizer statistics

E. initialization parameter settings

Answer: C,D,E

 – 75

Which two activities are NOT supported by the Data Recovery Advisor? (Choose two.)

A. Diagnose and repair failures on a standby database.

B. Recover from failures in the Real Application Cluster (RAC) environment.

C. Diagnose and repair a data file corruption online.

D. Diagnose and repair a data file corruption offline.

Answer: A,B

 

 

 – 76

You want to track and store all transactional changes to a table over its lifetime. To

accomplish this task, you enabled Flashback Data Archive with the retention of 5 years.

After some time, the business requirement changed and you were asked to change the

retention from 5 years to 3 years. To accomplish this, you issued the following command:

ALTER FLASHBACK ARCHIVE fla1 MODIFY RETENTION 3 YEAR;

What is the implication of this command?

A. The command produces an error because the retention time cannot be reduced.

B. All historical data is retained but the subsequent flashback data archives are

maintained for only three years.

C. All historical data is purged and the new flashback data archives are maintained for

three years.

D. All historical data older than three years is purged from the flashback archive FLA1.

Answer: D

 – 77

Exhibit:

View the Exhibit to examine the replay settings for replay parameters.

What is the implication for setting the values for replay parameters? (Choose all that

apply.)

A. The COMMIT order in the captured workload is preserved during replay.

B. The value 100 in the THINK_TIME_SCALE parameter attempts to match the

captured user think time while replaying.

C. The value 100 in the CONNECT_TIME_SCALE parameter attempts to connect all

sessions as captured.

D. The value 100 in the THINK_TIME_SCALE parameter attempts to make the replay

client shorten the think time between calls.

E. The value 100 in the CONNECT_TIME_SCALE parameter attempts to connect all

sessions immediately as soon as the replay begins.

Answer: A,B,C

 

 

 – 78

You issued the following command on the temporary tablespace LMTEMP in your

database:

SQL>ALTER TABLESPACE lmtemp SHRINK SPACE KEEP 20M;

Which requirement must be fulfilled for this command to succeed?

A. The tablespace can remain as the default but must have no active sort operations.

B. The tablespace must be locally managed.

C. The tablespace must have only one temp file.

D. The tablespace must be made nondefault and offline.

Answer: B

 – 79

Which statement is true regarding the VALIDATE DATABASE command?

A. It checks the database for intrablock corruptions only.

B. It checks for block corruption in the valid backups of the database.

C. It checks the database for both intrablock and interblock corruptions.

D. It checks for only those corrupted blocks that are associated with data files.

Answer: A

 – 80

Exhibit:

View the Exhibit that sets the threshold for the Current Open Cursors Count metric.

Why is the Significance Level threshold type not available in the threshold setting?

A. because the STATISTICS_LEVEL parameter is set to BASIC

B. because the AWR baseline is a system-defined moving window baseline

C. because AWR baseline is not enabled

D. because Current Open Cursors Count is not a basic metric

 

 

Answer: D

 – 81

You enabled Flashback Data Archive on the INVENTORY table. Which DDL operation

is supported on the table after enabling Flashback Data Archive?

A. Partition the table

B. Truncate the table.

C. Drop the table.

D. Rename a column in the table.

E. Add a column to the table.

Answer: E

 – 82

You are managing an Oracle Database 11g database with ASM storage. The ASM disk

group has the COMPATIBLE.ASM attribute set to 11.1. Which statements are true

regarding extent management and allocation units in the ASM disk group? (Choose all

that apply.)

A. The au_size disk group attribute determines the size of allocation units in the disk

group.

B. The allocation unit size may vary but the extent size is fixed.

C. The allocation unit size and extent size are fixed for all the disks in a disk group and

cannot be changed.

D. Extent management is completely automated.

Answer: A,D

 – 83

Which are the prerequisites for performing flashback transactions on your database?

(Choose all that apply.)

A. Undo retention guarantee for the database must be configured.

B. Supplemental log must be enabled for the primary key.

C. Supplemental log must be enabled.

D. Execute permission on the DBMS_FLASHBACK package must be granted to the

user.

Answer: B,C,D

 – 84

Which statement is true regarding online redefinition for the migration of BasicFile

LOBs to SecureFile LOBs?

 

 

A. It can be done at the table level or partition level.

B. It does not require additional storage because the operation is done online.

C. Local and global indexes are maintained automatically during the operation.

D. It cannot be done in parallel.

Answer: A

 – 85

Which three statements about performance analysis by SQL Performance Analyzer are

true? (Choose three.)

A. It produces results that can be used to create the SQL plan baseline.

B. It detects changes in SQL execution plans.

C. It generates recommendations to run SQL Tuning Advisor to tune regressed SQLs.

D. The importance of SQL statements is based on the size of the objects accessed.

E. It shows only the overall impact on workload and not the net SQL impact on

workload.

Answer: A,B,C

 – 86

The INV_HISTORY table is created using the command:

SQL>CREATE TABLE INV_HISTORY

(inv_no NUMBER(3),

inv_date DATE,

inv_amt NUMBER(10,2))

partition by range (inv_date)

interval (numtoyminterval(1,’month’))

(partition p0 values less than (to_date(’01-01-2005′,’dd-mm-yyyy’)),

partition p1 values less than (to_date(’01-01-2006′,’dd-mm-yyyy’)));

The following data has been inserted into the INV_HISTORY table :

INV_NO INV_DATE INV_AMT

1 30-dec-2004 1000

2 30-dec-2005 2000

3 1-feb-2006 3000

4 1-mar-2006 4000

5 1-apr-2006 5000

You would like to store the data belonging to the year 2006 in a single partition and issue

the command:

SQL> ALTER TABLE inv_history MERGE PARTITIONS

FOR(TO_DATE(’15-feb-2006′,’dd-mon-yyyy’)), FOR(TO_DATE(’15-apr-2006′))

INTO PARTITION sys_py;

What would be the outcome of this command?

A. It executes successfully, and the transition point is set to ’15-apr-2006′.

B. It produces an error because the partitions specified for merging are not adjacent.

 

 

 

C. It produces an error because the date values specified in the merge do not match the

date values stored in the table.

D. It executes successfully, and the transition point is set to ‘1-apr-2006′.

Answer: B

 – 87

You plan to have a larger moving window size for the default system-defined moving

window baseline because you want to use the adaptive threshold. Which statement

factors in this consideration while increasing the size of the moving window?

A. The moving window size must be less than Undo Retention.

B. The moving window size should be greater than the Automatic Workload Repository

(AWR) retention period.

C. The collection level for the AWR should be set to BASIC.

D. The moving window size should be equal to or less than the Automatic Workload

Repository (AWR) retention period.

Answer: D

 – 88

You issued the following command:

CREATE GLOBAL TEMPORARY TABLE admin_work_area

(startdate DATE,

enddate DATE,

class CHAR(20))

ON COMMIT DELETE ROWS

TABLESPACE tbs_t1;

An index is then created on the ADMIN_WORK_AREA temporary table.

Which two statements are true regarding the TBS_T1 tablespace in the above command?

(Choose two.)

A. It stores only the temporary table but not its indexes.

B. It must be a nondefault temporary tablespace for the database.

C. It stores both the temporary table as well as its indexes.

D. It can be a default or nondefault temporary tablespace for the database.

E. It must be the default temporary tablespace of the user who issues the command.

Answer: C,D

 – 89

Which statements are true regarding the system-defined moving window baseline in

Oracle Database 11g? (Choose all that apply.)

A. It is created when the first snapshot is collected by the Automatic Workload

Repository (AWR).

 

 

 

B. It is created by default with the window size being equal to the AWR retention time.

C. Adaptive threshold functionalities use it by default to compute statistics.

D. It does not allow you to change the moving window size.

Answer: B,C

 – 90

Which three statements correctly describe the features of the I/O calibration process?

(Choose three.)

A. Only one I/O calibration process can run at a time.

B. It automates the resource allocation for the Automated Maintenance Tasks.

C. The latency time is computed only when the TIMED_STATISTICS initialization

parameter is set to TRUE.

D. It improves the performance of the performance-critical sessions while running.

E. It can be used to estimate the maximum number of I/Os and maximum latency time for

the system.

Answer: A,C,E

 – 91

Which statements are true regarding system-partitioned tables? (Choose all that apply.)

A. Only a single partitioning key column can be specified.

B. The same physical attributes must be specified for each partition.

C. Unique local indexes cannot be created on a system-partitioned table.

D. Traditional partition pruning and partitionwise joins are not supported on these tables.

E. All DML statements must use partition-extended syntax.

Answer: C,D

 – 92

ENCRYPT_TS is an encrypted tablespace that contains tables with data. Which

statement is true regarding the effect of queries and data manipulation language (DML)

statements on the encrypted data in the tables?

A. The data remains encrypted when it is stored in the redo logs.

B. The data remains encrypted when it is read into memory.

C. The data remains encrypted in the UNDO tablespace provided that the UNDO

tablespace was created with the encryption option enabled.

D. The data is decrypted during SORT and JOIN operations.

Answer: A

 – 93

You are managing an Oracle Database 11g ASM instance with a disk group dg01 having

 

 

 

three disks. One of the disks in the disk group becomes unavailable because of power

failure. You issued the following command to change the DISK_REPAIR_TIME

attribute from 3.6 hours to 5 hours:

ALTER DISKGROUP dg01 SET ATTRIBUTE ‘disk_repair_time’ = ‘5h';

To which disks in the disk group will the new value be applicable?

A. all disks in the disk group

B. all disks that are not currently in OFFLINE mode

C. all disks that are currently in OFFLINE mode

D. all disks in the disk group only if all of them are ONLINE

Answer: B

 – 94

You have applications that have frequently executed queries, and produce small and

static result sets.

You configure the sqlnet.ora file in the client machine to set a nonzero value for the

OCI_RESULT_CACHE_MAX_SIZE parameter.

What is the purpose of this configuration?

A. to avoid round trips to the server by enabling caching of query results in client

memory

B. to improve performance by storing a copy of the data from the private SQL area of the

PGA

C. to enhance the query performance by creating a cache in the client memory for sorting

operations

D. to avoid the storing of query plans and results in the server by creating a cache in the

client memory

Answer: A

 – 95

Exhibit:

 

 

View the Exhibit to examine the parameter values.

You are planning to set the value for the MEMORY_TARGET parameter of your

database instance. What value would you assign?

A. 1440 MB

B. 90 MB

C. 362 MB

D. 272 MB

Answer: C

 – 96

You have the following requirements in relation to the detection of block corruption for

your database instance:

1. Check for logical self-consistency of data blocks when modified in memory.

2. Checksums are calculated before and after the block change.

3. Checks are performed for the lost writes to the physical standby database.

Which method would help you perform the above checks automatically?

A. Set the DB_LOCK_CHECKSUM parameter to TYPICAL.

B. Set the DB_SECUREFILE parameter to PERMITTED.

C. Set the DB_LOST_WRITE_PROTECT parameter to TYPICAL.

D. Set the DB_ULTRA_SAFE parameter to DATA_ONLY.

Answer: D

 – 97

During the installation of Oracle Database 11g, you do not set ORACLE_BASE

explicitly. You selected the option to create a database as part of the installation. How

would this environment variable setting affect the installation?

A. The installation terminates with an error.

B. The installation proceeds with the default value but a message would be generated in

the alert log file.

C. The installation proceeds with the default value but it would not be an OFA-compliant

database.

D. The installation proceeds with the default value without warnings and errors.

Answer: B

 – 98

You are managing an Oracle Database 11g database. You want to take the backup of

MULT_DATA, a big file tablespace of size 100 TB on tape drive, but you have tape

drives of only 10 GB each. Which method would accomplish the task quickly and

efficiently?

 

 

A. parallel image copy backup

B. backup with MAXPIECESIZE configured for the channel

C. parallel backup with MAXPIECESIZE configured for the channel

D. intrafile parallel backup

Answer: D

 – 99

You perform the following activities during the database upgrade from Oracle Database

10g to Oracle Database 11g:

1. Capture plans for a SQL workload into a SQL Tuning Set (STS) before upgrade.

2. Load these plans from the STS into the SQL plan baseline immediately after the

upgrade.

What is the reason for performing these activities?

A. to prevent plan capturing when the SQL statement is executed after the database

upgrade

B. to keep the plan in the plan history so that it can be used when the older version of the

optimizer is used

C. to minimize plan regression due to the use of a new optimizer version

D. to completely avoid the use of new plans generated by a new optimizer version

Answer: C

 – 100

Which steps are mandatory to enable Direct NFS?

1. Mount all required file systems using the kernel NFS driver.

2. Create an oranfstab file containing the attributes for each NFS server to be accessed

using Direct NFS.

3. Replace the ODM library libodm11.so_stub with libodm11.so.

A. 2 and 3

B. 1 and 2

C. 1, 2 and 3

D. 1 and 3

Answer: D

 – 101

Exhibit:

 

 

View the Exhibit for some of the parameter settings.

You start a session and issue the following command:

SQL>CREATE INDEX emp_ename ON emp(ename)

TABLESPACE users INVISIBLE;

What is the outcome of the above command?

A. The index is used by the optimizer only if a hint is specified in the query statement

and is maintained during DML operations.

B. The index is not used by the optimizer but is maintained during DML operations.

C. The index is not used by the optimizer and is not maintained during DML operations.

D. The index is used by the optimizer only if a hint is specified in the query statement but

is not maintained during DML operations.

Answer: B

 – 102

You executed the following commands:

SQL> ALTER SESSION SET OPTIMIZER_USE_PENDING_STATISTICS = false;

SQL> EXECUTE DBMS_STATS.SET_TABLE_PREFS(‘SH’, ‘CUSTOMERS’,

‘PUBLISH’,’false’);

SQL> EXECUTE DBMS_STATS.GATHER_TABLE_STATS(‘SH’, ‘CUSTOMERS’);

Which statement is correct regarding the above statistics collection on the

SH.CUSTOMERS table in the above session?

A. The statistics are stored in the pending statistics table in the data dictionary.

B. The statistics are treated as the current statistics by the optimizer for the current

sessions only.

C. The statistics are treated as the current statistics by the optimizer for all sessions.

D. The statistics are temporary and used by the optimizer for all sessions until this

session terminates.

Answer: A

 – 103

You plan to set up the Automatic Workload Repository (AWR) baseline metric

thresholds for a moving window baseline. Which action would you take before

performing this task?

 

 

A. Take an immediate AWR snapshot.

B. Decrease the window size for the baseline.

C. Decrease the expiration time for the baseline.

D. Compute the baseline statistics.

Answer: D

 – 104

You are managing the APPPROD database as a DB

A. You plan to duplicate this database

in the same system with the name DUPDB.

You issued the following RMAN commands to create a duplicate database:

RMAN> CONNECT target sys/sys@APPPROD

RMAN> DUPLICATE TARGET DATABASE

TO dupdb

FROM ACTIVE DATABASE

DB_FILE_NAME_CONVERT ‘/oracle/oradata/prod/’,

‘/scratch/oracle/oradata/dupdb/’

SPILE

PARAMETER_VALUE_CONVERT ‘/oracle/oradata/prod/’,

‘/scratch/oracle/oradata/dupdb/’

SET SGA_MAX_SIZE = ‘300M’

SET SGA_TARGET = ‘250M’

SET LOG_FILE_NAME_CONVERT ‘/oracle/oradata/prod/redo/’,

‘/scratch/oracle/oradata/dupdb/redo/';

Which three are the prerequisites for the successful execution of the above command?

(Choose three.)

A. RMAN should be connected to both the instances as SYSDBA.

B. The target database backups should be copied to the source database backup

directories.

C. The password file must exist for the source database and have the same SYS user

password as the target.

D. The target database should be in ARCHIVELOG mode if it is open.

E. The source database should be open.

Answer: A,C,D

 – 105

You performed the RMAN database backup with the KEEP option. Which two

statements are true regarding this backup? (Choose two.)

A. The backup contains data files, the server parameter file, and the control file even if

the control file autobackup is disabled.

B. The KEEP option overrides the configured retention policy.

C. The backup contains only data files and archived redo log files.

 

 

 

D. The KEEP option is an attribute of an individual backup piece.

Answer: A,B

 – 106

You set the following parameters in the parameter file and restarted the database:

MEMORY_MAX_TARGET=0

MEMORY_TARGET=500M

PGA_AGGREGATE_TARGET=90M

SGA_TARGET=270M

Which two statements are true regarding these parameters after the database instance is

restarted? (Choose two.)

A. The lower bounds of PGA_AGGREGATE_TARGET and SGA_TARGET parameters

are set to 90 MB and 270 MB, respectively.

B. The value of the MEMORY_MAX_TARGET parameter remains zero till it is

changed manually.

C. The MEMORY_MAX_TARGET parameter is automatically set to 500 MB.

D. The PGA_AGGREGATE_TARGET and SGA_TARGET parameters are

automatically set to zero.

Answer: A,C

 – 107

You are managing an Oracle Database 11g database. You want to take a backup on tape

drives of the USERS tablespace that has a single data file of 900 MB. You have tape

drives of 300 MB each. To accomplish the backup, you issued the following RMAN

command:

RMAN>BACKUP

SECTION SIZE 300M

TABLESPACE users;

What configuration should be effected to accomplish faster and optimized backups by

using the above command?

A. The SBT channel must be configured, with the default parallelism setting for the SBT

device set to 1.

B. The COMPATIBLE initialization parameter for the database instance must be set to at

least 10.0.

C. The SBT channel must be configured, with the parallelism setting for the SBT device

set to 3.

D. The SBT channel must be configured, with the MAXPIECESIZE set to 300 MB.

Answer: C

 – 108

Exhibit:

 

 

 

View the Exhibit to examine the error while executing the REPAIR FAILURE command

in an RMAN session.

What is the reason for this error?

A. Another repair session is running concurrently.

B. The failure ID has not been mentioned in the command for data file 5.

C. There are new failures recorded in the Automatic Diagnostic Repository (ADR).

D. The ADVISE FAILURE command has not been issued before the REPAIR FAILURE

command.

Answer: A

 – 109

To control the execution of a server process when it is receiving bad packets from a

potentially malicious client, you set the

SEC_PROTOCOL_ERROR_FURTHER_ACTION initialization parameter as follows:

SQL> ALTER SYSTEM SET SEC_PROTOCOL_ERROR_FURTHER_ACTION =

Drop,10;

What is the significance of this setting?

A. It terminates the client connection after receiving a bad packet and the client can

reconnect to the same instance after 10 minutes.

B. It terminates the client connection after 10 bad packets but the client can still

 

 

reconnect, and attempt the same operation again.

C. It terminates the client connection after 10 bad packets and the client cannot reconnect

to the same instance.

D. It terminates the client connection 10 seconds after receiving a bad packet and the

client cannot reconnect to the same instance.

Answer: B

 – 110

You want to analyze a SQL Tuning Set (STS) using SQL Performance Analyzer in a test

database. Which two statements are true regarding the activities performed during the test

execution of SQLs in a SQL Tuning Set? (Choose two.)

A. The execution plan and execution statistics are computed for each SQL statement in

the STS.

B. The effects of DDL and DML are considered to produce the execution plan and

execution statistics.

C. Every SQL statement in the STS is considered only once for execution.

D. The SQL statements in the STS are executed concurrently to produce the execution

plan and execution statistics.

Answer: A,C

 – 111

Sales details are being stored on a daily basis in the SALES_2007 table. A large amount

of data is added to the table daily. To save disk space, you issued the following

command:

ALTER TABLE sales_2007 COMPRESS FOR ALL OPERATIONS;

What would be the outcome of this command?

A. It immediately compresses all existing data as well as new data, resulting from either

fresh additions or modifications to existing data.

B. It produces an error because data already exists in the table.

C. It compresses all data added or modified henceforth but the existing data in the table is

not compressed immediately.

D. It produces an error because compression can be enabled at table creation only.

Answer: C

 – 112

When executing a SQL workload, you choose to generate execution plans only, without

collecting execution statistics. Which two statements describe the implications of this?

(Choose two.)

A. Only the changes in the execution plan, and not performance regression, are detected.

B. It shortens the time of execution and reduces the impact on system resources.

 

 

 

C. It produces less accurate results of the comparison analysis.

D. It automatically calls the SQL Tuning Advisor for recommendations.

Answer: B,C

 – 113

Which dependent object will get invalidated even if it is not affected by the table

redefinition?

A. packages

B. triggers

C. synonyms

D. views

Answer: B

 – 114

A PL/SQL procedure queries only those columns of a redefined table that were

unchanged by the online table redefinition. What happens to the PL/SQL procedure after

the online table redefinition?

A. It remains valid.

B. It becomes invalid for all options of online table redefinition but automatically gets

revalidated the next time it is used.

C. It becomes invalid only if the storage parameters have been modified and it

automatically gets revalidated the next time it is used.

D. It becomes invalid for all options of online table redefinition and is automatically

recompiled during online redefinition of the table.

Answer: A

 – 115

The ADMIN_EMP table has columns EMPNO, ENAME, DEPTNO, and SAL. It has a

materialized view EMP_MV with a materialized log and an ENAME_IDX index on the

ENAME column.

You need to perform an online table redefinition on the ADMIN_EMP table to move it

from the TBS1 tablespace to the TBS2 tablespace in the same schema.

What action is required for the dependent objects when you perform online redefinition

on the table?

A. The materialized view should have a complete refresh performed after the online table

redefinition is completed.

B. The materialized view should have a fast refresh performed after the online table

redefinition is completed.

C. The materialized view, materialized log, and the index should be dropped and

re-created after the online table redefinition is complete.

 

 

 

D. The materialized view and materialized log should be dropped and all constraints

disabled and re-created after the online table redefinition is complete.

Answer: A

 – 116

Which setting enables the baselines by default in Oracle Database 11g?

A. enabling Automated Maintenance Task using Oracle Enterprise Manager

B. setting the STATISTICS_LEVEL parameter to TYPICAL

C. adding filters to the Automatic Database Diagnostic Monitor (ADDM)

D. setting the OPTIMIZER_USE_PENDING_STATISTICS parameter to TRUE

Answer: B

 – 117

Identify the activities performed as part of the Automatic SQL Tuning process in the

maintenance window? (Choose all that apply.)

A. tuning each SQL statement in the order of importance

B. generating baselines that include candidate SQLs for tuning

C. generating the SQL profile

D. adding tuned SQL plans into the SQL plan baseline

E. testing and accepting the SQL profile

F. generating a list of candidate SQLs for tuning

Answer: A,C,E,F

 – 118

You installed Oracle Database 11g and are performing a manual upgrade of the Oracle9i

database. As a part of the upgrade process, you execute the following script:

SQL>@utlu111i.sql

Which statement about the execution of this script is true?

A. It must be executed from the Oracle Database 11g environment.

B. It must be executed only after the SYSAUX tablespace has been created.

C. It must be executed from both the Oracle Database 11g and Oracle Database 9i

environments.

D. It must be executed from the environment of the database that is being upgraded.

E. It must be executed only after AUTOEXTEND is set to ON for all existing

tablespaces.

Answer: D

 – 119

Exhibit #1:

 

 

 

Exhibit #2:

View the Exhibit exhibit1.

In the CUSTOMERS_OBE table, when the value of CUST_STATE_PROVINCE is

“CA”, the value of COUNTRY_ID is “US.”

View the Exhibit exhibit2 to examine the commands and query plans.

The optimizer can sense 8 rows instead of 29 rows, which is the actual number of rows in

the table. What can you do to make the optimizer detect the actual selectivity?

A. Change the STALE_PERCENT value for the CUSTOMERS_OBE table.

B. Set the STATISTICS_LEVEL parameter to TYPICAL.

C. Create extended statistics for the CUST_STATE_PROVINCE and

CUSTOMERS_OBE columns.

D. Set the OPTIMIZER_USE_PENDING_STATISTICS parameter to FALSE.

 

 

Answer: C

WWW.ExamMagi

c.COM – 120

Exhibit:

View the Exhibit for the object interdependency diagram.

The PRODUCTS table is used to create the PRODCAT_VW view.

PRODCAT_VW is used in the GET_DATA procedure.

GET_DATA is called in the CHECK_DATA function.

A new column PROD_QTY is added to the PRODUCTS table.

How does this impact the status of the dependent objects?

A. All dependent objects remain valid.

B. Only the view becomes invalid and gets automatically revalidated the next time it is

used.

C. Only the procedure and function become invalid and get automatically revalidated the

next time they are called.

D. Only the procedure and function become invalid and must be recompiled.

Answer: A

 – 121

Exhibit:

 

 

View the Exhibit to examine the Automatic SQL Tuning result details.

Which action would you suggest for the selected SQL statement in the Exhibit?

A. Run the Access Advisor for the SQL statement.

B. Run the Segment Advisor for recommendations.

C. Collect statistics for the related objects.

D. Accept the recommended SQL profile.

Answer: A

 – 122

Exhibit:

View the Exhibit and examine the output.

You executed the following command to enable Flashback Data Archive on the

EXCHANGE_RATE table:

ALTER TABLE exchange_rate FLASHBACK ARCHIVE;

What is the outcome of this command?

A. The Flashback Archive is created on the same tablespace where the tables are stored.

 

 

B. The Flashback Archive is created on the SYSAUX tablespace.

C. The command generates an error because no Flashback Archive name is specified and

there is no default Flashback Archive.

D. The table uses the default Flashback Archive.

Answer: C

 – 123

You issued the following command to mount the DATA disk group in restricted mode:

ALTER DISKGROUP data MOUNT RESTRICT;

What is the implication of this command?

A. The client RDBMS instance can access the file as a read-only file.

B. A new disk cannot be added to a disk group.

C. A disk in a disk group can be taken offline.

D. The client RDBMS instance cannot access the files in the disk group.

Answer: D

 – 124

Your company wants to upgrade the current production database to the RAC

environment. To perform testing before migrating to the RAC environment, you

performed the workload capture on the production database to record the peak workload.

You set up the test RAC database and want to replay the recorded workload on the test

machine. Note the following steps that you may require to replay the database workload:

1) Preprocess the captured workload.

2) Restart the database in RESTRICTED mode.

3) Set up the Replay Clients.

4) Restore the test database to the point when the capture started.

5) Remap connections.

Arrange the steps required in the correct sequence to accomplish this task on the test

machine.

A. 1, 4, 5, 3 (2 is not required.)

B. 1, 4, 3, 5 (2 is not required.)

C. 1, 2, 4, 5 (3 is not required.)

D. 2, 1, 5, 3, 4

E. 1, 2, 4, 5, 3

Answer: A

 – 125

You are working on the APPDB database as a DB

A. The database has a default

Flashback Data Archive DFLA1 created on it.

You issued the following command to drop the Flashback Archive FLA1:

 

 

 

DROP FLASHBACK ARCHIVE fla1;

What is the effect of this command?

A. The Flashback Archive FLA1 is dropped only if it is empty.

B. The tablespace having Flashback Archive is dropped.

C. The Flashback Archive FLA1 is dropped after moving the existing data in it to the

default Flashback Archive.

D. The Flashback Data Archive and historical data are dropped.

Answer: D

 – 126

You need to configure fine-grained access control to external network resources from

within your database. You create an access control list (ACL) using the

DBMS_NETWORK_ACL_ADMIN package.

Which statement is true regarding the ACL created?

A. It is a list of users and network privileges stored in the XML file according to which a

group of users can connect to one or more hosts.

B. It is a list of users and network privileges stored in the data dictionary according to

which a group of users can connect to one or more hosts.

C. It is a list of remote database links stored in the XML file that are available to the

users of the database.

D. It is the list of the host names or the IP addresses stored in the data dictionary that can

connect to your database through PL/SQL network utility packages such as UTL_TCP.

Answer: A

 – 127

Following is the list of locations in random order where oranfstab can be placed.

1./etc/mtab

2.$ORACLE_HOME/dbs/oranfstab

3./etc/oranfstab

What is the sequence in which Direct NFS will search the locations?

A. 1, 2, 3

B. 3, 2, 1

C. 1, 3, 2

D. 2, 3, 1

Answer: D

 – 128

You are managing the APPPROD database as a DBA which is not using the

Oracle-managed files. You plan to duplicate this database in the same system with the

name DUPDB.You want to create the same directory structure for duplicate database

 

 

 

files as of the target database.

You executed the following RMAN commands:

RMAN> CONNECT TARGET sys/sys@APPPROD

RMAN> CONNECT AUXILIARY sys/sys@DUPDB

RMAN> DUPLICATE TARGET DATABASE

TO dupdb

FROM ACTIVE DATABASE

PASSWORD FILE

SPILE

NOFILENAMECHECK;

What are the implications of this command?

A. It creates database files for the duplicate database under the Oracle base with a

different directory for the duplicate database.

B. It creates database files for the duplicate database under the same Oracle home as that

of the target but with a different directory for the duplicate database.

C. It creates database files for the duplicate database under the same Oracle home as that

of the target database with the same directory structure.

D. It overwrites data files of the target database because a different location for data files

is not mentioned for the duplicate database.

Answer: D

 – 129

What are the recommendations for Oracle Database 11g installation to make it Optimal

Flexible Architecture (OFA)-compliant? (Choose all that apply.)

A. Flash recovery area and data file location should be on separate disks.

B. ORACLE_BASE should be set explicitly.

C. An Oracle base should have only one Oracle home created in it.

D. Flash recovery area and data file location should be created under Oracle base in a

non-Automatic Storage Management (ASM) setup.

Answer: A,B,D

 – 130

You are managing an Oracle Database 11g instance. You want to create a duplicate

database for testing purpose. What are the prerequisites for performing the active

database duplication? (Choose all that apply.)

A. The source database must be run in ARCHIVELOG mode if the database is open.

B. A net service name should be set up and a listener configured with the target as well as

the source database.

C. The source database backup must be copied over the net for test database.

D. The source database must be shut down cleanly if the database is in mounted state.

 

 

Answer: A,B,D

 – 131

Which two kinds of failures make the Data Recovery Advisor (DRA) generate a manual

checklist? (Choose two.)

A. failures because a data file is renamed by error

B. failures due to loss of connectivity-for example, an unplugged disk cable

C. failures that require no archive logs to be applied for recovery

D. failures when no standby database is configured

Answer: A,B

 – 132

The following databases are registered in the base recovery catalog: PROD1, PROD2,

and PROD3. The database user CATOWNER owns the base recovery catalog. You want

a new user VPC1 to have access to only the PROD1 database and create a virtual private

catalog.

Given below are some of the commands required to achieve this:

1.SQL> GRANT recovery_catalog_owner TO vpc1;

2.RMAN> CONNECT CATALOG vpc1/password@catdb;

3.RMAN> GRANT CATALOG FOR DATABASE prod1 TO vpc1;

4.RMAN> CONNECT CATALOG catowner/password@catdb;

5.RMAN> CREATE VIRTUAL CATALOG;

What is the correct sequence in which the commands have to be executed?

A. 1, 4, 3, 2, 5

B. 2, 3, 4, 5, 1

C. 4, 5, 2, 3, 1

D. 1, 4, 2, 3, 5

E. 1, 4, 5, 2, 3

Answer: A

 – 133

Exhibit #1:

 

 

Exhibit #2:

View the Exhibits exhibit1 and exhibit2.

Both the processes use PROG_1 as the job template that is already available. The time

taken by the jobs are recorded in the TEST_LOG table. While comparing the time taken

to create the jobs, the process in exhibit1 takes less time than the process in exhibit2.

What is the reason for this?

 

 

A. It updates several tables in the SYSTEM tablespace instead of creating new tables.

B. It creates jobs temporarily in memory only.

C. It creates less metadata for the jobs.

D. It writes the job metadata to disk in compressed format.

Answer: C

 – 134

Which two prerequisites are needed for performing workload capture and replay?

(Choose two.)

A. Close all sessions performing queries using database links.

B. running the database in shared server mode

C. The database on which the workload is replayed has to be a restore of the original

database to a specific SCN.

D. setting up the directory to capture the workload

Answer: C,D

 – 135

Which two statements are true regarding Health Monitor checks in Oracle Database 11g?

(Choose two.)

A. Health Monitor checks can be used to scan the contents of the redo log and archive

logs for accessibility and corruption.

B. Health Monitor checks can be used to verify the integrity of database files and report

failures if these files are inaccessible, corrupt or inconsistent.

C. Health Monitor checks can be used to verify the contents of dictionary entries for each

dictionary object and fix it automatically.

D. Health Monitor checks are always initiated manually when there is some critical error.

Answer: A,B

 – 136

Examine the section of the Health Check report given below:

DBMS_HM.GET_RUN_REPORT(‘HM_RUN_1061′)

————————

Run Name : HM_RUN_1061

Run Id : 1061

Check Name : Data Block Integrity Check

Mode : REACTIVE

Status : COMPLETED

Start Time : 2007-05-12 22:11:02.032292 -07:00

End Time : 2007-05-12 22:11:20.835135 -07:00

Error Encountered : 0

Source Incident Id : 7418

 

 

 

Number of Incidents Created :0

Which two statements are true regarding the Health Check report? (Choose two.)

A. Health Check was performed to verify the integrity of database files and report

failures.

B. Health Check was performed to check the disk image block corruptions.

C. Health Check was performed to check interblock and intersegment corruption.

D. Health Check was performed manually.

E. Health Check was performed by the Health Monitor automatically in response to a

critical error.

Answer: B,D

 – 137

Which two statements are true regarding hot patching? (Choose two.)

A. It can detect conflicts between two online patches.

B. It requires relinking of the Oracle binary.

C. It is available for installing all patches on all platforms.

D. It works only in a single database instance environment.

E. It does not require database instance shutdown.

Answer: A,E

 – 138

Exhibit:

View the Exhibit for some of the current parameter settings.

A user logs in to the HR schema and issues the following commands:

SQL> CREATE TABLE emp

(empno NUMBER(3),

ename VARCHAR2(20),

sal NUMBER(8,2));

SQL> INSERT INTO emp(empno,ename) VALUES(1,’JAMES’);

At this moment, a second user also logs in to the HR schema and issues the following

command:

SQL> ALTER TABLE emp MODIFY sal NUMBER(10,2);

What happens in the above scenario?

A. The second user’s session immediately produces the resource busy error.

 

 

B. The second user’s command executes successfully.

C. The second user’s session waits for a time period before producing the resource busy

error.

D. A deadlock is created.

Answer: C

 – 139

You want the Automatic SQL Tuning process to stop accepting and implementing the

recommended SQL profiles automatically. Which action would you perform to achieve

this?

A. Edit the automatic maintenance window group configuration.

B. Use the DBMS_SQLTUNE.SET_TUNING_TASK_PARAMETERS procedure to set

ACCEPT_SQL_PROFILES to FALSE.

C. Set the CURSOR_SHARING parameter to EXACT for the database instance.

D. Set the SQLTUNE_CATEGORY parameter to DEFAULT for the database instance.

Answer: B

 – 140

In which situations will the ASM metadata backup help you recover the ASM disk in a

disk group? (Choose all that apply.)

A. when one or more file directory paths are accidentally deleted from an ASM disk

group

B. when one of the disks in a disk group is accidentaly unplugged

C. when the data file on an ASM disk group gets corrupted

D. when one or more disks in an ASM disk group are lost

Answer: A,D

 – 141

The Database Resource Manager is automatically enabled in the maintenance window

that runs the Automated Maintenance Task. What is the reason for this?

A. to prevent the Automated Maintenance Tasks from consuming excessive amounts of

system resources

B. to prevent the creation of an excessive number of scheduler job classes

C. to allow resource sharing only among the Automated Maintenance Tasks in the

maintenance window

D. to allow the Automated Maintenance Tasks to use system resources without any

restriction

Answer: A

 

 

 – 142

You plan to control the sessions performing a huge number of I/O operations. Your

requirement is to kill the session when it exceeds a specified number of I/Os. Which

statement describes a solution to the above?

A. Add directives to the Automatic Database Diagnostic Monitor (ADDM).

B. Modify the profile for the targeted users for which control needs to be imposed.

C. Implement the database resource manager to add the SWITCH_IO_REQS and

SWITCH_GROUP directives.

D. Set a threshold for the default system-defined moving window baseline.

Answer: C

 – 143

Examine the following PL/SQL block:

DECLARE

my_plans pls_integer;

BEGIN

my_plans := DBMS_SPM.LOAD_PLANS_FROM_CURSOR_CACHE (sql_id =>

?9twu5t2dn5xd?;

END;

Which statement is true about the plan being loaded into the SQL plan baseline by the

above command?

A. It is loaded with the ACCEPTED status.

B. It is loaded with the FIXED status.

C. It is not loaded with the ACCEPTED status.

D. It is not loaded with the ENABLED status.

Answer: A

 – 144

You performed the RMAN database backup having a backupset key number 231 with the

KEEP FOREVER option. After some days, you want to change the status of the database

backup and you issued the following command:

RMAN>CHANGE BACKUPSET 231 NOKEEP;

What is the implication of this command?

A. The backup overrides the backup retention policy.

B. the backup becomes eligible for deletion according to the existing retention policy

C. The backup is marked unavailable.

D. The backup is deleted.

Answer: B

 

 

 – 145

The Oracle Database 11g database is running in the ARCHIVELOG mode. The archived

redo log files are stored on three locations. The Flash Recovery Area is one of the

locations. The details are given below:

LOG_ARCHIVE_DEST_1 = ‘LOCATION = /disk1/archive’

LOG_ARCHIVE_DEST_2 = ‘SERVICE = stdb1′

DB_RECOVERY_FILE_DEST = ‘/u01/oradata’

Examine the following RMAN command issued to set the deletion policy for archived

log files:

RMAN> CONFIGURE ARCHIVELOG DELETION POLICY

TO BACKED UP 2 TIMES TO sbt;

Which statement is true regarding what this command accomplishes?

A. All archived redo log files backed up at least twice to tape are deleted from the flash

recovery area.

B. All archived redo log files in local archiving destinations and the flash recovery area

backed up at least twice to tape are eligible for deletion.

C. All archived redo log files backed up at least once to tape are eligible for deletion.

D. All archived redo log files backed up at least twice to tape are deleted.

Answer: B

 – 146

Examine the following PL/SQL block:

SET SERVEROUTPUT ON

SET LONG 10000

ECLARE report clob;

BEGIN

report := DBMS_SPM.EVOLVE_SQL_PLAN_BASELINE();

DBMS_OUTPUT.PUT_LINE(report);

END;

Which statement describes the effect of the execution of the above PL/SQL block?

A. The nonaccepted plans in the SQL Management Base are verified with the existing

plan baselines.

B. The plan baselines are verified with the SQL profiles.

C. All fixed plan baselines are converted into nonfixed plan baselines.

D. All the nonaccepted SQL profiles are accepted into the plan baseline.

Answer: A

 – 147

Which two are the prerequisites to enable Flashback Data Archive? (Choose two.)

A. Database must be running in archivelog mode.

B. Automatic undo management must be enabled.

 

 

 

C. Undo retention guarantee must be enabled.

D. The tablespace on which the Flashback Data Archive is created must be managed with

Automatic Segment Space Management (ASSM).

Answer: B,D

 – 148

The following command is executed to create the baseline template:

SQL> EXECUTE

DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE_TEMPLATE(START_TIME=>

TO_TIMESTAMP(SYSDATE+2),

END_TIME=>TO_TIMESTAMP(SYSDATE+10),

BASELINE_NAME=>’Mybase4′,

TEMPLATE_NAME=>’Mytemp4′,

EXPIRATION=>NULL);

Which statement is true about the effect of the above command?

A. It produces an error because no snapshot information is provided to create the

baseline.

B. It creates a baseline template that expires after the Automatic Workload Repository

(AWR) retention period.

C. It creates a baseline template that never expires.

D. It creates a repeating baseline template that repeats after the Automatic Workload

Repository (AWR) retention period.

Answer: C

 – 149

An index called ORD_CUSTNAME_IX has been created on the CUSTNAME column in

the ORDERS table using the following command:

SQL>CREATE INDEX ord_custname_ix ON orders(custname);

The ORDERS table is frequently queried using the CUSTNAME column in the WHERE

clause.

You want to check the impact on the performance of the queries if the index is not

available. You do not want the index to be dropped or rebuilt to perform this test.

Which is the most efficient method of performing this task?

A. making the index invisible

B. making the index unusable

C. disabling the index

D. using the MONITORING USAGE clause for the index

Answer: A

 – 150

In your database, the RESULT_CACHE_MODE parameter has been set to MANUAL in

 

 

 

the initialization parameter file.

You issued the following command:

SQL>SELECT /*+ RESULT_CACHE */ sale_category, sum(sale_amt)

FROM sales

GROUP BY sale_category;

Where would the result of this query be stored?

A. database buffer cache

B. shared pool

C. PGA

D. large pool

Answer: B

 – 151

Exhibit:

View the Exhibit to examine the output for the V$DIAG_INFO view.

Which statements are true regarding the location of diagnostic traces? (Choose all that

apply.)

A. The path to the location of the background as well as the foreground process trace

files is /u01/oracle/diag/rdbms/orclbi/orclbi/trace.

B. The location of the text alert log file is /u01/oracle/diag/rdbms/orclbi/orclbi/alert.

C. The location of the XML-formatted version of the alert log is

/u01/oracle/diag/rdbms/orclbi/orclbi/alert.

D. The location of the trace file for the current session is

/u01/oracle/diag/rdbms/orclbi/orclbi/trace.

Answer: A,C,D

 – 152

Evaluate the following command and its output:

SQL>SELECT * FROM dba_temp_free_space;

TABLESPACE_NAME TABLESPACE_SIZE ALLOCATED_SPACE FREE_SPACE

 

 

—————————- ————————– —————————- ——————

LMTEMP 250609664 101048576 149561088

Which two statements correctly interpret the output? (Choose two.)

A. FREE_SPACE indicates both the space that is currently allocated and available for

reuse, and the space that is currently unallocated.

B. ALLOCATED_SPACE indicates only the space currently allocated and in use.

C. ALLOCATED_SPACE indicates both the space currently allocated and used, and the

space that is available for reuse.

D. FREE_SPACE indicates only the space that is currently unallocated.

E. FREE_SPACE indicates only the space that is currently allocated and available for

reuse.

Answer: A,C

 – 153

Evaluate the following block of code:

BEGIN

DBMS_NETWORK_ACL_ADMIN.CREATE_ACL (

acl => ‘mycompany-com-permissions.xml’,

principal => ‘ACCT_MGR’,

is_grant => TRUE,

privilege => ‘connect’);

DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL (

acl => ‘mycompany-com-permissions.xml’,

host => ‘*.mycompany.com’);

END;

What is the outcome of the above code?

A. It creates an access control list (ACL) with the user ACCT_MGR who gets the

CONNECT privilege but not the RESOLVE privilege.

B. It creates an access control list (ACL) with the user ACCT_MGR who gets the

CONNECT and RESOLVE privileges.

C. It produces an error because a fully qualified host name needs to be specified.

D. It produces an error because the range of ports associated with the hosts has not been

specified.

Answer: B

 – 154

Which statement is true regarding the retention policy for the incidents accumulated in

the Automatic Diagnostic Repository (ADR)?

A. The incident files are retained but the incident metadata is purged when the problem is

resolved and the DBA closes the SR

B. The incident files and dumps are not retained in the ADR for the manually created

 

 

 

incidents.

C. The incident metadata is purged when the problem is resolved and the DBA closes the

SR.

D. The default setting is for one year after which the incident metadata is purged from the

ADR and the files are retained for one month.

Answer: D

 – 155

You need to create a partitioned table to store historical data and you issued the following

command:

CREATE TABLE purchase_interval

PARTITION BY RANGE (time_id)

INTERVAL (NUMTOYMINTERVAL(1,’month’)) STORE IN (tbs1,tbs2,tbs3)

(

PARTITION p1 VALUES LESS THAN(TO_DATE(‘1-1-2005′, ‘dd-mm-yyyy’)),

PARTITION p2 VALUES LESS THAN(TO_DATE(‘1-1-2007′, ‘dd-mm-yyyy’)))

AS

SELECT *

FROM purchases

WHERE time_id < TO_DATE(‘1-1-2007′,’dd-mm-yyyy’);

What is the outcome of the above command?

A. It creates two range partitions of varying range. For data beyond ‘1-1-2007,’ it creates

partitions with a width of one month each.

B. It returns an error because the number of tablespaces (TBS1,TBS2,TBS3)specified

does not match the number of range partitions (P1,P2) specified.

C. It returns an error because the range partitions P1 and P2 should be of the same range.

D. It creates two range partitions (P1, P2). Within each range partition, it creates

monthwise subpartitions.

Answer: A

 – 156

Which two statements are true regarding the SQL Repair Advisor? (Choose two.)

A. The SQL Repair Advisor is invoked by the Health Monitor when it encounters the

problematic SQL statement.

B. The SQL Repair Advisor can be invoked even when the incident is not active for a

SQL statement crash.

C. The DBA can invoke the SQL Repair Advisor when he or she receives an alert

generated when a SQL statement crashes and an incident is created in the ADR.

D. The SQL Repair Advisor can be invoked to tune the performance of the regressed

SQL statements.

Answer: B,C

 

 

 

 – 157

You need to perform an online table redefinition of an existing SALES table to partition

it into two tablespaces TBS1 and TBS2.

The SALES table has a materialized view, materialized log, indexes, referential integrity

constraint, and triggers with the PRECEDES clause existing on it.

What action is required for dependent objects when you perform online table

redefinition?

A. The dependent materialized view should have a complete refresh performed after the

online table redefinition process.

B. Triggers with the PRECEDES clause should be disabled before the online table

redefinition process.

C. Referential integrity constraints must be manually enabled after the online table

redefinition process.

D. The materialized log should be dropped before the online table redefinition process.

Answer: A

 – 158

You are managing an Oracle Database 11g database with the ASM storage. The database

is having big file tablespaces. You want files to open faster and less memory to be used

in the shared pool to manage the extent maps. What configuration would you effect to

achieve your objective? (Choose all that apply.)

A. Set the COMPATIBLE initialization parameter for the ASM instance to 11.1.0.

B. Set the COMPATIBLE initialization parameter for the database instance to 11.1.0.

C. Set the ASM compatibility attribute for the ASM disk group to 11.1.0.

D. Set the RDBMS compatibility attribute for the ASM disk group to 11.1.0.

Answer: B,C

 – 159

You issued the following RMAN command to back up the database:

RMAN> RUN{

ALLOCATE CHANNEL c1

DEVICE TYPE sbt

BACKUP DATABASE

TAG quarterly

KEEP FOREVER

RESTORE POINT FY06Q4;}

Which two statements are true regarding the backup performed? (Choose two.)

A. Archived redo log files are backed up along with data files.

B. Archived log files are backed up along with data files, and the archived log files are

deleted.

 

 

C. The command creates a restore point named FY06Q4 to match the SCN at which this

backup is consistent.

D. Only data files are backed up and a restore point named FY06Q4 is created.

Answer: A,C

 – 160

The OPTIMIZER_USE_PLAN_BASELINES parameter is set to TRUE. The optimizer

generates a plan for a SQL statement but does not find a matching plan in the SQL plan

baseline. Which two operations are performed by the optimizer in this scenario? (Choose

two.)

A. The optimizer adds the new plan to the plan history.

B. The optimizer selects the new plan for the execution of the SQL statement.

C. The optimizer adds the new plan to the SQL plan baseline as an accepted plan.

D. The optimizer costs each of the accepted plans in the SQL plan baseline and picks the

one with the lowest cost.

E. The optimizer adds the new plan to the SQL plan baseline but not in the ENABLED

state.

Answer: A,D

 – 161

Which tasks are run automatically as part of the Automated Maintenance Task by

default? (Choose all that apply.)

A. Automatic Database Diagnostics Monitor

B. Automatic SQL Tuning Advisor

C. SQL Access Advisor

D. Segment Advisor

E. Optimizer statistics gathering

Answer: B,D,E

 – 162

You decided to use Direct NFS configuration in a non-RAC Oracle installation and

created the oranfstab file in /etc. Which two statements are true regarding this oranfstab

file? (Choose two.)

A. It contains file systems that have been mounted by the kernel NFS system.

B. It is globally available to all Oracle 11g databases on the machine.

C. It contains file systems that have been mounted by Direct NFS.

D. Its entries are specific to a single database.

Answer: A,B

 

 

 – 163

Examine the following command:

ALTER DISKGROUP data MOUNT FORCE;

In which scenario can you use the above command to mount the disk group?

A. when ASM disk goes offline

B. when some disks in a failure group for a disk group are rebalancing

C. when some disks in a disk group are offline

D. when one or more ASM files are dropped

Answer: C

 – 164

Which client requests to the database can be captured as a part of the workload capture?

(Choose all that apply.)

A. distributed transactions

B. direct path load of data from external files

C. flashback query

D. logging in and logging out of sessions

E. all DDL statements having bind variables

Answer: D,E

 – 165

You are managing an Oracle Database 11g instance with ASM storage. The ASM

instance is down. To know the details of the disks in the DATA disk group , you issued

the following ASMCMD command:

ASMCMD> lsdsk -I -d DATA

Which statement is true regarding the outcome of this command?

A. The command succeeds and retrieves information by scanning the disk headers based

on an ASM_DISKSTRING value.

B. The command succeeds but it retrieves only the disk names.

C. The command produces an error because the ASM instance is down.

D. The command succeeds but it shows only the status of the ASM instance.

Answer: A

 – 166

You want to perform the following operations for the DATA ASM disk group:

-Verify the consistency of the disk.

-Cross-check all the file extent maps and allocation tables for consistency.

-Check whether the alias metadata directory and file directory are linked correctly.

-Check that ASM metadata directories do not have unreachable allocated blocks.

Which command accomplishes these tasks?

 

 

 

A. ALTER DISKGROUP data CHECK DISK IN FAILURE GROUP 1;

B. ALTER DISKGROUP data CHECK FILE;

C. ALTER DISKGROUP data CHECK;

D. ALTER DISKGROUP data CHECK DISK;

Answer: C

 – 167

Observe the following warning in an RMAN session of your database instance:

WARNING: new failures were found since last LIST FAILURE command

Which statement describes the scenario that must have produced this warning?

A. The CHANGE FAILURE command has detected new failures recorded in the

Automatic Diagnostic Repository (ADR).

B. The RECOVER command has detected new failures recorded in the Automatic

Diagnostic Repository (ADR) since the last LIST FAILURE command was executed.

C. The ADVISE FAILURE command has detected new failures recorded in the

Automatic Diagnostic Repository (ADR) since the last LIST FAILURE.

D. The VALIDATE DATABASE command has detected new failures recorded in the

Automatic Diagnostic Repository (ADR).

Answer: C

 – 168

Exhibit:

 

 

View the Exhibit to examine a portion of the output from the VALIDATE DATABASE

command.

Which statement is true about the block corruption detected by the command?

A. No action is taken except the output in the Exhibit.

B. The ADVISE FAILURE command is automatically called to display the repair script.

C. The failure is logged into the Automatic Diagnostic Repository (ADR).

D. The corruption is repaired by the command implicitly.

Answer: C

 – 169

Which two statements about workload capture and replay operations are true? (Choose

two.)

A. The clients must be created manually on the test machines to perform more realistic

testing.

B. Restart the database in RESTRICTED mode before beginning workload capture to

enable a clean state for capturing the workload.

C. The application state of the capture system must be identical to the application state of

the replay system when the workload replay begins.

D. Restart the database in RESTRICTED mode before beginning workload replay to

enable a clean state for workload replay.

 

 

Answer: B,C

 – 170

You are working on a CATDB database that contains an Oracle Database version 11.1

catalog schema owned by the user RCO11. The INST1 database contains an Oracle

Database version 10.1 catalog schema owned by the user RCAT10.

You want the RMAN to import metadata for database IDs 1423241 and 1423242,

registered in RCAT10, into the recovery catalog owned by RCO11. You also want to

deregister them from the catalog after import.

You executed the following commands to achieve this:

RMAN> CONNECT CATALOG rco11/password@catdb

RMAN> IMPORT CATALOG rcat10/oracle@inst1 DBID=1423241,1423242;

What happens if the RCO11 catalog has scripts with the same name as that of the scripts

in RCAT10 catalog?

A. RMAN renames the local stored scripts in the RCO11 catalog.

B. The scripts in the RCO11 catalog are overwritten.

C. The RMAN session in which the command is executed aborts.

D. RMAN renames the global scripts that are imported from the RCAT10 catalog.

Answer: D

 – 171

You are in the process of creating a virtual private catalog in your Oracle Database 11g

database. The PROD1, PROD2, and PROD3 Oracle Database 10g databases are

registered in the base recovery catalog. The database user who owns the base recovery

catalog is CATOWNER. CATOWNER executes the following command to grant

privileges to a new user VPC1 using Oracle Database 11g RMAN executables:

RMAN> GRANT CATALOG FOR DATABASE prod1, prod2 TO vpc1;

Then you issue the following commands:

RMAN> CONNECT CATALOG vpc1/oracle@catdb;

RMAN> SQL “EXEC catowner.dbms_rcvcat.create_virtual_catalog;”

What is the outcome of the above commands?

A. They produce an error because you need to connect as CATOWNER to execute this

packaged procedure.

B. They execute and create a virtual catalog for pre-Oracle 11g clients.

C. They produce an error because PROD1 and PROD2 databases belong to the older

version.

D. They produce an error because you need to connect to the target database to execute

this packaged procedure.

Answer: B

 

 

 – 172

In which cases is reference partitioning effective in enhancing performance?

A. It is effective only in partition pruning.

B. It is effective in both partition pruning as well as partitionwise joins irrespective of

whether the query predicates are different from or identical to the partitioning key.

C. It is effective in both partition pruning as well as partitionwise joins provided that the

query predicates are identical to the partitioning key.

D. It is effective only in partitionwise joins provided that the query predicates are

different from the partitioning key.

Answer: B

 – 173

What recommendations does the SQL Access Advisor provide for optimizing SQL

queries? (Choose all that apply.)

A. creation of bitmap, function-based, and B-tree indexes

B. creation of index-organized tables

C. optimization of materialized views for maximum query usage and fast refresh

D. selection of SQL plan baselines

E. partitioning of tables and indexes

Answer: A,C,E

 – 174

You are managing an Oracle 11g database with ASM storage, for which the

COMPATIBLE initialization parameter is set to 11.1.0. In the ASM instance, the

COMPATIBLE.RDBMS attribute for the disk group is set to 10.2 and the

COMPATIBLE.ASM attribute is set to 11.1.

Which two statements are true in this scenario for the features enabled for ASM?

(Choose two.)

A. The ASM supports variable sizes for extents of 1, 8, and 64 allocation units.

B. The ASM-preferred mirror read feature is enabled.

C. The RDBMS always reads the primary copy of a mirrored extent of the ASM disk

group.

D. The ASM disk is dropped immediately from a disk group when it becomes

unavailable.

Answer: A,B

 – 175

You want to take the backup of the USERS tablespace. It has a single data file of 900

MB.. You have tape drives of 300 MB each. The SBT channel is configured for the

RMAN. To accomplish the backup, you issued the following RMAN command:

 

 

 

RMAN> BACKUP SECTION SIZE 300M TABLESPACE users;

Which two statements are true regarding the execution of the above command? (Choose

two.)

A. The RMAN parallelizes the backup although the parallelism is not set for a channel.

B. The backup piece size will be limited to 300 MB.

C. The operation is accomplished using the default channel available.

D. Three channels for the tape drive must be configured by setting the parallelism to

three.

Answer: B,C

 – 176

Exhibit #1:

Exhibit #2:

View the Exhibit exhibit1 to observe the maintenance window property.

 

 

View the Exhibit exhibit2 to examine the output of the query.

Which two statements describe the conclusions? (Choose two.)

A. RESOURCE_PERCENTAGE should be increased.

B. The repeat time for the window should be decreased.

C. RESOURCE_PERCENTAGE should be decreased.

D. The window duration should be increased.

Answer: A,D

 – 177

Exhibit:

View the Exhibit to examine the error obtained during the I/O calibration process.

There are no data files on raw devices. What is the reason for this error?

A. Another session runs the I/O calibration process concurrently.

B. The FILESYSTEMIO_OPTIONS parameter is set to NONE.

C. The pending area has not been created before running the I/O calibration process.

D. The DISK_ASYNCH_IO parameter is set to TRUE.

Answer: B

 – 178

Which statement is true for enabling Enterprise Manager Support Workbench in Oracle

Database 11g to upload the physical files generated by Incident Packaging Service (IPS)

to MetaLink?

A. The path for the Automatic Diagnostic Repository (ADR) must be configured with the

DIAGNOSTIC_DEST initialization parameter.

B. Select the Enable option in the Oracle Configuration Manager Registration window

during the installation of the Oracle Database 11g software, provide valid MetaLink

credentials and select license agreement.

C. The Enterprise Manager Support Workbench can be enabled only if the background

process manageability monitor (MMON) is configured.

D. No special setup is required, and the feature is enabled by default.

E. The database must be running in ARCHIVELOG mode.

 

 

Answer: B

 – 179

Which statements are true regarding SecureFile LOBs? (Choose all that apply.)

A. The amount of undo retained is user controlled.

B. It automatically detects duplicate LOB data and conserves space by storing only one

copy.

C. SecureFile encryption allows for random reads and writes of the encrypted data.

D. Fragmentation is minimized by using variable-sized chunks dynamically.

E. SecureFile LOBs can be used only for nonpartitioned tables.

Answer: C,D

 – 180

You executed the following commands in an RMAN session for your database instance

that has failures:

RMAN> LIST FAILURE;

After some time, you executed the following command in the same session:

RMAN> ADVISE FAILURE;

But there are new failures recorded in the Automatic Diagnostic Repository (ADR) after

the execution of the last LIST FAILURE command. Which statement is true for the

above ADVISE FAILURE command in this scenario?

A. It produces advice only for new failures and the failures listed in the last LIST

FAILURE command are ignored.

B. It produces a warning for new failures before advising for CRITICAL and HIGH

failures.

C. It produces an error with recommendation to run the LIST FAILURE command before

the ADVISE FAILURE command.

D. It ignores new failures and considers the failures listed in the last LIST FAILURE

command only.

Answer: B

 – 181

Your organization decided to upgrade the existing Oracle 10g database to Oracle 11g

database in a multiprocessor environment. At the end of the upgrade, you observe that the

DBA executes the following script:

SQL> @utlrp.sql

What is the significance of executing this script?

A. It performs sequential recompilation of any stored PL/SQL as well as Java code.

B. It performs parallel recompilation of any stored PL/SQL as well as Java code.

C. It performs sequential recompilation of only the stored PL/SQL code.

 

 

D. It performs parallel recompilation of only the stored PL/SQL code.

Answer: B

 – 182

View the Exhibit.

Examine the following command that is executed for the TRANSPORT table in the SH

schema:

SQL> SELECT DBMS_STATS.CREATE_EXTENDED_STATS(‘sh’, ‘customers_obe’,

‘(country_id, cust_state_province)’) FROM dual;

Which statement describes the significance of this command?

A. It collects statistics with AUTO_SAMPLE_SIZE for ESTIMATE_PERCENT.

B. It collects statistics into the pending area in the data dictionary.

C. It creates a histogram to hold skewed information about the data in the columns.

D. It creates a virtual hidden column in the CUSTOMERS_OBE table.

Answer: D

 – 183

You installed Oracle Database 11g afresh. Which statements are true regarding the

default audit settings in this database? (Choose all that apply.)

A. The audit trail is stored in an operating system file.

B. Auditing is disabled for all privileges.

C. The audit trail is stored in the database.

D. Auditing is enabled for all privileges.

E. Auditing is enabled for certain privileges related to database security.

Answer: C,E

Publicado em OCP, ORACLE 11gR2, TUTORIAL | Marcado com , , , , , | Deixe um comentário

OBIEE functional architecture

Publicado em DATAWAREHOUSE, TUTORIAL, VIDEOS | Marcado com | Deixe um comentário

OBIEE technical architecture

Publicado em DATAWAREHOUSE, VIDEOS | Marcado com | Deixe um comentário

What are Dimensions and Measures?

Publicado em DATAGUARD, VIRTUAL BOX | Deixe um comentário

O que é Business Intelligence (BI)?

Publicado em DATAGUARD, VIDEOS | Deixe um comentário

OLAP Cartoons, Business Intelligence, Dimensions, Measures, OLAP

Publicado em DATAWAREHOUSE, VIDEOS | Deixe um comentário

Dismistificando Data Warehouse

Publicado em DATAWAREHOUSE, VIDEOS | Deixe um comentário

Compare Oracle Exadata e o Appliance de Data Warehouse IBM Netezza

Publicado em EXADATA, TUTORIAL, VIDEOS | Marcado com , , , | Deixe um comentário

Migrando um Datawarehouse de 1TB em 20 Minutos




Publicado em EXADATA, ORACLE 11gR2, TUTORIAL, VIDEOS | Marcado com | Deixe um comentário

Oracle Exadata Smart Flash Log

Publicado em EXADATA, ORACLE 11gR2, VIDEOS | Marcado com , | Deixe um comentário

Exadata Storage Indexes

Publicado em EXADATA, VIDEOS | Marcado com | Deixe um comentário

Exadata is Good, But Not Easy.

Publicado em EXADATA, VIDEOS | Deixe um comentário

Oracle Exadata: Hybrid Columnar Compression (HCC)

Publicado em EXADATA, VIDEOS | Marcado com , , | Deixe um comentário

Ajustando performance de PL/SQL usandoToad for Oracle

Publicado em PLSQL SCRIPTS, PLSQL TUNING, TUTORIAL, VIDEOS | Marcado com , | Deixe um comentário

PL/SQL Oracle BULK COLLECT

Publicado em PLSQL SCRIPTS, PLSQL TUNING, VIDEOS | Marcado com , | Deixe um comentário

PL/SQL Oracle REF CURSOR and SYS_REFCURSOR tutorial

Publicado em PLSQL SCRIPTS, PLSQL TUNING, VIDEOS | Marcado com , , , | Deixe um comentário

Oracle PL/SQL Reference Cursor

Publicado em PLSQL TUNING, VIDEOS | Marcado com , | Deixe um comentário

Automatizando performance de SQL

Publicado em FAST DIAG, PLSQL TUNING, VIDEOS | Marcado com , | Deixe um comentário

Erros comuns ao programar com Oracle PL/SQL

Publicado em PLSQL TUNING, VIDEOS | Marcado com , | Deixe um comentário

Oracle Buffer Busy Waits

Publicado em BUFFERS, VIDEOS, WAIT EVENTS | Marcado com , , | Deixe um comentário

Usando Exadata Smart Scan

Publicado em EXADATA, VIDEOS | Marcado com | Deixe um comentário

Exadata smart scan

Publicado em EXADATA, VIDEOS | Deixe um comentário

Exadata Live Performance Demo – OpenWorld 2009 – YouTube

Publicado em EXADATA, VIDEOS | Deixe um comentário

Oracle Exadata Smart Flash Cache – YouTube

Publicado em EXADATA, VIDEOS | Marcado com , , | Deixe um comentário

Video de Tuning e Performance usando ORACLE AWR

Publicado em AWR, VIDEOS | Marcado com | Deixe um comentário

Video sobre replicação real-time entre MySQL e Oracle

Publicado em MYSQL, ORACLE 11gR2, TUTORIAL | Deixe um comentário

Replicacação com Oracle GoldenGate – YouTube

Publicado em GOLDENGATE | Deixe um comentário

VIDEO Install Oracle Grid Infrastructure 11gR2 (RAC) – YouTube

Publicado em RAC | Deixe um comentário

Oracle Database Online Documentation 11g Release 2 (11.2)

Oracle Database Online Documentation 11g Release 2 (11.2).

Publicado em ORACLE 11gR2 | Deixe um comentário

Documetação completa do Oracle Clusterware 11g Release 2 (11.2)

Documetação completa do Oracle Clusterware 11g Release 2 (11.2)

Publicado em ORACLE 11gR2, RAC, TUTORIAL | Marcado com , , , , , | Deixe um comentário

Gerenciando o Virtual box

Introduction

Introduction

As briefly mentioned in the section called “Alternative front-ends”, VBoxManage is
the command-line interface to VirtualBox. With it, you can completely
control VirtualBox from the command line of your host operating system.
VBoxManage supports all the features that the graphical user interface
gives you access to, but it supports a lot more than that. It exposes
really all the features of the virtualization engine, even those that
cannot (yet) be accessed from the GUI.

You will need to use the command line if you want to

  • use a different user interface than the main GUI (for example,
    VBoxSDL or the VBoxHeadless server);
  • control some of the more advanced and experimental
    configuration settings for a VM.

There are two main things to keep in mind when using
VBoxManage: First,
VBoxManage must always be used with a
specific “subcommand”, such as “list” or “createvm” or “startvm”. All the
subcommands that VBoxManage supports are
described in detail in Chapter 8, VBoxManage.

Second, most of these subcommands require that you specify a
particular virtual machine after the subcommand. There are two ways you
can do this:

  • You can specify the VM name, as it is shown in the VirtualBox
    GUI. Note that if that name contains spaces, then you must enclose the
    entire name in double quotes (as it is always required with command
    line arguments that contain spaces).For example:

    VBoxManage startvm "Windows XP"
  • You can specify the UUID, which is the internal unique
    identifier that VirtualBox uses to refer to the virtual machine.
    Assuming that the aforementioned VM called “Windows XP” has the UUID
    shown below, the following command has the same effect as the
    previous:

    VBoxManage startvm 670e746d-abea-4ba6-ad02-2a3b043810a5

You can type VBoxManage list vms to
have all currently registered VMs listed with all their settings,
including their respective names and UUIDs.

Some typical examples of how to control VirtualBox from the command
line are listed below:

  • To create a new virtual machine from the command line and
    immediately register it with VirtualBox, use
    VBoxManage createvm with the
    --register option,[35]like this:

    $ VBoxManage createvm --name "SUSE 10.2" --register
    VirtualBox Command Line Management Interface Version 4.1.14
    (C) 2005-2012 Oracle Corporation
    All rights reserved.
    
    Virtual machine 'SUSE 10.2' is created.
    UUID: c89fc351-8ec6-4f02-a048-57f4d25288e5
    Settings file: '/home/username/.VirtualBox/Machines/SUSE 10.2/SUSE 10.2.xml'

    As can be seen from the above output, a new virtual machine has
    been created with a new UUID and a new XML settings file.

  • To show the configuration of a particular VM, use
    VBoxManage showvminfo; see the section called “VBoxManage showvminfo” for details and an example.
  • To change settings while a VM is powered off, use
    VBoxManage modifyvm, e.g. as
    follows:

    VBoxManage modifyvm "Windows XP" --memory "512MB"

    For details, see the section called “VBoxManage modifyvm”.

  • To change the storage configuration (e.g. to add a storage
    controller and then a virtual disk), use VBoxManage
    storagectl
    and VBoxManage
    storageattach
    ; see the section called “VBoxManage storagectl” and the section called “VBoxManage storageattach” for details.
  • To control VM operation, use one of the following:

Commands overview

When running VBoxManage without parameters or when supplying an
invalid command line, the below syntax diagram will be shown. Note that
the output will be slightly different depending on the host platform; when
in doubt, check the output of VBoxManage
for the commands available on your particular host.

Usage:

VBoxManage [-v|--version]    print version number and exit
VBoxManage [-q|--nologo] ... suppress the logo

VBoxManage list [--long|-l] vms|runningvms|ostypes|hostdvds|hostfloppies|
                            bridgedifs|dhcpservers|hostinfo|
                            hostcpuids|hddbackends|hdds|dvds|floppies|
                            usbhost|usbfilters|systemproperties|extpacks

VBoxManage showvminfo       <uuid>|<name> [--details]
                            [--machinereadable]
VBoxManage showvminfo       <uuid>|<name> --log <idx>

VBoxManage registervm       <filename>

VBoxManage unregistervm     <uuid>|<name> [--delete]

VBoxManage createvm         --name <name>
                            [--ostype <ostype>]
                            [--register]
                            [--basefolder <path>]
                            [--uuid <uuid>]

VBoxManage modifyvm         <uuid|name>
                            [--name <name>]
                            [--ostype <ostype>]
                            [--memory <memorysize in MB>]
                            [--pagefusion on|off]
                            [--vram <vramsize in MB>]
                            [--acpi on|off]
                            [--ioapic on|off]
                            [--pae on|off]
                            [--hpet on|off]
                            [--hwvirtex on|off]
                            [--hwvirtexexcl on|off]
                            [--nestedpaging on|off]
                            [--largepages on|off]
                            [--vtxvpid on|off]
                            [--synthcpu on|off]
                            [--cpuidset <leaf> <eax> <ebx> <ecx> <edx>]
                            [--cpuidremove <leaf>]
                            [--cpuidremoveall]
                            [--hardwareuuid <uuid>]
                            [--cpus <number>]
                            [--cpuhotplug on|off]
                            [--plugcpu <id>]
                            [--unplugcpu <id>]
                            [--cpuexecutioncap <1-100>]
                            [--rtcuseutc on|off]
                            [--monitorcount <number>]
                            [--accelerate3d on|off]
                            [--firmware bios|efi|efi32|efi64]
                            [--chipset ich9|piix3]
                            [--bioslogofadein on|off]
                            [--bioslogofadeout on|off]
                            [--bioslogodisplaytime <msec>]
                            [--bioslogoimagepath <imagepath>]
                            [--biosbootmenu disabled|menuonly|messageandmenu]
                            [--biossystemtimeoffset <msec>]
                            [--biospxedebug on|off]
                            [--boot<1-4> none|floppy|dvd|disk|net>]
                            [--nic<1-N> none|null|nat|bridged|intnet|
                                        generic]
                            [--nictype<1-N> Am79C970A|Am79C973]
                            [--cableconnected<1-N> on|off]
                            [--nictrace<1-N> on|off]
                            [--nictracefile<1-N> <filename>]
                            [--nicproperty<1-N> name=[value]]
                            [--nicspeed<1-N> <kbps>]
                            [--nicbootprio<1-N> <priority>]
                            [--nicpromisc<1-N> deny|allow-vms|allow-all]
                            [--nicbandwidthgroup<1-N> none|<name>]
                            [--bridgeadapter<1-N> none|<devicename>]
                            [--intnet<1-N> <network name>]
                            [--natnet<1-N> <network>|default]
                            [--nicgenericdrv<1-N> <driver>
                            [--natsettings<1-N> [<mtu>],[<socksnd>],
                                                [<sockrcv>],[<tcpsnd>],
                                                [<tcprcv>]]
                            [--natpf<1-N> [<rulename>],tcp|udp,[<hostip>],
                                          <hostport>,[<guestip>],<guestport>]
                            [--natpf<1-N> delete <rulename>]
                            [--nattftpprefix<1-N> <prefix>]
                            [--nattftpfile<1-N> <file>]
                            [--nattftpserver<1-N> <ip>]
                            [--natbindip<1-N> <ip>
                            [--natdnspassdomain<1-N> on|off]
                            [--natdnsproxy<1-N> on|off]
                            [--natdnshostresolver<1-N> on|off]
                            [--nataliasmode<1-N> default|[log],[proxyonly],
                                                         [sameports]]
                            [--macaddress<1-N> auto|<mac>]
                            [--mouse ps2|usb|usbtablet
                            [--keyboard ps2|usb
                            [--uart<1-N> off|<I/O base> <IRQ>]
                            [--uartmode<1-N> disconnected|
                                             server <pipe>|
                                             client <pipe>|
                                             file <file>|
                                             <devicename>]
                            [--guestmemoryballoon <balloonsize in MB>]
                            [--gueststatisticsinterval <seconds>]
                            [--audio none|null|dsound|solaudio|oss|
                                     oss|coreaudio]
                            [--audiocontroller ac97|hda|sb16]
                            [--clipboard disabled|hosttoguest|guesttohost|
                                         bidirectional]
                            [--vrde on|off]
                            [--vrdeextpack default|<name>
                            [--vrdeproperty <name=[value]>]
                            [--vrdeport <hostport>]
                            [--vrdeaddress <hostip>]
                            [--vrdeauthtype null|external|guest]
                            [--vrdeauthlibrary default|<name>
                            [--vrdemulticon on|off]
                            [--vrdereusecon on|off]
                            [--vrdevideochannel on|off]
                            [--vrdevideochannelquality <percent>]
                            [--usb on|off]
                            [--usbehci on|off]
                            [--snapshotfolder default|<path>]
                            [--teleporter on|off]
                            [--teleporterport <port>]
                            [--teleporteraddress <address|empty>
                            [--teleporterpassword <password>]
                            [--teleporterpasswordfile  <file>|stdin]

VBoxManage clonevm          <uuid>|<name>
                            [--snapshot <uuid>|<name>]
                            [--mode machine|machineandchildren|all]
                            [--options link|keepallmacs|keepnatmacs|
                                       keepdisknames]
                            [--name <name>]
                            [--basefolder <basefolder>]
                            [--uuid <uuid>]
                            [--register]

VBoxManage import           <ovf/ova>
                            [--dry-run|-n]
                            [--options keepallmacs|keepnatmacs]
                            [more options]
                            (run with -n to have options displayed
                             for a particular OVF)

VBoxManage export           <machines> --output|-o <ovf/ova>
                            [--legacy09]
                            [--manifest]
                            [--vsys <number of virtual system>]
                                    [--product <product name>]
                                    [--producturl <product url>]
                                    [--vendor <vendor name>]
                                    [--vendorurl <vendor url>]
                                    [--version <version info>]
                                    [--eula <license text>]
                                    [--eulafile <filename>]

VBoxManage startvm          <uuid>|<name>...
                            [--type gui|sdl|headless]

VBoxManage controlvm        <uuid>|<name>
                            pause|resume|reset|poweroff|savestate|
                            acpipowerbutton|acpisleepbutton|
                            keyboardputscancode <hex> [<hex> ...]|
                            setlinkstate<1-N> on|off |
                            nic<1-N> null|nat|bridged|intnet|generic
                                     [<devicename>] |
                            nictrace<1-N> on|off
                            nictracefile<1-N> <filename>
                            nicproperty<1-N> name=[value]
                            natpf<1-N> [<rulename>],tcp|udp,[<hostip>],
                                          <hostport>,[<guestip>],<guestport>
                            natpf<1-N> delete <rulename>
                            guestmemoryballoon <balloonsize in MB>]
                            gueststatisticsinterval <seconds>]
                            usbattach <uuid>|<address> |
                            usbdetach <uuid>|<address> |
                            vrde on|off |
                            vrdeport <port> |
                            vrdeproperty <name=[value]> |
                            vrdevideochannelquality <percent>
                            setvideomodehint <xres> <yres> <bpp> [display] |
                            screenshotpng <file> [display] |
                            setcredentials <username> <password> <domain>
                                           [--allowlocallogon <yes|no>] |
                            teleport --host <name> --port <port>
                                   [--maxdowntime <msec>] [--password password]
                            plugcpu <id>
                            unplugcpu <id>
                            cpuexecutioncap <1-100>

VBoxManage discardstate     <uuid>|<name>

VBoxManage adoptstate       <uuid>|<name> <state_file>

VBoxManage snapshot         <uuid>|<name>
                            take <name> [--description <desc>] [--pause] |
                            delete <uuid>|<name> |
                            restore <uuid>|<name> |
                            restorecurrent |
                            edit <uuid>|<name>|--current
                                 [--name <name>]
                                 [--description <desc>] |
                            list [--details|--machinereadable]
                            showvminfo <uuid>|<name>

VBoxManage closemedium      disk|dvd|floppy <uuid>|<filename>
                            [--delete]

VBoxManage storageattach    <uuid|vmname>
                            --storagectl <name>
                            [--port <number>]
                            [--device <number>]
                            [--type dvddrive|hdd|fdd]
                            [--medium none|emptydrive|
                                      <uuid>|<filename>|host:<drive>|iscsi]
                            [--mtype normal|writethrough|immutable|shareable|
                                     readonly|multiattach]
                            [--comment <text>]
                            [--setuuid <uuid>]
                            [--setparentuuid <uuid>]
                            [--passthrough on|off]
                            [--tempeject on|off]
                            [--nonrotational on|off]
                            [--bandwidthgroup <name>]
                            [--forceunmount]
                            [--server <name>|<ip>]
                            [--target <target>]
                            [--tport <port>]
                            [--lun <lun>]
                            [--encodedlun <lun>]
                            [--username <username>]
                            [--password <password>]
                            [--intnet]

VBoxManage storagectl       <uuid|vmname>
                            --name <name>
                            [--add ide|sata|scsi|floppy|sas]
                            [--controller LSILogic|LSILogicSAS|BusLogic|
                                          IntelAHCI|PIIX3|PIIX4|ICH6|I82078]
                            [--sataideemulation<1-4> <1-30>]
                            [--sataportcount <1-30>]
                            [--hostiocache on|off]
                            [--bootable on|off]
                            [--remove]

VBoxManage bandwidthctl     <uuid|vmname>
                            --name <name>
                            [--add disk|network]
                            [--limit <megabytes per second>
                            [--delete]

VBoxManage showhdinfo       <uuid>|<filename>

VBoxManage createhd         --filename <filename>
                            --size <megabytes>|--sizebyte <bytes>
                            [--format VDI|VMDK|VHD] (default: VDI)
                            [--variant Standard,Fixed,Split2G,Stream,ESX]

VBoxManage modifyhd         <uuid>|<filename>
                            [--type normal|writethrough|immutable|shareable|
                                    readonly|multiattach]
                            [--autoreset on|off]
                            [--compact]
                            [--resize <megabytes>|--resizebyte <bytes>]

VBoxManage clonehd          <uuid>|<filename> <uuid>|<outputfile>
                            [--format VDI|VMDK|VHD|RAW|<other>]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
                            [--existing]

VBoxManage convertfromraw   <filename> <outputfile>
                            [--format VDI|VMDK|VHD]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
                            [--uuid <uuid>
VBoxManage convertfromraw   stdin <outputfile> <bytes>
                            [--format VDI|VMDK|VHD]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
                            [--uuid <uuid>

VBoxManage getextradata     global|<uuid>|<name>
                            <key>|enumerate

VBoxManage setextradata     global|<uuid>|<name>
                            <key>
                            [<value>] (no value deletes key)

VBoxManage setproperty      machinefolder default|<folder> |
                            vrdeauthlibrary default|<library> |
                            websrvauthlibrary default|null|<library> |
                            vrdeextpack null|<library> |
                            loghistorycount <value>

VBoxManage usbfilter        add <index,0-N>
                            --target <uuid>|<name>|global
                            --name <string>
                            --action ignore|hold (global filters only)
                            [--active yes|no] (yes)
                            [--vendorid <XXXX>] (null)
                            [--productid <XXXX>] (null)
                            [--revision <IIFF>] (null)
                            [--manufacturer <string>] (null)
                            [--product <string>] (null)
                            [--remote yes|no] (null, VM filters only)
                            [--serialnumber <string>] (null)
                            [--maskedinterfaces <XXXXXXXX>]

VBoxManage usbfilter        modify <index,0-N>
                            --target <uuid>|<name>|global
                            [--name <string>]
                            [--action ignore|hold] (global filters only)
                            [--active yes|no]
                            [--vendorid <XXXX>|""]
                            [--productid <XXXX>|""]
                            [--revision <IIFF>|""]
                            [--manufacturer <string>|""]
                            [--product <string>|""]
                            [--remote yes|no] (null, VM filters only)
                            [--serialnumber <string>|""]
                            [--maskedinterfaces <XXXXXXXX>]

VBoxManage usbfilter        remove <index,0-N>
                            --target <uuid>|<name>|global

VBoxManage sharedfolder     add <vmname>|<uuid>
                            --name <name> --hostpath <hostpath>
                            [--transient] [--readonly] [--automount]

VBoxManage sharedfolder     remove <vmname>|<uuid>
                            --name <name> [--transient]

VBoxManage debugvm          <uuid>|<name>
                            dumpguestcore --filename <name> |
                            info <item> [args] |
                            injectnmi |
                            log [--release|--debug] <settings> ...|
                            logdest [--release|--debug] <settings> ...|
                            logflags [--release|--debug] <settings> ...|
                            osdetect |
                            osinfo |
                            getregisters [--cpu <id>] <reg>|all ... |
                            setregisters [--cpu <id>] <reg>=<value> ... |
                            statistics [--reset] [--pattern <pattern>]
                            [--descriptions]

VBoxManage metrics          list [*|host|<vmname> [<metric_list>]]
                                                 (comma-separated)

VBoxManage metrics          setup
                            [--period <seconds>] (default: 1)
                            [--samples <count>] (default: 1)
                            [--list]
                            [*|host|<vmname> [<metric_list>]]

VBoxManage metrics          query [*|host|<vmname> [<metric_list>]]

VBoxManage metrics          enable
                            [--list]
                            [*|host|<vmname> [<metric_list>]]

VBoxManage metrics          disable
                            [--list]
                            [*|host|<vmname> [<metric_list>]]

VBoxManage metrics          collect
                            [--period <seconds>] (default: 1)
                            [--samples <count>] (default: 1)
                            [--list]
                            [--detach]
                            [*|host|<vmname> [<metric_list>]]

VBoxManage dhcpserver       add|modify --netname <network_name> |
                            [--ip <ip_address>
                            --netmask <network_mask>
                            --lowerip <lower_ip>
                            --upperip <upper_ip>]
                            [--enable | --disable]

VBoxManage dhcpserver       remove --netname <network_name> |

VBoxManage extpack          install [--replace] <tarball> |
                            uninstall [--force] <name> |
                            cleanup

Each time VBoxManage is invoked, only one command can be executed.
However, a command might support several subcommands which then can be
invoked in one single call. The following sections provide detailed
reference information on the different commands.

VBoxManage list

The list command gives relevant
information about your system and information about VirtualBox’s current
settings.

The following subcommands are available with
VBoxManage list:

  • vms lists all virtual
    machines currently registered with VirtualBox. By default this
    displays a compact list with each VM’s name and UUID; if you also
    specify --long or
    -l, this will be a detailed list as
    with the showvminfo command (see
    below).
  • runningvms lists all
    currently running virtual machines by their unique identifiers
    (UUIDs) in the same format as with
    vms.
  • ostypes lists all guest
    operating systems presently known to VirtualBox, along with the
    identifiers used to refer to them with the
    modifyvm command.
  • hostdvds,
    hostfloppies, respectively, list
    DVD, floppy, bridged networking and host-only networking interfaces
    on the host, along with the name used to access them from within
    VirtualBox.
  • bridgedifs,
    hostonlyifs and
    dhcpservers, respectively, list
    bridged network interfaces, host-only network interfaces and DHCP
    servers currently available on the host. Please see Chapter 6, Virtual networking for details on these.
  • hostinfo displays information
    about the host system, such as CPUs, memory size and operating
    system version.
  • hostcpuids dumps the CPUID
    parameters for the host CPUs. This can be used for a more fine
    grained analyis of the host’s virtualization capabilities.
  • hddbackends lists all known
    virtual disk back-ends of VirtualBox. For each such format (such as
    VDI, VMDK or RAW), this lists the back-end’s capabilities and
    configuration.
  • hdds,
    dvds and
    floppies all give you information
    about virtual disk images currently in use by VirtualBox, including
    all their settings, the unique identifiers (UUIDs) associated with
    them by VirtualBox and all files associated with them. This is the
    command-line equivalent of the Virtual Media Manager; see the section called “The Virtual Media Manager”.
  • usbhost supplies information
    about USB devices attached to the host, notably information useful
    for constructing USB filters and whether they are currently in use
    by the host.
  • usbfilters lists all global
    USB filters registered with VirtualBox — that is, filters for
    devices which are accessible to all virtual machines — and displays
    the filter parameters.
  • systemproperties displays
    some global VirtualBox settings, such as minimum and maximum guest
    RAM and virtual hard disk size, folder settings and the current
    authentication library in use.
  • extpacks displays all
    VirtualBox extension packs currently installed; see the section called “Installing VirtualBox and extension packs” and the section called “VBoxManage extpack” for more information.

VBoxManage showvminfo

The showvminfo command shows
information about a particular virtual machine. This is the same
information as VBoxManage list vms --long
would show for all virtual machines.

You will get information similar to the following:

$ VBoxManage showvminfo "Windows XP"
VirtualBox Command Line Management Interface Version 4.1.14
(C) 2005-2012 Oracle Corporation
All rights reserved.

Name:            Windows XP
Guest OS:        Other/Unknown
UUID:            1bf3464d-57c6-4d49-92a9-a5cc3816b7e7
Config file:     /home/username/.VirtualBox/Machines/Windows XP/Windows XP.xml
Memory size:     512MB
VRAM size:       12MB
Number of CPUs:  2
Synthetic Cpu:   off
Boot menu mode:  message and menu
Boot Device (1): DVD
Boot Device (2): HardDisk
Boot Device (3): Not Assigned
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          on
PAE:             on
Time offset:     0 ms
Hardw. virt.ext: on
Hardw. virt.ext exclusive: on
Nested Paging:   on
VT-x VPID:       off
State:           powered off (since 2009-10-20T14:52:19.000000000)
Monitor count:   1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address:
Teleporter Password:
Storage Controller      (0): IDE Controller
Storage Controller Type (0): PIIX4
Storage Controller      (1): Floppy Controller 1
Storage Controller Type (1): I82078
IDE Controller (0, 0): /home/user/windows.vdi (UUID: 46f6e53a-4557-460a-9b95-68b0f17d744b)
IDE Controller (0, 1): /home/user/openbsd-cd46.iso (UUID: 4335e162-59d3-4512-91d5-b63e94eebe0b)
Floppy Controller 1 (0, 0): /home/user/floppy.img (UUID: 62ac6ccb-df36-42f2-972e-22f836368137)
NIC 1:           disabled
NIC 2:           disabled
NIC 3:           disabled
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
UART 1:          disabled
UART 2:          disabled
Audio:           disabled (Driver: Unknown)
Clipboard Mode:  Bidirectional
VRDE:            disabled
USB:             disabled

USB Device Filters:
<none>

Shared folders:
<none>

Statistics update:  disabled

VBoxManage registervm / unregistervm

The registervm command allows you
to import a virtual machine definition in an XML file into VirtualBox. The
machine must not conflict with one already registered in VirtualBox and it
may not have any hard or removable disks attached. It is advisable to
place the definition file in the machines folder before registering
it.

Note

When creating a new virtual machine with
VBoxManage createvm (see below), you
can directly specify the --register
option to avoid having to register it separately.

The unregistervm command
unregisters a virtual machine. If
--delete is also specified, the following
files will automatically be deleted as well:

  1. all hard disk image files, including differencing files, which
    are used by the machine and not shared with other machines;
  2. saved state files that the machine created, if any (one if the
    machine was in “saved” state and one for each online
    snapshot);
  3. the machine XML file and its backups;
  4. the machine log files, if any;
  5. the machine directory, if it is empty after having deleted all
    the above.

VBoxManage createvm

This command creates a new XML virtual machine definition
file.

The --name <name> parameter
is required and must specify the name of the machine. Since this name is
used by default as the file name of the settings file (with the extension
.xml) and the machine folder (a subfolder
of the .VirtualBox/Machines folder), it
must conform to your host operating system’s requirements for file name
specifications. If the VM is later renamed, the file and folder names will
change automatically.

However, if the --basefolder
<path>
option is used, the machine folder will be
named <path>. In this case, the
names of the file and the folder will not change if the virtual machine is
renamed.

By default, this command only creates the XML file without
automatically registering the VM with your VirtualBox installation. To
register the VM instantly, use the optional
--register option, or run
VBoxManage registervm separately
afterwards.

VBoxManage modifyvm

This command changes the properties of a registered virtual machine
which is not running. Most of the properties that this command makes
available correspond to the VM settings that VirtualBox graphical user
interface displays in each VM’s “Settings” dialog; these were described in
Chapter 3, Configuring virtual machines. Some of the more advanced settings,
however, are only available through the
VBoxManage interface.

These commands require that the machine is powered off (neither
running nor in “saved” state). Some machine settings can also be changed
while a machine is running; those settings will then have a corresponding
subcommand with the VBoxManage controlvm
subcommand (see the section called “VBoxManage controlvm”).

General settings

The following general settings are available through
VBoxManage modifyvm:

  • --name <name>: This
    changes the VM’s name and possibly renames the internal virtual
    machine files, as described with VBoxManage
    createvm
    above.
  • --ostype <ostype>:
    This specifies what guest operating system is supposed to run in
    the VM. To learn about the various identifiers that can be used
    here, use VBoxManage list
    ostypes
    .
  • --memory
    <memorysize>
    : This sets the amount of RAM,
    in MB, that the virtual machine should allocate for itself from
    the host. See the remarks in the section called “Creating your first virtual machine” for
    more information.
  • --vram <vramsize>:
    This sets the amount of RAM that the virtual graphics card should
    have. See the section called “Display settings” for details.
  • --acpi on|off;
    --ioapic on|off: These two
    determine whether the VM should have ACPI and I/O APIC support,
    respectively; see the section called “”Motherboard” tab” for
    details.
  • --hardwareuuid
    <uuid>
    : The UUID presented to the guest via
    memory tables (DMI/SMBIOS), hardware and guest properties. By
    default this is the same as the VM uuid. Useful when cloning a VM.
    Teleporting takes care of this automatically.
  • --cpus <cpucount>:
    This sets the number of virtual CPUs for the virtual machine (see
    the section called “”Processor” tab”). If CPU hot-plugging is
    enabled (see below), this then sets the
    maximum number of virtual CPUs that can be
    plugged into the virtual machines.
  • --rtcuseutc on|off: This
    option lets the real-time clock (RTC) operate in UTC time (see
    the section called “”Motherboard” tab”).
  • --cpuhotplug on|off: This
    enables CPU hot-plugging. When enabled, virtual CPUs can be added
    to and removed from a virtual machine while it is running. See
    the section called “CPU hot-plugging” for more information.
  • --plugcpu|unplugcpu
    <id>
    : If CPU hot-plugging is enabled (see
    above), this adds a virtual CPU to the virtual machines (or
    removes one). <id>
    specifies the index of the virtual CPU to be added or removed and
    must be a number from 0 to the maximum no. of CPUs configured with
    the --cpus option. CPU 0 can
    never be removed.
  • --cpuexecutioncap
    <1-100>
    : This setting controls how much cpu
    time a virtual CPU can use. A value of 50 implies a single virtual
    CPU can use up to 50% of a single host CPU.
  • --synthcpu on|off: This
    setting determines whether VirtualBox will expose a synthetic CPU
    to the guest to allow live migration between host systems that
    differ significantly.
  • --pae on|off: This
    enables/disables PAE (see the section called “”Processor” tab”).
  • --hpet on|off: This
    enables/disables a High Precision Event Timer (HPET) which can
    replace the legacy system timers. This is turned off by default.
    Note that Windows supports a HPET only from Vista onwards.
  • --hwvirtex on|off: This
    enables or disables the use of hardware virtualization extensions
    (Intel VT-x or AMD-V) in the processor of your host system; see
    the section called “Hardware vs. software virtualization”.
  • --hwvirtexexcl on|off: This
    specifies whether VirtualBox will make exclusive use of the
    hardware virtualization extensions (Intel VT-x or AMD-V) in the
    processor of your host system; see the section called “Hardware vs. software virtualization”. If
    you wish to simultaneously share these extensions with other
    hypervisors, then you must disable this setting. Doing so has
    negative performance implications.
  • --nestedpaging on|off: If
    hardware virtualization is enabled, this additional setting
    enables or disables the use of the nested paging feature in the
    processor of your host system; see the section called “Hardware vs. software virtualization”.
  • --largepages on|off: If
    hardware virtualization and nested paging are
    enabled, for Intel VT-x only, an additional performance
    improvement of up to 5% can be obtained by enabling this setting.
    This causes the hypervisor to use large pages to reduce TLB use
    and overhead.
  • --vtxvpid on|off: If
    hardware virtualization is enabled, for Intel VT-x only, this
    additional setting enables or disables the use of the tagged TLB
    (VPID) feature in the processor of your host system; see the section called “Hardware vs. software virtualization”.
  • --accelerate3d on|off: This
    enables, if the Guest Additions are installed, whether hardware 3D
    acceleration should be available; see the section called “Hardware 3D acceleration (OpenGL and Direct3D 8/9)”.
  • You can influence the BIOS logo that is displayed when a
    virtual machine starts up with a number of settings. Per default,
    a VirtualBox logo is displayed.With --bioslogofadein
    on|off
    and --bioslogofadeout
    on|off
    , you can determine whether the logo should
    fade in and out, respectively.With --bioslogodisplaytime
    <msec>
    you can set how long the logo should
    be visible, in milliseconds.

    With --bioslogoimagepath
    <imagepath>
    you can, if you are so
    inclined, replace the image that is shown, with your own logo. The
    image must be an uncompressed 256 color BMP file.

  • --biosbootmenu
    disabled|menuonly|messageandmenu
    : This specifies
    whether the BIOS allows the user to select a temporary boot
    device. menuonly suppresses the
    message, but the user can still press F12 to select a temporary
    boot device.
  • --boot<1-4>
    none|floppy|dvd|disk|net
    : This specifies the boot
    order for the virtual machine. There are four “slots”, which the
    VM will try to access from 1 to 4, and for each of which you can
    set a device that the VM should attempt to boot from.
  • --snapshotfolder
    default|<path>
    : This allows you to specify
    the folder in which snapshots will be kept for a virtual
    machine.
  • --firmware efi|bios:
    Specifies which firmware is used to boot particular virtual
    machine: EFI or BIOS. Use EFI only if your fully understand what
    you’re doing.
  • --guestmemoryballoon
    <size>
    sets the default size of the guest
    memory balloon, that is, memory allocated by the VirtualBox Guest
    Additions from the guest operating system and returned to the
    hypervisor for re-use by other virtual machines. <size> must
    be specified in megabytes. The default size is 0 megabytes. For
    details, see the section called “Memory ballooning”.

Networking settings

The following networking settings are available through
VBoxManage modifyvm. With all these
settings, the decimal number directly following the option name (“1-N”
in the list below) specifies the virtual network adapter whose settings
should be changed.

  • --nic<1-N>
    none|null|nat|bridged|intnet|hostonly|generic
    : With
    this, you can set, for each of the VM’s virtual network cards,
    what type of networking should be available. They can be not
    present (none), not connected to
    the host (null), use network
    address translation (nat),
    bridged networking (bridged) or
    communicate with other virtual machines using internal networking
    (intnet), host-only networking
    (hostonly), or access rarely used
    sub-modes (generic).
    These options correspond
    to the modes which are described in detail in the section called “Introduction to networking modes”.
  • --nictype<1-N>
    Am79C970A|Am79C973|82540EM|82543GC|82545EM|virtio
    :
    This allows you, for each of the VM’s virtual network cards, to
    specify which networking hardware VirtualBox presents to the
    guest; see the section called “Virtual networking hardware”.
  • --cableconnected<1-N>
    on|off
    : This allows you to temporarily disconnect
    a virtual network interface, as if a network cable had been pulled
    from a real network card. This might be useful for resetting
    certain software components in the VM.
  • With the “nictrace” options, you can optionally trace
    network traffic by dumping it to a file, for debugging
    purposes.With --nictrace<1-N>
    on|off
    , you can enable network tracing for a
    particular virtual network card.If enabled, you must specify with
    --nictracefile<1-N>
    <filename>
    what file the trace should be
    logged to.
  • --bridgeadapter<1-N>
    none|<devicename>
    : If bridged networking
    has been enabled for a virtual network card (see the
    --nic option above; otherwise
    this setting has no effect), use this option to specify which host
    interface the given virtual network interface will use. For
    details, please see the section called “Bridged networking”.
  • --hostonlyadapter<1-N>
    none|<devicename>
    : If host-only networking
    has been enabled for a virtual network card (see the –nic option
    above; otherwise this setting has no effect), use this option to
    specify which host-only networking interface the given virtual
    network interface will use. For details, please see the section called “Host-only networking”.
  • --intnet<1-N>
    network
    : If internal networking has been enabled
    for a virtual network card (see the
    --nic option above; otherwise
    this setting has no effect), use this option to specify the name
    of the internal network (see the section called “Internal networking”).
  • --macaddress<1-N>
    auto|<mac>
    : With this option you can set
    the MAC address of the virtual network card. Normally, each
    virtual network card is assigned a random address by VirtualBox at
    VM creation.
  • --nicgenericdrv<1-N>
    <backend driver>
    : If generic networking has been
    enabled for a virtual network card (see the
    --nic option above; otherwise
    this setting has no effect), this mode allows you to access
    rarely used networking sub-modes, such as VDE network or UDP Tunnel.
  • --nicproperty<1-N>
    <paramname>="paramvalue"
    :
    This option, in combination with “nicgenericdrv” allows you to
    pass parameters to rarely-used network backends.Those parameters are backend engine-specific, and are different
    between UDP Tunnel and the VDE backend drivers. For example,
    please see the section called “UDP Tunnel networking”.

NAT Networking settings.

The following NAT networking settings are available through
VBoxManage modifyvm. With all these
settings, the decimal number directly following the option name (“1-N”
in the list below) specifies the virtual network adapter whose
settings should be changed.

Serial port, audio, clipboard, remote desktop and USB
settings

The following other hardware settings are available through
VBoxManage modifyvm:

  • --uart<1-N> off|<I/O base>
    <IRQ>
    : With this option you can configure
    virtual serial ports for the VM; see the section called “Serial ports” for an introduction.
  • --uartmode<1-N>
    <arg>
    : This setting controls how VirtualBox
    connects a given virtual serial port (previously configured with
    the --uartX setting, see above)
    to the host on which the virtual machine is running. As described
    in detail in the section called “Serial ports”, for each such port,
    you can specify <arg> as
    one of the following options:

    • disconnected: Even
      though the serial port is shown to the guest, it has no
      “other end” — like a real COM port without a cable.
    • server
      <pipename>
      : On a Windows host, this
      tells VirtualBox to create a named pipe on the host named
      <pipename> and
      connect the virtual serial device to it. Note that Windows
      requires that the name of a named pipe begin with
      \\.\pipe\.On a Linux host, instead of a named pipe, a local
      domain socket is used.
    • client
      <pipename>
      : This operates just like
      server ..., except that the
      pipe (or local domain socket) is not created by VirtualBox,
      but assumed to exist already.
    • <devicename>:
      If, instead of the above, the device name of a physical
      hardware serial port of the host is specified, the virtual
      serial port is connected to that hardware port. On a Windows
      host, the device name will be a COM port such as
      COM1; on a Linux host, the
      device name will look like
      /dev/ttyS0. This allows you
      to “wire” a real serial port to a virtual machine.
  • --audio none|null|oss: With
    this option, you can set whether the VM should have audio
    support.
  • --clipboard
    disabled|hosttoguest|guesttohost|bidirectional
    :
    With this setting, you can select whether the guest operating
    system’s clipboard should be shared with the host; see the section called “General settings”. This requires that the Guest
    Additions be installed in the virtual machine.
  • --monitorcount
    <count>
    : This enables multi-monitor
    support; see the section called “Display settings”.
  • --usb on|off: This option
    enables or disables the VM’s virtual USB controller; see the section called “USB settings” for details.
  • --usbehci on|off: This
    option enables or disables the VM’s virtual USB 2.0 controller;
    see the section called “USB settings” for details.

Remote machine settings

The following settings that affect remote machine behavior are
available through VBoxManage
modifyvm
:

  • --vrde on|off: With the
    VirtualBox graphical user interface, this enables or disables the
    VirtualBox remote desktop extension (VRDE) server. Note that if
    you are using VBoxHeadless (see
    the section called “VBoxHeadless, the remote desktop server”), VRDE is enabled by
    default.
  • --vrdeport
    default|<ports>
    : A port or a range of ports
    the VRDE server can bind to; “default” or “0” means port 3389, the
    standard port for RDP. You can specify a comma-separated list of
    ports or ranges of ports. Use a dash between two port numbers to
    specify a range. The VRDE server will bind to one of available ports from the specified
    list. Only one machine can use a given port at a time. For
    example, the option --vrdeport
    5000,5010-5012
    will tell the server to bind to
    one of following ports: 5000, 5010, 5011 or 5012.
  • --vrdeaddress <IP
    address>
    : The IP address of the host network
    interface the VRDE server will bind to. If specified, the server
    will accept connections only on the specified host network
    interface.
  • --vrdeauthtype
    null|external|guest
    : This allows you to choose
    whether and how authorization will be performed; see the section called “RDP authentication” for details.
  • --vrdemulticon on|off: This
    enables multiple connections to the same VRDE server, if the
    server supports this feature; see the section called “Multiple connections to the VRDP server”.
  • --vrdereusecon on|off: This
    specifies the VRDE server behavior when multiple connections are
    disabled. When this option is enabled, the server will allow a new
    client to connect and will drop the existing connection. When this
    option is disabled (this is the default setting), a new connection
    will not be accepted if there is already a client connected to the
    server.
  • --vrdevideochannel on|off:
    This enables video redirection, if it is supported by the VRDE
    server; see the section called “VRDP video redirection”.
  • --vrdevideochannelquality
    <percent>
    : Sets the image quality for video
    redirection; see the section called “VRDP video redirection”.

Teleporting settings

With the following commands for VBoxManage
modifyvm
you can configure a machine to be a target for
teleporting. See the section called “Teleporting” for an
introduction.

  • --teleporter on|off: With
    this setting you turn on or off whether a machine waits for a
    teleporting request to come in on the network when it is started.
    If “on”, when the machine is started, it does not boot the virtual
    machine as it would normally; instead, it then waits for a
    teleporting request to come in on the port and address listed with
    the next two parameters.
  • --teleporterport
    <port>
    , --teleporteraddress
    <address>
    : these must be used with
    –teleporter and tell the virtual machine on which port and
    address it should listen for a teleporting request from another
    virtual machine. <port> can
    be any free TCP/IP port number (e.g. 6000);
    <address> can be any IP
    address or hostname and specifies the TCP/IP socket to bind to.
    The default is “0.0.0.0”, which means any address.
  • --teleporterpassword
    <password>
    : if this optional argument is
    given, then the teleporting request will only succeed if the
    source machine specifies the same password as the one given with
    this command.
  • --teleporterpasswordfile
    <password>
    : if this optional argument is
    given, then the teleporting request will only succeed if the
    source machine specifies the same password as the one specified
    in the file give with this command. Use stdin
    to read the password from stdin.
  • --cpuid <leaf> <eax> <ebx>
    <ecx> <edx>
    : Advanced users can use
    this command before a teleporting operation to restrict the
    virtual CPU capabilities that VirtualBox presents to the guest
    operating system. This must be run on both the source and the
    target machines involved in the teleporting and will then modify
    what the guest sees when it executes the
    CPUID machine instruction. This
    might help with misbehaving applications that wrongly assume that
    certain CPU capabilities are present. The meaning of the
    parameters is hardware dependent; please refer to the AMD or Intel
    processor manuals.

VBoxManage clonevm

This command creates a full or linked copy of an existing virtual
machine.

The clonevm subcommand takes at
least the name of the virtual machine which should be cloned. The following
additional settings can be used to further configure the clone VM
operation:

  • --snapshot <uuid>|<name>:
    Select a specific snapshot where the clone operation should refer
    to. Default is referring to the current state.
  • --mode machine|machineandchildren|all:
    Selects the cloning mode of the operation. If
    machine is selected (the default),
    the current state of the VM without any snapshots is cloned. In the
    machineandchildren mode the snapshot
    provided by --snapshot and all
    child snapshots are cloned. If all
    is the selected mode all snapshots and the current state are cloned.
  • --options link|keepallmacs|keepnatmacs|keepdisknames:
    Allows additional fine tuning of the clone operation. The first
    option defines that a linked clone should be created, which is
    only possible for a machine clone from a snapshot. The next two
    options allow to define how the MAC addresses of every virtual
    network card should be handled. They can either be reinitialized
    (the default), left unchanged
    (keepallmacs) or left unchanged
    when the network type is NAT
    (keepnatmacs). If you add
    keepdisknames all new disk images
    are called like the original once, otherwise they are
    renamed.
  • --name <name>: Select a
    new name for the new virtual machine. Default is “Original Name
    Clone”.
  • --basefolder <basefolder>:
    Select the folder where the new virtual machine configuration should
    be saved in.
  • --uuid <uuid>:
    Select the UUID the new VM should have. This id has to be unique in
    the VirtualBox instance this clone should be registered. Default is
    creating a new UUID.
  • --register:
    Automatically register the new clone in this VirtualBox
    installation. If you manually want register the new VM later, see
    the section called “VBoxManage registervm / unregistervm” for instructions how to do
    so.

VBoxManage import

This command imports a virtual appliance in OVF format by copying
the virtual disk images and creating virtual machines in VirtualBox. See
the section called “Importing and exporting virtual machines” for an introduction to appliances.

The import subcommand takes at
least the path name of an OVF file as input and expects the disk images,
if needed, in the same directory as the OVF file. A lot of additional
command-line options are supported to control in detail what is being
imported and modify the import parameters, but the details depend on the
content of the OVF file.

It is therefore recommended to first run the import subcommand with
the --dry-run or
-n option. This will then print a
description of the appliance’s contents to the screen how it would be
imported into VirtualBox, together with the optional command-line options
to influence the import behavior.

As an example, here is the screen output with a sample appliance
containing a Windows XP guest:

VBoxManage import WindowsXp.ovf --dry-run
Interpreting WindowsXp.ovf...
OK.
Virtual system 0:
 0: Suggested OS type: "WindowsXP"
    (change with "--vsys 0 --ostype <type>"; use "list ostypes" to list all)
 1: Suggested VM name "Windows XP Professional_1"
    (change with "--vsys 0 --vmname <name>")
 3: Number of CPUs: 1
    (change with "--vsys 0 --cpus <n>")
 4: Guest memory: 956 MB (change with "--vsys 0 --memory <MB>")
 5: Sound card (appliance expects "ensoniq1371", can change on import)
    (disable with "--vsys 0 --unit 5 --ignore")
 6: USB controller
    (disable with "--vsys 0 --unit 6 --ignore")
 7: Network adapter: orig bridged, config 2, extra type=bridged
 8: Floppy
    (disable with "--vsys 0 --unit 8 --ignore")
 9: SCSI controller, type BusLogic
    (change with "--vsys 0 --unit 9 --scsitype {BusLogic|LsiLogic}";
    disable with "--vsys 0 --unit 9 --ignore")
10: IDE controller, type PIIX4
    (disable with "--vsys 0 --unit 10 --ignore")
11: Hard disk image: source image=WindowsXp.vmdk,
      target path=/home/user/disks/WindowsXp.vmdk, controller=9;channel=0
    (change controller with "--vsys 0 --unit 11 --controller <id>";
    disable with "--vsys 0 --unit 11 --ignore")

As you can see, the individual configuration items are numbered, and
depending on their type support different command-line options. The import
subcommand can be directed to ignore many such items with a
--vsys X --unit Y --ignore option, where
X is the number of the virtual system (zero unless there are several
virtual system descriptions in the appliance) and Y the item number, as
printed on the screen.

In the above example, Item #1 specifies the name of the target
machine in VirtualBox. Items #9 and #10 specify hard disk controllers,
respectively. Item #11 describes a hard disk image; in this case, the
additional --controller option indicates
which item the disk image should be connected to, with the default coming
from the OVF file.

You can combine several items for the same virtual system behind the
same --vsys option. For example, to
import a machine as described in the OVF, but without the sound card and
without the USB controller, and with the disk image connected to the IDE
controller instead of the SCSI controller, use this:

VBoxManage import WindowsXp.ovf
      --vsys 0 --unit 5 --ignore --unit 6 --ignore --unit 11 --controller 10

VBoxManage export

This command exports one or more virtual machines from VirtualBox
into a virtual appliance in OVF format, including copying their virtual
disk images to compressed VMDK. See the section called “Importing and exporting virtual machines” for an
introduction to appliances.

The export command is simple to
use: list the machine (or the machines) that you would like to export to
the same OVF file and specify the target OVF file after an additional
--output or
-o option. Note that the directory of the
target OVF file will also receive the exported disk images in the
compressed VMDK format (regardless of the original format) and should have
enough disk space left for them.

Beside a simple export of a given virtual machine, you can append
several product information to the appliance file. Use
--product,
--producturl,
--vendor,
--vendorurl and
--version to specify this additional
information. For legal reasons you may add a license text or the content
of a license file by using the --eula and
--eulafile option respectively. As with
OVF import, you must use the --vsys X
option to direct the previously mentioned options to the correct virtual
machine.

For virtualization products which aren’t fully compatible with the
OVF standard 1.0 you can enable a OVF 0.9 legacy mode with the
--legacy09 option.

VBoxManage startvm

This command starts a virtual machine that is currently in the
“Powered off” or “Saved” states.

Note

This is provided for backwards compatibility only. We recommend to
start virtual machines directly by running the respective front-end, as
you might otherwise miss important error and state information that
VirtualBox may display on the console. This is especially important for
front-ends other than VirtualBox, our
graphical user interface, because those cannot display error messages in
a popup window. See the section called “VBoxHeadless, the remote desktop server” for more
information.

The optional --type specifier
determines whether the machine will be started in a window (GUI mode,
which is the default) or whether the output should go through
VBoxHeadless, with VRDE enabled or not;
see the section called “VBoxHeadless, the remote desktop server” for more information. The list of
types is subject to change, and it’s not guaranteed that all types are
accepted by any product variant.

The following values are allowed:

gui
Starts a VM showing a GUI window. This is the default.
headless
Starts a VM without a window for remote display only.

VBoxManage controlvm

The controlvm subcommand allows you
to change the state of a virtual machine that is currently running. The
following can be specified:

  • VBoxManage controlvm <vm>
    pause
    temporarily puts a virtual machine on hold,
    without changing its state for good. The VM window will be painted
    in gray to indicate that the VM is currently paused. (This is
    equivalent to selecting the “Pause” item in the “Machine” menu of
    the GUI.)
  • Use VBoxManage controlvm <vm>
    resume
    to undo a previous
    pause command. (This is equivalent
    to selecting the “Resume” item in the “Machine” menu of the
    GUI.)
  • VBoxManage controlvm <vm>
    reset
    has the same effect on a virtual machine as
    pressing the “Reset” button on a real computer: a cold reboot of the
    virtual machine, which will restart and boot the guest operating
    system again immediately. The state of the VM is not saved
    beforehand, and data may be lost. (This is equivalent to selecting
    the “Reset” item in the “Machine” menu of the GUI.)
  • VBoxManage controlvm <vm>
    poweroff
    has the same effect on a virtual machine
    as pulling the power cable on a real computer. Again, the state of
    the VM is not saved beforehand, and data may be lost. (This is
    equivalent to selecting the “Close” item in the “Machine” menu of
    the GUI or pressing the window’s close button, and then selecting
    “Power off the machine” in the dialog.)After this, the VM’s state will be “Powered off”. From there,
    it can be started again; see the section called “VBoxManage startvm”.
  • VBoxManage controlvm <vm>
    savestate
    will save the current state of the VM to
    disk and then stop the VM. (This is equivalent to selecting the
    “Close” item in the “Machine” menu of the GUI or pressing the
    window’s close button, and then selecting “Save the machine state”
    in the dialog.)After this, the VM’s state will be “Saved”. From there, it can
    be started again; see the section called “VBoxManage startvm”.
  • VBoxManage controlvm <vm> teleport
    --hostname <name> --port <port> [--password
    <password>]
    makes the machine the source of a
    teleporting operation and initiates a teleport to the given target.
    See the section called “Teleporting” for an introduction. If the
    optional password is specified, it must match the password that was
    given to the modifyvm command for
    the target machine; see the section called “Teleporting settings” for details.

A few extra options are available with
controlvm that do not directly affect the
VM’s running state:

  • The setlinkstate<1-N>
    operation connects or disconnects virtual network cables from their
    network interfaces.
  • nic<1-N>
    null|nat|bridged|intnet|hostonly|generic
    : With this, you can
    set, for each of the VM’s virtual network cards, what type of
    networking should be available. They can be not connected to the host
    (null), use network address
    translation (nat), bridged networking
    (bridged) or communicate with other
    virtual machines using internal networking
    (intnet) or host-only networking
    (hostonly) or access to rarely used
    sub-modes
    (generic). These options correspond
    to the modes which are described in detail in the section called “Introduction to networking modes”.
  • usbattach and
    usbdettach make host USB devices
    visible to the virtual machine on the fly, without the need for
    creating filters first. The USB devices can be specified by UUID
    (unique identifier) or by address on the host system.You can use VBoxManage list
    usbhost
    to locate this information.
  • vrde on|off lets you enable or
    disable the VRDE server, if it is installed.
  • vrdeport default|<ports>
    changes the port or a range of ports that the VRDE server can bind to;
    “default” or “0” means port 3389, the standard port for RDP. For
    details, see the description for the
    --vrdeport option in the section called “Serial port, audio, clipboard, remote desktop and USB
    settings”
    .
  • setvideomodehint requests that
    the guest system change to a particular video mode. This requires that
    the Guest Additions be installed, and will not work for all guest
    systems.
  • screenshotpng takes a screenshot
    of the guest display and saves it in PNG format.
  • The setcredentials operation is
    used for remote logons in Windows guests. For details, please refer to
    the section called “Automated guest logons”.
  • The guestmemoryballoon
    operation changes the size of the guest memory balloon, that is,
    memory allocated by the VirtualBox Guest Additions from the guest
    operating system and returned to the hypervisor for re-use by other
    virtual machines. This must be specified in megabytes. For details,
    see the section called “Memory ballooning”.
  • The cpuexecutioncap
    <1-100>
    : This operation controls how much cpu
    time a virtual CPU can use. A value of 50 implies a single virtual CPU
    can use up to 50% of a single host CPU.

VBoxManage discardstate

This command discards the saved state of a virtual machine which is
not currently running, which will cause its operating system to restart
next time you start it. This is the equivalent of pulling out the power
cable on a physical machine, and should be avoided if possible.

VBoxManage adoptstate

If you have a saved state file (.sav)
that is seperate from the VM configuration, you can use this command to
“adopt” the file. This will change the VM to saved state and when you
start it, VirtualBox will attempt to restore it from the saved state file
you indicated. This command should only be used in special setups.

VBoxManage snapshot

This command is used to control snapshots from the command line. A
snapshot consists of a complete copy of the virtual machine settings,
copied at the time when the snapshot was taken, and optionally a virtual
machine saved state file if the snapshot was taken while the machine was
running. After a snapshot has been taken, VirtualBox creates differencing
hard disk for each normal hard disk associated with the machine so that
when a snapshot is restored, the contents of the virtual machine’s virtual
hard disks can be quickly reset by simply dropping the pre-existing
differencing files.

The take operation takes a snapshot
of the current state of the virtual machine. You must supply a name for
the snapshot and can optionally supply a description. The new snapshot is
inserted into the snapshots tree as a child of the current snapshot and
then becomes the new current snapshot.

The delete operation deletes a
snapshot (specified by name or by UUID). This can take a while to finish
since the differencing images associated with the snapshot might need to
be merged with their child differencing images.

The restore operation will restore
the given snapshot (specified by name or by UUID) by resetting the virtual
machine’s settings and current state to that of the snapshot. The previous
current state of the machine will be lost. After this, the given snapshot
becomes the new “current” snapshot so that subsequent snapshots are
inserted under the snapshot from which was restored.

The restorecurrent operation is a
shortcut to restore the current snapshot (i.e. the snapshot from which the
current state is derived). This subcommand is equivalent to using the
“restore” subcommand with the name or UUID of the current snapshot, except
that it avoids the extra step of determining that name or UUID.

With the edit operation, you can
change the name or description of an existing snapshot.

With the showvminfo operation, you
can view the virtual machine settings that were stored with an existing
snapshot.

VBoxManage closemedium

This commands removes a hard disk, DVD or floppy image from a
VirtualBox media registry.[36]

Optionally, you can request that the image be deleted. You will get
appropriate diagnostics that the deletion failed, however the image will
become unregistered in any case.

VBoxManage storageattach

This command attaches/modifies/removes a storage medium connected to
a storage controller that was previously added with the
storagectl command (see the previous
section). The syntax is as follows:

VBoxManage storageattach    <uuid|vmname>
                            --storagectl <name>
                            [--port <number>]
                            [--device <number>]
                            [--type dvddrive|hdd|fdd]
                            [--medium none|emptydrive|
                                      <uuid>|<filename>|host:<drive>|iscsi]
                            [--mtype normal|writethrough|immutable|shareable]
                            [--comment <text>]
                            [--setuuid <uuid>]
                            [--setparentuuid <uuid>]
                            [--passthrough on|off]
                            [--tempeject on|off]
                            [--bandwidthgroup name|none]
                            [--forceunmount]
                            [--server <name>|<ip>]
                            [--target <target>]
                            [--tport <port>]
                            [--lun <lun>]
                            [--encodedlun <lun>]
                            [--username <username>]
                            [--password <password>]
                            [--intnet]

A number of parameters are commonly required; the ones at the end of
the list are required only for iSCSI targets (see below).

The common parameters are:

uuid|vmname
The VM UUID or VM Name. Mandatory.
storagectl
Name of the storage controller. Mandatory. The list of the
storage controllers currently attached to a VM can be obtained
with VBoxManage showvminfo; see
the section called “VBoxManage showvminfo”.
port
The number of the storage controller’s port which is to be
modified. Mandatory, unless the storage controller has only a
single port.
device
The number of the port’s device which is to be modified.
Mandatory, unless the storage controller has only a single device
per port.
type
Define the type of the drive to which the medium is being
attached/detached/modified. This argument can only be omitted if
the type of medium can be determined from either the medium given
with the --medium argument or
from a previous medium attachment.
medium
Specifies what is to be attached. The following values are
supported:

  • “none”: Any existing device should be removed from the
    given slot.
  • “emptydrive”: For a virtual DVD or floppy drive only,
    this makes the device slot behaves like a removeable drive
    into which no media has been inserted.
  • If a UUID is specified, it must be the UUID of a
    storage medium that is already known to VirtualBox (e.g.
    because it has been attached to another virtual machine).
    See the section called “VBoxManage list” for how to list known
    media. This medium is then attached to the given device
    slot.
  • If a filename is specified, it must be the full path
    of an existing disk image (ISO, RAW, VDI, VMDK or other),
    which is then attached to the given device slot.
  • “host:<drive>”: For a virtual DVD or floppy
    drive only, this connects the given device slot to the
    specified DVD or floppy drive on the host computer.
  • “iscsi”: For virtual hard disks only, this allows for
    specifying an iSCSI target. In this case, more parameters
    must be given; see below.

Some of the above changes, in particular for removeable
media (floppies and CDs/DVDs), can be effected while a VM is
running. Others (device changes or changes in hard disk device
slots) require the VM to be powered off.

mtype
Defines how this medium behaves with respect to snapshots
and write operations. See the section called “Special image write modes” for
details.
comment
Any description that you want to have stored with this
medium (optional; for example, for an iSCSI target, “Big storage
server downstairs”). This is purely descriptive and not needed for
the medium to function correctly.
setuuid, setparentuuid
Modifies the UUID or parent UUID of a medium before
attaching it to a VM. This is an expert option. Inappropriate use
can make the medium unusable or lead to broken VM configurations
if any other VM is referring to the same media already. The most
frequently used variant is --setuuid "", which assigns
a new (random) UUID to an image. This is useful to resolve the
duplicate UUID errors if one duplicated an image using file copy
utilities.
passthrough
For a virtual DVD drive only, you can enable DVD writing
support (currently experimental; see the section called “CD/DVD support”).
tempeject
For a virtual DVD drive only, you can configure the behavior
for guest-triggered medium eject. If this is set to “on”, the eject
has only temporary effects. If the VM is powered off and restarted
the originally configured medium will be still in the drive.
bandwidthgroup
Sets the bandwidth group to use for the given device; see
the section called “Limiting bandwidth for disk images”.
forceunmount
For a virtual DVD or floppy drive only, this forcibly
unmounts the DVD/CD/Floppy or mounts a new DVD/CD/Floppy even if
the previous one is locked down by the guest for reading. Again,
see the section called “CD/DVD support” for details.

When “iscsi” is used with the
--medium parameter for iSCSI support —
see the section called “iSCSI servers” –, additional parameters must or can
be used:

server
The host name or IP address of the iSCSI target;
required.
target
Target name string. This is determined by the iSCSI target
and used to identify the storage resource; required.
tport
TCP/IP port number of the iSCSI service on the target
(optional).
lun
Logical Unit Number of the target resource (optional).
Often, this value is zero.
username, password
Username and password for target authentication, if required
(optional).

Note

Currently, username and password are stored without
encryption (i.e. in clear text) in the XML machine
configuration file.

intnet
If specified, connect to the iSCSI target via Internal
Networking. This needs further configuration which is described in
the section called “Access iSCSI targets via Internal
Networking”
.

VBoxManage storagectl

This command attaches/modifies/removes a storage controller. After
this, virtual media can be attached to the controller with the
storageattach command (see the next
section).

The syntax is as follows:

VBoxManage storagectl       <uuid|vmname>
                            --name <name>
                            [--add <ide/sata/scsi/floppy>]
                            [--controller <LsiLogic|LSILogicSAS|BusLogic|
                                          IntelAhci|PIIX3|PIIX4|ICH6|I82078>]
                            [--sataideemulation<1-4> <1-30>]
                            [--sataportcount <1-30>]
                            [--hostiocache on|off]
                            [--bootable on|off]
                            [--remove]

where the parameters mean:

uuid|vmname
The VM UUID or VM Name. Mandatory.
name
Name of the storage controller. Mandatory.
add
Define the type of the system bus to which the storage
controller must be connected.
controller
Allows to choose the type of chipset being emulated for the
given storage controller.
sataideemulation
This specifies which SATA ports should operate in IDE
emulation mode. As explained in the section called “Hard disk controllers: IDE, SATA (AHCI), SCSI, SAS”, by default, this is the case for
SATA ports 1-4; with this command, you can map four IDE channels
to any of the 30 supported SATA ports.
sataportcount
This determines how many ports the SATA controller should
support.
hostiocache
Configures the use of the host I/O cache for all disk images
attached to this storage controller. For details, please see the section called “Host I/O caching”.
bootable
Selects whether this controller is bootable.
remove
Removes the storage controller from the VM config.

VBoxManage bandwidthctl

This command creates/deletes/modifies bandwidth groups of the given
virtual machine:

VBoxManage bandwidthctl    <uuid|vmname>
                          --name <name>
                          [--add disk
                          [--delete]
                          [--limit MB/s]

See the section called “Limiting bandwidth for disk images” for an introduction
to bandwidth limits. The parameters mean:

uuid|vmname
The VM UUID or VM Name. Mandatory.
name
Name of the bandwidth group. Mandatory.
add
Creates a new bandwdith group with the given type.
delete
Deletes a bandwdith group if it isn’t used anymore.
limit
Sets the limit for the given group to the specified amount.
Can be changed while the VM is running.

VBoxManage showhdinfo

This command shows information about a virtual hard disk image,
notably its size, its size on disk, its type and the virtual machines
which use it.

Note

For compatibility with earlier versions of VirtualBox, the
“showvdiinfo” command is also supported and mapped internally to the
“showhdinfo” command.

The disk image must be specified either by its UUID (if the medium
is registered) or by its filename. Registered images can be listed by
VBoxManage list hdds (see the section called “VBoxManage list”
for more information). A filename must be specified as valid path, either
as an absolute path or as a relative path starting from the current
directory.

VBoxManage createhd

This command creates a new virtual hard disk image. The syntax is as
follows:

VBoxManage createhd         --filename <filename>
                            --size <megabytes>
                            [--format VDI|VMDK|VHD] (default: VDI)
                            [--variant Standard,Fixed,Split2G,Stream,ESX]

where the parameters mean:

filename
Allows to choose a file name. Mandatory.
size
Allows to define the image capacity, in 1 MiB units.
Mandatory.
format
Allows to choose a file format for the output file different
from the file format of the input file.
variant
Allows to choose a file format variant for the output file.
It is a comma-separated list of variant flags. Not all
combinations are supported, and specifying inconsistent flags will
result in an error message.

Note

For compatibility with earlier versions of VirtualBox, the
“createvdi” command is also supported and mapped internally to the
“createhd” command.

VBoxManage modifyhd

With the modifyhd command, you can
change the characteristics of a disk image after it has been
created:

VBoxManage modifyhd         <uuid>|<filename>
                            [--type normal|writethrough|immutable|shareable|
                                    readonly|multiattach]
                            [--autoreset on|off]
                            [--compact]
                            [--resize <megabytes>|--resizebyte <bytes>]

Note

Despite the “hd” in the subcommand name, the command works with
all disk images, not only hard disks. For compatibility with earlier
versions of VirtualBox, the “modifyvdi” command is also supported and
mapped internally to the “modifyhd” command.

The disk image to modify must be specified either by its UUID
(if the medium is registered) or by its filename. Registered images
can be listed by VBoxManage list hdds
(see the section called “VBoxManage list” for more information).
A filename must be specified as valid path, either as an absolute path
or as a relative path starting from the current directory.

The following options are available:

  • With the --type argument, you
    can change the type of an existing image between the normal,
    immutable, write-through and other modes; see the section called “Special image write modes” for details.
  • For immutable (differencing) hard disks only, the
    --autoreset on|off option
    determines whether the disk is automatically reset on every VM
    startup (again, see the section called “Special image write modes”). The default
    is “on”.
  • With the --compact option,
    can be used to compact disk images, i.e. remove blocks that only
    contains zeroes. This will shrink a dynamically allocated image
    again; it will reduce the physical size of the
    image without affecting the logical size of the virtual disk.
    Compaction works both for base images and for diff images created as
    part of a snapshot.For this operation to be effective, it is required that free
    space in the guest system first be zeroed out using a suitable
    software tool. For Windows guests, you can use the
    sdelete tool provided by Microsoft.
    Execute sdelete -c in the guest to
    zero the free disk space before compressing the virtual disk
    image. For Linux, use the zerofree utility which
    supports ext2/ext3 filesystems.Please note that compacting is currently only available for
    VDI images. A similar effect can be achieved by zeroing out free
    blocks and then cloning the disk to any other dynamically allocated
    format. You can use this workaround until compacting is also
    supported for disk formats other than VDI.
  • The --resize option allows you
    to change the capacity of an existing image; this adjusts the
    logical size of a virtual disk without affecting
    the physical size much.[37] This currently works only for expanding the capacity of
    VDI and VHD formats, and only for the dynamically allocated variants.
    For example, if you originally created a 10G disk which is now full,
    you can use the --resize 15360
    command to add 5 GByte more space to the virtual disk without
    having to create a new image and copy all data from within a virtual
    machine.

VBoxManage clonehd

This command duplicates a registered virtual hard disk image to a
new image file with a new unique identifier (UUID). The new image can be
transferred to another host system or imported into VirtualBox again using
the Virtual Media Manager; see the section called “The Virtual Media Manager” and the section called “Cloning disk images”. The syntax is as follows:

VBoxManage clonehd         <uuid>|<filename> <outputfile>
                           [--format VDI|VMDK|VHD|RAW|<other>]
                           [--variant Standard,Fixed,Split2G,Stream,ESX]
                           [--existing]

The disk image to clone as well as the target image must be described
either by its UUIDs (if the mediums are registered) or by its filename.
Registered images can be listed by VBoxManage list hdds
(see the section called “VBoxManage list” for more information).
A filename must be specified as valid path, either as an absolute path or
as a relative path starting from the current directory.

The following options are available:

format
Allow to choose a file format for the output file different
from the file format of the input file.
variant
Allow to choose a file format variant for the output file.
It is a comma-separated list of variant flags. Not all
combinations are supported, and specifying inconsistent flags will
result in an error message.
existing
Perform the clone operation to an already existing
destination medium. Only the portion of the source medium which
fits into the destination medium is copied. This means if the
destination medium is smaller than the source only a part of it is
copied, and if the destination medium is larger than the source
the remaining part of the destination medium is unchanged.

Note

For compatibility with earlier versions of VirtualBox, the
“clonevdi” command is also supported and mapped internally to the
“clonehd” command.

VBoxManage convertfromraw

This command converts a raw disk image to a VirtualBox Disk Image
(VDI) file. The syntax is as follows:

VBoxManage convertfromraw   <filename> <outputfile>
                            [--format VDI|VMDK|VHD]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
                            [--uuid <uuid>]
VBoxManage convertfromraw   stdin <outputfile> <bytes>
                            [--format VDI|VMDK|VHD]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
                            [--uuid <uuid>]

where the parameters mean:

format
Select the disk image format to create. Default is
VDI.
variant
Allow to choose a file format variant for the output file.
It is a comma-separated list of variant flags. Not all
combinations are supported, and specifying inconsistent flags will
result in an error message.
uuid
Allow to specifiy the UUID of the output file.

The second form forces VBoxManage to read the content for
the disk image from standard input (useful for using that command in a
pipe).

Note

For compatibility with earlier versions of VirtualBox, the
“convertdd” command is also supported and mapped internally to the
“convertfromraw” command.

VBoxManage getextradata/setextradata

These commands let you attach and retrieve string data to a virtual
machine or to a VirtualBox configuration (by specifying
global instead of a virtual machine
name). You must specify a key (as a text string) to associate the data
with, which you can later use to retrieve it. For example:

VBoxManage setextradata Fedora5 installdate 2006.01.01
VBoxManage setextradata SUSE10 installdate 2006.02.02

would associate the string “2006.01.01” with the key installdate for
the virtual machine Fedora5, and “2006.02.02” on the machine SUSE10. You
could retrieve the information as follows:

VBoxManage getextradata Fedora5 installdate

which would return

VirtualBox Command Line Management Interface Version 4.1.14
(C) 2005-2012 Oracle Corporation
All rights reserved.

Value: 2006.01.01

To remove a key, the setextradata
command must be run without specifying data (only the key), for example:

VBoxManage setextradata Fedora5 installdate

VBoxManage setproperty

This command is used to change global settings which affect the
entire VirtualBox installation. Some of these correspond to the settings
in the “Global settings” dialog in the graphical user interface. The
following properties are available:

machinefolder
This specifies the default folder in which virtual machine
definitions are kept; see the section called “Where VirtualBox stores its files” for
details.
vrdeauthlibrary
This specifies which library to use when “external”
authentication has been selected for a particular virtual machine;
see the section called “RDP authentication” for details.
websrvauthlibrary
This specifies which library the web service uses to
authenticate users. For details about the VirtualBox web service,
please refer to the separate VirtualBox SDK reference (see Chapter 11, VirtualBox programming interfaces).
vrdelibrary
This specifies which library implements the VirtualBox
Remote Desktop Extension.
hwvirtexenabled
This selects whether or not hardware virtualization support
is enabled by default.

VBoxManage usbfilter add/modify/remove

The usbfilter commands are used for
working with USB filters in virtual machines, or global filters which
affect the whole VirtualBox setup. Global filters are applied before
machine-specific filters, and may be used to prevent devices from being
captured by any virtual machine. Global filters are always applied in a
particular order, and only the first filter which fits a device is
applied. So for example, if the first global filter says to hold (make
available) a particular Kingston memory stick device and the second to
ignore all Kingston devices, that memory stick will be available to any
machine with an appropriate filter, but no other Kingston device
will.

When creating a USB filter using usbfilter
add
, you must supply three or four mandatory parameters.
The index specifies the position in the list at which the filter should be
placed. If there is already a filter at that position, then it and the
following ones will be shifted back one place. Otherwise the new filter
will be added onto the end of the list. The
target parameter selects the virtual
machine that the filter should be attached to or use “global” to apply it
to all virtual machines. name is a name
for the new filter and for global filters,
action says whether to allow machines
access to devices that fit the filter description (“hold”) or not to give
them access (“ignore”). In addition, you should specify parameters to
filter by. You can find the parameters for devices attached to your system
using VBoxManage list usbhost. Finally,
you can specify whether the filter should be active, and for local
filters, whether they are for local devices, remote (over an RDP
connection) or either.

When you modify a USB filter using usbfilter
modify
, you must specify the filter by index (see the
output of VBoxManage list usbfilters to
find global filter indexes and that of VBoxManage
showvminfo
to find indexes for individual machines) and
by target, which is either a virtual machine or “global”. The properties
which can be changed are the same as for usbfilter
add
. To remove a filter, use usbfilter
remove
and specify the index and the target.

VBoxManage sharedfolder add/remove

This command allows you to share folders on the host computer with
guest operating systems. For this, the guest systems must have a version
of the VirtualBox Guest Additions installed which supports this
functionality.

Shared folders are described in detail in the section called “Shared folders”.

VBoxManage guestproperty

The “guestproperty” commands allow you to get or set properties of a
running virtual machine. Please see the section called “Guest properties”
for an introduction. As explained there, guest properties are arbitrary
key/value string pairs which can be written to and read from by either the
guest or the host, so they can be used as a low-volume communication
channel for strings, provided that a guest is running and has the Guest
Additions installed. In addition, a number of values whose keys begin with
“/VirtualBox/” are automatically set and maintained by the Guest
Additions.

The following subcommands are available (where
<vm>, in each case, can either be a
VM name or a VM UUID, as with the other VBoxManage commands):

  • enumerate <vm> [--patterns
    <pattern>]
    : This lists all the guest
    properties that are available for the given VM, including the value.
    This list will be very limited if the guest’s service process cannot
    be contacted, e.g. because the VM is not running or the Guest
    Additions are not installed.If --patterns <pattern>
    is specified, it acts as a filter to only list properties that match
    the given pattern. The pattern can contain the following wildcard
    characters:

    • * (asterisk):
      represents any number of characters; for example,
      /VirtualBox*” would match
      all properties beginning with “/VirtualBox”.
    • ? (question mark):
      represents a single arbitrary character; for example,
      fo?” would match both “foo”
      and “for”.
    • | (pipe symbol): can be
      used to specify multiple alternative patterns; for example,
      s*|t*” would match anything
      starting with either “s” or “t”.
  • get <vm>: This
    retrieves the value of a single property only. If the property
    cannot be found (e.g. because the guest is not running), this will
    print

    No value set!
  • set <vm> <property> [<value>
    [--flags <flags>]]
    : This allows you to set a
    guest property by specifying the key and value. If
    <value> is omitted, the
    property is deleted. With --flags
    you can optionally specify additional behavior (you can combine
    several by separating them with commas):

    • TRANSIENT: the value
      will not be stored with the VM data when the VM exits;
    • TRANSRESET: the value
      will be deleted as soon as the VM restarts and/or exits;
    • RDONLYGUEST: the value
      can only be changed by the host, but the guest can only read
      it;
    • RDONLYHOST: reversely,
      the value can only be changed by the guest, but the host can
      only read it;
    • READONLY: a combination
      of the two, the value cannot be changed at all.
  • wait <vm> <pattern> --timeout
    <timeout>
    : This waits for a particular value
    described by “pattern” to change or to be deleted or created. The
    pattern rules are the same as for the “enumerate” subcommand
    above.

VBoxManage guestcontrol

The “guestcontrol” commands allow you to control certain things
inside a guest from the host. Please see the section called “Guest control” for an introduction.

Generally, the syntax is as follows:

VBoxManage guestcontrol <command>

The following subcommands are available (where
<vm>, in each case, can either be a
VM name or a VM UUID, as with the other VBoxManage commands):

  • execute, which allows for
    executing a program/script (process) which already is installed and
    runnable on the guest. This command only works while a VM is up and
    running and has the following syntax:

    VBoxManage guestcontrol <vmname>|<uuid> exec[ute]
                --image <path to program>
                --username <name> [--password <password>]
                [--dos2unix]
                [--environment "<NAME>=<VALUE> [<NAME>=<VALUE>]"]
                [--timeout <msec>] [--unix2dos] [--verbose]
                [--wait-exit] [--wait-stdout] [--wait-stderr]
                -- [[<argument1>] ... [<argumentN>]]

    where the parameters mean:

    uuid|vmname
    The VM UUID or VM name. Mandatory.
    –image “<path to program>”
    Absolute path and process name of process to execute
    in the guest, e.g.
    C:\Windows\System32\calc.exe
    –username <name>
    Name of the user the process should run under. This
    user must exist on the guest OS.
    –password <password>
    Password of the user account specified with
    --username. If not given,
    an empty password is assumed.
    –dos2unix
    –environment
    “<NAME>=<VALUE>”
    One or more environment variables to be set or
    unset.By default, the new process in the guest will be
    created with the standard environment of the guest OS. This
    option allows for modifying that environment. To set/modify
    a variable, a pair of
    NAME=VALUE must be
    specified; to unset a certain variable, the name with no
    value must set, e.g.
    NAME=.Arguments containing spaces must be enclosed in
    quotation marks. More than one
    --environment at a time can
    be specified to keep the command line tidy.

    –timeout <msec>
    Value (in milliseconds) that specifies the time how
    long the started process is allowed to run and how long
    VBoxManage waits for getting output from that process. If no
    timeout is specified, VBoxManage will wait forever until the
    started process ends or an error occured.
    –unix2dos
    –verbose
    Tells VBoxManage to be more verbose.
    –wait-exit
    Waits until the process ends and outputs its
    exit code along with the exit reason/flags.
    –wait-stdout
    Waits until the process ends and outputs its
    exit code along with the exit reason/flags. While waiting
    VBoxManage retrieves the process output collected from stdout.
    –wait-stderr
    Waits until the process ends and outputs its
    exit code along with the exit reason/flags. While waiting
    VBoxManage retrieves the process output collected from stderr.
    [– [<argument1s>] … [<argumentNs>]]
    One or more arguments to pass to the process being
    executed.Arguments containing spaces must be enclosed in
    quotation marks.

    Note

    On Windows there are certain limitations for graphical
    applications; please see Chapter 14, Known limitations for more
    information.

    Examples:

    VBoxManage --nologo guestcontrol "My VM" execute --image "/bin/ls"
              --username foo --password bar --wait-exit --wait-stdout -- -l /usr
    VBoxManage --nologo guestcontrol "My VM" execute --image "c:\\windows\\system32\\ipconfig.exe"
              --username foo --password bar --wait-exit --wait-stdout

    Note that
    the double backslashes in the second example are only required on
    Unix hosts.

    Note

    For certain commands a user name of an existing user account on the guest
    must be specified; anonymous executions are not supported for security reasons. A
    user account password, however, is optional and depends on the guest’s OS security
    policy or rules. If no password is specified for a given user name, an empty password
    will be used. On certain OSes like Windows the security policy may needs to be adjusted
    in order to allow user accounts with an empty password set. Also, global domain rules might
    apply and therefore cannot be changed.

    Starting at VirtualBox 4.1.2 guest process execution by default is limited
    to serve up to 5 guest processes at a time. If a new guest process gets started
    which would exceed this limit, the oldest not running guest process will be discarded
    in order to be able to run that new process. Also, retrieving output from this
    old guest process will not be possible anymore then. If all 5 guest processes
    are still active and running, starting a new guest process will result in an
    appropriate error message.

    To raise or lower the guest process execution limit, either the guest
    property /VirtualBox/GuestAdd/VBoxService/--control-procs-max-kept
    or VBoxService’ command line by specifying --control-procs-max-kept
    needs to be modified. A restart of the guest OS is required afterwards. To serve unlimited
    guest processes, a value of 0 needs to be set (not recommended).

  • copyto, which allows copying
    files from the host to the guest (only with installed Guest
    Additions 4.0 and later).

    VBoxManage guestcontrol <vmname>|<uuid> copyto|cp
                <source on host> <destination on guest>
                --username <name> [--password <password>]
                [--dryrun] [--follow] [--recursive] [--verbose]

    where the parameters mean:

    uuid|vmname
    The VM UUID or VM name. Mandatory.
    source on host
    Absolute path of source file(s) on host to copy over
    to the guest, e.g.
    C:\Windows\System32\calc.exe.
    This also can be a wildcard expression, e.g.
    C:\Windows\System32\*.dll
    destination on guest
    Absolute destination path on the guest, e.g.
    C:\Temp
    –username <name>
    Name of the user the copy process should run under.
    This user must exist on the guest OS.
    –password <password>
    Password of the user account specified with
    --username. If not given,
    an empty password is assumed.
    –dryrun
    Tells VBoxManage to only perform a dry run instead of
    really copying files to the guest.
    –follow
    Enables following symlinks on the host’s
    source.
    –recursive
    Recursively copies files/directories of the specified
    source.
    –verbose
    Tells VBoxManage to be more verbose.
    –flags <flags>
    Additional flags to set. This is not used at the
    moment.
  • createdirectory, which allows
    copying files from the host to the guest (only with installed Guest
    Additions 4.0 and later).

    VBoxManage guestcontrol <vmname>|<uuid> createdir[ectory]|mkdir|md
                <directory to create on guest>
                [--username "<name>"] [--password "<password>"]
                [--parents] [--mode <mode>] [--verbose]

    where the parameters mean:

    uuid|vmname
    The VM UUID or VM name. Mandatory.
    directory to create on guest
    Absolute path of directory/directories to create on
    guest, e.g. D:\Foo\Bar.
    Parent directories need to exist (e.g. in this example
    D:\Foo) when switch
    --parents is omitted. The
    specified user must have appropriate rights to create the
    specified directory.
    –username <name>
    Name of the user the copy process should run under.
    This user must exist on the guest OS.
    –password <password>
    Password of the user account specified with
    --username. If not given,
    an empty password is assumed.
    –parents
    Also creates not yet existing parent directories of
    the specified directory, e.g. if the directory
    D:\Foo of
    D:\Foo\Bar does not exist
    yet it will be created. Without specifying
    --parent the action would
    have failed.
    –mode <mode>
    Sets the permission mode of the specified directory.
    Only octal modes (e.g.
    0755) are supported right
    now.
    –verbose
    Tells VBoxManage to be more verbose.
  • stat, which displays file
    or file system status on the guest.

    VBoxManage guestcontrol <vmname>|<uuid> stat
                <file element(s) to check on guest>
                [--username "<name>"] [--password "<password>"]
                [--verbose]

    where the parameters mean:

    uuid|vmname
    The VM UUID or VM name. Mandatory.
    file element(s) to check on guest
    Absolute path of directory/directories to check on
    guest, e.g. /home/foo/a.out.
    The specified user must have appropriate rights to access
    the given file element(s).
    –username <name>
    Name of the user the copy process should run under.
    This user must exist on the guest OS.
    –password <password>
    Password of the user account specified with
    --username. If not given,
    an empty password is assumed.
    –verbose
    Tells VBoxManage to be more verbose.
  • updateadditions, which allows
    for updating an already installed Guest Additions version on the
    guest (only already installed Guest Additions 4.0 and later).

    VBoxManage guestcontrol <vmname>|<uuid> updateadditions
                [--source "<guest additions .ISO file to use>"] [--verbose]

    where the parameters mean:

    uuid|vmname
    The VM UUID or VM name. Mandatory.
    –source “<guest additions .ISO file to
    use>”
    Full path to an alternative VirtualBox Guest Additions
    .ISO file to use for the Guest Additions update.
    –verbose
    Tells VBoxManage to be more verbose.

VBoxManage debugvm

The “debugvm” commands are for experts who want to tinker with the
exact details of virtual machine execution. Like the VM debugger described
in the section called “The built-in VM debugger”, these commands are only useful if you are
very familiar with the details of the PC architecture and how to debug
software.

The subcommands of “debugvm” all operate on a running virtual
machine. The following are available:

  • With dumpguestcore --filename
    <name>
    , you can create a system dump of the
    running VM, which will be written into the given file. This file
    will have the standard ELF core format (with custom sections); see
    the section called “VM core format”.This corresponds to the
    writecore command in the debugger.
  • The info command is used to
    display info items relating to the VMM, device emulations and
    associated drivers. This command takes one or two arguments: the
    name of the info item, optionally followed by a string containing
    arguments specific to the info item.
    The help info item provides a
    listning of the available items and hints about any optional
    arguments.This corresponds to the info
    command in the debugger.
  • The injectnmi command causes
    a non-maskable interrupt (NMI) in the guest, which might be useful
    for certain debugging scenarios. What happens exactly is dependent
    on the guest operating system, but an NMI can crash the whole guest
    operating system. Do not use unless you know what you’re
    doing.
  • The osdetect command makes the
    VMM’s debugger facility (re-)detection the guest operation
    system.This corresponds to the detect
    command in the debugger.
  • The osinfo command is used to
    display info about the operating system (OS) detected by the VMM’s
    debugger facility.
  • The getregisters command is
    used to display CPU and device registers. The command takes a list
    of registers, each having one of the following forms:

    • register-set.register-name.sub-field
    • register-set.register-name
    • cpu-register-name.sub-field
    • cpu-register-name
    • all

    The all form will cause all
    registers to be shown (no sub-fields). The registers names are
    case-insensitive. When requesting a CPU register the register set
    can be omitted, it will be selected using the value of the
    --cpu option (defaulting to 0).

  • The setregisters command is
    used to change CPU and device registers. The command takes a list
    of register assignments, each having one of the following forms:

    • register-set.register-name.sub-field=value
    • register-set.register-name=value
    • cpu-register-name.sub-field=value
    • cpu-register-name=value

    The value format should be in the same style as what
    getregisters displays, with the
    exception that both octal and decimal can be used instead of
    hexadecimal. The register naming and the default CPU register set
    are handled the same way as with the
    getregisters command.

  • The statistics command can be
    used to display VMM statistics on the command line. The
    --reset option will reset
    statistics. The affected statistics can be filtered with the
    --pattern option, which accepts
    DOS/NT-style wildcards (? and
    *).

VBoxManage metrics

This command supports monitoring the usage of system resources.
Resources are represented by various metrics associated with the host
system or a particular VM. For example, the host system has a
CPU/Load/User metric that shows the
percentage of time CPUs spend executing in user mode over a specific
sampling period.

Metric data is collected and retained internally; it may be
retrieved at any time with the VBoxManage metrics
query
subcommand. The data is available as long as the
background VBoxSVC process is alive. That
process terminates shortly after all VMs and frontends have been
closed.

By default no metrics are collected at all. Metrics collection does
not start until VBoxManage metrics setup
is invoked with a proper sampling interval and the number of metrics to be
retained. The interval is measured in seconds. For example, to enable
collecting the host processor and memory usage metrics every second and
keeping the 5 most current samples, the following command can be
used:

VBoxManage metrics setup --period 1 --samples 5 host CPU/Load,RAM/Usage

Metric collection can only be enabled for started VMs. Collected
data and collection settings for a particular VM will disappear as soon as
it shuts down. Use VBoxManage metrics list
subcommand to see which metrics are currently available.
You can also use --list option with any
subcommand that modifies metric settings to find out which metrics were
affected.

Note that the VBoxManage metrics
setup
subcommand discards all samples that may have been
previously collected for the specified set of objects and metrics.

To enable or disable metrics collection without discarding the data
VBoxManage metrics enable and
VBoxManage metrics disable subcommands
can be used. Note that these subcommands expect metrics, not submetrics,
like CPU/Load or RAM/Usage as parameters. In
other words enabling CPU/Load/User while disabling
CPU/Load/Kernel is not supported.

The host and VMs have different sets of associated metrics.
Available metrics can be listed with VBoxManage metrics
list
subcommand.

A complete metric name may include an aggregate function. The name
has the following form:
Category/Metric[/SubMetric][:aggregate].
For example, RAM/Usage/Free:min stands
for the minimum amount of available memory over all retained data if
applied to the host object.

Subcommands may apply to all objects and metrics or can be limited
to one object or/and a list of metrics. If no objects or metrics are given
in the parameters, the subcommands will apply to all available metrics of
all objects. You may use an asterisk
(“*“) to explicitly specify that the
command should be applied to all objects or metrics. Use “host” as the
object name to limit the scope of the command to host-related metrics. To
limit the scope to a subset of metrics, use a metric list with names
separated by commas.

For example, to query metric data on the CPU time spent in user and
kernel modes by the virtual machine named “test”, you can use the
following command:

VBoxManage metrics query test CPU/Load/User,CPU/Load/Kernel

The following list summarizes the available subcommands:

list
This subcommand shows the parameters of the currently existing
metrics. Note that VM-specific metrics are only available when a
particular VM is running.
setup
This subcommand sets the interval between taking two samples
of metric data and the number of samples retained internally. The
retained data is available for displaying with the
query subcommand. The --list
option shows which metrics have been modified as
the result of the command execution.
enable
This subcommand “resumes” data collection after it has been
stopped with disable subcommand. Note that specifying
submetrics as parameters will not enable underlying metrics. Use
--list to find out if the command
did what was expected.
disable
This subcommand “suspends” data collection without affecting
collection parameters or collected data. Note that specifying
submetrics as parameters will not disable underlying metrics. Use
--list to find out if the command
did what was expected.
query
This subcommand retrieves and displays the currently retained
metric data.

Note

The query subcommand does not remove or
“flush” retained data. If you query often enough you will see
how old samples are gradually being “phased out” by new
samples.

collect
This subcommand sets the interval between taking two samples
of metric data and the number of samples retained internally. The
collected data is displayed periodically until Ctrl-C is pressed
unless the --detach option is
specified. With the --detach
option, this subcommand operates the same way as setup
does. The --list option shows which
metrics match the specified filter.

VBoxManage hostonlyif

With “hostonlyif” you can change the IP configuration of a host-only
network interface. For a description of host-only networking, please
refer to the section called “Host-only networking”. Each host-only interface is
identified by a name and can either use the internal DHCP server or a
manual IP configuration (both IP4 and IP6).

VBoxManage dhcpserver

The “dhcpserver” commands allow you to control the DHCP server that
is built into VirtualBox. You may find this useful when using internal or
host-only networking. (Theoretically, you can enable it for a bridged
network as well, but that will likely cause conflicts with other DHCP
servers in your physical network.)

Use the following command line options:

  • If you use internal networking for a virtual network adapter
    of a virtual machine, use VBoxManage dhcpserver add
    --netname <network_name>
    , where
    <network_name> is the same
    network name you used with VBoxManage modifyvm
    <vmname> --intnet<X>
    <network_name>
    .
  • If you use host-only networking for a virtual network adapter
    of a virtual machine, use VBoxManage dhcpserver add
    --ifname <hostonly_if_name>
    instead, where
    <hostonly_if_name> is the
    same host-only interface name you used with
    VBoxManage modifyvm <vmname>
    --hostonlyadapter<X>
    <hostonly_if_name>
    .Alternatively, you can also use the –netname option as with
    internal networks if you know the host-only network’s name; you can
    see the names with VBoxManage list
    hostonlyifs
    (see the section called “VBoxManage list”
    above).

The following additional parameters are required when first adding a
DHCP server:

  • With --ip, specify the IP
    address of the DHCP server itself.
  • With --netmask, specify the
    netmask of the network.
  • With --lowerip and
    --upperip, you can specify the
    lowest and highest IP address, respectively, that the DHCP server
    will hand out to clients.

Finally, you must specify --enable
or the DHCP server will be created in the disabled state, doing
nothing.

After this, VirtualBox will automatically start the DHCP server for
given internal or host-only network as soon as the first virtual machine
which uses that network is started.

Reversely, use VBoxManage dhcpserver
remove
with the given --netname
<network_name>
or --ifname
<hostonly_if_name>
to remove the DHCP server again
for the given internal or host-only network.

To modify the settings of a DHCP server created earlier with
VBoxManage dhcpserver add, you can use
VBoxManage dhcpserver modify for a given
network or host-only interface name.

VBoxManage extpack

The “extpack” command allows you to add or remove VirtualBox
extension packs, as described in the section called “Installing VirtualBox and extension packs”.

  • To add a new extension pack, use VBoxManage
    extpack install <tarball>
    . This command
    will fail if an older version of the same extension pack is already
    installed. The optional --replace
    parameter can be used to uninstall the old package before the new
    package is installed.
  • To remove a previously installed extension pack, use
    VBoxManage extpack uninstall
    <name>
    . You can use
    VBoxManage list extpacks to show
    the names of the extension packs which are currently installed;
    please see the section called “VBoxManage list” also. The optional
    --force parameter can be used to
    override the refusal of an extension pack to be uninstalled.
  • The VBoxManage extpack
    cleanup
    command can be used to remove temporary
    files and directories that may have been left behind if a previous
    install or uninstall command failed.

[36] Before VirtualBox 4.0, it was necessary to call VBoxManage
openmedium before a medium could be attached to a virtual machine;
that call “registered” the medium with the global VirtualBox media
registry. With VirtualBox 4.0 this is no longer necessary; media are
added to media registries automatically. The “closemedium” call has
been retained, however, to allow for explicitly removing a medium from
a registry.

[37] Image resizing was added with VirtualBox 4.0.

Publicado em VIRTUAL BOX | Marcado com , , , , , | Deixe um comentário

Passo a Passo para resolver problemas ao iniciar o Oracle Grid Infrastructure

Troubleshooting Grid Infrastructure startup

This has been an interesting story today when one of my blades decided to reboot after an EXT3 journal error. The hard facts first:

  • Oracle Linux 5.5 with kernel 2.6.18-194.11.4.0.1.el5
  • Oracle 11.2.0.2 RAC
  • Bonded NICs for private and public networks
  • BL685-G6 with 128G RAM

First I noticed the node had problems when I tried to get all databases configured on the cluster. I got the dreaded “cannot communicate with the CRSD”

1
[oracle@node1.example.com] $ srvctl config database
2 PRCR-1119 : Failed to look up CRS resources of database type
3 PRCR-1115 : Failed to find entities of type resource that match filters (TYPE ==ora.database.type) and contain attributes DB_UNIQUE_NAME,ORACLE_HOME,VERSION
4
Cannot communicate with crsd

Not too great, especially since everything worked when I left yesterday. What could have gone wrong?An obvious reason for this could be a reboot, and fair enough, there has been one:

[grid@node1.example.com] $ uptime
09:09:22 up  2:40,  1 user,  load average: 1.47, 1.46, 1.42

The next step was to check if the local CRS stack was up, or better, to check what was down. Sometimes it’s only crsd which has a problem. In my case everything was down:

01 [grid@node1.example.com] $ crsctl check crs
02 CRS-4638: Oracle High Availability Services is online
03 CRS-4535: Cannot communicate with Cluster Ready Services
04 CRS-4530: Communications failure contacting Cluster Synchronization Services daemon
05 CRS-4534: Cannot communicate with Event Manager
06 [grid@node1.example.com] $ crsctl check cluster -all
07 **************************************************************
08 node1:
09 CRS-4535: Cannot communicate with Cluster Ready Services
10 CRS-4530: Communications failure contacting Cluster Synchronization Services daemon
11 CRS-4534: Cannot communicate with Event Manager
12 **************************************************************
13 CRS-4404: The following nodes did not reply within the allotted time:
14 node2,node3, node4, node5, node6, node7, node8

The CRS-4404 was slightly misleading, I assumed all cluster nodes were down after a clusterwide reboot. Sometimes a single node reboot triggers worse things. However, logging on to node 2 I saw that all but the first node were ok.

CRSD really needs CSSD to be up and running, and CSSD requires the OCR to be there. I wanted to know if the OCR was impacted in any way:

[grid@node1.example.com] $ ocrcheck
PROT-602: Failed to retrieve data from the cluster registry
PROC-26: Error while accessing the physical storage
ORA-29701: unable to connect to Cluster Synchronization Service

Well it seemed that the OCR location was unavailable. I know that on this cluster, the OCR is stored on ASM. Common reasons for the PROC-26 error are

  • Unix admin upgrades the kernel but forgets to upgrade the ASMLib kernel module (common grief with ASMLib!)
  • Storage is not visible on the host, i.e. SAN connectivity broken/taken away (happens quite frequently with storage/sys admin unaware of ASM)
  • Permissions not set correctly on the block devices (not an issue when using asmlib)

I checked ASMLib and it reported a working status:

[oracle@node1.example.com] $ /etc/init.d/oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes

That was promising, /dev/oracleasm/ was populated and the matching kernel modules loaded. /etc/init.d/oracleasm listdisks listed all my disks as well. Physical storage not accessible (PROC-26) seemed a bit unlikely now.

I could rule out permission problems since ASMLib was working fine, and I also rule out the kernel upgrade/missing libs problem by comparing the RPM with the kernel version: they matched. So maybe it’s storage related?

Why did the node go down?

Good question, usually to be asked towards the unix administration team. Luckily I have a good contact placed right inside that team and I could get the following excerpt from /var/log/messages arond the time of the crash (6:31 this morning):

01 Mar 17 06:26:06 node1 kernel: EXT3-fs error (device dm-2): ext3_free_blocks: Freeing blocks in system zones - Block = 8192116, count = 1
02 Mar 17 06:26:06 node1 kernel: Aborting journal on device dm-2.
03 Mar 17 06:26:06 node1 kernel: EXT3-fs error (device dm-2) in ext3_free_blocks_sb: Journal has aborted
04 Mar 17 06:26:06 node1 last message repeated 55 times
05 Mar 17 06:26:06 node1 kernel: EXT3-fs error (device dm-2): ext3_free_blocks: Freeing blocks in system zones - Block = 8192216, count = 1
06 Mar 17 06:26:06 node1 kernel: EXT3-fs error (device dm-2) in ext3_free_blocks_sb: Journal has aborted
07 Mar 17 06:26:06 node1 last message repeated 56 times
08 Mar 17 06:26:06 node1 kernel: EXT3-fs error (device dm-2): ext3_free_blocks: Freeing blocks in system zones - Block = 8192166, count = 1
09 Mar 17 06:26:06 node1 kernel: EXT3-fs error (device dm-2) in ext3_free_blocks_sb: Journal has aborted
10 Mar 17 06:26:06 node1 last message repeated 55 times
11 Mar 17 06:26:06 node1 kernel: EXT3-fs error (device dm-2): ext3_free_blocks: Freeing blocks in system zones - Block = 8192122, count = 1
12 Mar 17 06:26:06 node1 kernel: EXT3-fs error (device dm-2) in ext3_free_blocks_sb: Journal has aborted
13 Mar 17 06:26:06 node1 last message repeated 55 times
14 Mar 17 06:26:06 node1 kernel: EXT3-fs error (device dm-2): ext3_free_blocks: Freeing blocks in system zones - Block = 8192140, count = 1
15 Mar 17 06:26:06 node1 kernel: EXT3-fs error (device dm-2) in ext3_free_blocks_sb: Journal has aborted
16 Mar 17 06:26:06 node1 last message repeated 56 times
17 Mar 17 06:26:06 node1 kernel: EXT3-fs error (device dm-2): ext3_free_blocks: Freeing blocks in system zones - Block = 8192174, count = 1
18 Mar 17 06:26:06 node1 kernel: EXT3-fs error (device dm-2) in ext3_free_blocks_sb: Journal has aborted
19 Mar 17 06:26:06 node1 last message repeated 10 times
20 Mar 17 06:26:06 node1 kernel: EXT3-fs error (device dm-2) in ext3_reserve_inode_write: Journal has aborted
21 Mar 17 06:26:06 node1 kernel: EXT3-fs error (device dm-2) in ext3_truncate: Journal has aborted
22 Mar 17 06:26:06 node1 kernel: EXT3-fs error (device dm-2) in ext3_reserve_inode_write: Journal has aborted
23 Mar 17 06:26:06 node1 kernel: EXT3-fs error (device dm-2) in ext3_orphan_del: Journal has aborted
24 Mar 17 06:26:06 node1 kernel: EXT3-fs error (device dm-2) in ext3_reserve_inode_write: Journal has aborted
25 Mar 17 06:26:06 node1 kernel: EXT3-fs error (device dm-2) in ext3_delete_inode: Journal has aborted
26 Mar 17 06:26:06 node1 kernel: __journal_remove_journal_head: freeing b_committed_data
27 Mar 17 06:26:06 node1 kernel: ext3_abort called.
28 Mar 17 06:26:06 node1 kernel: EXT3-fs error (device dm-2): ext3_journal_start_sb: Detected aborted journal
29 Mar 17 06:26:06 node1 kernel: Remounting filesystem read-only
30 Mar 17 06:26:06 node1 kernel: __journal_remove_journal_head: freeing b_committed_data
31 Mar 17 06:26:06 node1 snmpd[25651]: Connection from UDP: [127.0.0.1]:19030
32 Mar 17 06:26:06 node1 snmpd[25651]: Received SNMP packet(s) from UDP: [127.0.0.1]:19030
33 Mar 17 06:26:06 node1 snmpd[25651]: Connection from UDP: [127.0.0.1]:19030
34 Mar 17 06:26:06 node1 snmpd[25651]: Connection from UDP: [127.0.0.1]:41076
35 Mar 17 06:26:06 node1 snmpd[25651]: Received SNMP packet(s) from UDP: [127.0.0.1]:41076
36 Mar 17 06:26:09 node1 kernel: SysRq : Resetting
37 Mar 17 06:31:15 node1 syslogd 1.4.1: restart.

So it looks like a file system error triggered the reboot-I’m glad the box came back up ok on it’s own. The $GRID_HOME/log/hostname/alerthostname.log didn’t show anything specific to storage. Normally you would see that it starts counting a node down if it lost contact to the voting disks (in this case OCR and voting disks share the same diskgroup).

And why does Clusteware not start?

After some more investigation it seems there was no underlying problem with the storage, so I tried to manually start the cluster, traililng the ocssd.log file for possible clues.

[root@node1 ~]# crsctl start cluster
CRS-2672: Attempting to start ‘ora.cssd’ on ‘node1′
CRS-2674: Start of ‘ora.cssd’ on ‘node1′ failed
CRS-2679: Attempting to clean ‘ora.cssd’ on ‘node1′
CRS-2681: Clean of ‘ora.cssd’ on ‘node1′ succeeded
CRS-5804: Communication error with agent process
CRS-2672: Attempting to start ‘ora.cssdmonitor’ on ‘node1′
CRS-2676: Start of ‘ora.cssdmonitor’ on ‘node1′ succeeded
CRS-2672: Attempting to start ‘ora.cssd’ on ‘node1′

… the command eventually failed. The ocssd.log file showed this:

01 ...
02 2011-03-17 09:47:49.073: [GIPCHALO][1081923904] gipchaLowerProcessNode: no valid interfaces found to node for 10996354 ms, node 0x2aaab008a260 { host 'node4', haName 'CSS_lngdsu1-c1', srcLuid b04d4b7b-a7491097, dstLuid 00000000-00000000 numInf 0, contigSeq 0, lastAck 0, lastValidAck 0, sendSeq [61 : 61], createTime 10936224, flags 0x4 }
03 2011-03-17 09:47:49.084: [GIPCHALO][1081923904] gipchaLowerProcessNode: no valid interfaces found to node for 10996364 ms, node 0x2aaab008a630 { host 'node6', haName 'CSS_lngdsu1-c1', srcLuid b04d4b7b-2f6ece1c, dstLuid 00000000-00000000 numInf 0, contigSeq 0, lastAck 0, lastValidAck 0, sendSeq [61 : 61], createTime 10936224, flags 0x4 }
04 2011-03-17 09:47:49.113: [    CSSD][1113332032]clssgmWaitOnEventValue: after CmInfo State  val 3, eval 1 waited 0
05 2011-03-17 09:47:49.158: [    CSSD][1090197824]clssnmvDHBValidateNCopy: node 2, node2, has a disk HB, but no network HB, DHB has rcfg 176226183, wrtcnt, 30846440, LATS 10996434, lastSeqNo 30846437, uniqueness 1300108895, timestamp 1300355268/3605443434
06 2011-03-17 09:47:49.158: [    CSSD][1090197824]clssnmvDHBValidateNCopy: node 3, node3, has a disk HB, but no network HB, DHB has rcfg 176226183, wrtcnt, 31355257, LATS 10996434, lastSeqNo 31355254, uniqueness 1300344405, timestamp 1300355268/10388584
07 2011-03-17 09:47:49.158: [    CSSD][1090197824]clssnmvDHBValidateNCopy: node 4, node4, has a disk HB, but no network HB, DHB has rcfg 176226183, wrtcnt, 31372473, LATS 10996434, lastSeqNo 31372470, uniqueness 1297097908, timestamp 1300355268/3605182454
08 2011-03-17 09:47:49.158: [    CSSD][1090197824]clssnmvDHBValidateNCopy: node 5, node5, has a disk HB, but no network HB, DHB has rcfg 176226183, wrtcnt, 31384686, LATS 10996434, lastSeqNo 31384683, uniqueness 1297098093, timestamp 1300355268/3604696294
09 2011-03-17 09:47:49.158: [    CSSD][1090197824]clssnmvDHBValidateNCopy: node 6, node6, has a disk HB, but no network HB, DHB has rcfg 176226183, wrtcnt, 31388819, LATS 10996434, lastSeqNo 31388816, uniqueness 1297098327, timestamp 1300355268/3604712934
10 2011-03-17 09:47:49.158: [    CSSD][1090197824]clssnmvDHBValidateNCopy: node 7, node7, has a disk HB, but no network HB, DHB has rcfg 176226183, wrtcnt, 29612975, LATS 10996434, lastSeqNo 29612972, uniqueness 1297685443, timestamp 1300355268/3603054884
11 2011-03-17 09:47:49.158: [    CSSD][1090197824]clssnmvDHBValidateNCopy: node 8, node8, has a disk HB, but no network HB, DHB has rcfg 176226183, wrtcnt, 31203293, LATS 10996434, lastSeqNo 31203290, uniqueness 1297156000, timestamp 1300355268/3604855704
12 2011-03-17 09:47:49.161: [    CSSD][1085155648]clssnmvDHBValidateNCopy: node 3, node33, has a disk HB, but no network HB, DHB has rcfg 176226183, wrtcnt, 31355258, LATS 10996434, lastSeqNo 31355255, uniqueness 1300344405, timestamp 1300355268/10388624
13 2011-03-17 09:47:49.161: [    CSSD][1085155648]clssnmvDHBValidateNCopy: node 4, node4, has a disk HB, but no network HB, DHB has rcfg 176226183, wrtcnt, 31372474, LATS 10996434, lastSeqNo 31372471, uniqueness 1297097908, timestamp 1300355268/3605182494
14 2011-03-17 09:47:49.161: [    CSSD][1085155648]clssnmvDHBValidateNCopy: node 5, node5, has a disk HB, but no network HB, DHB has rcfg 176226183, wrtcnt, 31384687, LATS 10996434, lastSeqNo 31384684, uniqueness 1297098093, timestamp 1300355268/3604696304
15 2011-03-17 09:47:49.161: [    CSSD][1085155648]clssnmvDHBValidateNCopy: node 6, node6, has a disk HB, but no network HB, DHB has rcfg 176226183, wrtcnt, 31388821, LATS 10996434, lastSeqNo 31388818, uniqueness 1297098327, timestamp 1300355268/3604713224
16 2011-03-17 09:47:49.161: [    CSSD][1085155648]clssnmvDHBValidateNCopy: node 7, node7, has a disk HB, but no network HB, DHB has rcfg 176226183, wrtcnt, 29612977, LATS 10996434, lastSeqNo 29612974, uniqueness 1297685443, timestamp 1300355268/3603055224
17 2011-03-17 09:47:49.197: [    CSSD][1094928704]clssnmvDHBValidateNCopy: node 2, node2, has a disk HB, but no network HB, DHB has rcfg 176226183, wrtcnt, 30846441, LATS 10996474, lastSeqNo 30846438, uniqueness 1300108895, timestamp 1300355269/3605443654
18 2011-03-17 09:47:49.197: [    CSSD][1094928704]clssnmvDHBValidateNCopy: node 3, node3, has a disk HB, but no network HB, DHB has rcfg 176226183, wrtcnt, 31355259, LATS 10996474, lastSeqNo 31355256, uniqueness 1300344405, timestamp 1300355268/10389264
19 2011-03-17 09:47:49.197: [    CSSD][1094928704]clssnmvDHBValidateNCopy: node 8, node8, has a disk HB, but no network HB, DHB has rcfg 176226183, wrtcnt, 31203294, LATS 10996474, lastSeqNo 31203291, uniqueness 1297156000, timestamp 1300355269/3604855914
20 2011-03-17 09:47:49.619: [    CSSD][1116485952]clssnmSendingThread: sending join msg to all nodes
21 ...

The interesting bit is the “BUT NO NETWORK HB”, i.e. something must be wrong with the network configuration. I quickly checked the output of ifconfig and found a missing entry for my private interconnect. This is defined in the GPnP profile if you are unsure:

1 <gpnp:Network-Profile>
2  <gpnp:HostNetwork id="gen" HostName="*">
3  <gpnp:Network id="net1" IP="17x.xx.x9.1x0" Adapter="bond1.251" Use="cluster_interconnect" />
4  </gpnp:HostNetwork>
5 </gpnp:Network-Profile>

Now that’s a starting point! If tried to bring up bond1.251, but that failed:

[root@node1 network-scripts]# ifup bond1.251
ERROR: trying to add VLAN #251 to IF -:bond1:-  error: Invalid argument
ERROR: could not add vlan 251 as bond1.251 on dev bond1

The “invalid argument” didn’t mean too much to me, so I ran ifup with the “-x” flag to get more information about which argument was invalid:

01 [root@node1 network-scripts]# which ifup
02 /sbin/ifup
03 [root@node1 network-scripts]# view /sbin/ifup
04 # turned out it's a shell script! Let's run with debug output enabled
05 [root@node1 network-scripts]# bash -x /sbin/ifup bond1.251
06 + unset WINDOW
07 ...
08 + MATCH='^(eth|hsi|bond)[0-9]+\.[0-9]{1,4}$'
09 + [[ bond1.251 =~ ^(eth|hsi|bond)[0-9]+\.[0-9]{1,4}$ ]]
10 ++ echo bond1.251
11 ++ LC_ALL=C
12 ++ sed 's/^[a-z0-9]*\.0*//'
13 + VID=251
14 + PHYSDEV=bond1
15 + [[ bond1.251 =~ ^vlan[0-9]{1,4}? ]]
16 + '[' -n 251 ']'
17 + '[' '!' -d /proc/net/vlan ']'
18 + test -z ''
19 + VLAN_NAME_TYPE=DEV_PLUS_VID_NO_PAD
20 + /sbin/vconfig set_name_type DEV_PLUS_VID_NO_PAD
21 + is_available bond1
22 + LC_ALL=
23 + LANG=
24 + ip -o link
25 + grep -q bond1
26 + '[' 0 = 1 ']'
27 + return 0
28 + check_device_down bond1
29 + echo bond1
30 + grep -q :
31 + LC_ALL=C
32 + ip -o link
33 + grep -q 'bond1[:@].*,UP'
34 + return 1
35 + '[' '!' -f /proc/net/vlan/bond1.251 ']'
36 + /sbin/vconfig add bond1 251
37 ERROR: trying to add VLAN #251 to IF -:bond1:-  error: Invalid argument
38 + /usr/bin/logger -p daemon.info -t ifup 'ERROR: could not add vlan 251 as bond1.251 on dev bond1'
39 + echo 'ERROR: could not add vlan 251 as bond1.251 on dev bond1'
40 ERROR: could not add vlan 251 as bond1.251 on dev bond1
41 + exit 1

Hmmm so it seemed that the underlying interface bond1 was missing-which was true. The output of ifconfig didn’t show it as configured, and trying to start it manually using ifup bond1 failed as well. It turned out that the ifcfg-bond1 file was missing and had to be recreated from the documentation. All network configuration files in Red Hat based systems belong into /etc/sysconfig/network-scripts/ifcfg-interfaceName. With the recreated file in place, I was back in the running:

[root@node1 network-scripts]# ll *bond1*
-rw-r–r– 1 root root 129 Mar 17 10:07 ifcfg-bond1
-rw-r–r– 1 root root 168 May 19  2010 ifcfg-bond1.251
[root@node1 network-scripts]# ifup bond1
[root@node1 network-scripts]# ifup bond1.251
Added VLAN with VID == 251 to IF -:bond1:-
[root@node1 network-scripts]#

Now I could try to start the lower stack again:

CRS-2672: Attempting to start ‘ora.cssdmonitor’ on ‘node1′
CRS-2676: Start of ‘ora.cssdmonitor’ on ‘node1′ succeeded
CRS-2672: Attempting to start ‘ora.cssd’ on ‘node1′
CRS-2676: Start of ‘ora.cssd’ on ‘node1′ succeeded
CRS-2672: Attempting to start ‘ora.cluster_interconnect.haip’ on ‘node1′
CRS-2672: Attempting to start ‘ora.ctssd’ on ‘node1′
CRS-2676: Start of ‘ora.ctssd’ on ‘node1′ succeeded
CRS-2672: Attempting to start ‘ora.evmd’ on ‘node1′
CRS-2676: Start of ‘ora.evmd’ on ‘node1′ succeeded
CRS-2676: Start of ‘ora.cluster_interconnect.haip’ on ‘node1′ succeeded
CRS-2679: Attempting to clean ‘ora.asm’ on ‘node1′
CRS-2681: Clean of ‘ora.asm’ on ‘node1′ succeeded
CRS-2672: Attempting to start ‘ora.asm’ on ‘node1′
CRS-2676: Start of ‘ora.asm’ on ‘node1′ succeeded
CRS-2672: Attempting to start ‘ora.crsd’ on ‘node1′
CRS-2676: Start of ‘ora.crsd’ on ‘node1′ succeeded
[root@node1 network-scripts]# crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online

Brilliant-problem solved. This is actually the first time that an incorrect network config prevented a cluster I looked after from starting. The best indication in this case is in the gipcd log file, but it didn’t occur to me to have a look at is as the error was clearly related to storage.

Publicado em RAC, TUTORIAL | Marcado com , , , , , , , , , , , , , , , , | Deixe um comentário

Lista completa de produtos Oracle para Download

Lista completa de produtos Oracle para Download separados por categoria.

Java


Banco de dados


Middleware


Servers and Storage Systems


Ferramentas de Desenvolvimento


Aplicação


Industries


Search


Enterprise Management


Drivers


Utilitários & Plugins


Ferramentas de migração


Archived Products


Publicado em DOWNLOADS | Marcado com , , , , , , , , | Deixe um comentário

Faça um tour 3D nas Maquinas Exadata e todas outras máquinas e equipamentos ORACLE

Exadata/Exalogic 3D Demos

 Exadata X2-2
 Exadata X2-8

 Exalogic X2-2

SPARC Servers and SuperCluster 3D Demos

 SPARC Enterprise M9000-64
 SPARC Enterprise M5000
 SPARC SuperCluster T4-4
 SPARC T4-1B Server
 SPARC T3-1B Server
 SPARC T4-1
 SPARC T4-2
 SPARC T4-4
 SPARC T3-1
 SPARC T3-2
 SPARC T3-4

Sun Blade 6000 Modular Systems 3D Demos

 Sun Blade 6000 Modular System
 Sun Blade X6270 M3

Sun x86 Servers and Database Appliance 3D Demos

 Sun Fire X4170 M3
 Sun Fire X4800 M2
 Sun Fire X4800
 Sun Fire X4470 M2
 Sun Blade X6270 M3
 Sun Fire X4170 M2
 Sun Fire X2270 M2
 Oracle Database Appliance

Netra Carrier-Grade Servers 3D Demos

 Netra T5440
 Netra X4270 Server

 Sun Netra CT900 Blade Server

NAS Storage 3D Demos

 Sun ZFS Storage 7420 Appliance

Tape Storage 3D Demos

 StorageTek SL8500
 StorageTek SL3000

 StorageTek SL500

SAN Storage 3D Demos

 PIllar Axiom 600 Storage System
 Sun Storage 6780 Array

Related Products 3D Demos

 External I/O Expansion Unit

Publicado em EXADATA | Marcado com , , , , | Deixe um comentário

COMANDO DD NO LINUX

Usando o comando dd

Uns meses atrás, estudando para a LPI me deparei com o comando dd e resolvi compartilhar como faço o uso do mesmo.

O comando dd é um clássico dos ambientes Unix-Like, com ele você pode fazer uma cópia exata de um arquivo, ou seja uma cópia bit a bit. Sintaxe básica:

dd if=origem of=destino

Exemplo:

$ dd if=/home/felipe/Downloads/netbeans-6.9.1-ml-linux.sh of=/home/felipe/netbeans.sh
543986+0 registros de entrada
543986+0 registros de saída
278520832 bytes (279 MB) copiados, 11,7956 s, 23,6 MB/s

O que foi feito?

Foi feito uma cópia do arquivo “netbeans-6.9.1-ml-linux.sh”, localizado em “/home/felipe/Downloads/”, onde o arquivo copiado foi para /home/felipe, com o nome de netbeans.sh.

Cópia do HD para um arquivo:

# dd if=/dev/sda of=~/backup_hd.img

Será feita uma cópia exata do HD dentro do diretório do root com o nome “backup_hd.img”. Se quiser restaurar o “backp_hd.img” no /dev/sda2 (lembre que o sda2 deve ter pelo menos o mesmo tamanho do arquivo “backup.hd” se não os resultados poderão ser desastrosos):

# dd if=backup_hd.img of=/dev/sda2

Cópia de partição para o partição:

# dd if=/dev/sda9 of=/dev/sda11

Será feita cópia da partição /dev/sda9 para a /dev/sda11.

Fazendo uma cópia do HD para um arquivo compactado:

# dd if=/dev/sda1 | gzip > backup_hd.img.gz

e para descompactar:

# gzip -d -c backup_hd.img.gz | dd of=/dev/sda2

O comando acima está descompactando o arquivo beckup_hd.img.gz no HD em /dev/sda2.

Criar uma imagem ISO:

# dd if=diretorio of=iso_do_diretorio.iso

Para visualizar progresso de cópia de arquivos, vá em outro terminal e execute:

$ watch df -h

Para converter todos as letras maiúsculas de um documento para letras minúsculas:

$ dd if=ficheiro1 of=ficheiro2 conv=lcase

Se quisermos converter todas as letras do ficheiro2 para maiúsculas:

$ dd if=ficheiro2 of=ficheiro3 conv=ucase

Para zerar (formatar) o seu HD (use com cuidado!):

# dd if=/dev/zero of=/dev/hda

Gerar senhas de forma (pseudo) aleatória:

$ dd if=/dev/random bs=2 count=6 | base64 –
r2KWFW83e9nTniVR
6+0 registros de entrada
6+0 registros de saída
12 bytes (12 B) copiados, 0,000100641 s, 119 kB/s

Publicado em LINUX, TUTORIAL | Marcado com , , | Deixe um comentário

CRIAÇÃO DE DISCOS COMPARTILHADOS NO VIRTUAL BOX

VBoxManage createhd --filename c:\storage\asm1.vdi --size 5120 --format VDI --variant Fixed
VBoxManage createhd --filename c:\storage\asm2.vdi --size 5120 --format VDI --variant Fixed
VBoxManage createhd --filename c:\storage\asm3.vdi --size 5120 --format VDI --variant Fixed
VBoxManage createhd --filename c:\storage\asm4.vdi --size 5120 --format VDI --variant Fixed
VBoxManage createhd --filename c:\storage\asm5.vdi --size 5120 --format VDI --variant Fixed
VBoxManage createhd --filename c:\storage\ocr_vote.vdi --size 1024 --format VDI --variant Fixed

VBoxManage modifyhd c:\storage\asm1.vdi --type shareable
VBoxManage modifyhd c:\storage\asm2.vdi --type shareable
VBoxManage modifyhd c:\storage\asm3.vdi --type shareable
VBoxManage modifyhd c:\storage\asm4.vdi --type shareable
VBoxManage modifyhd c:\storage\asm5.vdi --type shareable
VBoxManage modifyhd c:\storage\ocr_vote.vdi --type shareable

—————————————————————————-

$ mkdir -p $HOME/VirtualBox\ VMs/harddisks
$ cd $HOME/VirtualBox\ VMs/harddisks
$
$ # Create the disks and associate them with VirtualBox as virtual media.
$ VBoxManage createhd --filename asm1.vdi --size 5120 --format VDI --variant Fixed
$ VBoxManage createhd --filename asm2.vdi --size 5120 --format VDI --variant Fixed
$ VBoxManage createhd --filename asm3.vdi --size 5120 --format VDI --variant Fixed
$ VBoxManage createhd --filename asm4.vdi --size 5120 --format VDI --variant Fixed
$ VBoxManage createhd --filename asm5.vdi --size 5120 --format VDI --variant Fixed
$
$ # Connect them to the VM.
$ VBoxManage storageattach rac1 --storagectl "SATA Controller" --port 1 --device 0 --type hdd --medium asm1.vdi --mtype shareable
$ VBoxManage storageattach rac1 --storagectl "SATA Controller" --port 2 --device 0 --type hdd --medium asm2.vdi --mtype shareable
$ VBoxManage storageattach rac1 --storagectl "SATA Controller" --port 3 --device 0 --type hdd --medium asm3.vdi --mtype shareable
$ VBoxManage storageattach rac1 --storagectl "SATA Controller" --port 4 --device 0 --type hdd --medium asm4.vdi --mtype shareable
$ VBoxManage storageattach rac1 --storagectl "SATA Controller" --port 5 --device 0 --type hdd --medium asm5.vdi --mtype shareable
$
$ # Make shareable.
$ VBoxManage modifyhd asm1.vdi --type shareable
$ VBoxManage modifyhd asm2.vdi --type shareable
$ VBoxManage modifyhd asm3.vdi --type shareable
$ VBoxManage modifyhd asm4.vdi --type shareable
$ VBoxManage modifyhd asm5.vdi --type shareable

———————————————————————————————————————————–
comando para clonar vm

VBoxManage clonehd c:\storage\disk2.vdi c:\storage\diskR2.vdi

=====================================================================================================================
$ # Following line for VirtualBox 4.0.0 upwards
$ cd $HOME/VirtualBox\ VMs/harddisks
$
$ # All versions (can omit “–mtype shareable” for versions below 4.0.0)
$ VBoxManage storageattach racbx2 –storagectl “SATA Controller” –port 1 –device 0 –type hdd –medium c:\storage\asm1.vdi –mtype shareable
$ VBoxManage storageattach racbx2 –storagectl “SATA Controller” –port 2 –device 0 –type hdd –medium c:\storage\asm2.vdi –mtype shareable
$ VBoxManage storageattach racbx2 –storagectl “SATA Controller” –port 3 –device 0 –type hdd –medium c:\storage\asm3.vdi –mtype shareable
$ VBoxManage storageattach racbx2 –storagectl “SATA Controller” –port 4 –device 0 –type hdd –medium c:\storage\asm4.vdi –mtype shareable
$ VBoxManage storageattach racbx2 –storagectl “SATA Controller” –port 5 –device 0 –type hdd –medium c:\storage\asm5.vdi –mtype shareable

===============================================================================================================================================
comando para montar volume compartilhado no virtual box.

mount -t vboxsf HARD_DISK /root/Desktop/share

mount -t vboxsf HARD_DISK /home/oracle/CDGRID

COMANDOS PARA INSTALAR VÁRIOS PACOTES AO MESMO TEMPO NO LINUX

rpm -Uvh unixODBC-devel-2.2.11-7.1.x86_64.rpm
oracleasm-kernel-version.arch.rpm \
oracleasmlib-version.arch.rpm

Publicado em LINUX, SHELL SCRIPT, VIRTUAL BOX | Marcado com , , , , , , , , , , , , , | Deixe um comentário

Configurando ssh no VirtualBox

Configurando ssh no VirtualBox

Para configurar o acesso ssh na minha máquina virtual executei os seguintes comandos:

1
$ VBoxManage setextradata <guestname> "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222
2
$ VBoxManage setextradata <guestname> "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22
3
$ VBoxManage setextradata <guestname> "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP

É necessário trocar <guestname> pelo nome da sua máquina virtual. E para acessar é só digitar:

1
$ ssh -l user -p 2222 localhost
É possível também ver as configurações feitas em sua máquina virtual, com o comando:

1
$ VBoxManage getextradata <guestname> enumerate

E para excluir as configurações:

1
$ VBoxManage setextradata <guestname> “VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort”

——————————————————————————————————

1
$ C:\Program Files\Oracle\VirtualBox\VBoxManage setextradata RACBOX1 "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222
2
$ C:\Program Files\Oracle\VirtualBox\VBoxManage setextradata RACBOX1 "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22
3
$ C:\Program Files\Oracle\VirtualBox\VBoxManage setextradata RACBOX1 "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP
Publicado em VIRTUAL BOX | Marcado com , , , | Deixe um comentário

COMO REMOVER UMA INSTALAÇÃO DE RAC 11gR2 EM LINUX

Este script ajuda enquanto você está fazendo instalação do Oracle 11gr2 RAC e dá algo de errado e você tem que remover o software em ambiente Linux.

###############################################################
#!/bin/bash
# Purpose : Cleanup RAC 11g failed install
###############################################################

clear

echo “********************************”
echo “*** Removendo Oracle Rac 11g ***”
echo “********************************”

rm -f  /etc/init.d/init.cssd
rm -f  /etc/init.d/init.crs
rm -f  /etc/init.d/init.crsd
rm -f  /etc/init.d/init.evmd
rm -f  /etc/rc2.d/K96init.crs
rm -f  /etc/rc2.d/S96init.crs
rm -f  /etc/rc3.d/K96init.crs
rm -f  /etc/rc3.d/S96init.crs
rm -f  /etc/rc5.d/K96init.crs
rm -f  /etc/rc5.d/S96init.crs
rm -f /etc/rc2.d/S96ohasd
rm -f /etc/rc2.d/K96ohasd
rm -f /etc/rc3.d/S96ohasd
rm -f /etc/rc3.d/K96ohasd
rm -f /etc/rc5.d/S96ohasd
rm -f /etc/rc5.d/K96ohasd
rm -f  /etc/inittab.crs
rm -rf /u01/app
rm -rf /u01/grid
rm -rf /u01/lost+found
rm -rf /u01/oraInventory
rm -rf /u01/tmp
rm -f  /etc/oraInst.loc
rm -f  /etc/oratab
rm -rf /etc/oracle
cp /etc/inittab.orig /etc/inittab

echo ” ”

echo “********************************************”
echo “*** Reconfigurando pastas Oracle Rac 11g ***”
echo “********************************************”

mkdir -p /u01/app/product/11.2.0/db_1
mkdir -p /u01/grid/product/11.2.0/grid_1
mkdir -p /u01/tmp
chown -R oracle.oinstall /u01
chmod -R 775 /u01
############################  END ###############################

Publicado em RAC, TUTORIAL | Marcado com , , , , , , , | Deixe um comentário

Configurando a rede no Linux via linha de comando

Configurando a Rede no Linux via linha de comando

Bem, seja qual for o ambiente gráfico que você use ou distribuição, existem comandos do próprio sistema GNU/Linux que são comuns a todas elas, deste modo exporei aqui como usar elas para configurar rapidamente sua interface de rede.

Para configurar uma rede, você precisa de 4 elementos IP, máscara da rede, gateway e DNS.

Configuração automática

Se você souber esses dados é fácil, se não souber ou quiser detectá-los automaticamente você pode usar o comando:

# dhcpcd
ou
# dhcpcd ethX

(onde X é o número de sua interface de rede, caso você possua mais de uma placa de rede)

Configuração manual

Para configurar manualmente você precisa apenas dos comandos ifconfig (define as configurações da sua placa de rede) e route(controla o roteamento de pacotes, como os dados saem da sua rede).

Antes de mais nada, vamos ver se sua placa de rede foi reconhecida pelo Linux.

Para ver se sua placa está ativa digite:

# ifconfig

Para ver se o sistema a reconheceu:

# lspci 
ou
# lsusb

(se sua placa for usb)

Procure pela palavra “Ethernet”, normalmente ou similar:

# ifconfig -a

Se o seu sistema detectou sua placa de rede, ela deve aparecer listada seja pelo lspci/lsusb ou ifconfig.

Para configurar a rede, vejamos a sintaxe dos comandos que usaremos e em seguida darei um exemplo prático.

ifconfig [identificador da placa de rede] [IP] netmask [IP mask] up

route add default gw [IP]

OBS: Existem outros meios para fazer tais operações de configuração com o route e o ifconfig, para isso leia o manual de tais comandos.

Exemplo prático

Vamos supor que eu tenha uma rede com 3 computadores, 1 sendo o gateway do meu sistema, que possui, claro, duas placas de rede.

IPs dos 3 computadores: 10.0.0.1 , 10.0.0.2, 10.0.0.3
Máscara: 255.255.0.0
DNS: 200.192.168.1
Gateway: 10.0.0.1

1° PC

No terminal como root:

# ifconfig eth0 10.0.0.3 netmask 255.255.0.0 up
# route add default gw 10.0.0.1

2° PC

No terminal como root:

# ifconfig eth0 10.0.0.2 netmask 255.255.0.0 up
# route add default gw 10.0.0.1

3° PC – Gateway com duas placas de rede

No terminal como root:

# ifconfig eth0 10.0.0.1 netmask 255.255.0.0 up
# ifconfig eth1 200.17.11.1 netmask 255.255.255.0 up

# route add default gw 10.0.0.1 eth0
# route add default gw 200.17.11.2 eth1

Por último, para configurar o DNS, edite o arquivo /etc/resolv.conf de cada máquina e preencha da seguinte maneira:

nameserver 200.192.168.1
Repare que você pode configurar infinitos DNS, tantos quantos queira :-)

Para adicionar mais um por exemplo, só adicionamos 1 linha:

nameserver 200.192.168.1
nameserver 200.128.68.20
Muito bem? Espero que ninguém mais tenha dificuldades em configurar uma rede no Linux com isso :-)

PS: Se você estava era querendo saber como configurar a rede via conexão discada com o modem no Linux e chegou aqui por acaso, um bom lugar para começar é linmodems.org. Lá há grande chances que você encontre o drive para seu modem por lá.

Pronto.

Publicado em LINUX, TUTORIAL | Marcado com , , , , , , , | Deixe um comentário

Sequência de Inicialização do Oracle RAC 11gR2

ohasd -> orarootagent -> ora.cssdmonitor : Monitors CSSD and node health (along with the cssdagent). Try to restart the node if the node is unhealthy.

                                    -> ora.ctssd : Cluster Time Synchronization Services Daemon

                                    -> ora.crsd   -> oraagent  -> ora.LISTENER.lsnr

-> ora.LISTENER_SCAN.lsnr

-> ora.ons

-> ora.eons

-> ora.asm

-> ora.DB.db

 

->orarootagent -> ora.nodename.vip

                                                                                 -> ora.net1.network

                                                                                 -> ora.gns.vip

                                                                                 -> ora.gnsd

                                                                                 -> ora.SCANn.vip

 

-> cssdagent -> ora.cssd : Cluster Synchronization Services

 

 

-> oraagent -> ora.mdnsd : Used for DNS lookup
-> ora.evmd

-> ora.asmd

-> ora.gpnpd : Grid Plug and Play = adding a node to the cluster is easier (we need less configuration for the new node)

 

 

If a resource is written using blue & bold font => resource owned by root. The other resources are owner by oracle. (all this on UNIX environment)

When a resource is managed by root, we need to run the command crsctl as root or oracle.

 

 

Clusterware Resource Status Check

 

$ crsctl status resource -t

--------------------------------------------------------------------------------
NAME                  TARGET  STATE      SERVER            STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr    

                      ONLINE  ONLINE    tzdev1rac
ONLINE  ONLINE    tzdev2rac
ora.asm              

                      OFFLINE OFFLINE   tzdev1rac
OFFLINE OFFLINE   tzdev2rac
ora.eons             

                      ONLINE  ONLINE    tzdev1rac
ONLINE  ONLINE    tzdev2rac
ora.gsd
OFFLINE OFFLINE   tzdev1rac
OFFLINE OFFLINE   tzdev2rac
ora.net1.network
ONLINE  ONLINE    tzdev1rac
ONLINE  ONLINE    tzdev2rac
ora.ons
ONLINE  ONLINE    tzdev1rac
ONLINE  ONLINE    tzdev2rac
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1                     ONLINE  ONLINE    tzdev1rac
ora.LISTENER_SCAN2.lsnr
1                     ONLINE  ONLINE    tzdev2rac
ora.LISTENER_SCAN3.lsnr
1                     ONLINE  ONLINE    tzdev2rac
ora.oc4j
1                     OFFLINE OFFLINE
ora.scan1.vip
1                     ONLINE  ONLINE    tzdev1rac
ora.scan2.vip
1                     ONLINE  ONLINE    tzdev2rac
ora.scan3.vip
1                     ONLINE  ONLINE    tzdev2rac
ora.trezor.db
1                     ONLINE  ONLINE    tzdev1rac         Open
2                     ONLINE  ONLINE    tzdev2rac
ora.tzdev1rac.vip
1                     ONLINE  ONLINE    tzdev1rac
ora.tzdev2rac.vip
1                     ONLINE  ONLINE    tzdev2rac

 

crsctl start has    -> start all the clusterware services/ resources (including the database server and the listener);
crsctl stop has    
-> stop all the clusterware services/ resources (including the database server and the listener);

 

crsctl check has -> to check if ohasd is running/ stopped

 

Publicado em RAC, TUTORIAL | Marcado com , , | Deixe um comentário

Como aumentar o tamanho do disco no Virtual Box

  • Nos passos abaixo, explicarei com detalhes como aumentar o tamanho do seu disco virtual (.vdi):

[Post escrito e testado baseado no VirtualBox 3.2.6]

1º passo: Criar um novo disco com um espaço maior.

Para isso, abra o gerenciador de disco virtual ou o virtual disk manager e crie um novo disco.

Para os exemplos a seguir, eu criei o disco novoDisco30GB.vdi

2º passo: Escolher a máquina virtual com o disco a ser modificado

Ao decidir qual vm terá seu disco alterado, certifique-se que ela está desligada e entre nas configurações da VM. Vá até a categoria storage ou armazenamento:

O objetivo é fazer com que a vm fique com 2 discos. No meu exemplo utilizei a controladora SATA. Mas funciona da mesma forma para que utiliza controladora IDE. Basta colocar o segundo disco como IDE Primary Slave.

3º passo: Fazer o download da imagem .iso do Gparted live cd

Acesse a url: http://sourceforge.net/projects/gparted/ e baixe a ultima versão da imagem .iso

O Gparted é um editor de partição gratuito, que vamos usar para redimensionar as partições conforme desejarmos.

4º passo: Adicionar o liveCD Gparted na maquina virtual

Adicione o .iso na sua vm de forma que fique assim:

Para quem usa controlador IDE, basta adicionar na posição IDE Secondary Master.

Certifique-se também que a ordem de boot da sua VM está com o CD-Rom antes do HD:

5º passo: Iniciar a VM pelo LiveCD do GParted

Ligue a VM e inicie escolhendo a opção do GParted:

Ele irá oferecer alguma opções de formato do teclado e linguagem. Você pode ir pelas configuraões padrões apertando “ENTER” em todas as opções oferecidas até chegar na tela do sistema:

6º passo: Verificar os nomes dos discos

Assim que o GParted iniciar, o programa já deve vir aberto. Se não estiver em execução, você pode inicar o GParted pelo icone na área de trabalho.

Depois disso, você precisa anotar os nomes dos discos:

Então, no próximo passo nós iremos copiar todo o conteúdo do disco /dev/sda (20 GB) para o /dev/sdb (30 GB).

7º passo: Transferindo os dados de um disco para o outro

Antes de fazer a cópia, certifique-se de ter fechado o programa do GParted. Agora abra o terminal, clicando no icone na área de trabalho.

Agora, basta rodar o comando:
sudo dd if=/dev/sda of=/dev/sdb

Atenção: Tenha certeza que está fazendo a cópia certa. if é o caminho do disco de origem, neste caso o sda que é o de 20GB. E of é o caminho do disco de destino, neste caso o sdb que é o de 30GB.

Dependendo do tamanho do disco, esse processo pode demorar um pouco. Para testar o meu exemplo, levou cerca de 22 minutos para transferir todo o hd de 20GB para o de 30GB.

8º passo: Redimensionar a partição do novo disco

Feito o passo anterior, feche o terminal e reinicie a vm, abrindo pelo liveCD do GParted novamente. Essa reinicialização não é obrigatória, mas serve para evitar problemas no novo disco, já que por algum motivo o GParted fica reclamando de que nao consegue ler os dados da nova partição.

Bom, depois de reiniciar, vamos redimensionar o novo HD.

Se for uma VM windows, basta clicar com o botão direito sobre o /dev/sdb1 e clicar em redimensionar / resize e arrastar a partição até preencher todo o espaço disponível:

Depois disso basta apertar em aplicar e pular para o próximo passo…

No meu caso, estou redimensionando em um HD com linux, então entre a partição do sistema e o espaço disponível tem a partição do swap.

Para poder redimensionar o disco, você precisa remover o “swap” que está em nosso caminho.

Depois de deletar o swap, clique com o botão direito e depois em redimensionar / resize para chegar na tela abaixo:

Arraste o tamanho do disco até o limite desejado. Lembre-se de deixar um pouco de espaço para recriar o swap novamente. Geralmente o swap é criado com o dobro do tamanho da memória da máquina.

Depois de aumentar a partição primária, crie no espaço que sobrou uma partição estendida, onde iremos definir o novo swap.

Criado a partição estendida, crie dentro dela uma partição lógica com o file-system “linux swap”

Pronto. Terminamos de redimensionar o disco.

Agora basta aplicar as modificações e esperar um pouco.

Feito isso, já podemos desligar a vm.

9º passo: Ligar a VM com o novo disco

Remova o disco antigo da vm, remova o cd de boot e depois ligue a vm com o novo disco !

Agora, basta aproveitar a sua VM com um disco maior

OBS: Caso você esteja usando Unbuto será necessátio trocar o uuid (id do disco) do swap.

Como fizemos algumas modificações nas partições, esses ids mudaram. Então precisaremos editar o arquivo /etc/fstab .

 

Com o comando: ls -la /dev/disk/by-uuid/ você pode listar os novos ids e a onde eles estão montados.

Nesse caso, basta atualizar o arquivo fstab com o uuid do disco em sda1 e depois em sda5.

Reinicie a VM e estará tudo funcionando corretamente.

Publicado em LINUX, TUTORIAL, VIRTUAL BOX | Marcado com , , , , | Deixe um comentário

COMO AUMENTAR A AREA SWAP NO LINUX

Este artigo visa resolver o problema de pessoas que estão com pouca memória física ou por algum motivo precisam aumentar o tamanho de sua partição SWAP.

NOTA: Esta solução adiciona ao tamanho do SWAP que já existe o tamanho que você definir, então se você tem 500MB e adicionar mais 500MB, logo ficara com 1GB de SWAP.1) Primeiramente, vamos ver quanto temos de SWAP:# free 

OBS: Neste artigo usaremos o seguinte exemplo, uma máquina com 300MB iniciais de SWAP e aumentaremos para 800MB, mas você pode usar este exemplo e redimensionar seu SWAP a seu gosto, desde que tenha espaço em HD para isso.

2) Em seguida iremos criar um diretório no / (raiz) com o nome de swap:

# mkdir swap 

3) Agora criaremos a swap propriamente dita:

# cd swap 

4) Já que temos 300MB, teremos que adicionar 500MB, então faça a seqüência:

# dd if=/dev/zero of=/swap/swapfile bs=1024 count=500000
500000+0 records in
500000+0 records out
# mkswap /swap/swapfile 
Setting up swapspace version 1, size = 509595904 bytes
# swapon /swap/swapfile
Pronto, agora vamos ver se rolou:# free 5) Vamos adicionar agora a nova entrada no FSTAB para montar no boot:

# cd /etc
# vi fstab** Acrescentamos a linha embaixo da outra palavra swap do FSTAB 
/swap/swapfile swap swap defaults 0 0
Salve e saia do FSTAB.Pronto está feito, você acabou de aumentar sua SWAP.Se quiser voltar ao tamanho original, delete o arquivo que esta em /swap e remova a linha do /etc/fstab.

—–

COMO ALTERAR O NOME DO SWAP

o comando mkswap -L  muda o nome da partição de SWAP.

No nosso caso o novo nome será SWAP-i2o/hda3 presumindo que a fisicamente está na partição /dev/hd3

Será necessário executar o seguinte comando para criar o novo nome de partição SWAP:

/sbin/mkswap -c -v1 -L SWAP-i2o/hdb3 /dev/i2o/hdb3

Depois voce precisará editar /etc/fstab para incluir a seguinte linha:

LABEL=SWAP-i2o/hdb3 swap swap defaults 0 0

Executar o comando swapon -a

Pronto, agora sua partição esta com outro nome.

Publicado em LINUX, TUTORIAL | Marcado com , , , , , | Deixe um comentário

CONFIGURANDO SSH NO WINDOWS

O SSH é uma ferramenta que dispensa comentários. Além se permitir administrar máquinas Linux remotamente e transferir arquivos de forma segura, ele pode ser usado para rodar programas gráficos remotamente, criar túneis criptografados e até mesmo fazer backups, com a ajuda do rsync.

O SSH é como um iceberg: mais de 90% dos recursos estão escondidos sob a superfície ;). Você pode se aprofundar no uso do SSH no meu guia de acesso remoto (http://www.hardware.com.br/guias/acesso-remoto/). A dica de hoje é sobre como acessar máquinas Linux, com o SSH ativo através do Windows.

Existem diversas versões do SSH. A maioria das distribuições Linux inclui o OpenSSH, que não possui um cliente for Windows. No entanto, isso não chega a ser um problema, pois o SSH é um protocolo aberto, o que permite o desenvolvimento de clientes para várias plataformas, inclusive Windows. Eles são usados por muita gente para administrar servidores Linux remotamente.

Um exemplo de cliente simples e gratuito é o Putty, que inclui também o PSFTP, um cliente de SFTP, que permite também transferir arquivos usando comandos de transferência como put, get, cd, lcd, pwd, lpwd, etc. Ambos podem ser baixados no: http://www.putty.nl/.

Usar o Putty para se conectar a servidores Linux é bem simples, pois ele não precisa sequer ser instalado. Basta baixar o arquivo e executar.

index_html_m23effb76

O putty também permite criar túneis. Comece colocando o IP ou domínio do servidor a que vai se conectar no campo “Host Name (or IP address)” na tela principal, como se estivesse abrindo uma conexão normal. Mas, ao invés de clicar no “open”, acesse a opção “Connection > SSH > Tunels”.

Na “source port” vai a porta do seu micro, que receberá o túnel (3128, por exemplo) e no “Destination” vai o endereço IP ou domínio do servidor remoto a que você está se conectando, seguido da porta, como em “meuservidor.com.br:3128″. Clique no “Add” (você pode adicionar várias portas) e em seguida no “Open”, para abrir a conexão.

index_html_53132bcc

Outro exemplo de cliente SSH é a versão da SSH Security, que possui vários recursos mas é gratuita apenas para universidades e usuários domésticos e por isso bem menos usado. O link é: http://www.ssh.com.

O Putty, o SSH da SSH Security e o OpenSSH são intercompatíveis. A grande limitação é que esses dois clientes são limitados ao modo texto, pois, para exibir aplicativos gráficos via SSH, é necessário que o sistema cliente possua um servidor X, coisa que o Windows naturalmente não possui nativamente. Ao tentar abrir qualquer aplicativo gráfico, você recebe a fatídica mensagem “cannot connect to X server”.

Também não existem servidores SSH “de verdade” para Windows, que permitam administrar um servidor Windows remotamente. As soluções se “servidores” SSH para Windows se concentram nos recursos de encriptação para transferências de arquivos e criação de túneis.

Voltando ao tema principal, existem alguns servidores X para Windows, que abrem uma sessão do X dentro de uma janela, como o X-Win32 (http://xwin32.dk) e o WinaXe (um Shareware de 90 dólares que pode ser baixado no http://labf.com). O Putty pode ser configurado para utilizar um desses servidores (de forma a rodar aplicativos gráficos), marcando a opção “Enable X11 forwarding”, em “Connection > SSH > Tunnels”. Embora não seja uma solução muito elegante, realmente funciona:

index_html_m30f1eee3

Mas, a melhor opção para rodar aplicativos gráficos via SSH no Windows é o Cliente NX, que (uma vez configurado o servidor) é muito mais simples de usar e oferece uma performance muito melhor que a obtida ao rodar aplicativos gráficos através do SSH “puro”, graças às várias otimizações utilizadas.

Você pode baixar o cliente NX for Windows no http://nomachine.com. No site, você pode fazer um “testdrive”, acessando um dos servidores da empresa. O NX trabalha sobre o SSH, implementando um conjunto de otimizações para reduzir o tráfego e a latência das conexões. O resultado é algo similar ao VNC, mas com um desempenho bem melhor. Ao contrário do putty, no NX tudo é feito através de um cliente gráfico:

index_html_m7f47465b

Na hora de transferir arquivos via SFTP, uma boa opção é o Filezilla, um cliente de FTP gráfico e bastante amigável, que inclui suporte ao SFTP. Você pode baixá-lo no: http://filezilla.sourceforge.net/

Para conectar a servidores SSH, use a opção “File > Site Manager > New Site” (os campos na tela principal servem apenas para servidores FTP). Na tela seguinte, informe o IP do servidor, a porta (22) e a conta de acesso. Uma vez conectado, você acesso os arquivos usando a interface tradicional dos clientes de FTP, com as duas janelas, uma mostrando os arquivos locais e outra mostrando os do servidor. Para transferir arquivos, basta arrastá-los entre as duas.

Publicado em LINUX | Marcado com , , , , , , , , | Deixe um comentário

COMPONENTES DO ORACLE 11gR2 CLUSTERWARE

1) Cluster Ready Services (CRS)

 

          FunctionalityRAC resource monitoring/ management   ==> all changes are written in the OCR

– start, stop of the resouces

– failover of the application resources

– node recovery

 – automatically restarts t RAC resources when a failure occurs.

RAC resources: a database, an instance, a service, a listener, a virtual IP (VIP) address, an application process

 

 

Daemon process (on AIX, UNIX, Linux):  crsd

 

Run as (on AIX, UNIX, Linux): root

 

ps -ef | grep crsd
root 221524 1 0 May 26 – 3:33 /oracle/crs/10.2/bin/crsd.bin reboot
 

Failure of the process: the crsd restarts automatically, without restarting the node.

 

 

CRSd can run in 2 modes:

  

     reboot mode -> when crsd starts all the resources are restarted.

  

     restart mode -> when crsd starts the resources are started as these were before the shutdown.

 

   When CRS is installed on the cluster where a 3rd-party clusterware is integrated (there are 2 clusterware on the cluster)

 

-> CRSd manages:

–  Oracle RAC services and resources

 

 

When CRS is the ONLY ONE clusterware on the cluster

 

-> CRSd manages:

–  Oracle RAC services and resources

–  the node membership functionality  (by CSSd, but CSS in managed by CRSd)

 

 

   COMMENT:

In order to start the crsd we need:

– the public interface, the private interface and the virtual IP (VIP) should be up and running !

– these IPs must be pingable to each other.

 

 

 

2) Cluster Synchronization Services (CSS)

 

Functionalityenables basic cluster services    ==> new/ lost node information is written to OCR

 

                                   – the node membership functionality

– basic locking

 

Daemon process (on AIX, UNIX, Linux):  ocssd

 

Run as (on AIX, UNIX, Linux): oracle


ps -ef | grep ocssd
oracle 229642 241940 1 May 26 – 3:36 /oracle/crs/10.2/bin/ocssd.bin
Failure of the process: Node restart.

 

 

 

3) Event Management (EVM)

 

Functionality: – a background process that publishes events that crs creates.

 

Daemon process (on AIX, UNIX, Linux):  evmd

Run as (on AIX, UNIX, Linux): oracle


ps -ef | grep evmd
oracle 229633 241356 1 May 26 – 3:36 /oracle/crs/10.2/bin/evmd.bin
Failure of the process: the evmd restarts automatically, without restarting the node.

 

 

 

4) Oracle Notification Service (ONS)

 

Functionality: – a publish and subscribe service for communicating Fast Application Notification (FAN) events to clients.

 

Daemon process (on AIX, UNIX, Linux):  ons

Run as (on AIX, UNIX, Linux): oracle


ps -ef | grep ons
oracle 233968 1 0 May 28 – 0:00 /oracle/crs/10.2/opmn/bin/ons -d
Failure of the process:  –

 

 

 

5) RACG

 

Functionality: – Runs server callout scripts when FAN events occur.

 

Daemon process (on AIX, Linux):  racgimon (AIX), racgmain (Linux)

Run as (on AIX, UNIX, Linux): oracle


ps -ef | grep racgimon
oracle 385292 1 0 11:40:08 – 0:03 /oracle/db/10.2/bin/racgimon startd MYDB

Failure of the process:  –

 

 

 

6) Process Monitor Daemon (OPROCD)    (cssdagent from 11gR2)

 

Functionality: – is the I/O fencing solution which monitors the Cluster Node (I/O fencing )

– when the Nx node fails, no other node can modify the Nx node resources

 

Daemon process (on AIX, Linux):  racgimon (AIX), racgmain (Linux)

Run as (on AIX, UNIX, Linux): root


ps -ef | grep oprocd
root 184346 201058 0 May 27 – 0:06 /oracle/crs/10.2/bin/oprocd run -t 1000 -m 400

COMMENT: In this case oprocd wakes up every minute to get the current time. If it is within 400ms range with the last result it will go back to sleep again otherwise it will reboot the node.

 

Failure of the process:  Node restart (=node reboot).

Publicado em RAC | Marcado com , , , , , , , , , | Deixe um comentário

NOVOS COMANDOS DE CUSTER RAC 11gR2

11gr2 CRS Commands
STOP CLUSTER SERVICES

./crsctl stop cluster -all
./crsctl stop cluster

START CLUSTER SERVICES

./crsctl start cluster -all
./crsctl start cluster

CHECK CLUSTER SERVICES

./crsctl check cluster -all
./crsctl check cluster

./crsctl stat res -t -init

START HIGH AVAILABILITY SERVICES

crsctl start has
crsctl enable has -> enable Oracle High Availability Services autostart

crsctl config has -> check if Oracle High Availability Services autostart is enabled/ disabled.
STOP HIGH AVAILABILITY SERVICES

crsctl stop has

crsctl disable has -> disable Oracle High Availability Services autostart
CHECK RESOURCE STATUS

crsctl status resource -t

Publicado em PLSQL SCRIPTS, RAC | Marcado com , , , , , , , , | Deixe um comentário

COMANDOS PARA CONFIGURAR O ORACLE GRID CONTROL

*no sqlplus como sys

drop user sysman cascade;
drop public synonym SETEMVIEWUSERCONTEXT;
drop role MGMT_USER;
drop PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS;
drop user MGMT_VIEW;
drop tablespace MGMT_TABLESPACE including contents and datafiles; 
drop tablespace MGMT_ECM_DEPOT_TS including contents and datafiles;
set termout off feedb off trimsp on lin 9999 head off echo off 
spool /tmp/dropsysmanpublicsynonym.sql 
select 'drop public synonym '||synonym_name||';' ddl from dba_synonyms where table_owner='SYSMAN'; 
spool off 
set termout on feedb on echo on 
@/tmp/dropsysmanpublicsynonym

no so

****emca -config dbcontrol db -repos recreate
emca -deconfig dbcontrol db -cluster -repos drop
emca -config dbcontrol db -repos create -cluster

emca -deconfig all db -cluster
emca -deconfig all db -repos drop -cluster

emca -config dbcontrol db -repos recreate -cluster

emca -config dbcontrol db -repos recreate -cluster -CLUSTER_NAME crs -DB_UNIQUE_NAME ALEAP -PORT 1521 -EMAIL_ADDRESS dba@ALE.COM.br -MAIL_SERVER_NAME mailx.XAN.org.br -ASM_OH /oracle/product/asm -ASM_USER_ROLE SYSDBA -ASM_USER_NAME sys -ASM_PORT 1521 -NODE_LIST ALE-db-001,ALE-db-002,ALE-db-003

emca -config dbcontrol db -repos create -cluster -CLUSTER_NAME crs -DB_UNIQUE_NAME ALEAP -PORT 1521 -EMAIL_ADDRESS dba@ALE.COM.br-MAIL_SERVER_NAME mailx.XAN.org.br -ASM_OH /oracle/product/asm -ASM_USER_ROLE SYSDBA -ASM_USER_NAME sys -ASM_PORT 1521 -NODE_LIST ALE-db-001,ALE-db-002,ALE-db-003

emca -config dbcontrol db -repos create -cluster -CLUSTER_NAME crs -DB_UNIQUE_NAME ALEAP -PORT 1521 -EMAIL_ADDRESS dba@ALE.COM.br -MAIL_SERVER_NAME mailx.XAN.org.br -ASM_OH /oracle/product/asm -ASM_USER_ROLE SYSDBA -ASM_USER_NAME sys -ASM_PORT 1521 -NODE_LIST ALE-db-001,ALE-db-002,ALE-db-003

*********para mostrar destinos do agente

emctl config agent listtargets

********* para mostrar configuração do cluster

emca -displayConfig dbcontrol -cluster

********* para adicionar instance no console

emca -addInst db

cd <AGENT_HOME>/bin
agentca -d -c “node1,node2…” [-t -i <path to oraInst.loc> -n CLUSTER_NAME]

agentca -d -c "ALE-db-001,ALE-db-002,ALE-db-003"

HOST: Database hostname
SID: Database SID
PORT: Listener port number
ORACLE_HOME: Database ORACLE_HOME
HOST_USER: Host username for automatic backup
HOST_USER_PWD: Host user password for automatic backup
BACKUP_SCHEDULE: Automatic backup schedule (HH:MM)
EMAIL_ADDRESS: Email address for notifications
MAIL_SERVER_NAME: Outgoing Mail (SMTP) server for notifications
ASM_OH: ASM ORACLE_HOME
ASM_SID: ASM SID
ASM_PORT: ASM port
ASM_USER_ROLE: ASM user role
ASM_USER_NAME: ASM username
ASM_USER_PWD: ASM user password
SRC_OH: ORACLE_HOME for the database to be upgraded
DBSNMP_PWD: Password for DBSNMP user
SYSMAN_PWD: Password for SYSMAN user
SYS_PWD: Password for SYS user
DBCONTROL_HTTP_PORT: Database Control HTTP port
AGENT_PORT: EM agent port
RMI_PORT: RMI port for Database Control
JMS_PORT: JMS port for Database Control

CLUSTER_NAME: Cluster name
DB_UNIQUE_NAME: Database unique name
SERVICE_NAME: Service name
EM_NODE: Database Control node name
EM_SID_LIST: Agent SID list [comma separated]
**********************************************************************************

Database ORACLE_HOME ……………. /oracle/product/app/10R2/db
Database instance hostname ……………. XAN-db-001
Listener port number ……………. 1521
Cluster name ……………. crs
Database unique name ……………. ALEAP
Email address for notifications …………… dba@ALEX.COM.br
Outgoing Mail (SMTP) server for notifications …………… mail.ALEX.org.br
ASM ORACLE_HOME ……………. /oracle/product/asm
ASM port ……………. 1521
ASM user role ……………. SYSDBA
ASM username ……………. SYS

*****************************OUTRO LADO*******************************

Database ORACLE_HOME ……………. /oracle/product/app/10R2/db
Database instance hostname ……………. XAN-db-001
Listener port number ……………. 1521
Cluster name ……………. crs
Database unique name ……………. SPCAP
Email address for notifications …………… dba@ALEX.br
Outgoing Mail (SMTP) server for notifications …………… mailx.XAN.org.br
ASM ORACLE_HOME ……………. /oracle/product/asm
ASM port ……………. 1521
ASM user role ……………. SYSDBA
ASM username ……………. SYS

ps -ef |grep java

Caso tenha alterado o horário e nao subir mais, pode seyr o Time zone
Nesse caso colocar a variavel TZ = o valor que etiver em /etc/sysconfig/clock

ex: export TZ=Brasil/East

Obs: Colocar essa variável no profile!

Fazer isso em todos os nós do RAC

lista de timezone oracle
/oracle/product/app/10R2/db/sysman/admin/supportedtzs.lst

emctl resetTZ agent

Updating /oracle/product/app/10R2/db/cot-db-001_ALEAP1/sysman/config/emd.properties…
Time zone set to +00:00.

To complete this process, you must either:

connect to the database served by this DBConsole as user ‘sysman’, and execute:

SQL> exec mgmt_target.set_agent_tzrgn('cot-db-001:1830','+00:00')

— or —

connect to the database served by this DBConsole as user ‘sys’, and execute:

SQL> alter session set current_schema = SYSMAN;
SQL> exec mgmt_target.set_agent_tzrgn('ALE-db-001:1830','+00:00')

lista o nome dos agents

emctl config listtargets
********************************
drop user sysman cascade; 
drop user MGMT_VIEW cascade; 
drop role MGMT_USER; 
drop tablespace MGMT_TABLESPACE including contents and datafiles; 
drop tablespace MGMT_ECM_DEPOT_TS including contents and datafiles; 
set termout off feedb off trimsp on lin 9999 head off echo off 
spool /tmp/dropsysmanpublicsynonym.sql 
select 'drop public synonym '||synonym_name||';' ddl from dba_synonyms where table_owner='SYSMAN'; 
spool off 
set termout on feedb on echo on 
@/tmp/dropsysmanpublicsynonym
set|export ORACLE_SID=<database_sid>
set|export ORACLE_HOME=<oracle_home>
cd to ORACLE_HOME/bin
./emca -deconfig dbcontrol db -repos drop

******************************************************************
example I:

[celcaix2]> export TZ=EET-10EETDT-11,M10.1.0/02:00,M4.1.0/03:00
[celcaix2]> echo $TZ
EET-10EETDT-11,M10.1.0/02:00,M4.1.0/03:00

[celcaix2]> emctl config agent getTZ
Oracle Enterprise Manager 10g Release 4 Grid Control 10.2.0.4.0.
Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
GMT+10:00

example II:

[celcaix2]> export TZ=EET-10EETDT,M10.1.0/02:00,M4.1.0/03:00
[celcaix2]> echo $TZ
EET-10EETDT,M10.1.0/02:00,M4.1.0/03:00

[celcaix2]> emctl config agent getTZ
Oracle Enterprise Manager 10g Release 4 Grid Control 10.2.0.4.0.
Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
Australia/Sydney
********************************************************************

export TZ=GMT+3
na produção quando forA do horário de verão TZ=GMT+3 e no horario de verão= TZ=GMT+2

se der erro ao executar:
ORA-20233: Invalid agent name
sun220r.spiceindia.com:3872
ORA-06512: at “SYSMAN.MGMT_TARGET”, line 3814
ORA-06512: at line 1

Faça o seguinte:

emctl stop dbconsole
emdctl validateTZ agent GMT+3
- emctl getemhome
- EXPORT emdroot=<from above>
emctl start dbconsole
Start the console. This populates values in sysman.mgmt_targets
As SYSMAN, run the SQL:
exec mgmt_target.set_agent_tzrgn('cur-db-001.dc.spc.org.br:3938','-03:00');

comando para verificar a porta.

NETSTAT -AN |GREP (nº da porta) 
netstat -an |grep 1830

——————-*************————————–**************————————
This script worked for me on Solaris 5.10 with Oracle 10.2.0.4.

Test before running on your server.

# SCRIPT NAME: set_agent_tzrgn.sh
# PURPOSE: Update the timezone for dbsoncole. FYI - database timezone should be updated first.
# USAGE . ./set_agent_tzrgn
# Configure the oracle home and ORACLE_SID before sourcing this script.
#
#set -vx
echo "Report the current timezone from the OS."
echo $TZ
echo "Check to see if the reported timezone is supported by the agent."
grep $TZ $ORACLE_HOME/sysman/admin/supportedtzs.lst
echo "Check to see the current timezone as configured for the agent."
grep TZ $ORACLE_HOME/`hostname`_$ORACLE_SID/sysman/config/emd.properties
# Just a reporting step.
emctl status agent
echo "This should display current timezone as reported by OS TZ value."
emctl config agent getTZ
echo "Take OS TZ and update emd.properties."
echo "resetTZ may send output to the screen on the next command needed in sqlplus."
emctl resetTZ agent
grep TZ $ORACLE_HOME/`hostname`_$ORACLE_SID/sysman/config/emd.properties
# Review and set the EMDROOT then validate the new timezone
emctl getemhome
export EMDROOT=$ORACLE_HOME/`hostname`_$ORACLE_SID
emdctl validateTZ agent $TZ
echo "Make sure the dbconsole is shutdown."
emctl stop dbconsole
# Just a reporting step.
emctl config agent getTZ
# These should be the same port and server as reported by the resetTZ command
hostname=`hostname`
agentport=`grep "Agent Port" $ORACLE_HOME/install/portlist.ini|grep $ORACLE_SID|awk '{print $7}'`
# Create timezone update sql script.
echo "
set echo on verify on feedback on autocommit off;
WHENEVER OSERROR EXIT SQL.SQLCODE ROLLBACK
WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK
prompt Updating dbconsole timezone for &1
alter session set current_schema = SYSMAN;
exec mgmt_target.set_agent_tzrgn('&2:&3','&4');
commit;
exit SQL.SQLCODE
" > /tmp/set_agent_tzrgn_""$$"".sql
echo "\nExecute set_agent_tzrgn.sql script to update the dbconsole config for sysman."
$ORACLE_HOME/bin/sqlplus -S "/ as sysdba" @/tmp/set_agent_tzrgn_""$$"".sql $ORACLE_SID $hostname $agentport $TZ
SQLRESULT=$?
if \[ $SQLRESULT -eq 0 \] ; then
echo "\nBrowse to the URL as reported by the startup of dbconsole."
else
echo "\nFAILED: The set_agent_tzrgn task failed."
fi
rm /tmp/set_agent_tzrgn_""$$"".sql
emctl start dbconsole
echo "\nTimezone update for dbconsole is finished."
echo "\nFor further details on resetTZ and set_agent_tzrgn see:"
echo "Oracle® Enterprise Manager Advanced Configuration 10g Release 5 (10.2.0.5) E10954-02 March 2009."
set +vx
********************----------------------***********************

Here is a related script for updating the dbms scheduler timezone and database timezone. Updating these timezone values should be done before the dbconsole related timezone work.
This script worked for me on Solaris 5.10 with Oracle 10.2.0.4. Test before running on your server.

This script requires manual updates. Manually set the UTC_OFFSET and manually remove the sqlplus ” prompt” statement in front of
“exec dbms_scheduler.set_scheduler_attribute”
and in front of
“alter database set time_zone”.

The database changes are commented out to protect from accidental changes due to the manual configurtion for the UTC_OFFSET.

# SCRIPT NAME: set_dbtimezone.ksh
# PURPOSE: Update the timezone for the dbms_scheduler and database.
# FYI - dbconsole must also be updated using "emctl resetTZ agent" and set_agent_tzrgn.
# USAGE . ./set_dbtimezone.ksh
# Configure the oracle home and ORACLE_SID before sourcing this script.
#
#set -vx
echo "Report the current timezone from the OS."
echo $TZ
# Manually set the offset based on the expected TZ value.
UTC_OFFSET=+08:00
# Create timezone update sql script.
echo "
set echo on verify on feedback on autocommit off;
WHENEVER OSERROR EXIT SQL.SQLCODE ROLLBACK
WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK
prompt Updating database timezone for &1
select distinct tzname from v\$timezone_names where tzname like '&2' order by tzname;
select dbms_scheduler.stime from dual;
prompt exec dbms_scheduler.set_scheduler_attribute('default_timezone','&2');
select dbms_scheduler.stime from dual;
select localtimestamp from dual;
select dbtimezone, sessiontimezone from dual;
prompt alter database set time_zone = '&3';
select localtimestamp from dual;
prompt commit;
exit SQL.SQLCODE
" > /tmp/dbtimezone_""$$"".sql
echo "\nExecute dbtimezone.sql script to update the dbms scheduler timezone and database timezone."
$ORACLE_HOME/bin/sqlplus -S "/ as sysdba" @/tmp/dbtimezone_""$$"".sql $ORACLE_SID $TZ $UTC_OFFSET
SQLRESULT=$?
if \[ $SQLRESULT -eq 0 \] ; then
echo "\nDatabase and DBMS Scheduler timezone updated to $TZ $UTC_OFFSET."
else
echo "\nFAILED: The 'dbms_scheduler.set_scheduler_attribute' and/or 'alter database set time_zone' task failed."
fi
rm /tmp/dbtimezone_""$$"".sql
echo "\nTimezone update for the database and dbms scheduler is finished."
echo "\nFor further details on set_scheduler_attribute (for 10g or 11g) see:"
echo "Oracle® Database Administrator's Guide 11g Release 1 (11.1) B28310-04 March 2008. - Configuring Oracle Scheduler."
set +vx

———————************************—————————-*********************

emca -reconfig dbcontrol –cluster –EM_NODE cur-db-001 -EM_NODE_LIST cur-db-001,cur-db-002,cur-db-003
emca -config dbcontrol db -repos create -cluster –EM_NODE cur-db-001 -EM_NODE_LIST cur-db-001,cur-db-002,cur-db-003

emca -reconfig dbcontrol –cluster –EM_NODE node5 -EM_NODE_LIST node6,node7,node8
emctl unsecure agent

1. setup env.
$ export PERL5LIB=$ORACLE_HOME/perl/lib:$PERL5LIB
2. Run targetdeploy.pl with arguments.
$ cd $ORACLE_HOME << ORACLE_HOME is /u0001/app/product/db/10.2.0/dv00ism
$ find . -name 'Copy.pm' -printcd
find . -name 'agentca' -printcd
export PERL5LIB= /oracle/product/app/10R2/db/perl/lib/site_perl/5.8.3:/oracle/product/app/10R2/db/perl/lib/5.8.3
directories...
/oracle/product/app/10R2/db/perl/bin/perl /oracle/product/app/10R2/db/bin/targetdeploy.pl -v cDur-db-001-vip -l LISTENER_CDUR-DB-001 -t LISTENER_CDUR-DB-001_cDur-db-001.dc.org.br -s +ASM1 -o /oracle/product/asm /oracle/product/app/10R2/db/cur-db-001_ALEAP1 cDur-db-001.dc.org.br ALEAP1
/oracle/product/app/10R2/db/perl/bin/perl /oracle/product/app/10R2/db/bin/targetdeploy.pl -v cDur-db-003-vip -l LISTENER_CDUR-DB-003 -t LISTENER_CDUR-DB-003_cDur-db-003.dc.org.br -s +ASM3 -o /oracle/product/asm /oracle/product/app/10R2/db/cDur-db-003_ALEAP3 cDur-db-003.dc.org.br ALEAP3
/oracle/product/app/10R2/db/perl/bin/perl /oracle/product/app/10R2/db/bin/targetdeploy.pl -v cDur-db-002-vip -l LISTENER_CUR-DB-002 -t LISTENER_CDUR-DB-002_cDur-db-002.dc.org.br -s +ASM2 -o /oracle/product/asm /oracle/product/app/10R2/db/cDur-db-002_ALEAP2 cDur-db-002.dc.org.br ALEAP2
Publicado em GRID CONTROL, TUTORIAL | Marcado com , , , , , , , , , , | Deixe um comentário

ÍNDICES BASEADOS EM FUNÇÃO (FUNCTION INDEXES)

SEGUE ALGUNS EXEMPLOS DE ÍNDICES BASEADOS EM FUNÇÃO.

create unique index product_index 
on product_id ( decode(enabled, 'Y', id , null));

CREATE INDEX idx_person_upper_given_names ON person (UPPER(given_names));
CREATE INDEX idx_person_upper_last_name ON person (UPPER(last_name));
create index my_objects_name on my_objects (lower(object_name));
CREATE INDEX tele_Remote DBA.up1_clientsv8i 
ON tele_Remote DBA.clientsv8i(UPPER(customer_name))
TABLESPACE tele_index
STORAGE (INITIAL 1M NEXT 1M PCTINCREASE 0);

CREATE INDEX tele_Remote DBA.dec_clientsv8i 
ON tele_Remote DBA.clientsv8i(DECODE(user_code,1,'MANAGER',2,'CLERK',3,'GENERAL USER'))
TABLESPACE tele_index
STORAGE (INITIAL 1M NEXT 1M PCTINCREASE 0);
CREATE UNIQUE INDEX idx_uniq_metadata2
 ON metadata( (case when obj_type = 1 
 then fk_id 
 else null 
 end) );

SELECT /*+INDEX(PERSON IDX_PERSON_UPPER_SURNAME)*/ * 
FROM person 
WHERE UPPER(surname) LIKE 'P%';
Publicado em INDEX TUNING, TUTORIAL | Marcado com , , , , , , , , , , , | Deixe um comentário

VÁRIOS SCRIPTS EM SHELL E DICAS DE COMANDOS DE LINUX

CONTAR O NUMERO DE PROCESSOS

ps aux |wc -l

CONTAR NUMERO DE PROCESSOS

ps -ef |wc -l

Apaga todos os aquivos di dia 30 de Maio

 for i in `ls -ltr |grep 'May 30'|awk '{print $9}'`
 do
 rm -fr $i
 echo $i
 done
 ----move todos os arquivo do dia 23 de outubro para a pasta old
for i in `ls -ltr |grep 'Oct 23'|awk '{print $9}'`
 do
 mv $i to old/
 echo $i
 done
 ---- apaga todos os aquivos do mes de junho
for i in `ls -ltr |grep 'Jun '|awk '{print $9}'`
 do
 rm -fr $i
 echo $i
 done

 Mostra todos os arquivos maiores que 1000000
 ------------------------------------------
for i in `du -k |awk '{print $1}'`
 do
 if [ "$i" -gt 1000000 ]
 then
 echo $i
 fi
 done

——————————————

> ls -ltr |grep 'Jul 16'|awk '{print $9}'
-------------------------------------------------------------------
 deleta por DIA
-------------------------------------------------------------------
for linha in `ls -ltr |grep 'Sep 25' |awk '{print $9}'`
 do
 rm $linha
 echo 'DELETEI O ARQUIVO ' $linha
 done
-------------------------------------------------------------------
 deleta por MES
-------------------------------------------------------------------
for linha in `ls -ltr |grep 'Aug' |awk '{print $9}'`
 do
 rm $linha
 echo $linha
 done
for linha in `ls -ltr |grep 'Aug 14' |awk '{print $9}'`
 do
 rm $linha
 echo $linha
 done
du -k |awk '{print $1}'| sort -u
du -k |awk '{print $1}'| sort -A
-------------------------------------------------------------------

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*

AWK COM IF MUDANDO COR DA TELA *-*-*-/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*

 awk '
 { if ($6 >=550 && $6 <2000){system("tput bel ~/");system("tput blink ~/");system("tput setaf 1 ~/");system("tput bold ~/"); print "| INSTANCIA 1 = > " $6 , " INSTANCIA 2 = > " $11, " INSTANCIA 3 = > " $16," |";}
 else if ($11>=550 && $11<2000){system("tput bel ~/");system("tput blink ~/");system("tput setaf 1 ~/");system("tput bold ~/"); print "| INSTANCIA 1 = > " $6 , " INSTANCIA 2 = > " $11, " INSTANCIA 3 = > " $16," |";}
 else if ($16>=550 && $16<2000){system("tput bel ~/");system("tput blink ~/");system("tput setaf 1 ~/");system("tput bold ~/"); print "| INSTANCIA 1 = > " $6 , " INSTANCIA 2 = > " $11, " INSTANCIA 3 = > " $16," |";}
 else if ($6 <550 && $6>=400) {system("tput sgr0 ~/");system("tput setaf 3 ~/");system("tput bold ~/"); print "| INSTANCIA 1 = > " $6 , " INSTANCIA 2 = > " $11, " INSTANCIA 3 = > " $16," |";}
 else if ($11<550 && $11>=400){system("tput sgr0 ~/");system("tput setaf 3 ~/");system("tput bold ~/"); print "| INSTANCIA 1 = > " $6 , " INSTANCIA 2 = > " $11, " INSTANCIA 3 = > " $16," |";}
 else if ($16<550 && $16>=400){system("tput sgr0 ~/");system("tput setaf 3 ~/");system("tput bold ~/"); print "| INSTANCIA 1 = > " $6 , " INSTANCIA 2 = > " $11, " INSTANCIA 3 = > " $16," |";}
 else if ($6 >=0 && $6 <=400){system("tput sgr0 ~/");system("tput setaf 2 ~/");system("tput bold ~/"); print "| INSTANCIA 1 = > " $6 , " INSTANCIA 2 = > " $11, " INSTANCIA 3 = > " $16," |";}
 else if ($11>=0 && $11<=400){system("tput sgr0 ~/");system("tput setaf 2 ~/");system("tput bold ~/"); print "| INSTANCIA 1 = > " $6 , " INSTANCIA 2 = > " $11, " INSTANCIA 3 = > " $16," |";}
 else if ($16>=0 && $16<=400){system("tput sgr0 ~/");system("tput setaf 2 ~/");system("tput bold ~/"); print "| INSTANCIA 1 = > " $6 , " INSTANCIA 2 = > " $11, " INSTANCIA 3 = > " $16," |";}
 else if ($2 == "-----------------------------------------------------------------" ) {system("tput sgr0 ~/");system("tput setaf 2 ~/"); print $0;}
 else if ($10 >=450 && $10 <1000) {system("tput bel ~/");system("tput blink ~/"); system("tput setaf 1 ~/");system("tput bold ~/"); print $0;}
 else if ($10 >=300 && $10 <450) {system("tput sgr0 ~/");system("tput setaf 3 ~/");system("tput bold ~/"); print $0;}
 else if ($6 == "|" ) {system("tput sgr0 ~/");system("tput setaf 2 ~/");system("tput bold ~/"); print $0;}
 else if ($6 == "L" ) {system("tput sgr0 ~/");system("tput setaf 7 ~/");system("tput bold ~/"); print $0;}
 else if ($6 == "INST" ) {system("tput sgr0 ~/");system("tput setaf 7 ~/");system("tput bold ~/"); print $0;}
 else if ($6 == "ORACLE" ) {system("tput sgr0 ~/");system("tput setaf 2 ~/");system("tput bold ~/"); print $0;}
 else null;
 }' /u01/app/operacao/scr/novoconexoes_tst.txt

*-*-*-/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/

NAWK COM IF

*-*-*-/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*

 while read i
 do
 pctot=`echo $i | nawk '{printf ("%d\n", $7 * 10)}'`
 if (($pctot == 0));then
 tput setaf 2
 echo "$i"
 elif (($pctot < 50)); then
 tput setaf 3
 echo "$i"
 else
 tput setaf 1
 echo "$i"
 fi
 done < srs_ale.txt
para mudar de cor
 tput setaf 1
para tocar beep
 tput bel
para começar a piscar
 tput blink
para parar de piscar
 tput sgr0
echo "`tput blink` `tput setaf 1 `hightlighted`tput sgr0`"
 system("tput bold ~/");
----------------------------------------------

####numero das linhas
 cat -n alert_ALEXDB1.log|grep "ORA-"

Mostra texto de linas entre 2 numeros de linha

sed -n 191391,191399p alert_ALEXDB1.log

Acha e mostra todos as linhas com o texto “ORA-”

 grep -c "ORA-" /DADOS/FULL/log/logbkp.${DATABKP}.log

Acha e mostra as linhas com o texto “ORA-” das 500 ultimas linhas

tail -500 /oracle/product/app/admin/ALEXDB/bdump/alert_ALEXDB1.log |grep -c "ORA-"
cat -n|tail -50 /oracle/product/app/admin/ALEXDB/bdump/alert_ALEXDB1.log |grep "ORA-"
cat -n /oracle/product/app/admin/ALEXDB/bdump/alert_ALEXDB1.log |grep "ORA-"| tail -50
awk '$5>=95 && $5<101 {system("tput setaf 1 ~/"); print $0;}
 $5<95 && $5>31 {system("tput setaf 3 ~/"); print $0;}
 $5>0 && $5<=30 {system("tput setaf 2 ~/"); print $0;}
 $7 *10 >=300 && $7 *10 <1100 {system("tput setaf 1 ~/"); print $0;}
 $7 *10 >=0 && $7 *10 <= 9 {system("tput setaf 2 ~/"); print $0;}
 $7 *10 >=10 && $7 *10 <=299 {system("tput setaf 3 ~/"); print $0;}' srs_mon.txt
for i in `cat -n /oracle/product/app/admin/ALEXDB/bdump/alert_ALEXDB1.log |grep "ORA-"| tail -5|awk '{print $1}'`
 do
 if [ $i -eq 0 ];
 then
 echo "NÃO TEM ERROS";
 else
 #echo $i "eq nao zero ";
 sed -n $i,$(i +2)\p /oracle/product/app/admin/ALEXDB/bdump/alert_ALEXDB1.log >> /DADOS/FULL/log/errosALEXDB1.log
 mailx -s "ERROS NO ALERT DA PRODUÇÂO ALEXDB1" dba@pires.com.br < //DADOS/FULL/log/errosALEXDB1.log
 fi;
 done

*-*-*-/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*

for i in `cat -n /oracle/product/app/admin/ALEXDB/bdump/alert_ALEXDB1.log |grep "ORA-"| tail -2500|awk '{print $1}'`
 do
 if [ $i -eq 0 ];
 then
 echo "NÃO TEM ERROS";
 else
 #echo $i "eq nao zero ";
 sed -n $i,$(($i +2))\p /oracle/product/app/admin/ALEXDB/bdump/alert_ALEXDB1.log >> /DADOS/FULL/log/errosALEXDB1.log
 fi;
 done
 if [ -f $filename ];
 then
 mailx -s "ERROS NO ALERT DA PRODUÇÂO ALEXDB1" dba@pires.com.br < /DADOS/FULL/log/errosALEXDB1.log
 rm /DADOS/FULL/log/errosALEXDB1.log
 fi;

*-*-*-/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*

awk cat -n /oracle/product/app/admin/ALEXDB/bdump/alert_ALEXDB1.log |grep "ORA-"| tail -50

 sed -n 192369,(192369+3)P alert_ALEXDB1.log

/oracle/product/app/admin/ALEXDB/bdump/alert_ALEXDB1.log

cat -n /oracle/product/app/admin/ALEXDB/bdump/alert_ALEXDB1.log |grep "ORA-"| tail -50

Programa para enviar -email quando achar erros nos alert do banco

tail -500 /oracle/product/app/admin/ALEXDB/bdump/alert_ALEXDB1.log |grep -c "ORA-"

 if [ $? -eq 0 ] ## ERRO NO ALERT
 then
 ##echo "ACHOU ERRO NO ALERT"
 grep "ORA-" /oracle/product/app/admin/ALEXDB/bdump/alert_ALEXDB1.log >> /DADOS/FULL/log/ERROBKP.${DATABKP}.log
 mailx -s "ERROS NO ALERT DA PRODUÇÂO ALEXDB1" dba@pires.com.br < /DADOS/FULL/log/ERROBKP.${DATABKP}.log
 mailx -s "Fim Backup FULL Oracle COM ERRO - Producao - IBM" dba@pires.com.br < /DADOS/FULL/log/logbkp.${DATABKP}.log
 else
 ##echo "BACKUP FEITO COM SUCESSO"
 mailx -s "Fim Backup FULL Oracle com sucesso - Producao" dba@pires.com.br,operacao@pires.com.br,sysadm@pires.com.br < /DADOS/FULL/log/logbkp.${DATABKP}.log
 fi

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
COPIA ARCHIVES
/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*

 #!/usr/bin/bash
 ls /ARCHIVE/*.arc | awk -F"/" '{print $3}' > /tmp/local1.tmp
 ssh oracle@apolo "ls /backup/arch/SPCAP/*.arc" | awk -F"/" '{print $5}' > /tmp/local2.tmp
 diff /tmp/local1.tmp /tmp/local2.tmp | grep "<" | awk '{print "scp -c blowfish -C /ARCHIVE/" $2 " oracle@apolo:/backup/arch/SPCAP/."
 }' | bash

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
Comando pra saber se uma maquina linux é vmware ou virtual
/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*

lspci

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
COMANDOS DE DISCO UTIL COM ASM
/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
verifica discos

lsdev -Ccdisk

Verificar conteudo do disco

lspv | grep hdisk7
lquerypv -h /dev/rhdiskpower33

discos com problema
25 CANDIDATE NORMAL /dev/rhdiskpower33
27 CANDIDATE NORMAL /dev/rhdiskpower35

chdev -l /dev/rhdiskpower33 -a reserve_lock=no
chdev -l /dev/rhdiskpower35 -a reserve_lock=no
chdev -l hdiskpower35 -a reserve_lock=no
hdiskpower35 changed

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*

MUDANDO NOME DO HOST NO LINUX

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*

Tenta mudar no arquivo /etc/hosts
x.x.x.x meu.dominio.com.br hostname
e muda tb la no /etc/sysconfig/network
HOSTNAME: nome

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*

COMANDO DE MOUNT DE NFS
/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*

mount -o fastattr,hard,rw,noac,proto=udp,bg,intr,retrans=10,timeo=1000,vers=3 10.198.35.11:/backup /DADOS

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*

COMANDO DE CRIAÇÃO DE LINK SIMBÓLICO

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*

create a symbolic link "ln -s /usr/lib/libgdbm.so.2.0.0 /usr/lib/libdb.so.2"
ln -s /usr/lib64/libdb1.so.2 /usr/lib/libdb.so.2
ln -s /usr/lib64/libgdbm.so.2.0.0 /usr/lib64/libdb.so.2

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*

Solution
Enhancement Request ( Unpublished Bug 8303425 ) has this issue discussed.

1] If creating new ASMLib Devices, give label name with no more than 24 characters.

2] When you see ORA-15040, ORA-15042, then you can do the followings:

shutdown ASM instances on All the nodes

take 50 MB ‘dd’ backup of All the disks in the affected diskgroup

dd if=/dev/emcpoweral1 of=/tmp/al1.50m.dd bs=1024 count=51200

==============================================================:

IMPORTANT: This is a must safety measure, in case anything happens in the next step, we can go back to the original state. Also it is recommended that you open an SR with Oracle GCS.

use force-renamedisk commad to change ” driver.provstr ” value and provide a label length <= 24. This needs to be done for all the affected disks.

/etc/init.d/oracleasm force-renamedisk /dev/emcpoweral1 P300R10RG2D13

Run the scandisks command on All the nodes

/etc/init.d/oracleasm scandisks
 Check the disks are visible on All the nodes, with new labels
Publicado em SHELL SCRIPT, TUTORIAL | Marcado com , , , , , , , , , , , , , , , , , , , , , , , , , | Deixe um comentário

Exemplos de tabelas organizadas por índice

Abaixo estão alguns exemplos de como criar tabelas organizadas por indice

 
CREATE TABLE my_iot (id INTEGER PRIMARY KEY, value VARCHAR2(50)) ORGANIZATION INDEX;
CREATE TABLE my_iot (id INTEGER PRIMARY KEY, value VARCHAR2(50)) ORGANIZATION INDEX;
 CREATE TABLE ALT_DOC (TIP_DOCUMENT CHAR(1),NUM_DOCUMENTO number(9) PRIMARY KEY) ORGANIZATION INDEX;

CREATE TABLE ALT_DOC (
TIP_DOCUMENTO CHAR(1),
NUM_DOCUMENTO number(9), 
CONsTRAINT PK_ALT_DOC PRIMARY KEY (TIP_DOCUMENTO,NUM_DOCUMENTO)) 
ORGANIZATION INDEX
TABLESPACE TBS_SPC_DT_01;
CREATE TABLE labor_hour (
WORK_DATE DATE,
EMPLOYEE_NO VARCHAR2(8),
SUMMIT_WORK_ORDER_NO VARCHAR2(7),
DASH VARCHAR2(2),
CLASS_CODE VARCHAR2(6),
PAYCODE VARCHAR2(2),
ASSIGNED_CREW_NUMBER VARCHAR2(5),
TRANSFER_CREW_NUMBER VARCHAR2(5),
REFERENCE_TYPE VARCHAR2(1),
REFERENCE_NUMBER VARCHAR2(10),
OVERTIME_CODE VARCHAR2(1),
SHIFT_DIFFERENTIAL VARCHAR2(1) NOT NULL,
HOURS NUMBER(4,2) NOT NULL,
MOD_USER_ID VARCHAR2(30) DEFAULT USER,
MOD_USER_DATE DATE DEFAULT SYSDATE,
CONSTRAINT pk_labor_hour 
PRIMARY KEY (work_date, employee_no, summit_work_order_no, dash, class_code, paycode, assigned_crew_number, transfer_crew_number, reference_type, reference_number, overtime_code, shift_differential))
ORGANIZATION INDEX
INCLUDING hours
OVERFLOW TABLESPACE uwdata;
Publicado em INDEX TUNING, PLSQL SCRIPTS | Marcado com , , , , , , , , , | Deixe um comentário