Control File is used for: - Database recovery - Whenever an instance of an ORACLE database begins, its control file is used to identify the database and redo log files that must be opened for database operation to go ahead
Correct Answer: - When two processes are waiting to update the rows of a table which are locked by another process, the situation is called a deadlock - The reasons for it to happen are: * lack of proper row lock commands * Poor design of front-end application - It reduces the performance of the server severely - These locks get automatically released automatically when a commit/rollback operation is performed or any process is killed externally
2. What is the difference between mysql_connect and mysql_pconnect?
Correct Answer: There is a decent page in the php manual on the subject, in short mysql_pconnect() makes a persevering association with the database which implies a SQL join that don't close when the execution of your script closes mysql_connect()provides just for the database new association while utilizing mysql_pconnect , the capacity would first attempt to locate a (relentless) connection that is as of now open with the same host, username and password On the off chance that one is found, an identifier for it will be returned as opposed to opening another connection the connection with the SQL server won't be terminated when the execution of the script ends Rather, the link will stay open for future use
3. What is the difference between using copy() and move() function in php file uploading?
Correct Answer: Copy() makes a copy of the file It returns TRUE on success It can copy from any source to destination Move simply Moves the file to destination if the file is valid While move can move the uploaded file from temp server location to any destination on the server If filename is a valid upload file, but cannot be moved for some reason, no action will occur
4. Explain the working with directories using opendir(), readdirs(), closedir() along with examples.
Correct Answer: Opendir():- It opens the directory This function returns a directory stream on success and FALSE and an error on failure Syntax: Opendir(directory, context) Context is a set of options that can modify the behavior of a stream Example: opens sample directory $dir = opendir("directory"); Readdir(): It returns an entry from a directory handle opened by opendir() Syntax: Readdir(dir_stream) Example: $file = readdir($dir); closedir(): It closes a directory handle opened by opendir() Syntax: closedir(dir_stream) Example: $file = close($dir);
5. Explain the changing file permission and ownership using PHP's chmod() function.
Correct Answer: Chmod() is used for changing permissions on a file Syntax: Chmod(file, mode) Mode here specifies the permissions as follows: The first number is always zero The second number specifies permissions for the owner The third number specifies permissions for the owner's user group The fourth number specifies permissions for everybody else Possible values (to set multiple permissions, add up the following numbers) 1 = execute permissions 2 = write permissions 4 = read permissions Example: // everything for owner, read for owner's group chmod("testtxt",0740);
Correct Answer: - Rename : It is a permanent name provided to a table or column - Alias : It is a temporary name provided to a table or column which gets over after the execution of SQL statement
Correct Answer: A synonym can be called as an alias for a table, view, sequence or program unit It is basically of two types: - Private - Only the owner can access it - Public - Can be accessed by any database user